Skip to content

Commit

Permalink
[tina] TinyVision Support HW encoder and decoder
Browse files Browse the repository at this point in the history
Signed-off-by: YuzukiTsuru <gloomyghost@gloomyghost.com>
  • Loading branch information
YuzukiTsuru committed Feb 18, 2024
1 parent 6e0d573 commit 6a4b3aa
Show file tree
Hide file tree
Showing 1,759 changed files with 418,453 additions and 39 deletions.
113 changes: 74 additions & 39 deletions tina/openwrt/package/allwinner/multimedia/tina_multimedia/Makefile

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
#config the parsers which will be compiled
ifeq ($(CONFIG_CEDAR_PARSER_AAC),y)
CONFIG_PARSER += --enable-aac-parser=yes
else
CONFIG_PARSER += --enable-aac-parser=no
endif

ifeq ($(CONFIG_CEDAR_PARSER_MP3),y)
CONFIG_PARSER += --enable-mp3-parser=yes
else
CONFIG_PARSER += --enable-mp3-parser=no
endif

ifeq ($(CONFIG_CEDAR_PARSER_WAV),y)
CONFIG_PARSER += --enable-wav-parser=yes
else
CONFIG_PARSER += --enable-wav-parser=no
endif

ifeq ($(CONFIG_CEDAR_PARSER_ID3V2),y)
CONFIG_PARSER += --enable-id3v2-parser=yes
else
CONFIG_PARSER += --enable-id3v2-parser=no
endif

ifeq ($(CONFIG_CEDAR_PARSER_FLAC),y)
CONFIG_PARSER += --enable-flac-parser=yes
else
CONFIG_PARSER += --enable-flac-parser=no
endif

ifeq ($(CONFIG_CEDAR_PARSER_APE),y)
CONFIG_PARSER += --enable-ape-parser=yes
else
CONFIG_PARSER += --enable-ape-parser=no
endif

ifeq ($(CONFIG_CEDAR_PARSER_AMR),y)
CONFIG_PARSER += --enable-amr-parser=yes
else
CONFIG_PARSER += --enable-amr-parser=no
endif

ifeq ($(CONFIG_CEDAR_PARSER_ATRAC),y)
CONFIG_PARSER += --enable-atrac-parser=yes
else
CONFIG_PARSER += --enable-atrac-parser=no
endif

ifeq ($(CONFIG_CEDAR_PARSER_OGG),y)
CONFIG_PARSER += --enable-ogg-parser=yes
else
CONFIG_PARSER += --enable-ogg-parser=no
endif

ifeq ($(CONFIG_CEDAR_PARSER_TS),y)
CONFIG_PARSER += --enable-ts-parser=yes
else
CONFIG_PARSER += --enable-ts-parser=no
endif

ifeq ($(CONFIG_CEDAR_PARSER_MKV),y)
CONFIG_PARSER += --enable-mkv-parser=yes
else
CONFIG_PARSER += --enable-mkv-parser=no
endif

ifeq ($(CONFIG_CEDAR_PARSER_MOV),y)
CONFIG_PARSER += --enable-mov-parser=yes
else
CONFIG_PARSER += --enable-mov-parser=no
endif

ifeq ($(CONFIG_CEDAR_PARSER_AVI),y)
CONFIG_PARSER += --enable-avi-parser=yes
else
CONFIG_PARSER += --enable-avi-parser=no
endif

ifeq ($(CONFIG_CEDAR_PARSER_FLV),y)
CONFIG_PARSER += --enable-flv-parser=yes
else
CONFIG_PARSER += --enable-flv-parser=no
endif

ifeq ($(CONFIG_CEDAR_PARSER_ASF),y)
CONFIG_PARSER += --enable-asf-parser=yes
else
CONFIG_PARSER += --enable-asf-parser=no
endif

