dynamically register elements from a .so file

Jacob S jacobhameiri at gmail.com
Thu Nov 6 14:12:45 PST 2014


I tried to split x264 from my gstreamer_android.so like this:
Android.mk :

LOCAL_PATH := $(call my-dir)
APP_PLATFORM := android-19


include $(CLEAR_VARS)
ifndef GSTREAMER_ROOT
ifndef GSTREAMER_SDK_ROOT_ANDROID
$(error GSTREAMER_SDK_ROOT_ANDROID is not defined!)
endif
GSTREAMER_ROOT        := $(GSTREAMER_SDK_ROOT_ANDROID)
endif
GSTREAMER_ANDROID_MODULE_NAME := gstreamer_android
LOCAL_MODULE    := gsthelper
LOCAL_SRC_FILES := gsthelper.c
LOCAL_SHARED_LIBRARIES := gstreamer_android
LOCAL_C_INCLUDES := $(LOCAL_PATH)/../..
LOCAL_LDLIBS := -landroid
include $(BUILD_STATIC_LIBRARY)

# main gstreamer lib

GSTREAMER_NDK_BUILD_PATH  := $(GSTREAMER_ROOT)/share/gst-android/ndk-build/
include $(GSTREAMER_NDK_BUILD_PATH)/plugins.mk
GSTREAMER_PLUGINS_CODECS_TRIMMED := isomp4 jpeg opus videoparsersbad
jpegformat androidmedia libav  avi asf ogg theora vorbis mpeg2dec mad faad
mulaw id3demux apetag vpx matroska
GSTREAMER_PLUGINS_NET_TRIMMED := tcp rtsp rtp rtpmanager soup udp sdp
GSTREAMER_PLUGINS         := $(GSTREAMER_PLUGINS_CORE)
$(GSTREAMER_PLUGINS_PLAYBACK) \
$(GSTREAMER_PLUGINS_CODECS_TRIMMED) $(GSTREAMER_PLUGINS_NET_TRIMMED)
opensles opengl videobox gio
G_IO_MODULES              := gnutls
GSTREAMER_EXTRA_DEPS      := glib-2.0 gstreamer-net-1.0
gstreamer-rtsp-server-1.0 gstreamer-video-1.0 gio-2.0
include $(GSTREAMER_NDK_BUILD_PATH)/gstreamer-1.0.mk

# gstreamer x264 lib

include $(CLEAR_VARS)
GSTREAMER_ANDROID_MODULE_NAME := gstreamer_x264
GSTREAMER_PLUGINS         := x264
include $(GSTREAMER_NDK_BUILD_PATH)/gstreamer-1.0.mk


but I am getting this error when I build:

[armeabi-v7a] Prebuilt       : libgstreamer_android.so <=
gst-build-armeabi-v7a/
cp: cannot stat ‘gst-build-armeabi-v7a/libgstreamer_android.so’: No such
file or directory
make[1]: *** [obj/local/armeabi-v7a/libgstreamer_android.so] Error 1
make[1]: Leaving directory `/home/builder/test1/test1Lib'
make: *** [build] Error 2

What is wrong with my Android.mk file ?
What is the proper way to split gstreamer dependencies to one main lib (
gstreamer_android.so ) and another gstx264 lib ( gstreamer_x264.so ) ?

Thanks
Jacob

2014-11-05 14:50 GMT+02:00 Sebastian Dröge <sebastian at centricular.com>:

> On Mi, 2014-11-05 at 13:53 +0200, Jacob S wrote:
> > I am trying to load libgstx264.so using gst_plugin_load_file.
> >
> > I copied libx264.so and libgstx264.so to the same directory where my
> > process is located.
> >
> > when I call gst_plugin_load_file("./libgstx264.so", &error); I get this
> > error:
> > Could not load libgstx264 file: Opening module failed: Cannot load
> library:
> > soinfo_link_image(linker.cpp:1673): could not load library
> > "libgstpbutils-1.0.so.0" needed by "libgstx264.so"; caused by
> > load_library(linker.cpp:771): library "libgstpbutils-1.0.so.0" not found
> >
> > Isnt libgstpbutils-1.0.so.0" supposed to be loaded already by the app ?
> how
> > do I load it manually ?
> >
> > what am I doing wrong here ?
>
> Your shared objects will required the shared GStreamer libraries to
> work. Ideally you would statically compile x264 into the x264 GStreamer
> plugin, and then link it to your libgstreamer_android.so. This has to be
> done manually though.
>
> Alternatively you could pull in all the needed .so files from the
> runtime binary release, but that's a lot of code duplication and
> increased binary size then.
>
> --
> Sebastian Dröge, Centricular Ltd · http://www.centricular.com
>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20141107/6f430022/attachment.html>


More information about the gstreamer-devel mailing list