<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">2015-01-18 19:18 GMT+01:00 Sebastian Dröge <span dir="ltr"><<a href="mailto:sebastian@centricular.com" target="_blank">sebastian@centricular.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span class="">On So, 2015-01-18 at 16:11 +0100, Sérgio Agostinho wrote:<br>
> Hi folks,<br>
><br>
> I've been trying to build and package gstreamer for android using cerbero.<br>
> Additionally to what comes bundled by default, I've been trying to build<br>
> the static versions of video4linux2 and faac.<br>
<br>
</span>You won't be able to use v4l2 on Android except for a few devices if<br>
you're lucky. It's not public Android API.<br>
<br>
If you want to use the camera, there is a GStreamer plugin here, which<br>
uses public Android APIs only:<br>
<a href="https://github.com/EricssonResearch/openwebrtc-gst-plugins/tree/master/sys/androidvideo/video-source" target="_blank">https://github.com/EricssonResearch/openwebrtc-gst-plugins/tree/master/sys/androidvideo/video-source</a> </blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><br>
<br>
Hopefully we will merge that one into gst-plugins-bad in the near<br>
future.<br></blockquote><div><br></div><div>I'm targeting a rooted Nexus 5 with a USB camera attached.  </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<span class=""><br>
> I've cloned cerbero from the repo, checked out tag 1.4.5. Currently my<br>
> config file has the following contents.<br>
><br>
> <a href="https://gist.github.com/SergioRAgostinho/9d252023507a83b41b49" target="_blank">https://gist.github.com/SergioRAgostinho/9d252023507a83b41b49</a><br>
><br>
> import os<br>
> > from cerbero.config import Platform, Architecture, Distro, DistroVersion<br>
> ><br>
> > target_platform = Platform.ANDROID<br>
> > target_distro = Distro.ANDROID<br>
> > target_distro_version = DistroVersion.ANDROID_JELLY_BEAN<br>
> > target_arch = Architecture.ARMv7<br>
> ><br>
> > #variants = ['nodebug']<br>
> > variants = ['v4l2']<br>
> ><br>
> ><br>
> > toolchain_prefix = '/home/nexusdev/Development/3rdparty/android-ndk-r10d'<br>
><br>
><br>
> As you can see I added the v4l2 variant. I noticed that this created<br>
> the libgstvideo4linux2.so and libgstvideo4linux2.a but it only bundled<br>
> the shared library in the final package.<br>
<br>
</span>You need to add the static one to<br>
recipes/gst-plugins-bad-1.0-static.recipe, and the dynamic one to<br>
recipes/gst-plugins-bad-1.0.recipe.<br></blockquote><div><br></div><div>I thought these lines already did that</div><div><recipes/gst-plugins-good-1.0.recipe> line 120<br></div><div><br></div><div><div>        if self.config.variants.v4l2:</div><div>            self.files_plugins_capture += ['lib/gstreamer-1.0/libgstvideo4linux2%(mext)s']</div></div><div><br></div><div><div><recipes/gst-plugins-good-1.0-static.recipe> line 114<br></div><div><br></div><div><div>        if self.config.variants.v4l2:</div><div>            self.files_plugins_capture_devel += ['libgstvideo4linux2']</div></div><div><br></div></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<span class=""><br>
> What are the steps I need to perform to also be able to build faac?<br>
<br>
</span>You need to add a recipe for faac, then enable the plugin in the two<br>
(static and non-static) GStreamer plugin recipes, then add faac to the<br>
corresponding .package file as a dependency.<br></blockquote><div><br></div><div>I already have the following recipe</div><div><a href="https://gist.github.com/SergioRAgostinho/b73b899d2b32d7928a45">https://gist.github.com/SergioRAgostinho/b73b899d2b32d7928a45</a><br></div><div>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.</div><div>I'm currently trying to add some -L flags to the recipe.</div><div><br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<span class=""><br>
> Do I need perform a cerbero wipe every time I change some recipe? I<br>
> only added the v4l2 variant after I made an initial build attempt and<br>
> I think the libraries were only built after I did wipe and requested<br>
> for cerbero to build the package again.<br>
<br>
</span>The buildone command of cerbero takes a recipe name as parameter, and<br>
then rebuilds that single recipe. No wipe needed.<br></blockquote><div>Makes sense.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<span class=""><br>
> What do I need to target android-19 (kitkat)? I notice android.config<br>
> has this little snippet in it<br>
><br>
> > if target_distro_version == DistroVersion.ANDROID_GINGERBREAD:<br>
> >     v = '9'<br>
> > elif target_distro_version == DistroVersion.ANDROID_ICE_CREAM_SANDWICH:<br>
> >     v = '14'<br>
> > elif target_distro_version == DistroVersion.ANDROID_JELLY_BEAN:<br>
> >     v = '14'<br>
><br>
><br>
> Is adding another condition for ANDROID_KITKAT and setting v= '19' enough?<br>
<br>
</span>That should be enough, yes. But why would you restrict the build of the<br>
GStreamer binaries to KitKat? Did you add any changes that use features<br>
that are only available in newer versions? Otherwise it does not make<br>
any difference other than losing compatibility with older devices.<br>
<br>
Your application target API is independent of this, and you can choose<br>
KitKat or anything else there.</blockquote><div> </div><div>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. </div><div><br></div><div>For the record I also had to add ANDROID_KITKAT to the enum.py in cerbero/cerbero/utils/enums.py.</div><div><br></div><div>Cheers</div></div></div></div>