This tool generates a libgstreamer_android.so
library with all
GStreamer dependencies for
Servo Media and some Java code
required to initialize Gstreamer on Android.
It makes use of GStreamer ndk-build Makefiles that in summary do:
- override the path of the pkg-config files
- collect all gstreamer plugins that were selected and their dependencies
- generate a C source file that does the gstreamer/android initialization
- link all this together into a single
libgstreamer_android.so
, which is necessary for non-latest Android as the number of shared libraries a process can load was seriously limited (64 or so? you can easily have that many gstreamer plugins) - provide a
GStreamer.java
that loads all this
Install the Android NDK. The recommended NDK version is r16b.
Download GStreamer prebuilt binaries for Android. The current version known to work with gstreamer-rs is 1.14.3
The ndk-build Makefiles need to know where you installed the GStreamer binaries.
You must define an environment variable called GSTREAMER_ROOT_ANDROID
and point it to the
folder where you extracted the GStreamer binaries. This environment variable must be available
at build time, so maybe you want to make it available system-wide by adding it to your ~/.profile
file.
If you need to add extra GStreamer plugins, list them here.
Finally run:
./build.sh
This should generate an out
folder containing a zip file per architecture including the
libgstreamer_android.so
and a src.zip
file with the generated GStreamer.java
among others.
The GStreamer binaries per each platform are deployed to Servo's AWS S3 space.
In order to deploy new binaries you need the s3cmd tool and authorized access to Servo's S3.
The generated binaries are named with this nomenclature: gstreamer-<target>-<version>-<date>-<time>.zip
and are meant to be uploaded to http://servo-deps.s3.amazonaws.com/gstreamer
.
An example command to upload new binaries to http://servo-deps.s3.amazonaws.com/gstreamer/gstreamer-armeabi-v7a-1.14.3-20181004-142930.zip:
./s3cmd put ~/dev/gstreamer/libgstreamer_android_gen/out/gstreamer-armeabi-v7a-1.14.3-20181004-142930.zip s3://servo-deps/gstreamer/gstreamer-armeabi-v7a-1.14.3-20181004-142930.zip -P
-
Android binaries have text relocations. Prevents usage on Android >= 5.0. The current workaround involves removing the
openh264
plugin from the list of plugins for the x86 arch. The plugin list is located at$GSTREAMER_ROOT_ANDROID/*/share/gst-android/ndk-build/plugins.mk
-
nice
is missing from the plugins list in versions <= 1.14.4. We need to manually add it to$GSTREAMER_ROOT_ANDROID/*/share/gst-android/ndk-build/plugins.mk