Help with Android.mk file for plugin

yoyosuper8 yoyosuper8 at yahoo.com
Mon Sep 23 11:54:20 PDT 2013


Hi all, so I'm having a lot of issues registering a plugin in Android. I
think it may be my Android.mk file that its missing something. I'm hoping
that someone can help me resolve this.
Here is what I have in my jni folder within my android project:
Android.mk
gstplugin.h
gstplugin.c
tutorial-3.c

The code for the Android.mk:

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)
plugin_LTLIBRARIES			:= libgstplugin.la
LOCAL_MODULE				:= libgstplugin
libgstplugin_la_SOURCES		:= gstplugin.c
noinst_HEADERS				:= gstplugin.h
libgstplugin_la_LDLIBS			:= -llog -landroid
libgstplugin_la_CFLAGS			:= -DGST_PLUGIN_BUILD_STATIC
libgstplugin_la_LDFLAGS			:= -module -avoid-version -export-symbols-regex
[_]*\(gst_\|Gst\|GST_\).*

include $(BUILD_STATIC_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE			:= tutorial-3
LOCAL_SRC_FILES		:= tutorial-3.c
LOCAL_SHARED_LIBRARIES	:= gstreamer_android
LOCAL_LDLIBS			:= -llog -landroid -pthread
LOCAL_LDFLAGS			:= -mode=link
LOCAL_STATIC_LIBRARIES	:= -llibgstplugin

include $(BUILD_SHARED_LIBRARY)

ifndef GSTREAMER_SDK_ROOT
ifndef GSTREAMER_SDK_ROOT_ANDROID
$(error GSTREAMER_SDK_ROOT_ANDROID is not defined!)
endif
GSTREAMER_SDK_ROOT        := $(GSTREAMER_SDK_ROOT_ANDROID)
endif
GSTREAMER_NDK_BUILD_PATH  :=
$(GSTREAMER_SDK_ROOT)/share/gst-android/ndk-build/
include $(GSTREAMER_NDK_BUILD_PATH)/plugins.mk
GSTREAMER_PLUGINS         := $(GSTREAMER_PLUGINS_CORE)
$(GSTREAMER_PLUGINS_SYS) $(GSTREAMER_PLUGINS_EFFECTS)
GSTREAMER_EXTRA_DEPS      := gstreamer-interfaces-0.10 gstreamer-video-0.10
include $(GSTREAMER_NDK_BUILD_PATH)/gstreamer.mk

This generates a libgstplugin.a static library. However, it fails because it
says: undefined reference to 'gst_plugin_myplugin_register'

I'm registering the plugin using GST_PLUGIN_STATIC_REGISTER(myplugin) and
GST_PLUGIN_STATIC_DECLARE(myplugin) in tutorial-3.c. The tutorial-3.c does
not have a main method, but instead it is "main" method is gst_native_init()
which is initiated in java. In this method, I call gst_init(NULL, NULL)
followed by GST_PLUGIN_STATIC_REGISTER(myplugin). However, I still get the
undefined reference error.

I've attached the files to this post if someone cares to look at them.
Any help would be appreciated. There has got to be something missing, but I
can't figure out what.

Thank you
Andy

Android.mk
<http://gstreamer-devel.966125.n4.nabble.com/file/n4662154/Android.mk>  
gstplugin.h
<http://gstreamer-devel.966125.n4.nabble.com/file/n4662154/gstplugin.h>  
gstplugin.c
<http://gstreamer-devel.966125.n4.nabble.com/file/n4662154/gstplugin.c>  
tutorial-3.c
<http://gstreamer-devel.966125.n4.nabble.com/file/n4662154/tutorial-3.c>  



--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Help-with-Android-mk-file-for-plugin-tp4662154.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.


More information about the gstreamer-devel mailing list