Commit fe1ffba9 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Move generation of iomx and anw in the Android.mk

And call it from compile-libvlc.sh
parent 836c1fe6
...@@ -12,23 +12,6 @@ JAVA_SOURCES+=$(shell find $(APP_SRC)/res -name "*.xml" -o -name "*.png") ...@@ -12,23 +12,6 @@ JAVA_SOURCES+=$(shell find $(APP_SRC)/res -name "*.xml" -o -name "*.png")
JNI_SOURCES=$(SRC)/jni/*.c $(SRC)/jni/*.h JNI_SOURCES=$(SRC)/jni/*.c $(SRC)/jni/*.h
LIBVLC_LIBS = libvlcjni LIBVLC_LIBS = libvlcjni
ifneq ($(HAVE_64),1)
# Can't link with 32bits symbols.
# Not a problem since MediaCodec should work on 64bits devices (android-21)
LIBVLC_LIBS += libiomx.14 libiomx.13 libiomx.10
endif
# The following iomx libs are used for DEBUG only.
# (after android Jelly Bean, we prefer to use MediaCodec instead of iomx)
#LIBVLC_LIBS += libiomx.19 libiomx.18
LIBVLC_LIBS += libanw.10 libanw.13 libanw.14 libanw.18 libanw.21
LIBVLCJNI= $(addprefix $(SRC)/obj/local/$(ARCH)/,$(addsuffix .so,$(LIBVLC_LIBS)))
PRIVATE_LIBDIR=android-libs
PRIVATE_LIBS=$(PRIVATE_LIBDIR)/libstagefright.so $(PRIVATE_LIBDIR)/libmedia.so $(PRIVATE_LIBDIR)/libutils.so $(PRIVATE_LIBDIR)/libcutils.so $(PRIVATE_LIBDIR)/libbinder.so $(PRIVATE_LIBDIR)/libui.so $(PRIVATE_LIBDIR)/libhardware.so
ANT_OPTS += -v ANT_OPTS += -v
VERBOSE = VERBOSE =
GEN = GEN =
...@@ -57,13 +40,6 @@ endef ...@@ -57,13 +40,6 @@ endef
$(VLC_APK): $(LIBVLCJNI) $(JAVA_SOURCES) $(VLC_APK): $(LIBVLCJNI) $(JAVA_SOURCES)
$(call build_apk) $(call build_apk)
$(PRIVATE_LIBDIR)/%.so: $(PRIVATE_LIBDIR)/%.c
$(GEN)$(TARGET_TUPLE)-gcc $< -shared -o $@ --sysroot=$(SYSROOT)
$(PRIVATE_LIBDIR)/%.c: $(PRIVATE_LIBDIR)/%.symbols
$(VERBOSE)rm -f $@
$(GEN)for s in `cat $<`; do echo "void $$s() {}" >> $@; done
apk: apk:
$(call build_apk) $(call build_apk)
......
...@@ -427,13 +427,16 @@ make $MAKEFLAGS ...@@ -427,13 +427,16 @@ make $MAKEFLAGS
cd ../.. cd ../..
######################################################################################
# libvlcJNI
###################################################################################### ######################################################################################
##################
# libVLC modules #
##################
echo "Generating static module list" echo "Generating static module list"
VLC_MODULES=`./find_modules.sh vlc/$VLC_BUILD_DIR` VLC_MODULES=`./find_modules.sh vlc/$VLC_BUILD_DIR`
echo $VLC_MODULES
DEFINITION=""; DEFINITION="";
BUILTINS="const void *vlc_static_modules[] = {\n"; BUILTINS="const void *vlc_static_modules[] = {\n";
for file in $VLC_MODULES; do for file in $VLC_MODULES; do
...@@ -444,6 +447,9 @@ done; \ ...@@ -444,6 +447,9 @@ done; \
BUILTINS="$BUILTINS NULL\n};\n"; \ BUILTINS="$BUILTINS NULL\n};\n"; \
printf "/* Autogenerated from the list of modules */\n $DEFINITION\n $BUILTINS\n" > libvlc/jni/libvlcjni.h printf "/* Autogenerated from the list of modules */\n $DEFINITION\n $BUILTINS\n" > libvlc/jni/libvlcjni.h
###############################
# NDK-Build for libvlcjni.so #
###############################
echo $VLC_BUILD_DIR echo $VLC_BUILD_DIR
LIBVLC_LIBS="libvlcjni" LIBVLC_LIBS="libvlcjni"
...@@ -464,4 +470,3 @@ $ANDROID_NDK/ndk-build -C libvlc \ ...@@ -464,4 +470,3 @@ $ANDROID_NDK/ndk-build -C libvlc \
APP_PLATFORM=${ANDROID_API} \ APP_PLATFORM=${ANDROID_API} \
APP_ABI=${ANDROID_ABI} \ APP_ABI=${ANDROID_ABI} \
NDK_PROJECT_PATH=jni NDK_PROJECT_PATH=jni
LOCAL_PATH := $(call my-dir) LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS) include $(CLEAR_VARS)
ANDROID_PRIVATE_LIBDIR := $(LOCAL_PATH)/../../android-libs
LOCAL_MODULE := libvlcjni LOCAL_MODULE := libvlcjni
...@@ -87,9 +88,25 @@ LOCAL_LDLIBS := -L$(VLC_CONTRIB)/lib \ ...@@ -87,9 +88,25 @@ LOCAL_LDLIBS := -L$(VLC_CONTRIB)/lib \
-lzvbi \ -lzvbi \
$(CPP_STATIC) $(CPP_STATIC)
################
# PRIVATE LIBS #
################
ANDROID_PRIVATE_LIBS=$(ANDROID_PRIVATE_LIBDIR)/libstagefright.so $(ANDROID_PRIVATE_LIBDIR)/libmedia.so $(ANDROID_PRIVATE_LIBDIR)/libutils.so $(ANDROID_PRIVATE_LIBDIR)/libcutils.so $(ANDROID_PRIVATE_LIBDIR)/libbinder.so $(ANDROID_PRIVATE_LIBDIR)/libui.so $(ANDROID_PRIVATE_LIBDIR)/libhardware.so
$(ANDROID_PRIVATE_LIBDIR)/%.so: $(ANDROID_PRIVATE_LIBDIR)/%.c
$(GEN)$(TARGET_TUPLE)-gcc $< -shared -o $@ --sysroot=$(SYSROOT)
$(ANDROID_PRIVATE_LIBDIR)/%.c: $(ANDROID_PRIVATE_LIBDIR)/%.symbols
$(VERBOSE)rm -f $@
$(GEN)for s in `cat $<`; do echo "void $$s() {}" >> $@; done
$(TARGET_OUT)/$(1).so: $(ANDROID_PRIVATE_LIBS)
include $(BUILD_SHARED_LIBRARY) include $(BUILD_SHARED_LIBRARY)
# libiomx-* build ###########
# libiOMX #
###########
LIBIOMX_INCLUDES_COMMON := $(VLC_SRC_DIR)/modules/codec/omxil LIBIOMX_INCLUDES_COMMON := $(VLC_SRC_DIR)/modules/codec/omxil
...@@ -129,20 +146,33 @@ LIBIOMX_INCLUDES_21 := $(LIBIOMX_INCLUDES_COMMON) \ ...@@ -129,20 +146,33 @@ LIBIOMX_INCLUDES_21 := $(LIBIOMX_INCLUDES_COMMON) \
$(ANDROID_SYS_HEADERS)/21/system/core/include \ $(ANDROID_SYS_HEADERS)/21/system/core/include \
$(ANDROID_SYS_HEADERS)/21/hardware/libhardware/include $(ANDROID_SYS_HEADERS)/21/hardware/libhardware/include
ifneq ($(HAVE_64),1)
# Can't link with 32bits symbols.
# Not a problem since MediaCodec should work on 64bits devices (android-21)
LIBIOMX_LIBS += libiomx.14 libiomx.13 libiomx.10
endif
# (after android Jelly Bean, we prefer to use MediaCodec instead of iomx)
#LIBIOMX_LIBS += libiomx.19 libiomx.18
define build_iomx define build_iomx
include $(CLEAR_VARS) include $(CLEAR_VARS)
LOCAL_MODULE := $(1) LOCAL_MODULE := $(1)
LOCAL_SRC_FILES := ../$(VLC_SRC_DIR)/modules/codec/omxil/iomx.cpp LOCAL_SRC_FILES := ../$(VLC_SRC_DIR)/modules/codec/omxil/iomx.cpp
LOCAL_C_INCLUDES := $(LIBIOMX_INCLUDES_$(2)) LOCAL_C_INCLUDES := $(LIBIOMX_INCLUDES_$(2))
LOCAL_LDLIBS := -L$(ANDROID_LIBS) -lgcc -lstagefright -lmedia -lutils -lbinder -llog -lcutils -lui LOCAL_LDLIBS := -L$(ANDROID_PRIVATE_LIBDIR) -lgcc -lstagefright -lmedia -lutils -lbinder -llog -lcutils -lui
LOCAL_CFLAGS := -Wno-psabi -DANDROID_API=$(2) LOCAL_CFLAGS := -Wno-psabi -DANDROID_API=$(2)
$(TARGET_OUT)/$(1).so: $(ANDROID_PRIVATE_LIBS)
include $(BUILD_SHARED_LIBRARY) include $(BUILD_SHARED_LIBRARY)
endef endef
# call build_iomx for each libiomx-* in LIBVLC_LIBS # call build_iomx for each libiomx-* in LIBIOMX_LIBS
$(foreach IOMX_MODULE,$(filter libiomx.%,$(LIBVLC_LIBS)), \ $(foreach IOMX_MODULE, $(LIBIOMX_LIBS), \
$(eval $(call build_iomx,$(IOMX_MODULE),$(subst libiomx.,,$(IOMX_MODULE))))) $(eval $(call build_iomx,$(IOMX_MODULE),$(subst libiomx.,,$(IOMX_MODULE)))))
#######
# ANW #
#######
LIBANW_SRC_FILES_COMMON += ../$(VLC_SRC_DIR)/modules/video_output/android/nativewindowpriv.c LIBANW_SRC_FILES_COMMON += ../$(VLC_SRC_DIR)/modules/video_output/android/nativewindowpriv.c
# Once we always build this with a version of vlc that contains nativewindowpriv.c, # Once we always build this with a version of vlc that contains nativewindowpriv.c,
# we can remove this condition # we can remove this condition
...@@ -153,11 +183,14 @@ include $(CLEAR_VARS) ...@@ -153,11 +183,14 @@ include $(CLEAR_VARS)
LOCAL_MODULE := $(1) LOCAL_MODULE := $(1)
LOCAL_SRC_FILES := $(LIBANW_SRC_FILES_COMMON) LOCAL_SRC_FILES := $(LIBANW_SRC_FILES_COMMON)
LOCAL_C_INCLUDES := $(LIBIOMX_INCLUDES_$(2)) LOCAL_C_INCLUDES := $(LIBIOMX_INCLUDES_$(2))
LOCAL_LDLIBS := -L$(ANDROID_LIBS) -llog -lhardware LOCAL_LDLIBS := -L$(ANDROID_PRIVATE_LIBDIR) -llog -lhardware
LOCAL_CFLAGS := $(LIBIOMX_CFLAGS_COMMON) -DANDROID_API=$(2) LOCAL_CFLAGS := $(LIBIOMX_CFLAGS_COMMON) -DANDROID_API=$(2)
$(TARGET_OUT)/$(1).so: $(ANDROID_PRIVATE_LIBS)
include $(BUILD_SHARED_LIBRARY) include $(BUILD_SHARED_LIBRARY)
endef endef
$(foreach ANW_MODULE,$(filter libanw.%,$(LIBVLC_LIBS)), \ LIBANW_LIBS += libanw.10 libanw.13 libanw.14 libanw.18 libanw.21
$(foreach ANW_MODULE,$(LIBANW_LIBS), \
$(eval $(call build_anw,$(ANW_MODULE),$(subst libanw.,,$(ANW_MODULE))))) $(eval $(call build_anw,$(ANW_MODULE),$(subst libanw.,,$(ANW_MODULE)))))
endif endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment