starting android development

classic Classic list List threaded Threaded
15 messages Options
Reply | Threaded
Open this post in threaded view
|

starting android development

Chuck Crisler-2
I am trying to learn Java and Android development at the same time. Fortunately, I know GStreamer fairly well. I have the Android Studio, the SDK and the NDK installed on my Linux system and have downloaded the GStreamer 1.4.5 ARM v7 binaries. I have also downloaded the GStreamer SDK and have been looking at ~slomo/gst-sdk-tutorials. I am confused and can't seem to 'put it all together'. I have read and built and executed (on my Android phone) some of the pure Android samples, including JNI samples. I feel that I could convert a GStreamer Android SDK based tutorial to the Android Studio structure.

Here are the questions that I immediately don't understand.
1. Do I need both the 1.4.5 binaries and the GStreamer SDK?
2. Do I need to build anything to get started working with the GStreamer tutorials?
3. Tutorial #1 imports package org.freedesktop.gstreamer.GStreamer, which I don't think that I have. How should I build it, or where is it?
4. Which tutorials are more current, ~slomo or the GStreamer SDK?
5. Is it possible to run something like the command line gst-launch application on Android to test pipelines and installations?

All guidance is greatly appreciated.

Thank you,
Chuck Crisler

_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: starting android development

Sebastian Dröge-3
On Do, 2015-03-19 at 22:30 -0400, Chuck Crisler wrote:

> I am trying to learn Java and Android development at the same time.
> Fortunately, I know GStreamer fairly well. I have the Android Studio, the
> SDK and the NDK installed on my Linux system and have downloaded the
> GStreamer 1.4.5 ARM v7 binaries. I have also downloaded the GStreamer SDK
> and have been looking at ~slomo/gst-sdk-tutorials. I am confused and can't
> seem to 'put it all together'. I have read and built and executed (on my
> Android phone) some of the pure Android samples, including JNI samples. I
> feel that I could convert a GStreamer Android SDK based tutorial to the
> Android Studio structure.
>
> Here are the questions that I immediately don't understand.
> 1. Do I need both the 1.4.5 binaries and the GStreamer SDK?
The GStreamer 1.4.5 binaries contain everything that the "GStreamer SDK"
contains, just 3 years newer.

> 2. Do I need to build anything to get started working with the GStreamer
> tutorials?

You just need to extract the binaries to some please and then set
GSTREAMER_ROOT_ANDROID in the environment to that place. Then you can
just build them like any other Android project.

> 3. Tutorial #1 imports package org.freedesktop.gstreamer.GStreamer, which I
> don't think that I have. How should I build it, or where is it?

That's autogenerated by ndk-build.

> 4. Which tutorials are more current, ~slomo or the GStreamer SDK?

See above :)

> 5. Is it possible to run something like the command line gst-launch
> application on Android to test pipelines and installations?

Yes but command line applications don't have access to the hardware
codecs and other things, and you need a rooted device.

See
https://coaxion.net/blog/2014/10/gstreamer-remote-controlled-testing-application-for-android-ios-and-more/
for some gst-launch style application for Android/iOS.

Also see
https://github.com/sdroege/gst-player
for some (hopefully) cleaner code (than the tutorials) for how to do
GStreamer Android development by properly splitting the backend (C) and
the frontend (Java).

--
Sebastian Dröge, Centricular Ltd · http://www.centricular.com

_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (968 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: starting android development

Sérgio Agostinho
Hi Chuck, 

This might also be useful. I remember I struggled for a while to properly build Gstreamer with Android Studio. Place your Android.mk and Application.mk inside src/main/jni
Add these snippets to your local.properties file

android{
    //otherstuff
    sourceSets.main {
        jniLibs.srcDir 'src/main/libs'
        jni.srcDirs = [];
    }
    tasks.withType(JavaCompile) {
        compileTask -> compileTask.dependsOn ndkBuild
    }
    task('ndkBuild', type: Exec) {
        // normal building tool
        commandLine 'ndk-build', 'clean'
        commandLine 'ndk-build', 'APP_PLATFORM=<replace with target version e.g. android-19>', '-C', file('src/main').absolutePath
    }
}

This ensures your ndk code will always be compiled before your java code, and that the Gstreamer.java will be already in your src folder. 

Cheers


2015-03-20 9:41 GMT+01:00 Sebastian Dröge <[hidden email]>:
On Do, 2015-03-19 at 22:30 -0400, Chuck Crisler wrote:
> I am trying to learn Java and Android development at the same time.
> Fortunately, I know GStreamer fairly well. I have the Android Studio, the
> SDK and the NDK installed on my Linux system and have downloaded the
> GStreamer 1.4.5 ARM v7 binaries. I have also downloaded the GStreamer SDK
> and have been looking at ~slomo/gst-sdk-tutorials. I am confused and can't
> seem to 'put it all together'. I have read and built and executed (on my
> Android phone) some of the pure Android samples, including JNI samples. I
> feel that I could convert a GStreamer Android SDK based tutorial to the
> Android Studio structure.
>
> Here are the questions that I immediately don't understand.
> 1. Do I need both the 1.4.5 binaries and the GStreamer SDK?

The GStreamer 1.4.5 binaries contain everything that the "GStreamer SDK"
contains, just 3 years newer.

> 2. Do I need to build anything to get started working with the GStreamer
> tutorials?

You just need to extract the binaries to some please and then set
GSTREAMER_ROOT_ANDROID in the environment to that place. Then you can
just build them like any other Android project.

> 3. Tutorial #1 imports package org.freedesktop.gstreamer.GStreamer, which I
> don't think that I have. How should I build it, or where is it?

That's autogenerated by ndk-build.

> 4. Which tutorials are more current, ~slomo or the GStreamer SDK?

See above :)

> 5. Is it possible to run something like the command line gst-launch
> application on Android to test pipelines and installations?

Yes but command line applications don't have access to the hardware
codecs and other things, and you need a rooted device.

See
https://coaxion.net/blog/2014/10/gstreamer-remote-controlled-testing-application-for-android-ios-and-more/
for some gst-launch style application for Android/iOS.

Also see
https://github.com/sdroege/gst-player
for some (hopefully) cleaner code (than the tutorials) for how to do
GStreamer Android development by properly splitting the backend (C) and
the frontend (Java).

--
Sebastian Dröge, Centricular Ltd · http://www.centricular.com

_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel



_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: starting android development

Chuck Crisler-2
Thank you *VERY MUCH* for the help. I suspected that the SDK was old. It would be helpful if there was a note added to the (real) GStreamer website to that effect.

On Fri, Mar 20, 2015 at 4:54 AM, Sérgio Agostinho <[hidden email]> wrote:
Hi Chuck, 

This might also be useful. I remember I struggled for a while to properly build Gstreamer with Android Studio. Place your Android.mk and Application.mk inside src/main/jni
Add these snippets to your local.properties file

android{
    //otherstuff
    sourceSets.main {
        jniLibs.srcDir 'src/main/libs'
        jni.srcDirs = [];
    }
    tasks.withType(JavaCompile) {
        compileTask -> compileTask.dependsOn ndkBuild
    }
    task('ndkBuild', type: Exec) {
        // normal building tool
        commandLine 'ndk-build', 'clean'
        commandLine 'ndk-build', 'APP_PLATFORM=<replace with target version e.g. android-19>', '-C', file('src/main').absolutePath
    }
}

This ensures your ndk code will always be compiled before your java code, and that the Gstreamer.java will be already in your src folder. 

Cheers


2015-03-20 9:41 GMT+01:00 Sebastian Dröge <[hidden email]>:
On Do, 2015-03-19 at 22:30 -0400, Chuck Crisler wrote:
> I am trying to learn Java and Android development at the same time.
> Fortunately, I know GStreamer fairly well. I have the Android Studio, the
> SDK and the NDK installed on my Linux system and have downloaded the
> GStreamer 1.4.5 ARM v7 binaries. I have also downloaded the GStreamer SDK
> and have been looking at ~slomo/gst-sdk-tutorials. I am confused and can't
> seem to 'put it all together'. I have read and built and executed (on my
> Android phone) some of the pure Android samples, including JNI samples. I
> feel that I could convert a GStreamer Android SDK based tutorial to the
> Android Studio structure.
>
> Here are the questions that I immediately don't understand.
> 1. Do I need both the 1.4.5 binaries and the GStreamer SDK?

