gstreamer on android build help
Lee Matthews
lma at spaceapplications.com
Tue Apr 29 04:56:31 PDT 2014
Hi,
Does anyone know of any step by step build instructions to get gstreamer-1.0 working on Android ?
I need to build some code that will run as an executable on Android, without any Java code. The final executable will be ran via a shell on the Android target.
I'm currently building my code using eclipse with the necessary arm libraries being built by buildroot.
I've tried using the NDK method by taking the android tutorial-1.c code, adding the plugins that I wish to use in my final application.
The shared library builds ok, but when I try linking it to my application in eclipse, I get the following errors :
---
/home/lma/Development/buildroot-2014.02/output/host/opt/ext-toolchain/bin/../lib/gcc/arm-none-linux-gnueabi/4.7.3/../../../../arm-none-linux-gnueabi/bin/ld: warning: libc.so, needed by /home/lma/tmp/libs/armeabi/libgstreamer_android.so, not found (try using -rpath or -rpath-link)
/home/lma/Development/buildroot-2014.02/output/host/opt/ext-toolchain/bin/../lib/gcc/arm-none-linux-gnueabi/4.7.3/../../../../arm-none-linux-gnueabi/bin/ld: warning: libOpenSLES.so, needed by /home/lma/tmp/libs/armeabi/libgstreamer_android.so, not found (try using -rpath or -rpath-link)
/home/lma/Development/buildroot-2014.02/output/host/opt/ext-toolchain/bin/../lib/gcc/arm-none-linux-gnueabi/4.7.3/../../../../arm-none-linux-gnueabi/bin/ld: warning: liblog.so, needed by /home/lma/tmp/libs/armeabi/libgstreamer_android.so, not found (try using -rpath or -rpath-link)
./src/audio-sink-opensles.o: In function `main':
/home/lma/workspace/mobipv_dev/Trunk/mobiPV/audio-sink-opensles/ARM_Debug/../src/audio-sink-opensles.c:1072: undefined reference to `__sF'
./gst-build-armeabi/gstreamer_android.o: In function `glib_print_handler':
/home/lma/workspace/mobipv_dev/Trunk/mobiPV/audio-sink-opensles/ARM_Debug/../gst-build-armeabi/gstreamer_android.c:33: undefined reference to `__android_log_print'
./gst-build-armeabi/gstreamer_android.o: In function `glib_printerr_handler':
/home/lma/workspace/mobipv_dev/Trunk/mobiPV/audio-sink-opensles/ARM_Debug/../gst-build-armeabi/gstreamer_android.c:39: undefined reference to `__android_log_print'
./gst-build-armeabi/gstreamer_android.o: In function `glib_log_handler':
/home/lma/workspace/mobipv_dev/Trunk/mobiPV/audio-sink-opensles/ARM_Debug/../gst-build-armeabi/gstreamer_android.c:168: undefined reference to `__android_log_print'
./gst-build-armeabi/gstreamer_android.o: In function `gst_debug_logcat':
/home/lma/workspace/mobipv_dev/Trunk/mobiPV/audio-sink-opensles/ARM_Debug/../gst-build-armeabi/gstreamer_android.c:223: undefined reference to `__android_log_print'
/home/lma/workspace/mobipv_dev/Trunk/mobiPV/audio-sink-opensles/ARM_Debug/../gst-build-armeabi/gstreamer_android.c:230: undefined reference to `__android_log_print'
./gst-build-armeabi/gstreamer_android.o:/home/lma/workspace/mobipv_dev/Trunk/mobiPV/audio-sink-opensles/ARM_Debug/../gst-build-armeabi/gstreamer_android.c:330: more undefined references to `__android_log_print' follow
/home/lma/Development/buildroot-2014.02/output/host/opt/ext-toolchain/bin/../lib/gcc/arm-none-linux-gnueabi/4.7.3/../../../../arm-none-linux-gnueabi/bin/ld: mobipv-audio-sink-opensles-arm: hidden symbol `fstatat' in /home/lma/Development/buildroot-2014.02/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libc_nonshared.a(fstatat.oS) is referenced by DSO
/home/lma/Development/buildroot-2014.02/output/host/opt/ext-toolchain/bin/../lib/gcc/arm-none-linux-gnueabi/4.7.3/../../../../arm-none-linux-gnueabi/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
make: *** [mobipv-audio-sink-opensles-arm] Error 1
---
I've also tried building the gstreamer library using libtool. I downloaded the binary files : gstreamer-1.0-android-arm-1.2.4.1-debug.zip
I then tried linking the static libraries to produce one static library that I could link with my code in eclipse.
libtool --tag=CC --mode=link arm-none-linux-gnueabi-gcc -static -o libgstreamer.a libgstcoreelements.a libgstopensles.a libgstaudioconvert.a libgstogg.a libgstopus.a libgstudp.a
If I run readelf afterwards I get :
---
readelf -h libgstreamer.a
readelf: Error: Unable to read in 0x2020 bytes of section headers
File: libgstreamer.a(libgstcoreelements.a)
readelf: Error: Not an ELF file - it has the wrong magic bytes at the start
readelf: Error: Unable to read in 0x2020 bytes of section headers
File: libgstreamer.a(libgstopensles.a)
readelf: Error: Not an ELF file - it has the wrong magic bytes at the start
readelf: Error: Unable to read in 0x2020 bytes of section headers
File: libgstreamer.a(libgstaudioconvert.a)
readelf: Error: Not an ELF file - it has the wrong magic bytes at the start
readelf: Error: Unable to read in 0x2020 bytes of section headers
File: libgstreamer.a(libgstogg.a)
readelf: Error: Not an ELF file - it has the wrong magic bytes at the start
readelf: Error: Unable to read in 0x2020 bytes of section headers
File: libgstreamer.a(libgstopus.a)
readelf: Error: Not an ELF file - it has the wrong magic bytes at the start
readelf: Error: Unable to read in 0x2020 bytes of section headers
File: libgstreamer.a(libgstudp.a)
readelf: Error: Not an ELF file - it has the wrong magic bytes at the start
---
If I then try compiling with eclipse I get :
/home/lma/libtool-test/libgstreamer.a: could not read symbols: Archive has no index; run ranlib to add one
collect2: error: ld returned 1 exit status
make: *** [mobipv-audio-sink-opensles-arm] Error 1
I'm really getting stuck with this, could anyone please point me in the direction of a good tutorial or help guide me through the process ?
Thanks
Lee
More information about the gstreamer-devel
mailing list