SmartAudio/package/allwinner/tina_multimedia/Makefile

518 lines
20 KiB
Makefile
Raw Normal View History

2018-07-13 01:31:50 +00:00
include $(TOPDIR)/rules.mk
include $(BUILD_DIR)/kernel.mk
PKG_NAME:=libcedarx2.7
PKG_VERSION:=1
PKG_RELEASE:=1
PKG_BUILD_DIR := $(COMPILE_DIR)/libcedarx2.7
include $(BUILD_DIR)/package.mk
TINA_CHIP_TYPE = G102
TINA_CHIP_TYPE = G102
KERNEL_VERSION = CONF_KERNEL_VERSION_3_10
CEDARC_COMPILE_TOOL_CHAIN = arm-openwrt-linux
CEDARX_COMPILE_TOOL_CHAIN = arm-openwrt-linux-muslgnueabi
CEDARC_LIBS_PATH = libcedarc/lib/arm-openwrt-linux-muslgnueabi
CEDARX_LIBS_PATH = libcedarx/external/lib32/arm-openwrt-linux-muslgnueabi
VE_OFFSET = NOT_CONFIG_VE_OFFSET
KERNEL_VERSION_ION = CONF_KERNEL_CMA
ifeq ($(CONFIG_SUNXI_ALLOC_CMA),y)
KERNEL_VERSION_ION = CONF_KERNEL_CMA
endif
ifeq ($(CONFIG_SUNXI_ALLOC_IOMMU),y)
KERNEL_VERSION_ION = CONF_KERNEL_IOMMU
endif
SYSTEM_LIB := libasound.so \
libcrypto.so \
libssl.so \
libxml2.so \
libz.so
CONFIG_STATUS = --enable-hls=yes
CEDAR_LD_FLAGS = -lcrypto -lz
CONFIG_HTTPS = --enable-https=yes
AUDIO_DEC_LIBS := AAC \
ALAC \
AMR \
APE \
ATRC \
COOK \
FLAC \
MP3 \
OGG \
SIPR \
WAV \
RA
VIDEO_DEC_LIBS := MPEG2 \
H264 \
AVS \
H265 \
MJPEG \
MPEG4BASE \
MPEG4DX \
MPEG4H263 \
MPEG4NORMAL \
MPEG4VP6 \
VP8 \
WMV3 \
VP9HW
MULTIMEDIA_LIBS := SUPPORT_AUDIO_DEC_LIBS \
SUPPORT_VIDEO_DEC_LIBS \
SUPPORT_SUBTITLE_DEC_LIBS \
SUPPORT_VDEC_COMMON_LIBS \
SUPPORT_ADEC_COMMON_LIBS \
SUPPORT_TPLAYER_PARSER \
SUPPORT_TPLAYER_STREAM \
SUPPORT_TPLAYER_COMMON \
SUPPORT_VIDEO_ENC_LIBS \
SUPPORT_AUDIO_ENC_LIBS \
SUPPORT_VENC_COMMON_LIBS \
SUPPORT_TRECORDER_MUXER \
SUPPORT_TRECORDER_COMMON \
SUPPORT_TMETADATA \
SUPPORT_JPEG_DECODER \
SUPPORT_OMX_LIBS
## TPLAYER related libraries
SUPPORT_AUDIO_DEC_LIBS = $(foreach c,$(AUDIO_DEC_LIBS), \
$(if $(CONFIG_CEDAR_ADECODER_$(c)),libaw_$(shell echo $(c) | tr '[A-Z]' '[a-z]')dec.so))
SUPPORT_VIDEO_DEC_LIBS = $(foreach c,$(VIDEO_DEC_LIBS), \
$(if $(CONFIG_CEDAR_VDECODER_$(c)),libcdc_vd_$(shell echo $(c) | tr '[A-Z]' '[a-z]').so))
SUPPORT_VIDEO_DEC_LIBS += $(if $(CONFIG_CEDAR_VDECODER_MJPEG),libcdc_vd_mjpegs.so)
SUPPORT_VIDEO_DEC_LIBS += $(if $(CONFIG_CEDAR_VDECODER_VP9),libcdc_vd_vp9Hw.so)
SUPPORT_SUBTITLE_DEC_LIBS := $(if $(CONFIG_CEDAR_SUBTITLE_SUPPORT),libcdc_sdecoder.so)
SUPPORT_VDEC_COMMON_LIBS := $(if $(CONFIG_TPLAYER),libcdc_base.so libcdc_memory.so libcdc_vdecoder.so libcdc_ve.so libcdc_videoengine.so)
SUPPORT_OMX_LIBS := $(if $(CONFIG_OMX),libcdc_omxil_core.so libcdc_omxil_vdec.so libcdc_omxil_venc.so)
SUPPORT_ADEC_COMMON_LIBS := $(if $(CONFIG_TPLAYER),libadecoder.so librw_data_api.so)
SUPPORT_TPLAYER_PARSER := $(if $(CONFIG_CEDAR_PARSER_ALL),libcdx_parser.so)
SUPPORT_TPLAYER_STREAM := $(if $(CONFIG_CEDAR_STREAM_ALL),libcdx_stream.so)
SUPPORT_TPLAYER_COMMON := $(if $(CONFIG_TPLAYER),libcdx_base.so libcdx_common.so libcdx_playback.so libxplayer.so libtplayer.so libz.so)
## TRECORDER related libraries
SUPPORT_VIDEO_ENC_LIBS := $(if $(CONFIG_CEDAR_VIDEO_ENCODER_ALL),libcdc_vencoder.so)
SUPPORT_AUDIO_ENC_LIBS := $(if $(CONFIG_CEDAR_AENCODER_ALL),libaencoder.so)
SUPPORT_VENC_COMMON_LIBS := $(if $(CONFIG_TRECORDER), libcdc_base.so libcdc_memory.so libcdc_ve.so)
SUPPORT_AENC_COMMON_LIBS :=
SUPPORT_TRECORDER_MUXER := $(if $(CONFIG_CEDAR_MUXER_ALL),libcdx_muxer.so)
SUPPORT_TRECORDER_COMMON := $(if $(CONFIG_TRECORDER),libawrecorder.so libcdx_base.so libcdx_common.so libtrecorder.so libz.so)
## TMETA related libraries
SUPPORT_TMETADATA := $(if $(CONFIG_TMETADATARETRIVER),libxmetadataretriever.so libtmetadataretriever.so)
## TJPEGDECODER related libraries
SUPPORT_JPEG_DECODER := $(if $(CONFIG_JPEGDECODER),libjpegdecode.so)
SUPPORT_LIBRARY_ALL := $(foreach c,$(MULTIMEDIA_LIBS), \
$($c))
ifeq ($(TARGET_BOARD_PLATFORM),astar)
TINA_CHIP_TYPE = r16
KERNEL_VERSION = CONF_KERNEL_VERSION_3_4
CEDARC_COMPILE_TOOL_CHAIN = arm-openwrt-linux
CEDARX_COMPILE_TOOL_CHAIN = arm-openwrt-linux-muslgnueabi
CEDARC_LIBS_PATH = libcedarc/lib/arm-openwrt-linux-muslgnueabi
CEDARX_LIBS_PATH = libcedarx/external/lib32/arm-openwrt-linux-muslgnueabi
NOT_SUPPORT_VIDEO_LIBS += libcdc_vd_mjpegs.so
endif
ifeq ($(TARGET_BOARD_PLATFORM),octopus)
TINA_CHIP_TYPE = r58
KERNEL_VERSION = CONF_KERNEL_VERSION_3_4
CEDARC_COMPILE_TOOL_CHAIN = arm-openwrt-linux
CEDARX_COMPILE_TOOL_CHAIN = arm-openwrt-linux-muslgnueabi
CEDARC_LIBS_PATH = libcedarc/lib/arm-openwrt-linux-muslgnueabi
CEDARX_LIBS_PATH = libcedarx/external/lib32/arm-openwrt-linux-muslgnueabi
NOT_SUPPORT_VIDEO_LIBS += libcdc_vd_mjpegs.so
endif
ifeq ($(TARGET_BOARD_PLATFORM),azalea)
TINA_CHIP_TYPE = r40
KERNEL_VERSION = CONF_KERNEL_VERSION_3_10
CEDARC_COMPILE_TOOL_CHAIN = arm-openwrt-linux
CEDARX_COMPILE_TOOL_CHAIN = arm-openwrt-linux-muslgnueabi
CEDARC_LIBS_PATH = libcedarc/lib/arm-openwrt-linux-muslgnueabi
CEDARX_LIBS_PATH = libcedarx/external/lib32/arm-openwrt-linux-muslgnueabi
NOT_SUPPORT_VIDEO_LIBS += libcdc_vd_mjpegs.so
endif
ifeq ($(TARGET_BOARD_PLATFORM),tulip)
TINA_CHIP_TYPE = r18
KERNEL_VERSION = CONF_KERNEL_VERSION_4_4
ifeq ($(CONFIG_COMPLILE_KERNEL64_USER32),y)
CEDARC_COMPILE_TOOL_CHAIN = arm-openwrt-linux
CEDARX_COMPILE_TOOL_CHAIN = arm-openwrt-linux-muslgnueabi
CEDARC_LIBS_PATH = libcedarc/lib/arm-openwrt-linux-muslgnueabi
CEDARX_LIBS_PATH = libcedarx/external/lib32/arm-openwrt-linux-muslgnueabi
NOT_SUPPORT_VIDEO_LIBS += libcdc_vd_mjpeg.so
else
CEDARC_COMPILE_TOOL_CHAIN = aarch64-openwrt-linux
CEDARX_COMPILE_TOOL_CHAIN = aarch64-openwrt-linux
CEDARC_LIBS_PATH = libcedarc/lib/arm-aarch64-openwrt-linux
CEDARX_LIBS_PATH = libcedarx/external/lib64/arm-aarch64-openwrt-linux
NOT_SUPPORT_VIDEO_LIBS += libcdc_vd_mjpeg.so
endif
endif
ifeq ($(TARGET_BOARD_PLATFORM),koto)
TINA_CHIP_TYPE = r30
KERNEL_VERSION = CONF_KERNEL_VERSION_4_9
ifeq ($(CONFIG_COMPLILE_KERNEL64_USER32),y)
CEDARC_COMPILE_TOOL_CHAIN = arm-openwrt-linux
CEDARX_COMPILE_TOOL_CHAIN = arm-openwrt-linux-muslgnueabi
CEDARC_LIBS_PATH = libcedarc/lib/arm-openwrt-linux-muslgnueabi
CEDARX_LIBS_PATH = libcedarx/external/lib32/arm-openwrt-linux-muslgnueabi
NOT_SUPPORT_VIDEO_LIBS += libcdc_vd_mjpegs.so
else
CEDARC_COMPILE_TOOL_CHAIN = aarch64-openwrt-linux
CEDARX_COMPILE_TOOL_CHAIN = aarch64-openwrt-linux
CEDARC_LIBS_PATH = libcedarc/lib/arm-aarch64-openwrt-linux
CEDARX_LIBS_PATH = libcedarx/external/lib64/arm-aarch64-openwrt-linux
NOT_SUPPORT_VIDEO_LIBS += libcdc_vd_mjpegs.so
endif
endif
ifeq ($(TARGET_BOARD_PLATFORM),mandolin)
TINA_CHIP_TYPE = r311
VE_OFFSET = CONFIG_VE_OFFSET_0
KERNEL_VERSION = CONF_KERNEL_VERSION_4_9
CEDARC_COMPILE_TOOL_CHAIN = arm-openwrt-linux
CEDARX_COMPILE_TOOL_CHAIN = arm-openwrt-linux-muslgnueabi
CEDARC_LIBS_PATH = libcedarc/lib/arm-openwrt-linux-muslgnueabi
CEDARX_LIBS_PATH = libcedarx/external/lib32/arm-openwrt-linux-muslgnueabi
NOT_SUPPORT_VIDEO_LIBS += libcdc_vd_mjpegs.so
endif
ifeq ($(TARGET_BOARD_PLATFORM),sitar)
TINA_CHIP_TYPE = c600
KERNEL_VERSION = CONF_KERNEL_VERSION_3_10
ifeq ($(CONFIG_LIBC),"musl")
CEDARC_COMPILE_TOOL_CHAIN = arm-openwrt-linux
CEDARX_COMPILE_TOOL_CHAIN = arm-openwrt-linux-muslgnueabi
CEDARC_LIBS_PATH = libcedarc/lib/arm926-muslgnueabi
CEDARX_LIBS_PATH = libcedarx/external/lib32/arm926-muslgnueabi
else
CEDARC_COMPILE_TOOL_CHAIN = arm-openwrt-linux
CEDARX_COMPILE_TOOL_CHAIN = arm-openwrt-linux
CEDARC_LIBS_PATH = libcedarc/lib/arm926-glibc
CEDARX_LIBS_PATH = libcedarx/external/lib32/arm926-glibc
endif
NOT_SUPPORT_VIDEO_LIBS += libcdc_vd_mjpegs.so
endif
ifeq ($(TARGET_BOARD_PLATFORM),violin)
TINA_CHIP_TYPE = c600
CONFIG_STATUS = --enable-hls=no
CEDAR_LD_FLAGS = -lz
CONFIG_HTTPS = --enable-https=no
KERNEL_VERSION = CONF_KERNEL_VERSION_3_10
ifeq ($(CONFIG_LIBC),"musl")
CEDARC_COMPILE_TOOL_CHAIN = arm-openwrt-linux
CEDARX_COMPILE_TOOL_CHAIN = arm-openwrt-linux-muslgnueabi
CEDARC_LIBS_PATH = libcedarc/lib/arm926-muslgnueabi
CEDARX_LIBS_PATH = libcedarx/external/lib32/arm926-muslgnueabi
else
CEDARC_COMPILE_TOOL_CHAIN = arm-openwrt-linux
CEDARX_COMPILE_TOOL_CHAIN = arm-openwrt-linux
CEDARC_LIBS_PATH = libcedarc/lib/arm926-glibc
CEDARX_LIBS_PATH = libcedarx/external/lib32/arm926-glibc
endif
NOT_SUPPORT_VIDEO_LIBS += libcdc_vd_mjpegs.so
endif
ifeq ($(TARGET_BOARD_PLATFORM),cello)
TINA_CHIP_TYPE = G102
KERNEL_VERSION = CONF_KERNEL_VERSION_3_10
CEDARC_COMPILE_TOOL_CHAIN = arm-openwrt-linux
CEDARX_COMPILE_TOOL_CHAIN = arm-openwrt-linux-muslgnueabi
CEDARC_LIBS_PATH = libcedarc/lib/arm-openwrt-linux-muslgnueabi
CEDARX_LIBS_PATH = libcedarx/external/lib32/arm-openwrt-linux-muslgnueabi
NOT_SUPPORT_VIDEO_LIBS += libcdc_vd_mjpeg.so \
libcdc_vd_mjpegs.so
endif
ifeq ($(TARGET_BOARD_PLATFORM),banjo)
TINA_CHIP_TYPE = MR100
CONFIG_STATUS = --enable-hls=no
CEDAR_LD_FLAGS = -lz
CONFIG_HTTPS = --enable-https=no
KERNEL_VERSION = CONF_KERNEL_VERSION_3_4
CEDARC_COMPILE_TOOL_CHAIN = arm-openwrt-linux
CEDARX_COMPILE_TOOL_CHAIN = arm-openwrt-linux-muslgnueabi
CEDARC_LIBS_PATH = libcedarc/lib/arm-openwrt-linux-muslgnueabi
CEDARX_LIBS_PATH = libcedarx/external/lib32/arm-openwrt-linux-muslgnueabi
NOT_SUPPORT_VIDEO_LIBS += libcdc_vd_mjpeg.so
endif
ifeq ($(TARGET_BOARD_PLATFORM),$(filter $(TARGET_BOARD_PLATFORM),astar octopus azalea tulip sitar violin cello banjo koto mandolin))
define Package/$(PKG_NAME)/config
source "$(SOURCE)/Config.in"
endef
define Package/$(PKG_NAME)
SECTION:=utils
CATEGORY:=Allwinner
TITLE:=CedarX2.7 for allwinner
DEPENDS:=+libpthread \
+libuapi \
+zlib \
+alsa-lib
ifeq ($(TARGET_BOARD_PLATFORM),banjo)
ifeq ($(CONFIG_OMX),y)
DEPENDS+= +libstdcpp
else
DEPENDS+=
endif
else ifeq ($(TARGET_BOARD_PLATFORM),sitar)
DEPENDS+= +libstdcpp +libopenssl
else ifeq ($(TARGET_BOARD_PLATFORM),violin)
DEPENDS+= +libstdcpp
else
DEPENDS+= +libstdcpp +libopenssl
endif
ifeq ($(CONFIG_TR_YES_USE_VIN_ISP),y)
DEPENDS+= +libAWIspApi
endif
endef
define Package/$(PKG_NAME)/Default
TITLE:=libcedarx2.7 for all
URL:=http://www.allwinner.com/
endef
define Package/$(PKG_NAME)/description
CedarX2.7
endef
define Build/Prepare
mkdir -p $(PKG_BUILD_DIR)
$(CP) -r ./libcedarc $(PKG_BUILD_DIR)/
$(CP) -r ./libcedarx $(PKG_BUILD_DIR)/
$(CP) -r ./tplayer $(PKG_BUILD_DIR)/tplayer
$(CP) -r ./trecorder $(PKG_BUILD_DIR)/trecorder
$(CP) -r ./jpegdecode $(PKG_BUILD_DIR)/jpegdecode
$(CP) -r ./tmetadataretriever $(PKG_BUILD_DIR)/tmetadataretriever
$(CP) -r ./tplayer/configs/$(TARGET_BOARD_PLATFORM)_linux_cedarx.conf $(PKG_BUILD_DIR)/
endef
define Build/Configure
$(info *****************target_board_platform = $(TARGET_BOARD_PLATFORM)**************)
$(info *****************chip type = $(TINA_CHIP_TYPE)**************)
cd $(PKG_BUILD_DIR)/libcedarc; \
./bootstrap; \
./configure --prefix=$(PKG_BUILD_DIR)/libcedarc/install --host=$(CEDARC_COMPILE_TOOL_CHAIN) CFLAGS="-D__ENABLE_ZLIB__ -D$(VE_OFFSET) -D$(KERNEL_VERSION)" CPPFLAGS="-D__ENABLE_ZLIB__ -D$(KERNEL_VERSION)" LDFLAGS="-L$(PKG_BUILD_DIR)/$(CEDARC_LIBS_PATH)"
cd $(PKG_BUILD_DIR)/libcedarx; \
./bootstrap; \
./configure --prefix=$(PKG_BUILD_DIR)/libcedarx/install $(CONFIG_STATUS) $(CONFIG_HTTPS) --host=$(CEDARX_COMPILE_TOOL_CHAIN) CFLAGS="-D__ENABLE_ZLIB__ -D$(TINA_CHIP_TYPE)" CPPFLAGS="-D__ENABLE_ZLIB__" LDFLAGS="-lz $(CEDAR_LD_FLAGS) -L$(PKG_BUILD_DIR)/$(CEDARX_LIBS_PATH) -L$(PKG_BUILD_DIR)/libcedarc/install/lib -L$(PKG_BUILD_DIR)/$(CEDARC_LIBS_PATH)"
endef
define Build/Compile
$(MAKE) -C $(PKG_BUILD_DIR)/libcedarc \
ARCH="$(TARGET_ARCH)" \
AR="$(TARGET_AR)" \
CC="$(TARGET_CC)" \
CPP="$(TARGET_CXX)" \
CFLAGS="-D__ENABLE_ZLIB__ -D$(VE_OFFSET) -D$(KERNEL_VERSION) -D$(KERNEL_VERSION_ION) $(TARGET_CFLAGS)" \
CPPFLAGS="-D__ENABLE_ZLIB__ -D$(KERNEL_VERSION) -D$(KERNEL_VERSION_ION) $(TARGET_CPPFLAGS)" \
LDFLAGS="-L$(PKG_BUILD_DIR)/$(CEDARC_LIBS_PATH) -L$(PKG_BUILD_DIR)/libcedarc/install/lib $(TARGET_LDFLAGS)" \
install
$(MAKE) -C $(PKG_BUILD_DIR)/libcedarx \
ARCH="$(TARGET_ARCH)" \
AR="$(TARGET_AR)" \
CC="$(TARGET_CC)" \
CPP="$(TARGET_CXX)" \
CFLAGS="-D__ENABLE_ZLIB__ -D$(TINA_CHIP_TYPE) -D$(KERNEL_VERSION) -D$(KERNEL_VERSION_ION) $(TARGET_CFLAGS)" \
CPPFLAGS="-D__ENABLE_ZLIB__ -D$(KERNEL_VERSION) $(TARGET_CPPFLAGS)" \
LDFLAGS="$(CEDAR_LD_FLAGS) -L$(PKG_BUILD_DIR)/$(CEDARX_LIBS_PATH) -L$(PKG_BUILD_DIR)/libcedarc/install/lib -L$(PKG_BUILD_DIR)/$(CEDARC_LIBS_PATH) -L$(PKG_BUILD_DIR)/libcedarx/install/lib $(TARGET_LDFLAGS)" \
BOARD_PLATFORM="$(TARGET_BOARD_PLATFORM)" \
install
$(MAKE) -C $(PKG_BUILD_DIR)/tplayer \
ARCH="$(TARGET_ARCH)" \
AR="$(TARGET_AR)" \
CC="$(TARGET_CC)" \
CPP="$(TARGET_CXX)" \
CFLAGS="$(TARGET_CFLAGS) -D$(TINA_CHIP_TYPE) -D$(KERNEL_VERSION) -D$(KERNEL_VERSION_ION)" \
LDFLAGS="$(TARGET_LDFLAGS)" \
BOARD_PLATFORM="$(TARGET_BOARD_PLATFORM)" \
KERNEL64_USER32="$(CONFIG_COMPLILE_KERNEL64_USER32)" \
C_LIB_TYPE="$(CONFIG_LIBC)"
$(MAKE) -C $(PKG_BUILD_DIR)/trecorder \
ARCH="$(TARGET_ARCH)" \
AR="$(TARGET_AR)" \
CC="$(TARGET_CC)" \
CPP="$(TARGET_CXX)" \
CFLAGS="$(TARGET_CFLAGS)" \
BOARD_PLATFORM="$(TARGET_BOARD_PLATFORM)" \
LDFLAGS="$(TARGET_LDFLAGS)" \
USE_VIN_ISP="$(CONFIG_TR_YES_USE_VIN_ISP)"
$(MAKE) -C $(PKG_BUILD_DIR)/jpegdecode \
ARCH="$(TARGET_ARCH)" \
AR="$(TARGET_AR)" \
CC="$(TARGET_CC)" \
CPP="$(TARGET_CXX)" \
CFLAGS="$(TARGET_CFLAGS)" \
LDFLAGS="$(TARGET_LDFLAGS)"
$(MAKE) -C $(PKG_BUILD_DIR)/tmetadataretriever \
ARCH="$(TARGET_ARCH)" \
AR="$(TARGET_AR)" \
CC="$(TARGET_CC)" \
CPP="$(TARGET_CXX)" \
CFLAGS="$(TARGET_CFLAGS)" \
LDFLAGS="$(TARGET_LDFLAGS)"
endef
define Build/InstallDev
mkdir -p $(PKG_INSTALL_DIR)
$(INSTALL_DIR) $(PKG_INSTALL_DIR)/usr/lib
$(INSTALL_DIR) $(PKG_INSTALL_DIR)/usr/bin
$(INSTALL_DIR) $(PKG_INSTALL_DIR)/usr/include/allwinner
## copy libraries
$(CP) $(PKG_BUILD_DIR)/$(CEDARC_LIBS_PATH)/*.so $(PKG_INSTALL_DIR)/usr/lib/
$(CP) $(PKG_BUILD_DIR)/libcedarc/install/lib/*.so $(PKG_INSTALL_DIR)/usr/lib/
$(CP) $(PKG_BUILD_DIR)/libcedarc/install/lib/full-package-name/*.so $(PKG_INSTALL_DIR)/usr/lib/
$(CP) $(PKG_BUILD_DIR)/$(CEDARX_LIBS_PATH)/*.so $(PKG_INSTALL_DIR)/usr/lib/
$(CP) $(PKG_BUILD_DIR)/libcedarx/install/lib/*.so $(PKG_INSTALL_DIR)/usr/lib/
$(CP) $(PKG_BUILD_DIR)/tplayer/libtplayer.so $(PKG_INSTALL_DIR)/usr/lib/
$(CP) $(PKG_BUILD_DIR)/trecorder/libtrecorder.so $(PKG_INSTALL_DIR)/usr/lib/
$(CP) $(PKG_BUILD_DIR)/jpegdecode/libjpegdecode.so $(PKG_INSTALL_DIR)/usr/lib/
$(CP) $(PKG_BUILD_DIR)/tmetadataretriever/libtmetadataretriever.so $(PKG_INSTALL_DIR)/usr/lib/
cd $(PKG_INSTALL_DIR)/usr/lib/; rm -rf $(SYSTEM_LIB)
## copy header files.
## log.h
$(CP) $(PKG_BUILD_DIR)/libcedarc/base/include/log.h $(PKG_INSTALL_DIR)/usr/include/allwinner/
## libcedarc vdecoder/vencoder
-cp -r $(PKG_BUILD_DIR)/libcedarc/include $(PKG_INSTALL_DIR)/usr/include/allwinner/
##cdx_config.h
-cp -r $(PKG_BUILD_DIR)/libcedarx/cdx_config.h $(PKG_INSTALL_DIR)/usr/include/allwinner/
## libcedarx adecoder/aencoder/sdecoder
-cp -r $(PKG_BUILD_DIR)/libcedarx/external/include/adecoder/adecoder.h $(PKG_INSTALL_DIR)/usr/include/allwinner/
-cp -r $(PKG_BUILD_DIR)/libcedarx/external/include/aencoder/aencoder.h $(PKG_INSTALL_DIR)/usr/include/allwinner/
-cp -r $(PKG_BUILD_DIR)/libcedarx/external/include/sdecoder/sdecoder.h $(PKG_INSTALL_DIR)/usr/include/allwinner/
## libcedarx:libcore
-cp -r $(PKG_BUILD_DIR)/libcedarx/libcore/base/include/*.h $(PKG_INSTALL_DIR)/usr/include/allwinner/
-cp -r $(PKG_BUILD_DIR)/libcedarx/libcore/muxer/include/*.h $(PKG_INSTALL_DIR)/usr/include/allwinner/
-cp -r $(PKG_BUILD_DIR)/libcedarx/libcore/parser/include/*.h $(PKG_INSTALL_DIR)/usr/include/allwinner/
-cp -r $(PKG_BUILD_DIR)/libcedarx/libcore/stream/include/*.h $(PKG_INSTALL_DIR)/usr/include/allwinner/
-cp -r $(PKG_BUILD_DIR)/libcedarx/libcore/playback/include/*.h $(PKG_INSTALL_DIR)/usr/include/allwinner/
## xplayer
-cp -r $(PKG_BUILD_DIR)/libcedarx/xplayer/include/*.h $(PKG_INSTALL_DIR)/usr/include/allwinner/
## tplayer
-cp $(PKG_BUILD_DIR)/tplayer/tplayer.h $(PKG_INSTALL_DIR)/usr/include/allwinner/
## trecorder
-cp $(PKG_BUILD_DIR)/trecorder/Trecorder.h $(PKG_INSTALL_DIR)/usr/include/allwinner/
-cp $(PKG_BUILD_DIR)/trecorder/dataqueue.h $(PKG_INSTALL_DIR)/usr/include/allwinner/
## jpegdecode
-cp $(PKG_BUILD_DIR)/jpegdecode/jpegdecode.h $(PKG_INSTALL_DIR)/usr/include/allwinner/
## tmetadataretriever
-cp $(PKG_BUILD_DIR)/tmetadataretriever/tmetadataretriever.h $(PKG_INSTALL_DIR)/usr/include/allwinner/
## awrecorder
-cp $(PKG_BUILD_DIR)/libcedarx/awrecorder/awencoder.h $(PKG_INSTALL_DIR)/usr/include/allwinner/
$(CP) $(PKG_INSTALL_DIR)/usr $(1)/usr
endef
define Package/$(PKG_NAME)/install
$(INSTALL_DIR) $(1)/usr/lib/
$(INSTALL_DIR) $(1)/usr/bin/
$(INSTALL_DIR) $(1)/etc/
mkdir -p $(PKG_BUILD_DIR)/all_libs
$(CP) $(PKG_BUILD_DIR)/$(CEDARC_LIBS_PATH)/*.so $(PKG_BUILD_DIR)/all_libs
$(CP) $(PKG_BUILD_DIR)/libcedarc/install/lib/*.so $(PKG_BUILD_DIR)/all_libs
$(CP) $(PKG_BUILD_DIR)/libcedarc/install/lib/full-package-name/*.so $(PKG_BUILD_DIR)/all_libs
$(CP) $(PKG_BUILD_DIR)/$(CEDARX_LIBS_PATH)/*.so $(PKG_BUILD_DIR)/all_libs
$(CP) $(PKG_BUILD_DIR)/libcedarx/install/lib/*.so $(PKG_BUILD_DIR)/all_libs
$(CP) $(PKG_BUILD_DIR)/tplayer/libtplayer.so $(PKG_BUILD_DIR)/all_libs
$(CP) $(PKG_BUILD_DIR)/trecorder/libtrecorder.so $(PKG_BUILD_DIR)/all_libs
$(CP) $(PKG_BUILD_DIR)/jpegdecode/libjpegdecode.so $(PKG_BUILD_DIR)/all_libs
$(CP) $(PKG_BUILD_DIR)/tmetadataretriever/libtmetadataretriever.so $(PKG_BUILD_DIR)/all_libs
$(CP) $(PKG_BUILD_DIR)/trecorder/camera.cfg $(1)/etc/
for n in $(SUPPORT_LIBRARY_ALL); \
do \
$(INSTALL_BIN) $(PKG_BUILD_DIR)/all_libs/$$$$n $(1)/usr/lib; \
done
## deal with cedarx memory config
$(CP) $(PKG_BUILD_DIR)/$(TARGET_BOARD_PLATFORM)_linux_cedarx.conf $(PKG_BUILD_DIR)/all_libs/cedarx.conf
ifeq ($(CONFIG_CUSTOM_FBM_NUM_ENABLE),y)
./set_cedar_conf.sh pic_4list_num $(CONFIG_FBM_DISPLAY_HOLDING) $(PKG_BUILD_DIR)/all_libs/cedarx.conf $(CONFIG_CUSTOM_FBM_NUM_ENABLE)
./set_cedar_conf.sh pic_4di_num $(CONFIG_FBM_DEINTERLEACED_USED) $(PKG_BUILD_DIR)/all_libs/cedarx.conf $(CONFIG_CUSTOM_FBM_NUM_ENABLE)
./set_cedar_conf.sh pic_4rotate_num $(CONFIG_FBM_ROTATE_USED) $(PKG_BUILD_DIR)/all_libs/cedarx.conf $(CONFIG_CUSTOM_FBM_NUM_ENABLE)
./set_cedar_conf.sh pic_4smooth_num $(CONFIG_FBM_SMOOTHLY_USED) $(PKG_BUILD_DIR)/all_libs/cedarx.conf $(CONFIG_CUSTOM_FBM_NUM_ENABLE)
endif
ifeq ($(CONFIG_CUSTOM_VBV_ENABLE),y)
./set_cedar_conf.sh vbv_buffer_size $(CONFIG_VBVBUFSIZE) $(PKG_BUILD_DIR)/all_libs/cedarx.conf $(CONFIG_CUSTOM_VBV_ENABLE)
endif
ifeq ($(CONFIG_SCALE_DOWN_ENABLE),y)
./set_cedar_conf.sh scaledown_large_video_flag 1 $(PKG_BUILD_DIR)/all_libs/cedarx.conf $(CONFIG_SCALE_DOWN_ENABLE)
./set_cedar_conf.sh scaledown_width_limit $(CONFIG_SCALE_DOWN_WIDTH_LIMIT) $(PKG_BUILD_DIR)/all_libs/cedarx.conf $(CONFIG_SCALE_DOWN_ENABLE)
./set_cedar_conf.sh scaledown_ratio $(CONFIG_SCALE_DOWN_RATIO) $(PKG_BUILD_DIR)/all_libs/cedarx.conf $(CONFIG_SCALE_DOWN_ENABLE)
endif
ifeq ($(CONFIG_CUSTOM_CACHE_ENABLE),y)
./set_cedar_conf.sh cache_buffer_size $(CONFIG_CACHE_BUFFER_SIZE) $(PKG_BUILD_DIR)/all_libs/cedarx.conf $(CONFIG_CUSTOM_CACHE_ENABLE)
./set_cedar_conf.sh cache_buffer_size_live $(CONFIG_LIVE_CACHE_BUFFER_SIZE) $(PKG_BUILD_DIR)/all_libs/cedarx.conf $(CONFIG_CUSTOM_CACHE_ENABLE)
./set_cedar_conf.sh start_play_cache_time $(CONFIG_START_PLAY_CACHE_TIME) $(PKG_BUILD_DIR)/all_libs/cedarx.conf $(CONFIG_CUSTOM_CACHE_ENABLE)
./set_cedar_conf.sh max_http_stream_buf_size $(CONFIG_HTTP_STREAM_CACHE_SIZE) $(PKG_BUILD_DIR)/all_libs/cedarx.conf $(CONFIG_CUSTOM_CACHE_ENABLE)
endif
ifeq ($(CONFIG_USE_ION_BUF_ENABLE),y)
./set_cedar_conf.sh use_ion_buf_flag 1 $(PKG_BUILD_DIR)/all_libs/cedarx.conf $(CONFIG_USE_ION_BUF_ENABLE)
endif
$(CP) $(PKG_BUILD_DIR)/all_libs/cedarx.conf $(1)/etc/cedarx.conf
cd $(1)/usr/lib/; rm -rf $(SYSTEM_LIB) $(NOT_SUPPORT_VIDEO_LIBS) $(NOT_SUPPORT_AUDIO_LIBS)
endef
endif
ifeq ($(TARGET_BOARD_PLATFORM),$(filter $(TARGET_BOARD_PLATFORM),astar octopus azalea tulip sitar violin cello banjo koto mandolin))
$(eval $(call BuildPackage,$(PKG_NAME)))
endif