The GStreamer 1.4.5 binaries contain everything that the "GStreamer SDK"
contains, just 3 years newer.

> 2. Do I need to build anything to get started working with the GStreamer
> tutorials?

You just need to extract the binaries to some please and then set
GSTREAMER_ROOT_ANDROID in the environment to that place. Then you can
just build them like any other Android project.

> 3. Tutorial #1 imports package org.freedesktop.gstreamer.GStreamer, which I
> don't think that I have. How should I build it, or where is it?

That's autogenerated by ndk-build.

> 4. Which tutorials are more current, ~slomo or the GStreamer SDK?

See above :)

> 5. Is it possible to run something like the command line gst-launch
> application on Android to test pipelines and installations?

Yes but command line applications don't have access to the hardware
codecs and other things, and you need a rooted device.

See
https://coaxion.net/blog/2014/10/gstreamer-remote-controlled-testing-application-for-android-ios-and-more/
for some gst-launch style application for Android/iOS.

Also see
https://github.com/sdroege/gst-player
for some (hopefully) cleaner code (than the tutorials) for how to do
GStreamer Android development by properly splitting the backend (C) and
the frontend (Java).

--
Sebastian Dröge, Centricular Ltd · http://www.centricular.com

_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel



_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel




--
___________________________________________________
Name
Chuck Crisler

Mutualink, Inc.
3 Lan Dr.
Westford, MA  01886

Direct: <a href="tel:%28866%29%20957-5465" value="+18669575465" target="_blank">(978) 490-3006 Ext: 118

E-Mail: [hidden email] 

Web: www.mutualink.net


The information in this email, and subsequent attachments, may contain confidential information that is 
intended solely for the attention and use of the named addressee(s). This message or any part thereof 
must not be disclosed, copied, distributed or retained by any person without authorization from the addressee.

_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: starting android development