ifeq ($(CONFIG_CEDAR_PARSER_HLS),y)
CONFIG_PARSER += --enable-hls-parser=yes
else
CONFIG_PARSER += --enable-hls-parser=no
endif

ifeq ($(CONFIG_CEDAR_PARSER_MPG),y)
CONFIG_PARSER += --enable-mpg-parser=yes
else
CONFIG_PARSER += --enable-mpg-parser=no
endif

ifeq ($(CONFIG_CEDAR_PARSER_PMP),y)
CONFIG_PARSER += --enable-pmp-parser=yes
else
CONFIG_PARSER += --enable-pmp-parser=no
endif

ifeq ($(CONFIG_CEDAR_PARSER_PLS),y)
CONFIG_PARSER += --enable-pls-parser=yes
else
CONFIG_PARSER += --enable-pls-parser=no
endif

ifeq ($(CONFIG_CEDAR_PARSER_REMUX),y)
CONFIG_PARSER += --enable-remux-parser=yes
else
CONFIG_PARSER += --enable-remux-parser=no
endif

Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@

################################################################################
## set flags for golobal compile and link setting.
################################################################################

CONFIG_FOR_COMPILE = $(CFLAGS) $(LOCAL_CFLAGS)
CONFIG_FOR_LINK = -Wl,--no-undefined


################################################################################

BuildPath = ./build
ObjectPath = $(BuildPath)/obj
OutputPath = ./
DependFilePath = $(BuildPath)/dep
Target = $(OutputPath)/libjpegdecode.so ## output target.

ifneq ($(BuildPath),wildcard($(BuildPath)))
a := $(shell mkdir -p $(BuildPath))
endif
ifneq ($(ObjectPath),wildcard($(ObjectPath)))
a := $(shell mkdir -p $(ObjectPath))
endif
ifneq ($(OutputPath),wildcard($(OutputPath)))
a := $(shell mkdir -p $(OutputPath))
endif
ifneq ($(DependFilePath),wildcard($(DependFilePath)))
a := $(shell mkdir -p $(DependFilePath))
endif


################################################################################
## set the source files, object files and dependency files
################################################################################
## set the source path to VPATH.
SourcePath = $(shell find ./ -type d)
SourcePath := $(filter-out $(BuildPath) $(ObjectPath) $(DependFilePath), $(SourcePath))
VPATH := $(SourcePath)

## set the source files.
SourceFiles = $(foreach dir,$(SourcePath),$(shell find $(dir) -maxdepth 1 -name "*.c"))

## set the object files.
ObjectFiles = $(addprefix $(ObjectPath)/, $(addsuffix .o ,$(basename $(notdir $(SourceFiles)))))

## set the dependency files.
DependFiles = $(addprefix $(DependFilePath)/, $(addsuffix .d ,$(notdir $(basename $(SourceFiles)))))

#config the arm libs path
ifeq ($(CPU_TYPE),cortex-a7)
ifeq ($(C_LIB_TYPE),musl)
CEDARC_LIBS_PATH = ../$(JPEG_LIBCEDARC_DIR)/library/toolchain-sunxi-arm-musl
endif
ifeq ($(C_LIB_TYPE),glibc)
CEDARC_LIBS_PATH = ../$(JPEG_LIBCEDARC_DIR)/library/toolchain-sunxi-arm-glibc
endif
endif

#config the aarch64 libs path
ifeq ($(CPU_TYPE),cortex-a53)
ifeq ($(KERNEL64_USER32),y)
ifeq ($(C_LIB_TYPE),musl)
CEDARC_LIBS_PATH = ../$(JPEG_LIBCEDARC_DIR)/library/toolchain-sunxi-arm-musl
endif
ifeq ($(C_LIB_TYPE),glibc)
CEDARC_LIBS_PATH = ../$(JPEG_LIBCEDARC_DIR)/library/toolchain-sunxi-arm-glibc
endif
else
ifeq ($(C_LIB_TYPE),musl)
CEDARC_LIBS_PATH = ../$(JPEG_LIBCEDARC_DIR)/library/toolchain-sunxi-aarch64-musl
endif
ifeq ($(C_LIB_TYPE),glibc)
CEDARC_LIBS_PATH = ../$(JPEG_LIBCEDARC_DIR)/library/toolchain-sunxi-aarch64-glibc
endif
endif
endif

