GStreamer custom plugin use in Android

Sebastian Dröge sebastian at centricular.com
Thu Aug 11 07:57:11 UTC 2016


On Do, 2016-08-11 at 00:19 -0700, Akon wrote:
> Hi there,
> 
> First of all my delight for GStreamer. Great project!
> 
> I developed a GStreamer 1.0 plugin which works fine in Windows/Linux and
> some other systems. Now I want to cover Android. Currently, the plugin is
> not integrated into GStreamer in sense that it is not built with
> GStreamer/Cerbero, but it is built separately using GStreamer official
> binaries (devel) resulting *.so or *.a file.
> 
> How can I use the plugin in an Android app? I don't consider direct
> inclusion of the plugin sources into the app, but through prebuilt
> static/shared lib.
> 
> I think a way when my plugin will be used as a separate lib (shared or
> static) will not work, due to there will be e.g. two glib instances (one
> from GStreamer (there all libs are static) and one from the plugin), so
> g_malloc()/g_free() will fail (there will be two heaps).
> 
> At the moment I'm considering integration of my plugin to
> gstreamer-android.so prebuilt lib (see GStreamer Tutorials for Android) 
> that is generated by GStreamer's ndk-built scripts. How can I do it with?

There are multiple ways how you can do this:
1) a shared plugin .so that is linked against libgstreamer_android.so.
The latter contains all of glib, GStreamer, etc and can be used instead
of those libraries. You can then put the plugin .so into your apkg and
load it at runtime with gst_plugin_load_file() for example.

2) a static plugin .a that is linked into the libgstreamer_android.so
like the others. For that you only have to put it into the same
directory as the other plugin .a and add it to your Android.mk

3) a static plugin directly linked into your application, or just the
element linked into your application and registered from there

-- 
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: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20160811/c92b9817/attachment.sig>


More information about the gstreamer-devel mailing list