Building Gstreaming for Android with Cerbero. Adding plugins

Sérgio Agostinho sergio.r.agostinho at gmail.com
Sun Jan 18 10:45:12 PST 2015


2015-01-18 19:18 GMT+01:00 Sebastian Dröge <sebastian at centricular.com>:

> 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'm targeting a rooted Nexus 5 with a USB camera attached.

>
> > 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.
>

I thought these lines already did that
<recipes/gst-plugins-good-1.0.recipe> line 120

        if self.config.variants.v4l2:
            self.files_plugins_capture +=
['lib/gstreamer-1.0/libgstvideo4linux2%(mext)s']

<recipes/gst-plugins-good-1.0-static.recipe> line 114

        if self.config.variants.v4l2:
            self.files_plugins_capture_devel += ['libgstvideo4linux2']




>
> > 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.
>

I already have the following recipe
https://gist.github.com/SergioRAgostinho/b73b899d2b32d7928a45
but the linker is complaining that he doesn't find crtbegin_so.o and
crtend_so.o. The files are in
android-ndk-r10d/platforms/android-19/arch-arm/usr/lib.
I'm currently trying to add some -L flags to the recipe.




>
> > 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.
>
Makes sense.


>
> > 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.


No I didn't. It was simply ignorance on my part, but since I'm only
targeting a Nexus 5 on android-19 I thought it couldn't hurt :) I will
revert back to DistroVersion.ANDROID_GINGERBREAD, as it is on the original
config files.

For the record I also had to add ANDROID_KITKAT to the enum.py in
cerbero/cerbero/utils/enums.py.

Cheers
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20150118/98a0f0c6/attachment.html>


More information about the gstreamer-devel mailing list