How to build gstreamer for Android?

I need to build gstreamer for android as a single dynamic lib with some specific libs.

I found some info

this seems to build the whole thing.

Do I have to build cerbero or use cross build? Any more info for the build of gstreamer for Android? It is a bit hard to find related info online.

It seems that cerbero is the right choice.

Correct, use cerbero, and follow the general instructions, be attentive to that section:

Thanks, Nicolas. I am trying to build gstreamer with some specific libs and plugins for Android from the source. My command is as follows:

meson setup --cross-file android_arm64_api.txt \
            build-gst-full \
            --buildtype=release \
            --strip \
            --default-library=static \
            --wrap-mode=forcefallback \
            --prefix=path/thirdparties/gstreamer \
            -Dauto_features=disabled \
            -Dgst-full-libraries=app,video,player -Dbase=enabled -Dgood=enabled -Dbad=enabled -Dqt5=enabled \

to build a single dynamic lib.

I have managed to add quite a few libs and plugins successfully. How to enable
libs gstcodesparsers-1.0, gstandroidmedia and gstopensles? I am not familiar with meson.

I also need to add orc and libav. I added them as follows:

meson setup --cross-file android_arm64_api.txt \
            build-gst-full \
            --buildtype=release \
            --strip \
            --default-library=static \
            --wrap-mode=forcefallback \
            --prefix=path/thirdparties/gstreamer \
            -Dauto_features=disabled \
            -Dgst-full-libraries=app,video,player -Dbase=enabled -Dgood=enabled -Dbad=enabled -Dqt5=enabled \ 
            -Dorc=enabled -Dlibav=enabled \

These two libs are built. But they are not added to the single dynamic lib. Why?

and solved the issue of gstopensles

trying to add lib gstandroidmedia which needs opengl. But meson set-up shows GL/gl.h can not be found. How to enable opengl?

I added the following options to the meson set-up
-Dgst-plugins-base:gl-png=enabled \

Got the following messages:
gst-plugins-base| Dependency (anonymous) from subproject subprojects/gl-headers found: YES 2019.1.0
gst-plugins-base| Run-time dependency opengl found: NO (tried pkgconfig)
gst-plugins-base| Run-time dependency gl found: NO (tried pkgconfig)
gst-plugins-base| Library GL found: NO

gst-plugins-base| Has header “GL/gl.h” : NO

subprojects/gst-plugins-base/gst-libs/gst/gl/ ERROR: Problem encountered: Could not find requested OpenGL library

I looked through gstreamer source code and could not find GL/gl.h

replacing -Dgst-plugins-base:gl_api=opengl with
solves the problem

last puzzle:
libav is needed as well. Added -Dlibav=enabled. libav seems to be built into the single dynamic lib. If I remove static libs of libav in my app, video streaming disappears although there are no build errors.

Anyone knows what could affect libav build?

video codecs are not available. Need to figure out which option is required to build codecs.

-DFFmpeg:h264_decoder=enabled solved the problem.