Forzaferrarileo
In reply to this post by Sérgio Agostinho
Hi , I'm trying to use your snippet , but ndk-build isn't generating java packages (  org.freedesktop.gstreamer.Gstreamer ... they're missing ).  native libs are generated without problems .

I'm using ndk r10d and gstreamer 1.4.5 . There are other steps beyond those provided ?

I'm trying tutorial 1 from slomo's repo : http://cgit.freedesktop.org/~slomo/gst-sdk-tutorials/
Reply | Threaded
Open this post in threaded view
|

Re: starting android development

Sérgio Agostinho
If you we're mentioning the snippet I posted for Android studio, you need to have this env defined in your Android.mk

GSTREAMER_JAVA_SRC_DIR := java

Otherwise, the file will not be copied into the proper place.

Cheers


2015-04-02 22:46 GMT+02:00 Forzaferrarileo <[hidden email]>:
Hi , I'm trying to use your snippet , but ndk-build isn't generating java
packages (  org.freedesktop.gstreamer.Gstreamer ... they're missing ).
native libs are generated without problems .

I'm using ndk r10d and gstreamer 1.4.5 . There are other steps beyond those
provided ?

I'm trying tutorial 1 from slomo's repo :
http://cgit.freedesktop.org/~slomo/gst-sdk-tutorials/



--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/starting-android-development-tp4671223p4671435.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.
_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: starting android development

Forzaferrarileo
Thank you,  I'm going to try it as soon as possible
Reply | Threaded
Open this post in threaded view
|

Re: starting android development

Forzaferrarileo
In reply to this post by Sérgio Agostinho
i tried to add GSTREAMER_JAVA_SRC_DIR := java  , but the result is the same.. I can't figure out the problem ( in eclipse everything works fine )

I uploaded the whole code here :
https://bitbucket.org/Forzaferrarileo/gstreamer-androidstudio
could you please watch it ?


Thank you
Leonardo
Reply | Threaded
Open this post in threaded view
|

Re: starting android development

Sérgio Agostinho
Hi Leonardo, 

So I downloaded your code, created a new project and imported your 'app' module into it. Then I noticed your Android.mk had these lines

ifndef GSTREAMER_SDK_ROOT
ifndef GSTREAMER_SDK_ROOT_ANDROID
$(error GSTREAMER_SDK_ROOT_ANDROID is not defined!)
endif
GSTREAMER_SDK_ROOT        := $(GSTREAMER_SDK_ROOT_ANDROID)
endif
GSTREAMER_NDK_BUILD_PATH  := $(GSTREAMER_SDK_ROOT)/share/gst-android/ndk-build

which is strange since the env that 1.4.5 uses is

GSTREAMER_ROOT

So I set the env, added 

import org.freedesktop.gstreamer.GStreamer;

into your main activity and voilá, the file got copied into the right place and no more complains about the missing Gstreamer class. Then I noticed you had the following file and folder structure (from a previous build I guess)

src/main/src/com/gstreamer/Gstreamer.java

My preliminary conclusion is that you are not using 1.4.5 and you're using the android binaries from gstreamer.com.

Cheers, 
Sérgio

2015-04-03 22:45 GMT+02:00 Forzaferrarileo <[hidden email]>:
i tried to add GSTREAMER_JAVA_SRC_DIR := java  , but the result is the same..
I can't figure out the problem ( in eclipse everything works fine )

I uploaded the whole code here :
https://bitbucket.org/Forzaferrarileo/gstreamer-androidstudio
could you please watch it ?


Thank you
Leonardo



--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/starting-android-development-tp4671223p4671448.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.
_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: starting android development

Forzaferrarileo
Thanks for the tips ; anyway I resolved downloading again ndk and gstreamer sdk ( i was using 1.4.4 , but maybe something got broken ).

Although wasn't the right one , the env didn't cause any trouble because I defined the gst sdk path in it.

Leonardo
Reply | Threaded
Open this post in threaded view
|

Re: starting android development

pedjaman
This post was updated on .
There are very helpful instructions.
However, latest gstreamer is asking for gold linker which doesn't seems to exists in NDK linux where I'm developing for armv7.
Any idea how to install gold linker?
Reply | Threaded
Open this post in threaded view
|

Re: starting android development

pedjaman
Additional info:
it is building using mipsel-linux-android-4.9 and r12 NDK for linux if that matters.
Reply | Threaded
Open this post in threaded view
|

Re: starting android development

pedjaman
After some research, only after downgrading ndk to 10e, changing targt to arm (isntead of armv7) it finds gold linker (and it doesn't look for mipsel) but this code is failing in gstreamer-1.0.mk:

        @$(foreach plugin,$(GSTREAMER_PLUGINS_WITH_CLASSES), \
                $(call host-mkdir,$(GSTREAMER_JAVA_SRC_DIR)/org/freedesktop/gstreamer/$(plugin)) && ) echo Done mkdir

with error:
/bin/sh: Done: command not found

It seems

echo Done mkdir

is not interpreted as message. It is threated asn command instead.
Reply | Threaded
Open this post in threaded view
|

Re: starting android development

Arun Raghavan-4
In reply to this post by pedjaman
On Sat, 10 Sep 2016, at 06:12 PM, pedjaman wrote:
> There are very helpful instructions.
> However, latest gstreamer is asking for gold linker which doesn't seems
> to
> exists on linux where I'm developing.
> Any idea how to install gold linker?

With the most recent unstable releases (1.9.2), we made some changes to
support NDK r12b. I wrote about these at:

  https://arunraghavan.net/2016/09/gstreamer-on-android-and-universal-builds/

Our documentation on this can certainly improve, but in the mean time, a
more complete example of how you can integrate GStreamer on Android can
be seen at:

  https://cgit.freedesktop.org/gstreamer/gst-examples/tree/playback/player/android

Cheers,
Arun
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: starting android development

enthusiastic geek
In reply to this post by Chuck Crisler-2
One may start from here. I have tested this on Android Studio 3.0 and
Gstreamer prebuilt binaries 1.4.4
https://github.com/enthusiasticgeek/Gstreamer_Android_Tutorials



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel