[cmake]: add codec option

Use mpp/codecs.cmake to enable/disable codecs in order to reduce library
size.
All decoder and encoder can be disbaled now. Default all open.

Change-Id: I3307460df12f2f3fc82898d823ab2da12002d6c6
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
This commit is contained in:
Herman Chen
2016-09-10 15:22:40 +08:00
parent 2ee1843c54
commit 30c6bd08c1
28 changed files with 479 additions and 287 deletions

View File

@@ -1,6 +1,7 @@
#!/bin/bash #!/bin/bash
# Run this from within a bash shell # Run this from within a bash shell
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release \ cmake -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_TOOLCHAIN_FILE=./arm.linux.cross.cmake \ -DCMAKE_TOOLCHAIN_FILE=./arm.linux.cross.cmake \
-DCMAKE_RKPLATFORM_ENABLE=ON \ -DCMAKE_RKPLATFORM_ENABLE=ON \
-G "Unix Makefiles" \
../../../ && cmake --build . ../../../ && cmake --build .

View File

@@ -1,4 +1,12 @@
# vim: syntax=cmake # vim: syntax=cmake
# ----------------------------------------------------------------------------
# setup mpp codec config first
# ----------------------------------------------------------------------------
include(codecs.cmake)
# ----------------------------------------------------------------------------
# add include directory
# ----------------------------------------------------------------------------
include_directories(.) include_directories(.)
include_directories(common) include_directories(common)
include_directories(base/inc) include_directories(base/inc)

View File

@@ -9,6 +9,7 @@ add_library(mpp_codec STATIC
mpp_dec.cpp mpp_dec.cpp
mpp_parser.cpp mpp_parser.cpp
) )
set_target_properties(mpp_codec PROPERTIES FOLDER "mpp/codec") set_target_properties(mpp_codec PROPERTIES FOLDER "mpp/codec")
add_subdirectory(dec) add_subdirectory(dec)
@@ -17,16 +18,16 @@ add_subdirectory(enc)
target_link_libraries(mpp_codec target_link_libraries(mpp_codec
${CODEC_AVSD} ${CODEC_AVSD}
codec_h263d ${CODEC_H263D}
codec_h264d ${CODEC_H264D}
codec_h265d ${CODEC_H265D}
codec_m2vd ${CODEC_MPEG2D}
codec_mpg4d ${CODEC_MPEG4D}
codec_vp8d ${CODEC_VP8D}
codec_vp9d ${CODEC_VP9D}
codec_jpegd ${CODEC_JPEGD}
codec_h264e ${CODEC_H264E}
codec_jpege ${CODEC_JPEGE}
codec_dummy_enc codec_dummy_enc
codec_dummy_dec codec_dummy_dec
mpp_base) mpp_base)

View File

@@ -2,25 +2,38 @@
add_subdirectory(dummy) add_subdirectory(dummy)
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/avs") if( HAVE_AVSD )
set(HAVE_AVSD true)
set(CODEC_AVSD codec_avsd)
add_definitions(-DHAVE_AVSD)
add_subdirectory(avs) add_subdirectory(avs)
endif() endif()
add_subdirectory(h263) if( HAVE_H263D )
add_subdirectory(h263)
endif()
add_subdirectory(h264) if( HAVE_H264D )
add_subdirectory(h264)
endif()
add_subdirectory(h265) if( HAVE_H265D )
add_subdirectory(h265)
endif()
add_subdirectory(m2v) if( HAVE_MPEG2D )
add_subdirectory(m2v)
endif()
add_subdirectory(mpg4) if( HAVE_MPEG4D )
add_subdirectory(mpg4)
endif()
add_subdirectory(vp8) if( HAVE_VP8D )
add_subdirectory(vp8)
endif()
add_subdirectory(vp9) if( HAVE_VP9D )
add_subdirectory(vp9)
endif()
add_subdirectory(jpeg) if( HAVE_JPEGD )
add_subdirectory(jpeg)
endif()

View File

@@ -8,9 +8,10 @@ set(H263D_PARSER_SRC
h263d_parser.c h263d_parser.c
) )
add_library(codec_h263d STATIC add_library(${CODEC_H263D} STATIC
${H263D_PARSER_SRC} ${H263D_PARSER_HDR} ${H263D_PARSER_SRC} ${H263D_PARSER_HDR}
) )
set_target_properties(codec_h263d PROPERTIES FOLDER "mpp/codec")
target_link_libraries(codec_h263d mpp_base) set_target_properties(${CODEC_H263D} PROPERTIES FOLDER "mpp/codec")
target_link_libraries(${CODEC_H263D} mpp_base)

View File

@@ -5,6 +5,7 @@ include_directories(.)
set(H264D_API set(H264D_API
../../inc/h264d_api.h ../../inc/h264d_api.h
) )
set(H264D_COMMON set(H264D_COMMON
../../../common/h264d_log.h ../../../common/h264d_log.h
../../../common/h264d_syntax.h ../../../common/h264d_syntax.h
@@ -23,7 +24,6 @@ set(H264D_HDR
h264d_init.h h264d_init.h
h264d_fill.h h264d_fill.h
h264d_rwfile.h h264d_rwfile.h
) )
# h264 decoder sourse # h264 decoder sourse
@@ -40,17 +40,16 @@ set(H264D_SRC
h264d_init.c h264d_init.c
h264d_fill.c h264d_fill.c
h264d_rwfile.c h264d_rwfile.c
) )
add_library(codec_h264d STATIC add_library(${CODEC_H264D} STATIC
${H264D_API} ${H264D_API}
${H264D_COMMON} ${H264D_COMMON}
${H264D_HDR} ${H264D_HDR}
${H264D_SRC} ${H264D_SRC}
) )
target_link_libraries(codec_h264d mpp_base) target_link_libraries(${CODEC_H264D} mpp_base)
set_target_properties(codec_h264d PROPERTIES FOLDER "mpp/codec") set_target_properties(${CODEC_H264D} PROPERTIES FOLDER "mpp/codec")

View File

@@ -12,12 +12,13 @@ set(H265D_PARSER_SRC
h265d_sei.c h265d_sei.c
h265d_parser2_syntax.c h265d_parser2_syntax.c
) )
add_library(codec_h265d STATIC
${H265D_PARSER_SRC} ${H265D_PARSER_HDR} add_library(${CODEC_H265D} STATIC
${H265D_PARSER_SRC}
${H265D_PARSER_HDR}
) )
set_target_properties(codec_h265d PROPERTIES FOLDER "mpp/codec") set_target_properties(${CODEC_H265D} PROPERTIES FOLDER "mpp/codec")
target_link_libraries(${CODEC_H265D} mpp_base)
target_link_libraries(codec_h265d mpp_base)
add_subdirectory(test) add_subdirectory(test)

View File

