[Android] libiomx: Build the hwbuffer code if found
Thomas Guillem
git at videolan.org
Fri Jul 25 11:36:43 CEST 2014
vlc-ports/android | branch: master | Thomas Guillem <guillem at archos.com> | Thu Jul 24 11:14:07 2014 +0200| [7d491229dad2dc1d6a9a6d9266730260fd1cbf34] | committer: Martin Storsjö
libiomx: Build the hwbuffer code if found
The new iomx_hwbuffer.c file currently only exists in the master
branch in vlc.git, not in the 2.2 release branch.
Linking the libiomx-*.so to libcutils/liblog/libui even though we
don't use any functions from those (if iomx_hwbuffer.c isn't found)
doesn't hurt, and some of them are necessary even if iomx_hwbuffer.c
isn't built, since we still provide ANDROID_API to iomx.cpp (which
causes the HAS_USE_BUFFER codepaths to be built).
Signed-off-by: Martin Storsjö <martin at martin.st>
> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=7d491229dad2dc1d6a9a6d9266730260fd1cbf34
---
vlc-android/jni/Android.mk | 21 +++++++++++++++++----
1 file changed, 17 insertions(+), 4 deletions(-)
diff --git a/vlc-android/jni/Android.mk b/vlc-android/jni/Android.mk
index 2752d8e..a914c5a 100644
--- a/vlc-android/jni/Android.mk
+++ b/vlc-android/jni/Android.mk
@@ -79,32 +79,45 @@ include $(BUILD_SHARED_LIBRARY)
LIBIOMX_SRC_FILES_COMMON := ../$(VLC_SRC_DIR)/modules/codec/omxil/iomx.cpp
LIBIOMX_INCLUDES_COMMON := $(VLC_SRC_DIR)/modules/codec/omxil
-LIBIOMX_LDLIBS_COMMON := -L$(ANDROID_LIBS) -lgcc -lstagefright -lmedia -lutils -lbinder
+LIBIOMX_LDLIBS_COMMON := -L$(ANDROID_LIBS) -lgcc -lstagefright -lmedia -lutils -lbinder -llog -lcutils -lui
LIBIOMX_CFLAGS_COMMON := -Wno-psabi
+# Once we always build this with a version of vlc that contains iomx_hwbuffer.c,
+# we can remove this condition
+ifneq (,$(wildcard $(LOCAL_PATH)/../$(VLC_SRC_DIR)/modules/codec/omxil/iomx_hwbuffer.c))
+LIBIOMX_SRC_FILES_COMMON += ../$(VLC_SRC_DIR)/modules/codec/omxil/iomx_hwbuffer.c
+endif
+# no hwbuffer for gingerbread
LIBIOMX_INCLUDES_gingerbread := $(LIBIOMX_INCLUDES_COMMON) \
$(ANDROID_SYS_HEADERS_GINGERBREAD)/frameworks/base/include \
- $(ANDROID_SYS_HEADERS_GINGERBREAD)/system/core/include
+ $(ANDROID_SYS_HEADERS_GINGERBREAD)/system/core/include \
+ $(ANDROID_SYS_HEADERS_GINGERBREAD)/hardware/libhardware/include
+LIBIOMX_LDLIBS_gingerbread := $(LIBIOMX_LDLIBS_COMMON)
+LIBIOMX_CFLAGS_gingerbread := $(LIBIOMX_CFLAGS_COMMON) -DANDROID_API=10
LIBIOMX_INCLUDES_hc := $(LIBIOMX_INCLUDES_COMMON) \
$(ANDROID_SYS_HEADERS_HC)/frameworks/base/include \
$(ANDROID_SYS_HEADERS_HC)/frameworks/base/native/include \
$(ANDROID_SYS_HEADERS_HC)/system/core/include \
$(ANDROID_SYS_HEADERS_HC)/hardware/libhardware/include
+LIBIOMX_LDLIBS_hc := $(LIBIOMX_LDLIBS_COMMON)
+LIBIOMX_CFLAGS_hc := $(LIBIOMX_CFLAGS_COMMON) -DANDROID_API=11
LIBIOMX_INCLUDES_ics := $(LIBIOMX_INCLUDES_COMMON) \
$(ANDROID_SYS_HEADERS_ICS)/frameworks/base/include \
$(ANDROID_SYS_HEADERS_ICS)/frameworks/base/native/include \
$(ANDROID_SYS_HEADERS_ICS)/system/core/include \
$(ANDROID_SYS_HEADERS_ICS)/hardware/libhardware/include
+LIBIOMX_LDLIBS_ics := $(LIBIOMX_LDLIBS_COMMON) $(LIBIOMX_LDLIBS_HWBUFFER)
+LIBIOMX_CFLAGS_ics := $(LIBIOMX_CFLAGS_COMMON) -DANDROID_API=14
define build_iomx
include $(CLEAR_VARS)
LOCAL_MODULE := $(1)
LOCAL_SRC_FILES := $(LIBIOMX_SRC_FILES_COMMON)
LOCAL_C_INCLUDES := $(LIBIOMX_INCLUDES_$(2))
-LOCAL_LDLIBS := $(LIBIOMX_LDLIBS_COMMON)
-LOCAL_CFLAGS := $(LIBIOMX_CFLAGS_COMMON)
+LOCAL_LDLIBS := $(LIBIOMX_LDLIBS_$(2))
+LOCAL_CFLAGS := $(LIBIOMX_CFLAGS_$(2))
include $(BUILD_SHARED_LIBRARY)
endef
More information about the Android
mailing list