SmartAudio/package/allwinner/tina_multimedia/Makefile

585 lines
21 KiB
Makefile
Raw Permalink Normal View History

2018-07-13 01:31:50 +00:00
include $(TOPDIR)/rules.mk
include $(BUILD_DIR)/kernel.mk
2018-12-13 10:48:25 +00:00
PKG_VERSION:=2.8
2018-07-13 01:31:50 +00:00
PKG_RELEASE:=1
2018-12-13 10:48:25 +00:00
PKG_NAME:=libcedarx
2018-07-13 01:31:50 +00:00
2018-12-13 10:48:25 +00:00
PKG_BUILD_DIR := $(COMPILE_DIR)/$(PKG_NAME)
2018-07-13 01:31:50 +00:00
include $(BUILD_DIR)/package.mk
2018-12-13 10:48:25 +00:00
#init the default value
2018-07-13 01:31:50 +00:00
TINA_CHIP_TYPE = G102
KERNEL_VERSION = CONF_KERNEL_VERSION_3_10
CEDARC_COMPILE_TOOL_CHAIN = arm-openwrt-linux
2018-12-13 10:48:25 +00:00
CEDARX_COMPILE_TOOL_CHAIN = arm-openwrt-linux
CEDARC_LIBS_PATH = libcedarc/library/toolchain-sunxi-arm-musl
CEDARX_LIBS_PATH = libcedarx/external/lib32/openwrt-arm-musl
2018-07-13 01:31:50 +00:00
VE_OFFSET = NOT_CONFIG_VE_OFFSET
KERNEL_VERSION_ION = CONF_KERNEL_CMA
SYSTEM_LIB := libasound.so \
libcrypto.so \
libssl.so \
2018-12-13 10:48:25 +00:00
libxml2.so \
2018-07-13 01:31:50 +00:00
libz.so
CONFIG_STATUS = --enable-hls=yes
2018-12-13 10:48:25 +00:00
CEDARC_LD_FLAGS = -ldl
CEDARX_LD_FLAGS = -ldl -lcrypto -lz
2018-07-13 01:31:50 +00:00
CONFIG_HTTPS = --enable-https=yes
2018-12-13 10:48:25 +00:00
CONFIG_PLAYREADY = --enable-playready=no
2018-07-13 01:31:50 +00:00
AUDIO_DEC_LIBS := AAC \
ALAC \
AMR \
APE \
ATRC \
COOK \
FLAC \
MP3 \
OGG \
SIPR \
WAV \
2018-12-13 10:48:25 +00:00
RA \
DSD \
G729 \
OPUS
2018-07-13 01:31:50 +00:00
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), \
2018-12-13 10:48:25 +00:00
$(if $(CONFIG_CEDAR_VDECODER_$(c)),libaw$(shell echo $(c) | tr '[A-Z]' '[a-z]').so))
2018-07-13 01:31:50 +00:00
2018-12-13 10:48:25 +00:00
SUPPORT_VIDEO_DEC_LIBS += $(if $(CONFIG_CEDAR_VDECODER_MJPEG),libawmjpegplus.so)
2018-07-13 01:31:50 +00:00
2018-12-13 10:48:25 +00:00
SUPPORT_VIDEO_DEC_LIBS += $(if $(CONFIG_CEDAR_VDECODER_VP9),libawvp9Hw.so)
2018-07-13 01:31:50 +00:00
2018-12-13 10:48:25 +00:00
SUPPORT_SUBTITLE_DEC_LIBS := $(if $(CONFIG_CEDAR_SUBTITLE_SUPPORT),libsubdecoder.so)
2018-07-13 01:31:50 +00:00
2018-12-13 10:48:25 +00:00
SUPPORT_VDEC_COMMON_LIBS := $(if $(CONFIG_TPLAYER),libcdc_base.so libMemAdapter.so libvdecoder.so libVE.so libvideoengine.so)
2018-07-13 01:31:50 +00:00
SUPPORT_OMX_LIBS := $(if $(CONFIG_OMX),libcdc_omxil_core.so libcdc_omxil_vdec.so libcdc_omxil_venc.so)
2018-12-13 10:48:25 +00:00
SUPPORT_ADEC_COMMON_LIBS := $(if $(CONFIG_TPLAYER),libadecoder.so)
2018-07-13 01:31:50 +00:00
SUPPORT_TPLAYER_PARSER := $(if $(CONFIG_CEDAR_PARSER_ALL),libcdx_parser.so)
SUPPORT_TPLAYER_STREAM := $(if $(CONFIG_CEDAR_STREAM_ALL),libcdx_stream.so)
2018-12-13 10:48:25 +00:00
SUPPORT_TPLAYER_COMMON := $(if $(CONFIG_TPLAYER),libcdx_base.so libcdx_common.so libcdx_playback.so libxplayer.so libtplayer.so)
2018-07-13 01:31:50 +00:00
## TRECORDER related libraries
2018-12-13 10:48:25 +00:00
SUPPORT_VIDEO_ENC_LIBS := $(if $(CONFIG_CEDAR_VIDEO_ENCODER_ALL),libvencoder.so)
2018-07-13 01:31:50 +00:00
SUPPORT_AUDIO_ENC_LIBS := $(if $(CONFIG_CEDAR_AENCODER_ALL),libaencoder.so)
2018-12-13 10:48:25 +00:00
SUPPORT_VENC_COMMON_LIBS := $(if $(CONFIG_TRECORDER), libcdc_base.so libMemAdapter.so libVE.so)
2018-07-13 01:31:50 +00:00
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)
2018-12-13 10:48:25 +00:00
SUPPORT_LIBRARY_ALL := $(foreach c,$(MULTIMEDIA_LIBS), $($c))
#config the kernel version,which depends on $(KERNEL_PATCHVER)
ifeq ($(KERNEL_PATCHVER),3.4)
KERNEL_VERSION = CONF_KERNEL_VERSION_3_4
endif
ifeq ($(KERNEL_PATCHVER),3.10)
KERNEL_VERSION = CONF_KERNEL_VERSION_3_10
endif
ifeq ($(KERNEL_PATCHVER),4.4)
KERNEL_VERSION = CONF_KERNEL_VERSION_4_4
endif
ifeq ($(KERNEL_PATCHVER),4.9)
KERNEL_VERSION = CONF_KERNEL_VERSION_4_9
endif
#end config the kernel version
#config the toolchain,which depends on arm or arm64
#notice:arm musl,arm glibc,arm9 musl,arm9 glibc all use the following toolchain prefix
ifeq ($(CONFIG_ARCH),"arm")
CEDARC_COMPILE_TOOL_CHAIN = arm-openwrt-linux
CEDARX_COMPILE_TOOL_CHAIN = arm-openwrt-linux
endif
#notice:aarch64 musl,aarch64 glibc all use the following toolchain prefix
ifeq ($(CONFIG_ARCH),"aarch64")
CEDARC_COMPILE_TOOL_CHAIN = aarch64-openwrt-linux
CEDARX_COMPILE_TOOL_CHAIN = aarch64-openwrt-linux
endif
#end config the toolchain
#config the cma type
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
#config the arm libs path
ifeq ($(TARGET_CPU_VARIANT),cortex-a7)
ifeq ($(CONFIG_LIBC),"musl")
CEDARC_LIBS_PATH = libcedarc/library/toolchain-sunxi-arm-musl
CEDARX_LIBS_PATH = libcedarx/external/lib32/openwrt-arm-musl
endif
ifeq ($(CONFIG_LIBC),"glibc")
CEDARC_LIBS_PATH = libcedarc/library/toolchain-sunxi-arm-glibc
CEDARX_LIBS_PATH = libcedarx/external/lib32/openwrt-arm-glibc
endif
endif
#config the aarch64 libs path
ifeq ($(TARGET_CPU_VARIANT),cortex-a53)
ifeq ($(CONFIG_COMPLILE_KERNEL64_USER32),y)
CEDARC_COMPILE_TOOL_CHAIN = arm-openwrt-linux
CEDARX_COMPILE_TOOL_CHAIN = arm-openwrt-linux
ifeq ($(CONFIG_LIBC),"musl")
CEDARC_LIBS_PATH = libcedarc/library/toolchain-sunxi-arm-musl
CEDARX_LIBS_PATH = libcedarx/external/lib32/openwrt-arm-musl
endif
ifeq ($(CONFIG_LIBC),"glibc")
CEDARC_LIBS_PATH = libcedarc/library/toolchain-sunxi-arm-glibc
CEDARX_LIBS_PATH = libcedarx/external/lib32/openwrt-arm-glibc
endif
else
ifeq ($(CONFIG_LIBC),"musl")
CEDARC_LIBS_PATH = libcedarc/library/toolchain-sunxi-aarch64-musl
CEDARX_LIBS_PATH = libcedarx/external/lib32/openwrt-aarch64-musl
endif
ifeq ($(CONFIG_LIBC),"glibc")
CEDARC_LIBS_PATH = libcedarc/library/toolchain-sunxi-aarch64-glibc
CEDARX_LIBS_PATH = libcedarx/external/lib32/openwrt-aarch64-glibc
endif
endif
endif
#config the arm9 libs path
ifeq ($(TARGET_CPU_VARIANT),arm926ej-s)
ifeq ($(CONFIG_LIBC),"musl")
CEDARC_LIBS_PATH = libcedarc/library/toolchain-sunxi-arm9-musl
CEDARX_LIBS_PATH = libcedarx/external/lib32/openwrt-arm926-musl
endif
ifeq ($(CONFIG_LIBC),"glibc")
CEDARC_LIBS_PATH = libcedarc/library/toolchain-sunxi-arm9-glibc
CEDARX_LIBS_PATH = libcedarx/external/lib32/openwrt-arm926-glibc
endif
endif
2018-07-13 01:31:50 +00:00
ifeq ($(TARGET_BOARD_PLATFORM),astar)
2018-12-13 10:48:25 +00:00
TINA_CHIP_TYPE = r16
NOT_SUPPORT_VIDEO_LIBS += libawmjpegplus.so
2018-07-13 01:31:50 +00:00
endif
ifeq ($(TARGET_BOARD_PLATFORM),octopus)
2018-12-13 10:48:25 +00:00
TINA_CHIP_TYPE = r58
NOT_SUPPORT_VIDEO_LIBS += libawmjpegplus.so
2018-07-13 01:31:50 +00:00
endif
ifeq ($(TARGET_BOARD_PLATFORM),azalea)
2018-12-13 10:48:25 +00:00
TINA_CHIP_TYPE = r40
NOT_SUPPORT_VIDEO_LIBS += libawmjpegplus.so
2018-07-13 01:31:50 +00:00
endif
2018-12-13 10:48:25 +00:00
2018-07-13 01:31:50 +00:00
ifeq ($(TARGET_BOARD_PLATFORM),tulip)
2018-12-13 10:48:25 +00:00
TINA_CHIP_TYPE = r18
NOT_SUPPORT_VIDEO_LIBS += libawmjpeg.so
2018-07-13 01:31:50 +00:00
endif
ifeq ($(TARGET_BOARD_PLATFORM),koto)
2018-12-13 10:48:25 +00:00
TINA_CHIP_TYPE = r30
NOT_SUPPORT_VIDEO_LIBS += libawmjpegplus.so
2018-07-13 01:31:50 +00:00
endif
ifeq ($(TARGET_BOARD_PLATFORM),mandolin)
2018-12-13 10:48:25 +00:00
TINA_CHIP_TYPE = r311
VE_OFFSET = CONFIG_VE_OFFSET_0
NOT_SUPPORT_VIDEO_LIBS += libawmjpegplus.so
2018-07-13 01:31:50 +00:00
endif
ifeq ($(TARGET_BOARD_PLATFORM),sitar)
2018-12-13 10:48:25 +00:00
TINA_CHIP_TYPE = r6
NOT_SUPPORT_VIDEO_LIBS += libawmjpegplus.so
2018-07-13 01:31:50 +00:00
endif
ifeq ($(TARGET_BOARD_PLATFORM),violin)
2018-12-13 10:48:25 +00:00
TINA_CHIP_TYPE = c600
CONFIG_STATUS = --enable-hls=no
CEDARX_LD_FLAGS = -lz
CONFIG_HTTPS = --enable-https=no
NOT_SUPPORT_VIDEO_LIBS += libawmjpegplus.so
2018-07-13 01:31:50 +00:00
endif
ifeq ($(TARGET_BOARD_PLATFORM),cello)
2018-12-13 10:48:25 +00:00
TINA_CHIP_TYPE = G102
NOT_SUPPORT_VIDEO_LIBS += libawmjpeg.so \
libawmjpegplus.so
2018-07-13 01:31:50 +00:00
endif
ifeq ($(TARGET_BOARD_PLATFORM),banjo)
2018-12-13 10:48:25 +00:00
TINA_CHIP_TYPE = R11
CONFIG_STATUS = --enable-hls=no
CEDARX_LD_FLAGS = -lz
CONFIG_HTTPS = --enable-https=no
NOT_SUPPORT_VIDEO_LIBS += libawmjpeg.so
endif
ifeq ($(TARGET_BOARD_PLATFORM),bassoon)
TINA_CHIP_TYPE = R333
CONFIG_STATUS = --enable-hls=no
CEDARX_LD_FLAGS = -lz
CONFIG_HTTPS = --enable-https=no
NOT_SUPPORT_VIDEO_LIBS += libawmjpeg.so
endif
ifeq ($(TARGET_BOARD_PLATFORM),boobam)
TINA_CHIP_TYPE = R331
CONFIG_STATUS = --enable-hls=no
CEDARX_LD_FLAGS = -lz
CONFIG_HTTPS = --enable-https=no
NOT_SUPPORT_VIDEO_LIBS += libawmjpeg.so
endif
ifeq ($(TARGET_BOARD_PLATFORM),lute)
TINA_CHIP_TYPE = R7s
CONFIG_STATUS = --enable-hls=no
CEDARX_LD_FLAGS = -lz
CONFIG_HTTPS = --enable-https=no
NOT_SUPPORT_VIDEO_LIBS += libawmjpeg.so
endif
ifeq ($(TARGET_BOARD_PLATFORM),flute)
TINA_CHIP_TYPE = R332
CONFIG_STATUS = --enable-hls=no
CEDARX_LD_FLAGS = -lz
CONFIG_HTTPS = --enable-https=no
NOT_SUPPORT_VIDEO_LIBS += libawmjpeg.so
endif
ifeq ($(TARGET_BOARD_PLATFORM),piano)
TINA_CHIP_TYPE = T7
NOT_SUPPORT_VIDEO_LIBS += libawmjpeg.so
2018-07-13 01:31:50 +00:00
endif
2018-12-13 10:48:25 +00:00
ifeq ($(TARGET_BOARD_PLATFORM),bangu)
TINA_CHIP_TYPE = V3
CONFIG_STATUS = --enable-hls=no
CEDARX_LD_FLAGS = -lz
CONFIG_HTTPS = --enable-https=no
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 bassoon boobam lute piano flute bangu dolphin))
2018-07-13 01:31:50 +00:00
define Package/$(PKG_NAME)/config
source "$(SOURCE)/Config.in"
endef
define Package/$(PKG_NAME)
SECTION:=utils
CATEGORY:=Allwinner
2018-12-13 10:48:25 +00:00
TITLE:=$(PKG_NAME) for allwinner
2018-07-13 01:31:50 +00:00
DEPENDS:=+libpthread \
+libuapi \
+zlib \
2018-12-13 10:48:25 +00:00
+alsa-lib \
+libxml2 \
+libopenssl
2018-07-13 01:31:50 +00:00
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
2018-12-13 10:48:25 +00:00
ifeq ($(CONFIG_CEDARX_YES_USE_PLAYREADY),y)
DEPENDS+= +playready
endif
2018-07-13 01:31:50 +00:00
endef
2018-12-13 10:48:25 +00:00
ifeq ($(CONFIG_CEDARX_YES_USE_PLAYREADY),y)
CONFIG_PLAYREADY = --enable-playready=yes
COMPILE_PLAYREADY = \
-DADJUST_ADDRESS_FOR_SECURE_OS_OPTEE \
-DBOARD_USE_PLAYREADY=1 \
-DDRM_BUILD_PROFILE=900 \
-DARM=1
endif
2018-07-13 01:31:50 +00:00
define Package/$(PKG_NAME)/Default
2018-12-13 10:48:25 +00:00
TITLE:=$(PKG_NAME) for all
2018-07-13 01:31:50 +00:00
URL:=http://www.allwinner.com/
endef
define Package/$(PKG_NAME)/description
2018-12-13 10:48:25 +00:00
$(PKG_NAME)
2018-07-13 01:31:50 +00:00
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
2018-12-13 10:48:25 +00:00
$(info ********target_board_platform = $(TARGET_BOARD_PLATFORM)***********)
$(info ********chip type = $(TINA_CHIP_TYPE)*********)
$(info ********kernel version = $(KERNEL_PATCHVER)*********)
$(info ********toolchain = $(CONFIG_ARCH)_$(CONFIG_LIBC)*********)
$(info ********cpu arch = $(TARGET_CPU_VARIANT)*********)
2018-07-13 01:31:50 +00:00
cd $(PKG_BUILD_DIR)/libcedarc; \
./bootstrap; \
2018-12-13 10:48:25 +00:00
./configure --prefix=$(PKG_BUILD_DIR)/libcedarc/install --host=$(CEDARC_COMPILE_TOOL_CHAIN) CFLAGS="-D__ENABLE_ZLIB__ -D$(VE_OFFSET) -D$(KERNEL_VERSION) -D$(KERNEL_VERSION_ION)" CPPFLAGS="-D__ENABLE_ZLIB__ -D$(KERNEL_VERSION) -D$(KERNEL_VERSION_ION)" LDFLAGS="$(CEDARC_LD_FLAGS) -L$(PKG_BUILD_DIR)/$(CEDARC_LIBS_PATH) -L$(PKG_BUILD_DIR)/libcedarc/install/lib"
2018-07-13 01:31:50 +00:00
cd $(PKG_BUILD_DIR)/libcedarx; \
./bootstrap; \
2018-12-13 10:48:25 +00:00
./configure --prefix=$(PKG_BUILD_DIR)/libcedarx/install --host=$(CEDARX_COMPILE_TOOL_CHAIN) $(CONFIG_STATUS) $(CONFIG_HTTPS) $(CONFIG_PLAYREADY) CFLAGS="-D__ENABLE_ZLIB__ -D$(TINA_CHIP_TYPE) -Wno-error=format" CPPFLAGS="-D__ENABLE_ZLIB__ -D$(TINA_CHIP_TYPE) -Wno-error=format" LDFLAGS="$(CEDARX_LD_FLAGS) -L$(PKG_BUILD_DIR)/$(CEDARX_LIBS_PATH) -L$(PKG_BUILD_DIR)/libcedarx/install/lib -L$(PKG_BUILD_DIR)/libcedarc/install/lib -L$(PKG_BUILD_DIR)/$(CEDARC_LIBS_PATH)"
2018-07-13 01:31:50 +00:00
endef
define Build/Compile
$(MAKE) -C $(PKG_BUILD_DIR)/libcedarc \
ARCH="$(TARGET_ARCH)" \
AR="$(TARGET_AR)" \
CC="$(TARGET_CC)" \
CPP="$(TARGET_CXX)" \
2018-12-13 10:48:25 +00:00
CFLAGS="$(TARGET_CFLAGS) -D__ENABLE_ZLIB__ -D$(VE_OFFSET) -D$(KERNEL_VERSION) -D$(KERNEL_VERSION_ION)" \
CPPFLAGS="$(TARGET_CPPFLAGS) -D__ENABLE_ZLIB__ -D$(KERNEL_VERSION) -D$(KERNEL_VERSION_ION)" \
LDFLAGS="$(TARGET_LDFLAGS) $(CEDARC_LD_FLAGS) -L$(PKG_BUILD_DIR)/$(CEDARC_LIBS_PATH) -L$(PKG_BUILD_DIR)/libcedarc/install/lib" \
2018-07-13 01:31:50 +00:00
install
$(MAKE) -C $(PKG_BUILD_DIR)/libcedarx \
ARCH="$(TARGET_ARCH)" \
AR="$(TARGET_AR)" \
CC="$(TARGET_CC)" \
CPP="$(TARGET_CXX)" \
2018-12-13 10:48:25 +00:00
CFLAGS="$(TARGET_CFLAGS) -D__ENABLE_ZLIB__ -D$(TINA_CHIP_TYPE) -Wno-error=format" \
CPPFLAGS="$(TARGET_CPPFLAGS) -D__ENABLE_ZLIB__ -D$(TINA_CHIP_TYPE) -Wno-error=format" \
LDFLAGS="$(TARGET_LDFLAGS) $(CEDARX_LD_FLAGS) -L$(PKG_BUILD_DIR)/$(CEDARX_LIBS_PATH) -L$(PKG_BUILD_DIR)/libcedarx/install/lib -L$(PKG_BUILD_DIR)/libcedarc/install/lib -L$(PKG_BUILD_DIR)/$(CEDARC_LIBS_PATH)" \
2018-07-13 01:31:50 +00:00
BOARD_PLATFORM="$(TARGET_BOARD_PLATFORM)" \
install
$(MAKE) -C $(PKG_BUILD_DIR)/tplayer \
ARCH="$(TARGET_ARCH)" \
AR="$(TARGET_AR)" \
CC="$(TARGET_CC)" \
CPP="$(TARGET_CXX)" \
2018-12-13 10:48:25 +00:00
CFLAGS="$(TARGET_CFLAGS)" \
2018-07-13 01:31:50 +00:00
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)" \
LDFLAGS="$(TARGET_LDFLAGS)" \
2018-12-13 10:48:25 +00:00
BOARD_PLATFORM="$(TARGET_BOARD_PLATFORM)" \
2018-07-13 01:31:50 +00:00
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/
2018-12-13 10:48:25 +00:00
-cp -r $(PKG_BUILD_DIR)/libcedarx/libcore/muxer/include/*.h $(PKG_INSTALL_DIR)/usr/include/allwinner/
2018-07-13 01:31:50 +00:00
-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/
2018-12-13 10:48:25 +00:00
echo "**InstallDev path:$(1)***"
2018-07-13 01:31:50 +00:00
$(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/
2018-12-13 10:48:25 +00:00
echo "**install path:$(1)***"
2018-07-13 01:31:50 +00:00
for n in $(SUPPORT_LIBRARY_ALL); \
do \
2018-12-13 10:48:25 +00:00
$(CP) $(PKG_BUILD_DIR)/all_libs/$$$$n $(1)/usr/lib; \
2018-07-13 01:31:50 +00:00
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
2018-12-13 10:48:25 +00:00
ifeq ($(TARGET_BOARD_PLATFORM),$(filter $(TARGET_BOARD_PLATFORM),astar octopus azalea tulip sitar violin cello banjo koto mandolin bassoon boobam lute piano flute bangu dolphin))
2018-07-13 01:31:50 +00:00
$(eval $(call BuildPackage,$(PKG_NAME)))
endif