@@ -6,12 +6,13 @@ set(JPEGD_PARSER_HDR
set(JPEGD_PARSER_SRC set(JPEGD_PARSER_SRC
jpegd_parser.c jpegd_parser.c
) )
add_library(codec_jpegd STATIC
${JPEGD_PARSER_SRC} ${JPEGD_PARSER_HDR} add_library(${CODEC_JPEGD} STATIC
${JPEGD_PARSER_SRC}
${JPEGD_PARSER_HDR}
) )
set_target_properties(codec_jpegd PROPERTIES FOLDER "mpp/codec") set_target_properties(${CODEC_JPEGD} PROPERTIES FOLDER "mpp/codec")
target_link_libraries(${CODEC_JPEGD} mpp_base)
target_link_libraries(codec_jpegd mpp_base)
#add_subdirectory(test) #add_subdirectory(test)

View File

@@ -5,6 +5,7 @@ include_directories(.)
set(M2VD_API set(M2VD_API
../../inc/m2vd_api.h ../../inc/m2vd_api.h
) )
set(M2VD_COMMON set(M2VD_COMMON
) )
@@ -19,17 +20,14 @@ set(M2VD_HDR
set(M2VD_SRC set(M2VD_SRC
m2vd_api.c m2vd_api.c
m2vd_parser.c m2vd_parser.c
) )
add_library(${CODEC_MPEG2D} STATIC
add_library(codec_m2vd STATIC
${M2VD_API} ${M2VD_API}
${M2VD_COMMON} ${M2VD_COMMON}
${M2VD_HDR} ${M2VD_HDR}
${M2VD_SRC} ${M2VD_SRC}
) )
target_link_libraries(codec_m2vd
mpp_base
)
set_target_properties(codec_m2vd PROPERTIES FOLDER "mpp/codec")
target_link_libraries(${CODEC_MPEG2D} mpp_base)
set_target_properties(${CODEC_MPEG2D} PROPERTIES FOLDER "mpp/codec")

View File

@@ -8,9 +8,10 @@ set(MPG4D_PARSER_SRC
mpg4d_parser.c mpg4d_parser.c
) )
add_library(codec_mpg4d STATIC add_library(${CODEC_MPEG4D} STATIC
${MPG4D_PARSER_SRC} ${MPG4D_PARSER_HDR} ${MPG4D_PARSER_SRC}
${MPG4D_PARSER_HDR}
) )
set_target_properties(codec_mpg4d PROPERTIES FOLDER "mpp/codec")
target_link_libraries(codec_mpg4d mpp_base) set_target_properties(${CODEC_MPEG4D} PROPERTIES FOLDER "mpp/codec")
target_link_libraries(${CODEC_MPEG4D} mpp_base)

View File

@@ -16,14 +16,13 @@ set(VP8D_HDR
set(VP8D_SRC set(VP8D_SRC
vp8d_api.c vp8d_api.c
vp8d_parser.c vp8d_parser.c
) )
add_library(codec_vp8d STATIC add_library(${CODEC_VP8D} STATIC
${VP8D_API} ${VP8D_API}
${VP8D_HDR} ${VP8D_HDR}
${VP8D_SRC} ${VP8D_SRC}
) )
target_link_libraries(codec_vp8d mpp_base) target_link_libraries(${CODEC_VP8D} mpp_base)
set_target_properties(codec_vp8d PROPERTIES FOLDER "mpp/codec") set_target_properties(${CODEC_VP8D} PROPERTIES FOLDER "mpp/codec")

View File

@@ -6,16 +6,11 @@ set(VP9_D_API
../../inc/vp9d_api.h ../../inc/vp9d_api.h
) )
# vp9 decoder header
# h264 decoder header
set(VP9D_HDR set(VP9D_HDR
) )
# h264 decoder sourse # vp9 decoder sourse
set(VP9D_SRC set(VP9D_SRC
vp9d_api.c vp9d_api.c
vp9d_parser.c vp9d_parser.c
@@ -23,13 +18,11 @@ set(VP9D_SRC
vp9d_parser2_syntax.c vp9d_parser2_syntax.c
) )
add_library(${CODEC_VP9D} STATIC
add_library(codec_vp9d STATIC
${VP9D_API} ${VP9D_API}
${VP9D_HDR} ${VP9D_HDR}
${VP9D_SRC} ${VP9D_SRC}
) )
target_link_libraries(codec_vp9d mpp_base) target_link_libraries(${CODEC_VP9D} mpp_base)
set_target_properties(codec_vp9d PROPERTIES FOLDER "mpp/codec") set_target_properties(${CODEC_VP9D} PROPERTIES FOLDER "mpp/codec")

View File

@@ -4,11 +4,8 @@ include_directories(include)
# h264 encoder api # h264 encoder api
set(H264E_API set(H264E_API
# ../../inc/h264d_api.h
) )
set(H264E_COMMON set(H264E_COMMON
# ../../../common/h264d_log.h
# ../../../common/h264d_syntax.h
) )
# h264 encoder header # h264 encoder header
@@ -52,11 +49,12 @@ set(H264E_SRC
) )
add_library(codec_h264e STATIC add_library(${CODEC_H264E} STATIC
${H264E_API} ${H264E_API}
${H264E_COMMON} ${H264E_COMMON}
${H264E_HDR} ${H264E_HDR}
${H264E_SRC} ${H264E_SRC}
) )
target_link_libraries(codec_h264e mpp_base)
set_target_properties(codec_h264e PROPERTIES FOLDER "mpp/codec") target_link_libraries(${CODEC_H264E} mpp_base)
set_target_properties(${CODEC_H264E} PROPERTIES FOLDER "mpp/codec")

View File

@@ -1,9 +1,9 @@
# vim: syntax=cmake # vim: syntax=cmake
include_directories(.) include_directories(.)
add_library(codec_jpege STATIC add_library(${CODEC_JPEGE} STATIC
jpege_api.c jpege_api.c
) )
target_link_libraries(codec_jpege mpp_base) target_link_libraries(${CODEC_JPEGE} mpp_base)
set_target_properties(codec_jpege PROPERTIES FOLDER "mpp/codec") set_target_properties(${CODEC_JPEGE} PROPERTIES FOLDER "mpp/codec")

View File

@@ -28,8 +28,12 @@
* all decoder static register here * all decoder static register here
*/ */
static const ControlApi *controllers[] = { static const ControlApi *controllers[] = {
#if HAVE_H264E
&api_h264e_controller, &api_h264e_controller,
#endif
#if HAVE_JPEGE
&api_jpege_controller, &api_jpege_controller,
#endif
}; };
typedef struct ControllerImpl_t { typedef struct ControllerImpl_t {

View File

@@ -43,14 +43,30 @@ static const ParserApi *parsers[] = {
#if HAVE_AVSD #if HAVE_AVSD
&api_avsd_parser, &api_avsd_parser,
#endif #endif
#if HAVE_H263D
&api_h263d_parser, &api_h263d_parser,
#endif
#if HAVE_H264D
&api_h264d_parser, &api_h264d_parser,
#endif
#if HAVE_H265D
&api_h265d_parser, &api_h265d_parser,
#endif
#if HAVE_MPEG2D
&api_m2vd_parser, &api_m2vd_parser,
#endif
#if HAVE_MPEG4D
&api_mpg4d_parser, &api_mpg4d_parser,
#endif
#if HAVE_VP8D
&api_vp8d_parser, &api_vp8d_parser,
#endif
#if HAVE_VP9D
&api_vp9d_parser, &api_vp9d_parser,
#endif
#if HAVE_JPEGD
&api_jpegd_parser, &api_jpegd_parser,
#endif
&dummy_dec_parser, &dummy_dec_parser,
}; };

89
mpp/codecs.cmake Normal file
View File

@@ -0,0 +1,89 @@
# This file setup the enable flag of all supported codecs
if( NOT DEFINED DISABLE_AVSD AND
EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/codec/dec/avs" )
set(HAVE_AVSD true)
set(CODEC_AVSD codec_avsd)
set(HAL_AVSD hal_avsd)
add_definitions(-DHAVE_AVSD)
endif()
# H.263 decoder
if( NOT DEFINED DISABLE_H263D )
set(HAVE_H263D true)
set(CODEC_H263D codec_h263d)
set(HAL_H263D hal_h263d)
add_definitions(-DHAVE_H263D)
endif()
# H.264 decoder
if( NOT DEFINED DISABLE_H264D )
set(HAVE_H264D true)
set(CODEC_H264D codec_h264d)
set(HAL_H264D hal_h264d)
add_definitions(-DHAVE_H264D)
endif()
# H.265 decoder
if( NOT DEFINED DISABLE_H265D )
set(HAVE_H265D true)
set(CODEC_H265D codec_h265d)
set(HAL_H265D hal_h265d)
add_definitions(-DHAVE_H265D)
endif()
# mpeg2 decoder
if( NOT DEFINED DISABLE_MPEG2D )
set(HAVE_MPEG2D true)
set(CODEC_MPEG2D codec_mpeg2d)
set(HAL_MPEG2D hal_mpeg2d)
add_definitions(-DHAVE_MPEG2D)
endif()
# mpeg4 decoder
if( NOT DEFINED DISABLE_MPEG4D )
set(HAVE_MPEG4D true)
set(CODEC_MPEG4D codec_mpeg4d)
set(HAL_MPEG4D hal_mpeg4d)
add_definitions(-DHAVE_MPEG4D)
endif()
# VP8 decoder
if( NOT DEFINED DISABLE_VP8D )
set(HAVE_VP8D true)
set(CODEC_VP8D codec_vp8d)
set(HAL_VP8D hal_vp8d)
add_definitions(-DHAVE_VP8D)
endif()
# VP9 decoder
if( NOT DEFINED DISABLE_VP9D )
set(HAVE_VP9D true)
set(CODEC_VP9D codec_vp9d)
set(HAL_VP9D hal_vp9d)
add_definitions(-DHAVE_VP9D)
endif()
# jpeg decoder
if( NOT DEFINED DISABLE_JPEGD )
set(HAVE_JPEGD true)
set(CODEC_JPEGD codec_jpegd)
set(HAL_JPEGD hal_jpegd)
add_definitions(-DHAVE_JPEGD)
endif()
# H.264 encoder
if( NOT DEFINED DISABLE_H264E )
set(HAVE_H264E true)
set(CODEC_H264E codec_h264e)
set(HAL_H264E hal_h264e)
add_definitions(-DHAVE_H264E)
endif()
# jpeg encoder
if( NOT DEFINED DISABLE_JPEGE )
set(HAVE_JPEGE true)
set(CODEC_JPEGE codec_jpege)
set(HAL_JPEGE hal_jpege)
add_definitions(-DHAVE_JPEGE)
endif()

View File

@@ -1,6 +1,15 @@
# vim: syntax=cmake # vim: syntax=cmake
include_directories(worker/inc) include_directories(worker/inc)
# ----------------------------------------------------------------------------
# add hardware hal
# ----------------------------------------------------------------------------
add_subdirectory(vpu)
add_subdirectory(rkdec)
add_subdirectory(rkenc)
add_subdirectory(dummy)
add_subdirectory(rkdec/avsd)
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
# add mpp_hal implement # add mpp_hal implement
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
@@ -12,30 +21,6 @@ add_library(mpp_hal STATIC
set_target_properties(mpp_hal PROPERTIES FOLDER "mpp/hal") set_target_properties(mpp_hal PROPERTIES FOLDER "mpp/hal")
add_subdirectory(dummy)
add_subdirectory(rkdec/h264d)
add_subdirectory(rkdec/h265d)
add_subdirectory(rkdec/vp9d)
add_subdirectory(rkdec/avsd)
add_subdirectory(vpu/h263d)
add_subdirectory(vpu/m2vd)
add_subdirectory(vpu/mpg4d)
add_subdirectory(vpu/vp8d)
add_subdirectory(vpu/jpegd)
add_subdirectory(rkenc/h264e)
add_subdirectory(vpu/jpege)
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
# add hardware worker implement # add hardware worker implement
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
@@ -46,19 +31,18 @@ if(RKPLATFORM)
set(RKPLAT_VPU worker_vpu) set(RKPLAT_VPU worker_vpu)
endif(RKPLATFORM) endif(RKPLATFORM)
target_link_libraries(mpp_hal target_link_libraries(mpp_hal
hal_avsd ${HAL_AVSD}
hal_h263d ${HAL_H263D}
hal_h264d ${HAL_H264D}
hal_h265d ${HAL_H265D}
hal_m2vd ${HAL_MPEG2D}
hal_mpg4d ${HAL_MPEG4D}
hal_vp8d ${HAL_VP8D}
hal_vp9d ${HAL_VP9D}
hal_jpegd ${HAL_JPEGD}
hal_h264e ${HAL_H264E}
hal_jpege ${HAL_JPEGE}
hal_dummy hal_dummy
${RKPLAT_VPU} ${RKPLAT_VPU}
) )

View File

@@ -45,15 +45,33 @@
* all hardware api static register here * all hardware api static register here
*/ */
static const MppHalApi *hw_apis[] = { static const MppHalApi *hw_apis[] = {
#if HAVE_AVSD
&hal_api_avsd, &hal_api_avsd,
#endif
#if HAVE_H263D
&hal_api_h263d, &hal_api_h263d,
#endif
#if HAVE_H264D
&hal_api_h264d, &hal_api_h264d,
#endif
#if HAVE_H265D
&hal_api_h265d, &hal_api_h265d,
#endif
#if HAVE_MPEG2D
&hal_api_m2vd, &hal_api_m2vd,
#endif
#if HAVE_MPEG4D
&hal_api_mpg4d, &hal_api_mpg4d,
#endif
#if HAVE_VP8D
&hal_api_vp8d, &hal_api_vp8d,
#endif
#if HAVE_VP9D
&hal_api_vp9d, &hal_api_vp9d,
#endif
#if HAVE_JPEGD
&hal_api_jpegd, &hal_api_jpegd,
#endif
&hal_api_h264e, &hal_api_h264e,
&hal_api_jpege, &hal_api_jpege,
&hal_api_dummy_dec, &hal_api_dummy_dec,

View File

@@ -0,0 +1,13 @@
# vim: syntax=cmake
if( HAVE_H264D )
add_subdirectory(h264d)
endif()
if( HAVE_H265D )
add_subdirectory(h265d)
endif()
if( HAVE_VP9D )
add_subdirectory(vp9d)
endif()

View File

@@ -10,12 +10,12 @@ set(HAL_H265D_SRC
hal_h265d_reg.c hal_h265d_reg.c
) )
add_library(hal_h265d STATIC add_library(${HAL_H265D} STATIC
${HAL_H265D_SRC} ${HAL_H265D_HDR} ${HAL_H265D_SRC}
${HAL_H265D_HDR}
) )
set_target_properties(hal_h265d PROPERTIES FOLDER "mpp/hal") set_target_properties(${HAL_H265D} PROPERTIES FOLDER "mpp/hal")
target_link_libraries(${HAL_H265D} mpp_base)
target_link_libraries(hal_h265d mpp_base)
#add_subdirectory(test) #add_subdirectory(test)

View File

@@ -0,0 +1,2 @@
# vim: syntax=cmake
add_subdirectory(h264e)

View File

@@ -0,0 +1,25 @@
# vim: syntax=cmake
if( HAVE_H263D )
add_subdirectory(h263d)
endif()
if( HAVE_MPEG2D )
add_subdirectory(m2vd)
endif()
if( HAVE_MPEG4D )
add_subdirectory(mpg4d)
endif()
if( HAVE_VP8D )
add_subdirectory(vp8d)
endif()
if( HAVE_JPEGD )
add_subdirectory(jpegd)
endif()
if( HAVE_JPEGE )
add_subdirectory(jpege)
endif()

View File

@@ -9,9 +9,10 @@ set(HAL_JPEGE_SRC
hal_jpege_api.c hal_jpege_api.c
) )
add_library(hal_jpege STATIC add_library(${HAL_JPEGE} STATIC
${HAL_JPEGE_SRC} ${HAL_JPEGE_HDR} ${HAL_JPEGE_SRC}
${HAL_JPEGE_HDR}
) )
set_target_properties(hal_jpege PROPERTIES FOLDER "mpp/hal") set_target_properties(${HAL_JPEGE} PROPERTIES FOLDER "mpp/hal")
target_link_libraries(hal_jpege mpp_base) target_link_libraries(${HAL_JPEGE} mpp_base)

View File

@@ -1,32 +1,29 @@
# vim: syntax=cmake #vim: syntax=cmake
include_directories(.) include_directories(.)
# hal m2v decoder api #hal m2v decoder api
set(HAL_M2VD_API set(HAL_M2VD_API
../../inc/hal_m2vd_api.h ../../inc/hal_m2vd_api.h
../../../common/m2vd_syntax.h ../../../common/m2vd_syntax.h
) )
#hal m2v header
# hal m2v header
set(HAL_M2VD_HDR set(HAL_M2VD_HDR
hal_m2vd_reg.h hal_m2vd_reg.h
) )
# hal m2v decoder sourse #hal m2v decoder sourse
set(HAL_M2VD_SRC set(HAL_M2VD_SRC
hal_m2vd_api.c hal_m2vd_api.c
hal_m2vd_reg.c hal_m2vd_reg.c
) )
add_library(hal_m2vd STATIC add_library(${HAL_MPEG2D} STATIC
${HAL_M2VD_API} ${HAL_M2VD_API}
${HAL_M2VD_HDR} ${HAL_M2VD_HDR}
${HAL_M2VD_SRC} ${HAL_M2VD_SRC}
) )
target_link_libraries(${HAL_MPEG2D} mpp_base)
target_link_libraries(hal_m2vd mpp_base) set_target_properties(${HAL_MPEG2D} PROPERTIES FOLDER "mpp/hal")
set_target_properties(hal_m2vd PROPERTIES FOLDER "mpp/hal")

View File

@@ -8,11 +8,12 @@ set(HAL_MPEG4D_SRC
hal_mpg4d_reg.c hal_mpg4d_reg.c
) )
add_library(hal_mpg4d STATIC add_library(${HAL_MPEG4D} STATIC
${HAL_MPEG4D_SRC} ${HAL_MPEG4D_HDR} ${HAL_MPEG4D_SRC}
${HAL_MPEG4D_HDR}
) )
set_target_properties(hal_mpg4d PROPERTIES FOLDER "mpp/hal")
target_link_libraries(hal_mpg4d mpp_base) set_target_properties(${HAL_MPEG4D} PROPERTIES FOLDER "mpp/hal")
target_link_libraries(${HAL_MPEG4D} mpp_base)
#add_subdirectory(test) #add_subdirectory(test)

View File

@@ -35,17 +35,39 @@ typedef struct {
} MppCodingTypeInfo; } MppCodingTypeInfo;
static MppCodingTypeInfo support_list[] = { static MppCodingTypeInfo support_list[] = {
#if HAVE_MPEG2D
{ MPP_CTX_DEC, MPP_VIDEO_CodingMPEG2, "dec", "mpeg2", }, { MPP_CTX_DEC, MPP_VIDEO_CodingMPEG2, "dec", "mpeg2", },
#endif
#if HAVE_MPEG4D
{ MPP_CTX_DEC, MPP_VIDEO_CodingMPEG4, "dec", "mpeg4", }, { MPP_CTX_DEC, MPP_VIDEO_CodingMPEG4, "dec", "mpeg4", },
#endif
#if HAVE_H263D
{ MPP_CTX_DEC, MPP_VIDEO_CodingH263, "dec", "h.263", }, { MPP_CTX_DEC, MPP_VIDEO_CodingH263, "dec", "h.263", },
#endif
#if HAVE_H264D
{ MPP_CTX_DEC, MPP_VIDEO_CodingAVC, "dec", "h.264/AVC", }, { MPP_CTX_DEC, MPP_VIDEO_CodingAVC, "dec", "h.264/AVC", },
#endif
#if HAVE_H265D
{ MPP_CTX_DEC, MPP_VIDEO_CodingHEVC, "dec", "h.265/HEVC", }, { MPP_CTX_DEC, MPP_VIDEO_CodingHEVC, "dec", "h.265/HEVC", },
#endif
#if HAVE_VP8D
{ MPP_CTX_DEC, MPP_VIDEO_CodingVP8, "dec", "vp8", }, { MPP_CTX_DEC, MPP_VIDEO_CodingVP8, "dec", "vp8", },
#endif
#if HAVE_VP9D
{ MPP_CTX_DEC, MPP_VIDEO_CodingVP9, "dec", "VP9", }, { MPP_CTX_DEC, MPP_VIDEO_CodingVP9, "dec", "VP9", },
#endif
#if HAVE_AVSD
{ MPP_CTX_DEC, MPP_VIDEO_CodingAVS, "dec", "avs+", }, { MPP_CTX_DEC, MPP_VIDEO_CodingAVS, "dec", "avs+", },
#endif
#if HAVE_JPEGD
{ MPP_CTX_DEC, MPP_VIDEO_CodingMJPEG, "dec", "jpeg", }, { MPP_CTX_DEC, MPP_VIDEO_CodingMJPEG, "dec", "jpeg", },
#endif
#if HAVE_H264E
{ MPP_CTX_ENC, MPP_VIDEO_CodingAVC, "enc", "h.264/AVC", }, { MPP_CTX_ENC, MPP_VIDEO_CodingAVC, "enc", "h.264/AVC", },
#endif
#if HAVE_JPEGE
{ MPP_CTX_ENC, MPP_VIDEO_CodingMJPEG, "enc", "jpeg", }, { MPP_CTX_ENC, MPP_VIDEO_CodingMJPEG, "enc", "jpeg", },
#endif
}; };
#define check_mpp_ctx(ctx) _check_mpp_ctx(ctx, __FUNCTION__) #define check_mpp_ctx(ctx) _check_mpp_ctx(ctx, __FUNCTION__)

View File

@@ -24,19 +24,25 @@ endmacro()
add_mpp_test(mpp_info) add_mpp_test(mpp_info)
# h264 decoder test # h264 decoder test
include_directories(../codec/dec/h264) if( HAVE_H264D )
add_mpp_test(h264d) include_directories(../codec/dec/h264)
add_mpp_test(h264d)
endif()
# vp9 decoder test # vp9 decoder test
include_directories(../codec/dec/vp9) if( HAVE_VP9D )
add_mpp_test(vp9d) include_directories(../codec/dec/vp9)
add_mpp_test(vp9d)
endif()
if (${HAVE_AVSD}) if( HAVE_AVSD )
# avs decoder test # avs decoder test
include_directories(../codec/dec/avs) include_directories(../codec/dec/avs)
add_mpp_test(avsd) add_mpp_test(avsd)
endif() endif()
# jpeg decoder test # jpeg decoder test
include_directories(../codec/dec/jpeg) if( HAVE_JPEGD )
add_mpp_test(jpegd) include_directories(../codec/dec/jpeg)
add_mpp_test(jpegd)
endif()