diff --git a/mpp/CMakeLists.txt b/mpp/CMakeLists.txt index a9d1da7b..0032f988 100644 --- a/mpp/CMakeLists.txt +++ b/mpp/CMakeLists.txt @@ -1,30 +1,30 @@ # vim: syntax=cmake include_directories(.) include_directories(common) +include_directories(base/inc) include_directories(codec/inc) include_directories(hal/inc) +# ---------------------------------------------------------------------------- +# add mpp base component +# ---------------------------------------------------------------------------- +add_subdirectory(base) + # ---------------------------------------------------------------------------- # add codec parsers # ---------------------------------------------------------------------------- add_subdirectory(codec) - # ---------------------------------------------------------------------------- # add register generation hal # ---------------------------------------------------------------------------- add_subdirectory(hal) - # ---------------------------------------------------------------------------- # add mpp implement # ---------------------------------------------------------------------------- set (MPP_SRC mpp_info.cpp - mpp_buffer_impl.cpp - mpp_buffer.cpp - mpp_packet.cpp - mpp_frame.cpp mpp.cpp mpi_impl.cpp mpi.cpp @@ -33,7 +33,7 @@ set (MPP_SRC add_library(mpp STATIC ${MPP_SRC}) set_target_properties(mpp PROPERTIES FOLDER "mpp") set_target_properties(mpp PROPERTIES CLEAN_DIRECT_OUTPUT 1) -target_link_libraries(mpp mpp_codec mpp_hal osal) +target_link_libraries(mpp mpp_base mpp_codec mpp_hal) add_library(mpp_shared SHARED ${MPP_SRC}) set_target_properties(mpp_shared PROPERTIES FOLDER "mpp") diff --git a/mpp/base/CMakeLists.txt b/mpp/base/CMakeLists.txt new file mode 100644 index 00000000..65accf24 --- /dev/null +++ b/mpp/base/CMakeLists.txt @@ -0,0 +1,20 @@ +# vim: syntax=cmake + +# ---------------------------------------------------------------------------- +# add mpp basic components +# ---------------------------------------------------------------------------- +add_library(mpp_base STATIC + mpp_buf_slot.cpp + mpp_buffer_impl.cpp + mpp_buffer.cpp + mpp_packet.cpp + mpp_frame.cpp + mpp_bitread.c + mpp_bitput.c + ) + +set_target_properties(mpp_base PROPERTIES FOLDER "mpp/base") + +target_link_libraries(mpp_base osal) + + diff --git a/mpp/mpp_bitput.h b/mpp/base/inc/mpp_bitput.h similarity index 100% rename from mpp/mpp_bitput.h rename to mpp/base/inc/mpp_bitput.h diff --git a/mpp/mpp_bitread.h b/mpp/base/inc/mpp_bitread.h similarity index 100% rename from mpp/mpp_bitread.h rename to mpp/base/inc/mpp_bitread.h diff --git a/mpp/codec/inc/mpp_buf_slot.h b/mpp/base/inc/mpp_buf_slot.h similarity index 100% rename from mpp/codec/inc/mpp_buf_slot.h rename to mpp/base/inc/mpp_buf_slot.h diff --git a/mpp/mpp_buffer_impl.h b/mpp/base/inc/mpp_buffer_impl.h similarity index 100% rename from mpp/mpp_buffer_impl.h rename to mpp/base/inc/mpp_buffer_impl.h diff --git a/mpp/mpp_frame_impl.h b/mpp/base/inc/mpp_frame_impl.h similarity index 100% rename from mpp/mpp_frame_impl.h rename to mpp/base/inc/mpp_frame_impl.h diff --git a/mpp/mpp_packet_impl.h b/mpp/base/inc/mpp_packet_impl.h similarity index 100% rename from mpp/mpp_packet_impl.h rename to mpp/base/inc/mpp_packet_impl.h diff --git a/mpp/mpp_bitput.c b/mpp/base/mpp_bitput.c similarity index 100% rename from mpp/mpp_bitput.c rename to mpp/base/mpp_bitput.c diff --git a/mpp/mpp_bitread.c b/mpp/base/mpp_bitread.c similarity index 100% rename from mpp/mpp_bitread.c rename to mpp/base/mpp_bitread.c diff --git a/mpp/codec/mpp_buf_slot.cpp b/mpp/base/mpp_buf_slot.cpp similarity index 100% rename from mpp/codec/mpp_buf_slot.cpp rename to mpp/base/mpp_buf_slot.cpp diff --git a/mpp/mpp_buffer.cpp b/mpp/base/mpp_buffer.cpp similarity index 100% rename from mpp/mpp_buffer.cpp rename to mpp/base/mpp_buffer.cpp diff --git a/mpp/mpp_buffer_impl.cpp b/mpp/base/mpp_buffer_impl.cpp similarity index 100% rename from mpp/mpp_buffer_impl.cpp rename to mpp/base/mpp_buffer_impl.cpp diff --git a/mpp/mpp_frame.cpp b/mpp/base/mpp_frame.cpp similarity index 100% rename from mpp/mpp_frame.cpp rename to mpp/base/mpp_frame.cpp diff --git a/mpp/mpp_packet.cpp b/mpp/base/mpp_packet.cpp similarity index 100% rename from mpp/mpp_packet.cpp rename to mpp/base/mpp_packet.cpp diff --git a/mpp/codec/CMakeLists.txt b/mpp/codec/CMakeLists.txt index a5fa94fa..7fcd7ad5 100644 --- a/mpp/codec/CMakeLists.txt +++ b/mpp/codec/CMakeLists.txt @@ -4,7 +4,6 @@ # add mpp_dec implement # ---------------------------------------------------------------------------- add_library(mpp_codec STATIC - mpp_buf_slot.cpp mpp_enc.cpp mpp_dec.cpp mpp_parser.cpp @@ -18,9 +17,9 @@ add_subdirectory(enc) target_link_libraries(mpp_codec codec_h264d - codec_vp9d - codec_h265d - codec_avsd + codec_vp9d + codec_h265d + codec_avsd codec_dummy_enc codec_dummy_dec mpp) diff --git a/mpp/codec/dec/h265/CMakeLists.txt b/mpp/codec/dec/h265/CMakeLists.txt index f48a3969..793759d3 100644 --- a/mpp/codec/dec/h265/CMakeLists.txt +++ b/mpp/codec/dec/h265/CMakeLists.txt @@ -6,7 +6,6 @@ set(H265D_PARSER_HDR ) set(H265D_PARSER_SRC - ../../../mpp_bitread.c h265d_parser.c h265d_ps.c h265d_refs.c @@ -17,8 +16,9 @@ set(H265D_PARSER_SRC 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 osal) +target_link_libraries(codec_h265d mpp_base) add_subdirectory(test) diff --git a/mpp/hal/rkdec/h265d/CMakeLists.txt b/mpp/hal/rkdec/h265d/CMakeLists.txt index ff2bfea4..2090c62f 100644 --- a/mpp/hal/rkdec/h265d/CMakeLists.txt +++ b/mpp/hal/rkdec/h265d/CMakeLists.txt @@ -4,24 +4,22 @@ set(HAL_H265D_HDR hal_h265d_reg.h cabac.h - ../../../common/h265d_syntax.h ) set(HAL_H265D_SRC hal_h265d_reg.c - ../../../mpp_bitread.c - ../../../mpp_bitput.c ) add_library(hal_h265d STATIC ${HAL_H265D_SRC} ${HAL_H265D_HDR} ) + set_target_properties(hal_h265d PROPERTIES FOLDER "mpp/hal") -if(ANDROID) - target_link_libraries(hal_h265d vpu osal) +if(WIN32) + target_link_libraries(hal_h265d mpp_base) else() - target_link_libraries(hal_h265d osal) + target_link_libraries(hal_h265d vpu mpp_base) endif() #add_subdirectory(test) diff --git a/mpp/hal/rkdec/vp9d/CMakeLists.txt b/mpp/hal/rkdec/vp9d/CMakeLists.txt index cf6075f1..3f5f2841 100644 --- a/mpp/hal/rkdec/vp9d/CMakeLists.txt +++ b/mpp/hal/rkdec/vp9d/CMakeLists.txt @@ -3,7 +3,6 @@ # hal vp9 decoder api set(HAL_VP9D_API ../../inc/hal_vp9d_api.h - ../../../common/vp9d_syntax.h ) @@ -15,7 +14,6 @@ set(HAL_VP9D_HDR # hal vp9 decoder sourse set(HAL_VP9D_SRC hal_vp9d_api.c - ../../../mpp_bitput.c ) add_library(hal_vp9d STATIC @@ -23,10 +21,11 @@ add_library(hal_vp9d STATIC ${HAL_VP9D_HDR} ${HAL_VP9D_SRC} ) -if(ANDROID) - target_link_libraries(hal_vp9d vpu osal) + +if(WIN32) + target_link_libraries(hal_vp9d base) else() - target_link_libraries(hal_vp9d osal) + target_link_libraries(hal_vp9d vpu mpp_base) endif() set_target_properties(hal_vp9d PROPERTIES FOLDER "mpp/hal")