diff --git a/build/linux/arm/make-Makefiles.bash b/build/linux/arm/make-Makefiles.bash index 36476262..816296ca 100755 --- a/build/linux/arm/make-Makefiles.bash +++ b/build/linux/arm/make-Makefiles.bash @@ -1,6 +1,7 @@ #!/bin/bash # Run this from within a bash shell -cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_TOOLCHAIN_FILE=./arm.linux.cross.cmake \ - -DCMAKE_RKPLATFORM_ENABLE=ON \ +cmake -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_TOOLCHAIN_FILE=./arm.linux.cross.cmake \ + -DCMAKE_RKPLATFORM_ENABLE=ON \ + -G "Unix Makefiles" \ ../../../ && cmake --build . diff --git a/mpp/CMakeLists.txt b/mpp/CMakeLists.txt index 24b29de0..3ea77821 100644 --- a/mpp/CMakeLists.txt +++ b/mpp/CMakeLists.txt @@ -1,4 +1,12 @@ # vim: syntax=cmake +# ---------------------------------------------------------------------------- +# setup mpp codec config first +# ---------------------------------------------------------------------------- +include(codecs.cmake) + +# ---------------------------------------------------------------------------- +# add include directory +# ---------------------------------------------------------------------------- include_directories(.) include_directories(common) include_directories(base/inc) diff --git a/mpp/codec/CMakeLists.txt b/mpp/codec/CMakeLists.txt index dc3b088c..460ad78a 100644 --- a/mpp/codec/CMakeLists.txt +++ b/mpp/codec/CMakeLists.txt @@ -9,6 +9,7 @@ add_library(mpp_codec STATIC mpp_dec.cpp mpp_parser.cpp ) + set_target_properties(mpp_codec PROPERTIES FOLDER "mpp/codec") add_subdirectory(dec) @@ -17,16 +18,16 @@ add_subdirectory(enc) target_link_libraries(mpp_codec ${CODEC_AVSD} - codec_h263d - codec_h264d - codec_h265d - codec_m2vd - codec_mpg4d - codec_vp8d - codec_vp9d - codec_jpegd - codec_h264e - codec_jpege + ${CODEC_H263D} + ${CODEC_H264D} + ${CODEC_H265D} + ${CODEC_MPEG2D} + ${CODEC_MPEG4D} + ${CODEC_VP8D} + ${CODEC_VP9D} + ${CODEC_JPEGD} + ${CODEC_H264E} + ${CODEC_JPEGE} codec_dummy_enc codec_dummy_dec mpp_base) diff --git a/mpp/codec/dec/CMakeLists.txt b/mpp/codec/dec/CMakeLists.txt index 8cd42d5b..2fe36c7a 100644 --- a/mpp/codec/dec/CMakeLists.txt +++ b/mpp/codec/dec/CMakeLists.txt @@ -2,25 +2,38 @@ add_subdirectory(dummy) -if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/avs") - set(HAVE_AVSD true) - set(CODEC_AVSD codec_avsd) - add_definitions(-DHAVE_AVSD) +if( HAVE_AVSD ) add_subdirectory(avs) 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() diff --git a/mpp/codec/dec/h263/CMakeLists.txt b/mpp/codec/dec/h263/CMakeLists.txt index 2bc38704..7bff5391 100644 --- a/mpp/codec/dec/h263/CMakeLists.txt +++ b/mpp/codec/dec/h263/CMakeLists.txt @@ -8,9 +8,10 @@ set(H263D_PARSER_SRC h263d_parser.c ) -add_library(codec_h263d STATIC - ${H263D_PARSER_SRC} ${H263D_PARSER_HDR} +add_library(${CODEC_H263D} STATIC + ${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) diff --git a/mpp/codec/dec/h264/CMakeLists.txt b/mpp/codec/dec/h264/CMakeLists.txt index 4072577e..f090e4d4 100644 --- a/mpp/codec/dec/h264/CMakeLists.txt +++ b/mpp/codec/dec/h264/CMakeLists.txt @@ -3,54 +3,53 @@ include_directories(.) # h264 decoder api set(H264D_API - ../../inc/h264d_api.h - ) + ../../inc/h264d_api.h + ) + set(H264D_COMMON - ../../../common/h264d_log.h - ../../../common/h264d_syntax.h - ) - -# h264 decoder header + ../../../common/h264d_log.h + ../../../common/h264d_syntax.h + ) + +# h264 decoder header set(H264D_HDR - h264d_global.h - h264d_parse.h - h264d_slice.h - h264d_sps.h - h264d_pps.h - h264d_scalist.h - h264d_sei.h - h264d_dpb.h - h264d_init.h - h264d_fill.h - h264d_rwfile.h - - ) - + h264d_global.h + h264d_parse.h + h264d_slice.h + h264d_sps.h + h264d_pps.h + h264d_scalist.h + h264d_sei.h + h264d_dpb.h + h264d_init.h + h264d_fill.h + h264d_rwfile.h + ) + # h264 decoder sourse set(H264D_SRC - h264d_api.c - h264d_log.c - h264d_parse.c - h264d_slice.c - h264d_sps.c - h264d_pps.c - h264d_scalist.c - h264d_sei.c - h264d_dpb.c - h264d_init.c - h264d_fill.c - h264d_rwfile.c - - ) + h264d_api.c + h264d_log.c + h264d_parse.c + h264d_slice.c + h264d_sps.c + h264d_pps.c + h264d_scalist.c + h264d_sei.c + h264d_dpb.c + h264d_init.c + h264d_fill.c + h264d_rwfile.c + ) - -add_library(codec_h264d STATIC - ${H264D_API} - ${H264D_COMMON} - ${H264D_HDR} - ${H264D_SRC} - ) -target_link_libraries(codec_h264d mpp_base) -set_target_properties(codec_h264d PROPERTIES FOLDER "mpp/codec") +add_library(${CODEC_H264D} STATIC + ${H264D_API} + ${H264D_COMMON} + ${H264D_HDR} + ${H264D_SRC} + ) + +target_link_libraries(${CODEC_H264D} mpp_base) +set_target_properties(${CODEC_H264D} PROPERTIES FOLDER "mpp/codec") diff --git a/mpp/codec/dec/h265/CMakeLists.txt b/mpp/codec/dec/h265/CMakeLists.txt index 73bc149c..70fee87e 100644 --- a/mpp/codec/dec/h265/CMakeLists.txt +++ b/mpp/codec/dec/h265/CMakeLists.txt @@ -12,12 +12,13 @@ set(H265D_PARSER_SRC h265d_sei.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") - -target_link_libraries(codec_h265d mpp_base) +set_target_properties(${CODEC_H265D} PROPERTIES FOLDER "mpp/codec") +target_link_libraries(${CODEC_H265D} mpp_base) add_subdirectory(test) diff --git a/mpp/codec/dec/jpeg/CMakeLists.txt b/mpp/codec/dec/jpeg/CMakeLists.txt index 64f0dcc1..499f4bac 100644 --- a/mpp/codec/dec/jpeg/CMakeLists.txt +++ b/mpp/codec/dec/jpeg/CMakeLists.txt @@ -6,12 +6,13 @@ set(JPEGD_PARSER_HDR set(JPEGD_PARSER_SRC 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") - -target_link_libraries(codec_jpegd mpp_base) +set_target_properties(${CODEC_JPEGD} PROPERTIES FOLDER "mpp/codec") +target_link_libraries(${CODEC_JPEGD} mpp_base) #add_subdirectory(test) diff --git a/mpp/codec/dec/m2v/CMakeLists.txt b/mpp/codec/dec/m2v/CMakeLists.txt index 03e06c8c..963c3d30 100644 --- a/mpp/codec/dec/m2v/CMakeLists.txt +++ b/mpp/codec/dec/m2v/CMakeLists.txt @@ -3,33 +3,31 @@ include_directories(.) # m2v decoder api set(M2VD_API - ../../inc/m2vd_api.h - ) + ../../inc/m2vd_api.h + ) + set(M2VD_COMMON - ) - -# m2v decoder header + ) + +# m2v decoder header set(M2VD_HDR - m2vd_parser.h - m2vd_codec.h - m2vd_com.h - ) - + m2vd_parser.h + m2vd_codec.h + m2vd_com.h + ) + # m2v decoder source set(M2VD_SRC - m2vd_api.c - m2vd_parser.c -) + m2vd_api.c + m2vd_parser.c + ) - -add_library(codec_m2vd STATIC - ${M2VD_API} - ${M2VD_COMMON} - ${M2VD_HDR} - ${M2VD_SRC} - ) -target_link_libraries(codec_m2vd - mpp_base - ) -set_target_properties(codec_m2vd PROPERTIES FOLDER "mpp/codec") +add_library(${CODEC_MPEG2D} STATIC + ${M2VD_API} + ${M2VD_COMMON} + ${M2VD_HDR} + ${M2VD_SRC} + ) +target_link_libraries(${CODEC_MPEG2D} mpp_base) +set_target_properties(${CODEC_MPEG2D} PROPERTIES FOLDER "mpp/codec") diff --git a/mpp/codec/dec/mpg4/CMakeLists.txt b/mpp/codec/dec/mpg4/CMakeLists.txt index aa22b321..6cdf2152 100644 --- a/mpp/codec/dec/mpg4/CMakeLists.txt +++ b/mpp/codec/dec/mpg4/CMakeLists.txt @@ -8,9 +8,10 @@ set(MPG4D_PARSER_SRC mpg4d_parser.c ) -add_library(codec_mpg4d STATIC - ${MPG4D_PARSER_SRC} ${MPG4D_PARSER_HDR} +add_library(${CODEC_MPEG4D} STATIC + ${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) diff --git a/mpp/codec/dec/vp8/CMakeLists.txt b/mpp/codec/dec/vp8/CMakeLists.txt index d58ef1ce..6ae3abdc 100644 --- a/mpp/codec/dec/vp8/CMakeLists.txt +++ b/mpp/codec/dec/vp8/CMakeLists.txt @@ -3,27 +3,26 @@ include_directories(.) #vp8 decoder api set(VP8D_API - ../../inc/vp8d_api.h - ) - -#vp8 decoder header + ../../inc/vp8d_api.h + ) + +#vp8 decoder header set(VP8D_HDR - vp8d_parser.h - vp8d_codec.h - ) - + vp8d_parser.h + vp8d_codec.h + ) + #vp8 decoder source set(VP8D_SRC - vp8d_api.c - vp8d_parser.c -) - -add_library(codec_vp8d STATIC - ${VP8D_API} - ${VP8D_HDR} - ${VP8D_SRC} - ) + vp8d_api.c + vp8d_parser.c + ) -target_link_libraries(codec_vp8d mpp_base) -set_target_properties(codec_vp8d PROPERTIES FOLDER "mpp/codec") +add_library(${CODEC_VP8D} STATIC + ${VP8D_API} + ${VP8D_HDR} + ${VP8D_SRC} + ) +target_link_libraries(${CODEC_VP8D} mpp_base) +set_target_properties(${CODEC_VP8D} PROPERTIES FOLDER "mpp/codec") diff --git a/mpp/codec/dec/vp9/CMakeLists.txt b/mpp/codec/dec/vp9/CMakeLists.txt index ee719dfd..cc35b942 100644 --- a/mpp/codec/dec/vp9/CMakeLists.txt +++ b/mpp/codec/dec/vp9/CMakeLists.txt @@ -3,33 +3,26 @@ include_directories(.) # vp9 decoder api set(VP9_D_API - ../../inc/vp9d_api.h - ) + ../../inc/vp9d_api.h + ) - -# h264 decoder header +# vp9 decoder header set(VP9D_HDR + ) - - - - ) - -# h264 decoder sourse +# vp9 decoder sourse set(VP9D_SRC vp9d_api.c vp9d_parser.c vpx_rac.c - vp9d_parser2_syntax.c - ) + vp9d_parser2_syntax.c + ) - -add_library(codec_vp9d STATIC - ${VP9D_API} - ${VP9D_HDR} - ${VP9D_SRC} - ) - -target_link_libraries(codec_vp9d mpp_base) -set_target_properties(codec_vp9d PROPERTIES FOLDER "mpp/codec") +add_library(${CODEC_VP9D} STATIC + ${VP9D_API} + ${VP9D_HDR} + ${VP9D_SRC} + ) +target_link_libraries(${CODEC_VP9D} mpp_base) +set_target_properties(${CODEC_VP9D} PROPERTIES FOLDER "mpp/codec") diff --git a/mpp/codec/enc/h264/CMakeLists.txt b/mpp/codec/enc/h264/CMakeLists.txt index 030c1de9..c19d6a6a 100644 --- a/mpp/codec/enc/h264/CMakeLists.txt +++ b/mpp/codec/enc/h264/CMakeLists.txt @@ -4,59 +4,57 @@ include_directories(include) # h264 encoder api set(H264E_API -# ../../inc/h264d_api.h - ) + ) set(H264E_COMMON -# ../../../common/h264d_log.h -# ../../../common/h264d_syntax.h - ) - -# h264 encoder header + ) + +# h264 encoder header set(H264E_HDR - include/H264CodeFrame.h - include/H264Init.h - include/H264Instance.h - include/H264Mad.h - include/H264NalUnit.h - include/H264PictureParameterSet.h - include/H264PutBits.h - include/H264RateControl.h - include/H264Sei.h - include/H264SequenceParameterSet.h - include/H264Slice.h - include/encasiccontroller.h - include/enccommon.h - include/encpreprocess.h - include/h264encapi.h - include/h264e_codec.h - include/h264e_utils.h - ) - + include/H264CodeFrame.h + include/H264Init.h + include/H264Instance.h + include/H264Mad.h + include/H264NalUnit.h + include/H264PictureParameterSet.h + include/H264PutBits.h + include/H264RateControl.h + include/H264Sei.h + include/H264SequenceParameterSet.h + include/H264Slice.h + include/encasiccontroller.h + include/enccommon.h + include/encpreprocess.h + include/h264encapi.h + include/h264e_codec.h + include/h264e_utils.h + ) + # h264 encoder sourse set(H264E_SRC - src/H264CodeFrame.c - src/H264EncApi.c - src/H264Init.c - src/H264Mad.c - src/H264NalUnit.c - src/H264PictureParameterSet.c - src/H264PutBits.c - src/H264RateControl.c - src/H264Sei.c - src/H264SequenceParameterSet.c - src/H264Slice.c - src/encasiccontroller.c - src/encpreprocess.c - src/h264e_api.c - src/h264e_utils.c - ) + src/H264CodeFrame.c + src/H264EncApi.c + src/H264Init.c + src/H264Mad.c + src/H264NalUnit.c + src/H264PictureParameterSet.c + src/H264PutBits.c + src/H264RateControl.c + src/H264Sei.c + src/H264SequenceParameterSet.c + src/H264Slice.c + src/encasiccontroller.c + src/encpreprocess.c + src/h264e_api.c + src/h264e_utils.c + ) - -add_library(codec_h264e STATIC - ${H264E_API} - ${H264E_COMMON} - ${H264E_HDR} - ${H264E_SRC} - ) -target_link_libraries(codec_h264e mpp_base) -set_target_properties(codec_h264e PROPERTIES FOLDER "mpp/codec") + +add_library(${CODEC_H264E} STATIC + ${H264E_API} + ${H264E_COMMON} + ${H264E_HDR} + ${H264E_SRC} + ) + +target_link_libraries(${CODEC_H264E} mpp_base) +set_target_properties(${CODEC_H264E} PROPERTIES FOLDER "mpp/codec") diff --git a/mpp/codec/enc/jpeg/CMakeLists.txt b/mpp/codec/enc/jpeg/CMakeLists.txt index 4d143ddc..749c0976 100644 --- a/mpp/codec/enc/jpeg/CMakeLists.txt +++ b/mpp/codec/enc/jpeg/CMakeLists.txt @@ -1,9 +1,9 @@ # vim: syntax=cmake include_directories(.) -add_library(codec_jpege STATIC +add_library(${CODEC_JPEGE} STATIC jpege_api.c ) -target_link_libraries(codec_jpege mpp_base) -set_target_properties(codec_jpege PROPERTIES FOLDER "mpp/codec") +target_link_libraries(${CODEC_JPEGE} mpp_base) +set_target_properties(${CODEC_JPEGE} PROPERTIES FOLDER "mpp/codec") diff --git a/mpp/codec/mpp_controller.cpp b/mpp/codec/mpp_controller.cpp index 707f519d..ec4baa8d 100644 --- a/mpp/codec/mpp_controller.cpp +++ b/mpp/codec/mpp_controller.cpp @@ -28,8 +28,12 @@ * all decoder static register here */ static const ControlApi *controllers[] = { +#if HAVE_H264E &api_h264e_controller, +#endif +#if HAVE_JPEGE &api_jpege_controller, +#endif }; typedef struct ControllerImpl_t { diff --git a/mpp/codec/mpp_parser.cpp b/mpp/codec/mpp_parser.cpp index d133f1c1..33208c6d 100644 --- a/mpp/codec/mpp_parser.cpp +++ b/mpp/codec/mpp_parser.cpp @@ -43,14 +43,30 @@ static const ParserApi *parsers[] = { #if HAVE_AVSD &api_avsd_parser, #endif +#if HAVE_H263D &api_h263d_parser, +#endif +#if HAVE_H264D &api_h264d_parser, +#endif +#if HAVE_H265D &api_h265d_parser, +#endif +#if HAVE_MPEG2D &api_m2vd_parser, +#endif +#if HAVE_MPEG4D &api_mpg4d_parser, +#endif +#if HAVE_VP8D &api_vp8d_parser, +#endif +#if HAVE_VP9D &api_vp9d_parser, +#endif +#if HAVE_JPEGD &api_jpegd_parser, +#endif &dummy_dec_parser, }; diff --git a/mpp/codecs.cmake b/mpp/codecs.cmake new file mode 100644 index 00000000..cbb8c7b7 --- /dev/null +++ b/mpp/codecs.cmake @@ -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() diff --git a/mpp/hal/CMakeLists.txt b/mpp/hal/CMakeLists.txt index 18b26bd0..2c52840e 100644 --- a/mpp/hal/CMakeLists.txt +++ b/mpp/hal/CMakeLists.txt @@ -1,6 +1,15 @@ # vim: syntax=cmake 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 # ---------------------------------------------------------------------------- @@ -12,30 +21,6 @@ add_library(mpp_hal STATIC 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 # ---------------------------------------------------------------------------- @@ -46,19 +31,18 @@ if(RKPLATFORM) set(RKPLAT_VPU worker_vpu) endif(RKPLATFORM) - target_link_libraries(mpp_hal - hal_avsd - hal_h263d - hal_h264d - hal_h265d - hal_m2vd - hal_mpg4d - hal_vp8d - hal_vp9d - hal_jpegd - hal_h264e - hal_jpege + ${HAL_AVSD} + ${HAL_H263D} + ${HAL_H264D} + ${HAL_H265D} + ${HAL_MPEG2D} + ${HAL_MPEG4D} + ${HAL_VP8D} + ${HAL_VP9D} + ${HAL_JPEGD} + ${HAL_H264E} + ${HAL_JPEGE} hal_dummy ${RKPLAT_VPU} ) diff --git a/mpp/hal/mpp_hal.cpp b/mpp/hal/mpp_hal.cpp index 09a9b085..cd2e2555 100644 --- a/mpp/hal/mpp_hal.cpp +++ b/mpp/hal/mpp_hal.cpp @@ -45,15 +45,33 @@ * all hardware api static register here */ static const MppHalApi *hw_apis[] = { +#if HAVE_AVSD &hal_api_avsd, +#endif +#if HAVE_H263D &hal_api_h263d, +#endif +#if HAVE_H264D &hal_api_h264d, +#endif +#if HAVE_H265D &hal_api_h265d, +#endif +#if HAVE_MPEG2D &hal_api_m2vd, +#endif +#if HAVE_MPEG4D &hal_api_mpg4d, +#endif +#if HAVE_VP8D &hal_api_vp8d, +#endif +#if HAVE_VP9D &hal_api_vp9d, +#endif +#if HAVE_JPEGD &hal_api_jpegd, +#endif &hal_api_h264e, &hal_api_jpege, &hal_api_dummy_dec, diff --git a/mpp/hal/rkdec/CMakeLists.txt b/mpp/hal/rkdec/CMakeLists.txt new file mode 100644 index 00000000..459264df --- /dev/null +++ b/mpp/hal/rkdec/CMakeLists.txt @@ -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() diff --git a/mpp/hal/rkdec/h265d/CMakeLists.txt b/mpp/hal/rkdec/h265d/CMakeLists.txt index 901b2777..ad5e8c9e 100644 --- a/mpp/hal/rkdec/h265d/CMakeLists.txt +++ b/mpp/hal/rkdec/h265d/CMakeLists.txt @@ -10,12 +10,12 @@ set(HAL_H265D_SRC hal_h265d_reg.c ) -add_library(hal_h265d STATIC - ${HAL_H265D_SRC} ${HAL_H265D_HDR} +add_library(${HAL_H265D} STATIC + ${HAL_H265D_SRC} + ${HAL_H265D_HDR} ) -set_target_properties(hal_h265d PROPERTIES FOLDER "mpp/hal") - - target_link_libraries(hal_h265d mpp_base) +set_target_properties(${HAL_H265D} PROPERTIES FOLDER "mpp/hal") +target_link_libraries(${HAL_H265D} mpp_base) #add_subdirectory(test) diff --git a/mpp/hal/rkenc/CMakeLists.txt b/mpp/hal/rkenc/CMakeLists.txt new file mode 100644 index 00000000..3db50940 --- /dev/null +++ b/mpp/hal/rkenc/CMakeLists.txt @@ -0,0 +1,2 @@ +# vim: syntax=cmake +add_subdirectory(h264e) diff --git a/mpp/hal/vpu/CMakeLists.txt b/mpp/hal/vpu/CMakeLists.txt new file mode 100644 index 00000000..6b00d7fa --- /dev/null +++ b/mpp/hal/vpu/CMakeLists.txt @@ -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() diff --git a/mpp/hal/vpu/jpege/CMakeLists.txt b/mpp/hal/vpu/jpege/CMakeLists.txt index 11403c65..c232ae9f 100644 --- a/mpp/hal/vpu/jpege/CMakeLists.txt +++ b/mpp/hal/vpu/jpege/CMakeLists.txt @@ -2,16 +2,17 @@ # hal jpeg reg set(HAL_JPEGE_HDR - ) + ) set(HAL_JPEGE_SRC hal_jpege_hdr.c hal_jpege_api.c ) -add_library(hal_jpege STATIC - ${HAL_JPEGE_SRC} ${HAL_JPEGE_HDR} +add_library(${HAL_JPEGE} STATIC + ${HAL_JPEGE_SRC} + ${HAL_JPEGE_HDR} ) -set_target_properties(hal_jpege PROPERTIES FOLDER "mpp/hal") -target_link_libraries(hal_jpege mpp_base) +set_target_properties(${HAL_JPEGE} PROPERTIES FOLDER "mpp/hal") +target_link_libraries(${HAL_JPEGE} mpp_base) diff --git a/mpp/hal/vpu/m2vd/CMakeLists.txt b/mpp/hal/vpu/m2vd/CMakeLists.txt index a9f925ea..e600fde5 100644 --- a/mpp/hal/vpu/m2vd/CMakeLists.txt +++ b/mpp/hal/vpu/m2vd/CMakeLists.txt @@ -1,32 +1,29 @@ -# vim: syntax=cmake +#vim: syntax=cmake include_directories(.) -# hal m2v decoder api +#hal m2v decoder api set(HAL_M2VD_API - ../../inc/hal_m2vd_api.h - ../../../common/m2vd_syntax.h - ) + ../../inc/hal_m2vd_api.h + ../../../common/m2vd_syntax.h + ) - -# hal m2v header +#hal m2v header set(HAL_M2VD_HDR - hal_m2vd_reg.h - ) - -# hal m2v decoder sourse + hal_m2vd_reg.h + ) + +#hal m2v decoder sourse set(HAL_M2VD_SRC - hal_m2vd_api.c - hal_m2vd_reg.c - ) - -add_library(hal_m2vd STATIC - ${HAL_M2VD_API} - ${HAL_M2VD_HDR} - ${HAL_M2VD_SRC} - ) - + hal_m2vd_api.c + hal_m2vd_reg.c + ) -target_link_libraries(hal_m2vd mpp_base) +add_library(${HAL_MPEG2D} STATIC + ${HAL_M2VD_API} + ${HAL_M2VD_HDR} + ${HAL_M2VD_SRC} + ) -set_target_properties(hal_m2vd PROPERTIES FOLDER "mpp/hal") +target_link_libraries(${HAL_MPEG2D} mpp_base) +set_target_properties(${HAL_MPEG2D} PROPERTIES FOLDER "mpp/hal") diff --git a/mpp/hal/vpu/mpg4d/CMakeLists.txt b/mpp/hal/vpu/mpg4d/CMakeLists.txt index a690fa91..af39d57f 100644 --- a/mpp/hal/vpu/mpg4d/CMakeLists.txt +++ b/mpp/hal/vpu/mpg4d/CMakeLists.txt @@ -2,17 +2,18 @@ # hal mpeg4 reg set(HAL_MPEG4D_HDR - ) + ) set(HAL_MPEG4D_SRC hal_mpg4d_reg.c ) -add_library(hal_mpg4d STATIC - ${HAL_MPEG4D_SRC} ${HAL_MPEG4D_HDR} +add_library(${HAL_MPEG4D} STATIC + ${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) diff --git a/mpp/mpi.cpp b/mpp/mpi.cpp index 2988e3d9..1f12ca43 100644 --- a/mpp/mpi.cpp +++ b/mpp/mpi.cpp @@ -35,17 +35,39 @@ typedef struct { } MppCodingTypeInfo; static MppCodingTypeInfo support_list[] = { +#if HAVE_MPEG2D { MPP_CTX_DEC, MPP_VIDEO_CodingMPEG2, "dec", "mpeg2", }, +#endif +#if HAVE_MPEG4D { MPP_CTX_DEC, MPP_VIDEO_CodingMPEG4, "dec", "mpeg4", }, +#endif +#if HAVE_H263D { MPP_CTX_DEC, MPP_VIDEO_CodingH263, "dec", "h.263", }, +#endif +#if HAVE_H264D { MPP_CTX_DEC, MPP_VIDEO_CodingAVC, "dec", "h.264/AVC", }, +#endif +#if HAVE_H265D { MPP_CTX_DEC, MPP_VIDEO_CodingHEVC, "dec", "h.265/HEVC", }, +#endif +#if HAVE_VP8D { MPP_CTX_DEC, MPP_VIDEO_CodingVP8, "dec", "vp8", }, +#endif +#if HAVE_VP9D { MPP_CTX_DEC, MPP_VIDEO_CodingVP9, "dec", "VP9", }, +#endif +#if HAVE_AVSD { MPP_CTX_DEC, MPP_VIDEO_CodingAVS, "dec", "avs+", }, +#endif +#if HAVE_JPEGD { MPP_CTX_DEC, MPP_VIDEO_CodingMJPEG, "dec", "jpeg", }, +#endif +#if HAVE_H264E { MPP_CTX_ENC, MPP_VIDEO_CodingAVC, "enc", "h.264/AVC", }, +#endif +#if HAVE_JPEGE { MPP_CTX_ENC, MPP_VIDEO_CodingMJPEG, "enc", "jpeg", }, +#endif }; #define check_mpp_ctx(ctx) _check_mpp_ctx(ctx, __FUNCTION__) diff --git a/mpp/test/CMakeLists.txt b/mpp/test/CMakeLists.txt index 1e71c2a6..f5e07e5a 100644 --- a/mpp/test/CMakeLists.txt +++ b/mpp/test/CMakeLists.txt @@ -14,7 +14,7 @@ macro(add_mpp_test module) if(${test_tag}) add_executable(${test_name} ${test_name}.c) target_link_libraries(${test_name} mpp_shared) - set_target_properties(${test_name} PROPERTIES FOLDER "mpp/test") + set_target_properties(${test_name} PROPERTIES FOLDER "mpp/test") install(TARGETS ${test_name} RUNTIME DESTINATION ${TEST_INSTALL_DIR}) #add_test(NAME ${test_name} COMMAND ${test_name}) endif() @@ -24,19 +24,25 @@ endmacro() add_mpp_test(mpp_info) # h264 decoder test -include_directories(../codec/dec/h264) -add_mpp_test(h264d) +if( HAVE_H264D ) + include_directories(../codec/dec/h264) + add_mpp_test(h264d) +endif() # vp9 decoder test -include_directories(../codec/dec/vp9) -add_mpp_test(vp9d) +if( HAVE_VP9D ) + include_directories(../codec/dec/vp9) + add_mpp_test(vp9d) +endif() -if (${HAVE_AVSD}) +if( HAVE_AVSD ) # avs decoder test include_directories(../codec/dec/avs) add_mpp_test(avsd) endif() # jpeg decoder test -include_directories(../codec/dec/jpeg) -add_mpp_test(jpegd) +if( HAVE_JPEGD ) + include_directories(../codec/dec/jpeg) + add_mpp_test(jpegd) +endif()