[vlc-devel] [PATCH 1/2] Build the iomx glue code as a separate shared library

Martin Storsjö martin at martin.st
Fri Dec 16 22:47:07 CET 2011


---
This is for the vlc-android repo, and is needed to use the
new form of the iomx wrapper.

 vlc-android/jni/Android.mk                         |   11 ++++++++++-
 .../src/org/videolan/vlc/android/LibVLC.java       |    5 +++++
 2 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/vlc-android/jni/Android.mk b/vlc-android/jni/Android.mk
index f8a1242..06b547c 100644
--- a/vlc-android/jni/Android.mk
+++ b/vlc-android/jni/Android.mk
@@ -22,7 +22,16 @@ LOCAL_LDLIBS := -L$(VLC_CONTRIB)/lib \
 	-lavformat -lavcodec -lswscale -lavutil -lpostproc \
 	-lmpeg2 -lpng -ldca -ldvbpsi -ltwolame -lkate -llog -la52 \
 	-lebml -lmatroska -ltag \
-	-L$(ANDROID_LIBS) -lgcc -lstagefright -lmedia -lutils -lbinder \
 	$(ANDROID_NDK)/sources/cxx-stl/gnu-libstdc++/libs/$(ARCH)/libstdc++.a
 
 include $(BUILD_SHARED_LIBRARY)
+
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE     := libiomx
+LOCAL_SRC_FILES  := ../$(VLC_SRC_DIR)/modules/codec/omxil/iomx.cpp
+LOCAL_C_INCLUDES := $(VLC_SRC_DIR)/modules/codec/omxil $(ANDROID_SYS_HEADERS)/frameworks/base/include $(ANDROID_SYS_HEADERS)/system/core/include
+LOCAL_LDLIBS     := -L$(ANDROID_LIBS) -lgcc -lstagefright -lmedia -lutils -lbinder
+
+include $(BUILD_SHARED_LIBRARY)
diff --git a/vlc-android/src/org/videolan/vlc/android/LibVLC.java b/vlc-android/src/org/videolan/vlc/android/LibVLC.java
index 8cd436e..8f9b67a 100644
--- a/vlc-android/src/org/videolan/vlc/android/LibVLC.java
+++ b/vlc-android/src/org/videolan/vlc/android/LibVLC.java
@@ -30,6 +30,11 @@ public class LibVLC {
     /* Load library before object instantiation */
     static {
         try {
+            System.loadLibrary("iomx");
+        } catch (Throwable t) {
+            t.printStackTrace();
+        }
+        try {
             System.loadLibrary("vlcjni");
         } catch (UnsatisfiedLinkError ule) {
             Log.e(TAG, "Can't load vlcjni library: " + ule);
-- 
1.7.2.5




More information about the vlc-devel mailing list