Building Gstreaming for Android with Cerbero. Adding plugins

Sebastian Dröge sebastian at centricular.com
Sun Jan 18 10:18:08 PST 2015


On So, 2015-01-18 at 16:11 +0100, Sérgio Agostinho wrote:
> Hi folks,
> 
> I've been trying to build and package gstreamer for android using cerbero.
> Additionally to what comes bundled by default, I've been trying to build
> the static versions of video4linux2 and faac.

You won't be able to use v4l2 on Android except for a few devices if
you're lucky. It's not public Android API.

If you want to use the camera, there is a GStreamer plugin here, which
uses public Android APIs only:
https://github.com/EricssonResearch/openwebrtc-gst-plugins/tree/master/sys/androidvideo/video-source

Hopefully we will merge that one into gst-plugins-bad in the near
future.

> I've cloned cerbero from the repo, checked out tag 1.4.5. Currently my
> config file has the following contents.
> 
> https://gist.github.com/SergioRAgostinho/9d252023507a83b41b49
> 
> import os
> > from cerbero.config import Platform, Architecture, Distro, DistroVersion
> >
> > target_platform = Platform.ANDROID
> > target_distro = Distro.ANDROID
> > target_distro_version = DistroVersion.ANDROID_JELLY_BEAN
> > target_arch = Architecture.ARMv7
> >
> > #variants = ['nodebug']
> > variants = ['v4l2']
> >
> >
> > toolchain_prefix = '/home/nexusdev/Development/3rdparty/android-ndk-r10d'
> 
> 
> As you can see I added the v4l2 variant. I noticed that this created
> the libgstvideo4linux2.so and libgstvideo4linux2.a but it only bundled
> the shared library in the final package.

You need to add the static one to
recipes/gst-plugins-bad-1.0-static.recipe, and the dynamic one to
recipes/gst-plugins-bad-1.0.recipe.

> What are the steps I need to perform to also be able to build faac?

You need to add a recipe for faac, then enable the plugin in the two
(static and non-static) GStreamer plugin recipes, then add faac to the
corresponding .package file as a dependency.

> Do I need perform a cerbero wipe every time I change some recipe? I
> only added the v4l2 variant after I made an initial build attempt and
> I think the libraries were only built after I did wipe and requested
> for cerbero to build the package again.

The buildone command of cerbero takes a recipe name as parameter, and
then rebuilds that single recipe. No wipe needed.

> What do I need to target android-19 (kitkat)? I notice android.config
> has this little snippet in it
> 
> > if target_distro_version == DistroVersion.ANDROID_GINGERBREAD:
> >     v = '9'
> > elif target_distro_version == DistroVersion.ANDROID_ICE_CREAM_SANDWICH:
> >     v = '14'
> > elif target_distro_version == DistroVersion.ANDROID_JELLY_BEAN:
> >     v = '14'
> 
> 
> Is adding another condition for ANDROID_KITKAT and setting v= '19' enough?

That should be enough, yes. But why would you restrict the build of the
GStreamer binaries to KitKat? Did you add any changes that use features
that are only available in newer versions? Otherwise it does not make
any difference other than losing compatibility with older devices.

Your application target API is independent of this, and you can choose
KitKat or anything else 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: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20150118/284aaf7c/attachment-0001.sig>


More information about the gstreamer-devel mailing list