How to link element to pipeline in android?

Sebastian Dröge sebastian at centricular.com
Sat May 2 00:55:47 PDT 2015


On Di, 2015-04-28 at 22:08 -0700, Yingsheng wrote:
> Hi,
> I am a new learner of gstreamer and i want to port gstreamer to android.
> Now 
> 1. I could build gstreamer using command "cerbero -c cross-android.cbc
> package gstreamer-1.0" and create package "gstreamer-1.0-android-arm-1.5.0"
> sucessfully.
> 2. I could use ndk-build to build gstreamer package
> "gstreamer-1.0-android-arm-1.5.0" and create libgstreamer_android.so.
> 3. I wrote a application about to play mp3 file using c language, and
> ndk-build sucessfully, and create a executed file.After I push the executed
> file and "libgstreamer_android.so" to directory "/system/lib", I could not
> executed the file.
> Because I could not create element in app, such as:
> source = gst_element_factory_make("audiotestsrc", "audio_source");
> How could I do?

That's not how you're supposed to use GStreamer on Android. You should
do it like e.g. in the example applications here, i.e. include
libgstreamer_android.so in your application and initialize it via
GStreamer.init() from Java, and then use GStreamer from some C code that
you call via JNI.

http://cgit.freedesktop.org/~slomo/gst-sdk-tutorials/tree/gst-sdk/tutorials
(android-tutorial 1-5)

The important part here is how the initialization works, as
libgstreamer_android.so contains static plugins that have to be
explicitly initialized by something (GStreamer.init() in this case)
before usage.

-- 
Sebastian Dröge, Centricular Ltd · http://www.centricular.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 949 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20150502/5a6665c7/attachment.sig>


More information about the gstreamer-devel mailing list