[Android] libiomx: Add disabled rules for building libiomx for jbmr2 and kitkat

Thomas Guillem git at videolan.org
Fri Jul 25 11:38:04 CEST 2014


vlc-ports/android | branch: master | Thomas Guillem <guillem at archos.com> | Thu Jul 24 11:14:56 2014 +0200| [2ced0955318c3efb1f03f96e1ed71827cec5ec9c] | committer: Martin Storsjö

libiomx: Add disabled rules for building libiomx for jbmr2 and kitkat

This is useful for debugging.

Don't warn if unable to load these debug libs.

Signed-off-by: Martin Storsjö <martin at martin.st>

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=2ced0955318c3efb1f03f96e1ed71827cec5ec9c
---

 Makefile                                        |    4 ++++
 vlc-android/jni/Android.mk                      |   18 ++++++++++++++++++
 vlc-android/src/org/videolan/libvlc/LibVLC.java |    8 +++++++-
 3 files changed, 29 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index eb2ac34..5433600 100644
--- a/Makefile
+++ b/Makefile
@@ -10,6 +10,10 @@ JNI_SOURCES=$(SRC)/jni/*.c $(SRC)/jni/*.h
 LIBVLC_LIBS = libvlcjni
 LIBVLC_LIBS += libiomx-ics libiomx-hc libiomx-gingerbread
 
+# The following iomx libs are used for DEBUG only.
+# (after android Jelly Bean, we prefer to use MediaCodec instead of iomx)
+#LIBVLC_LIBS += libiomx-kk libiomx-jbmr2
+
 LIBVLCJNI= $(addprefix $(SRC)/obj/local/$(ARCH)/,$(addsuffix .so,$(LIBVLC_LIBS)))
 
 LIBVLCJNI_H=$(SRC)/jni/libvlcjni.h
diff --git a/vlc-android/jni/Android.mk b/vlc-android/jni/Android.mk
index 090eb5d..e1be179 100644
--- a/vlc-android/jni/Android.mk
+++ b/vlc-android/jni/Android.mk
@@ -114,6 +114,24 @@ LIBIOMX_INCLUDES_ics := $(LIBIOMX_INCLUDES_COMMON) \
 LIBIOMX_LDLIBS_ics := $(LIBIOMX_LDLIBS_COMMON) $(LIBIOMX_LDLIBS_HWBUFFER)
 LIBIOMX_CFLAGS_ics := $(LIBIOMX_CFLAGS_COMMON) -DANDROID_API=14
 
+LIBIOMX_SRC_FILES_jbmr2 := $(LIBIOMX_SRC_FILES_COMMON) $(LIBIOMX_SRC_FILES_HWBUFFER)
+LIBIOMX_INCLUDES_jbmr2 := $(LIBIOMX_INCLUDES_COMMON) \
+	$(ANDROID_SYS_HEADERS_JBMR2)/frameworks/native/include \
+	$(ANDROID_SYS_HEADERS_JBMR2)/frameworks/av/include \
+	$(ANDROID_SYS_HEADERS_JBMR2)/system/core/include \
+	$(ANDROID_SYS_HEADERS_JBMR2)/hardware/libhardware/include
+LIBIOMX_LDLIBS_jbmr2 := $(LIBIOMX_LDLIBS_COMMON) $(LIBIOMX_LDLIBS_HWBUFFER)
+LIBIOMX_CFLAGS_jbmr2 := $(LIBIOMX_CFLAGS_COMMON) $(LIBIOMX_CFLAGS_HWBUFFER) -DANDROID_API=18
+
+LIBIOMX_SRC_FILES_kk := $(LIBIOMX_SRC_FILES_COMMON) $(LIBIOMX_SRC_FILES_HWBUFFER)
+LIBIOMX_INCLUDES_kk := $(LIBIOMX_INCLUDES_COMMON) \
+	$(ANDROID_SYS_HEADERS_KK)/frameworks/native/include \
+	$(ANDROID_SYS_HEADERS_KK)/frameworks/av/include \
+	$(ANDROID_SYS_HEADERS_KK)/system/core/include \
+	$(ANDROID_SYS_HEADERS_KK)/hardware/libhardware/include
+LIBIOMX_LDLIBS_kk := $(LIBIOMX_LDLIBS_COMMON) $(LIBIOMX_LDLIBS_HWBUFFER)
+LIBIOMX_CFLAGS_kk := $(LIBIOMX_CFLAGS_COMMON) $(LIBIOMX_CFLAGS_HWBUFFER) -DANDROID_API=19
+
 define build_iomx
 include $(CLEAR_VARS)
 LOCAL_MODULE := $(1)
diff --git a/vlc-android/src/org/videolan/libvlc/LibVLC.java b/vlc-android/src/org/videolan/libvlc/LibVLC.java
index 6547c8e..2890021 100644
--- a/vlc-android/src/org/videolan/libvlc/LibVLC.java
+++ b/vlc-android/src/org/videolan/libvlc/LibVLC.java
@@ -102,8 +102,14 @@ public class LibVLC {
                 System.loadLibrary("iomx-hc");
             else if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.JELLY_BEAN_MR1)
                 System.loadLibrary("iomx-ics");
+            else if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.JELLY_BEAN_MR2)
+                System.loadLibrary("iomx-jbmr2");
+            else if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.KITKAT)
+                System.loadLibrary("iomx-kk");
         } catch (Throwable t) {
-            Log.w(TAG, "Unable to load the iomx library: " + t);
+            // No need to warn if it isn't found, when we intentionally don't build these except for debug
+            if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1)
+                Log.w(TAG, "Unable to load the iomx library: " + t);
         }
         try {
             System.loadLibrary("vlcjni");



More information about the Android mailing list