#config the arm9 libs path
ifeq ($(CPU_TYPE),arm926ej-s)
ifeq ($(C_LIB_TYPE),musl)
CEDARC_LIBS_PATH = ../$(JPEG_LIBCEDARC_DIR)/library/toolchain-sunxi-arm9-musl
endif
ifeq ($(C_LIB_TYPE),glibc)
CEDARC_LIBS_PATH = ../$(JPEG_LIBCEDARC_DIR)/library/toolchain-sunxi-arm9-glibc
endif
endif

#config the riscv libs path
ifeq ($(CPU_TYPE),c910)
ifeq ($(C_LIB_TYPE),glibc)
CEDARC_LIBS_PATH = ../$(JPEG_LIBCEDARC_DIR)/library/toolchain-sunxi-riscv-glibc
CEDARX_LIBS_PATH = ../libcedarx/external/lib64/openwrt-riscv-glibc
endif
endif

LocalLibPath = -L../$(JPEG_LIBCEDARC_DIR)/vdecoder/.libs/ -L../$(JPEG_LIBCEDARC_DIR)/memory/.libs/ -L../$(JPEG_LIBCEDARC_DIR)/base/.libs/ -L$(CEDARC_LIBS_PATH)

LocalLinkFlags = -lvdecoder -lVE -lMemAdapter -lcdc_base -ldl
################################################################################
## set flags for compile and link
################################################################################

## set the include path for compile flags.
SourceIncludePath = $(foreach dir,$(SourcePath),-I$(dir)) \
-I../ \
-I../tplayer \
-I../$(JPEG_LIBCEDARC_DIR)/include \
## set compile flags
CompileFlags = $(CONFIG_FOR_COMPILE) $(SourceIncludePath) -Wall -O2 -ldl

################################################################################
## make commands, all/clean/cleanall
################################################################################

## define commands for make, sush as all, clean
.PHONY: all clean cleantarget cleanall
all:$(Target)

clean:
-rm -f $(ObjectPath)/*
-rm -f $(Target)

cleanall: clean
-rm -f $(DependFilePath)/*
-rm -rf $(BuildPath)


################################################################################
## define target dependencies.
################################################################################

## compile source files to object files.
#$(ObjectPath)/%.o:%.c
# $(CC) $(CompileFlags) -o $@ -c $< -fPIC -shared
$(ObjectFiles):$(ObjectPath)/%.o:%.c
@echo =======$(CONFIG_FOR_COMPILE)===
@echo =======CPP:$(CPP)====
@echo =======CXX:$(CXX)====
$(CC) $(CompileFlags) -o $@ -c $< -fPIC -shared

## link object files to the target share library.
$(Target):$(ObjectFiles)
$(CC) -o $@ $^ -fPIC -shared $(LDFLAGS) $(LocalLibPath) $(LocalLinkFlags)

## set rules to generate .d files.
$(DependFilePath)/%.d:%.c
set -e; rm -f $@; \
$(CC) -MM $(CompileFlags) $< > $@.$$$$; \
sed 's,\($*\)\.o[:]*,$(ObjectPath)/\1.o $@: ,g' < $@.$$$$ > $@; \
rm -f $@.$$$$

## include the .d files to set dependency rules.
ifneq ($(MAKECMDGOALS),clean)
ifneq ($(MAKECMDGOALS),cleantarget)
ifneq ($(MAKECMDGOALS),cleanall)
-include $(DependFiles)
endif
endif
endif

0 comments on commit 6a4b3aa

Please sign in to comment.