androidgstreamerx264

x264 lib fails to build on Android, other plugins not included


On my x86 windows machine, I'm compiling an Android app that links gstreamer using CMake: https://github.com/henkeldi/gstreamer-android/blob/master/app/src/main/cpp/CMakeLists.txt

I'm using the latest Android binaries provided by gstreamer, so far everything worked and I've successfully linked gstreamer's app plugin. Next I tried to link x264:

SET(GST_PLUGINS_CORE_LIBS gstx264 gstapp)

SET(GST_PLUGINS_BASE ... x264)

However, doing so results in dozens of these text relocation errors:

ld:error: relocation R_AARCH64_ADD_ABS_L012_NC cannot be used against symbol x264_cabac_range_lps; recompile with -fPIC

Even after I add the flag -fPIC these do not go away. Doing a bit of digging I see that Android does not allow text relocation since Api23, but that was several years ago. Is there still no fix on Android?

I also noticed that the videoparsersbad and hls plugins are not in the latest Android gstreamer binaries (version 1.21.2). Are these also not supported on Android?


Solution

  • Looks like gstreamer use very outdated version of x264. If I pinpointed it correctly it use version 72db437770fd1ce3961f624dd57a8e75ff65ae0b from 04.03.2019 (3 years ago). And your relocation problem was probably fixed around 17.07.2019.