From ea476ad4d1c66f5ab187aa03d924ec9fc8f5609f Mon Sep 17 00:00:00 2001 From: Herman Chen Date: Mon, 14 Oct 2019 19:45:46 +0800 Subject: [PATCH] [misc]: Change internal API interface 1. Change internal api RK_S32 cmd to MpiCmd. 2. Remove external MppEncCfgSet in MPI and move it internal data. Change-Id: I0b93429f3b9f92712a57d0df54a1c76b3e08bf9d Signed-off-by: Herman Chen --- inc/rk_venc_cmd.h | 27 ------------ mpp/codec/dec/avs/avsd_api.c | 2 +- mpp/codec/dec/dummy/dummy_dec_api.c | 2 +- mpp/codec/dec/h263/h263d_api.c | 2 +- mpp/codec/dec/h264/h264d_api.c | 2 +- mpp/codec/dec/h265/h265d_parser.c | 11 ++--- mpp/codec/dec/jpeg/jpegd_parser.c | 6 +-- mpp/codec/dec/m2v/m2vd_parser.c | 2 +- mpp/codec/dec/m2v/m2vd_parser.h | 2 +- mpp/codec/dec/mpg4/mpg4d_api.c | 2 +- mpp/codec/dec/vp8/vp8d_parser.c | 2 +- mpp/codec/dec/vp8/vp8d_parser.h | 2 +- mpp/codec/dec/vp9/vp9d_api.c | 20 +-------- mpp/codec/dec/vp9/vp9d_codec.h | 3 +- mpp/codec/enc/h264/h264e_api.c | 2 +- mpp/codec/enc/h265/h265e_api.c | 2 +- mpp/codec/enc/jpeg/jpege_api.c | 2 +- mpp/codec/enc/vp8/vp8e_api.c | 2 +- mpp/codec/enc/vp8/vp8e_rc.h | 1 + mpp/codec/inc/avsd_api.h | 3 +- mpp/codec/inc/dummy_dec_api.h | 2 +- mpp/codec/inc/enc_impl_api.h | 6 ++- mpp/codec/inc/h264d_api.h | 2 +- mpp/codec/inc/h265d_api.h | 2 +- mpp/codec/inc/mpp_enc_impl.h | 2 +- mpp/codec/inc/mpp_parser.h | 2 +- mpp/codec/inc/parser_api.h | 3 +- mpp/codec/inc/vp9d_api.h | 2 +- mpp/codec/mpp_enc_impl.cpp | 2 +- mpp/codec/mpp_parser.cpp | 2 +- mpp/common/jpegd_syntax.h | 2 + mpp/hal/common/h264/hal_h264e_api.c | 2 +- mpp/hal/common/h265/hal_h265e_api.c | 2 +- mpp/hal/dummy/hal_dummy_dec_api.c | 2 +- mpp/hal/dummy/hal_dummy_enc_api.c | 2 +- mpp/hal/inc/hal_avsd_api.h | 12 ------ mpp/hal/inc/hal_h263d_api.h | 11 ----- mpp/hal/inc/hal_h264d_api.h | 2 +- mpp/hal/inc/hal_h264e_api.h | 4 +- mpp/hal/inc/hal_h265d_api.h | 2 +- mpp/hal/inc/hal_jpegd_api.h | 2 +- mpp/hal/inc/hal_m2vd_api.h | 2 +- mpp/hal/inc/hal_mpg4d_api.h | 2 +- mpp/hal/inc/hal_task.h | 3 +- mpp/hal/inc/hal_vp9d_api.h | 2 +- mpp/hal/inc/mpp_hal.h | 9 ++-- mpp/hal/mpp_hal.cpp | 2 +- mpp/hal/rkdec/avsd/hal_avsd_api.c | 44 +++---------------- mpp/hal/rkdec/h264d/hal_h264d_api.c | 2 +- mpp/hal/rkdec/h264d/hal_h264d_rkv_reg.c | 2 +- mpp/hal/rkdec/h264d/hal_h264d_rkv_reg.h | 2 +- mpp/hal/rkdec/h264d/hal_h264d_vdpu1.c | 2 +- mpp/hal/rkdec/h264d/hal_h264d_vdpu1.h | 2 +- mpp/hal/rkdec/h264d/hal_h264d_vdpu2.c | 2 +- mpp/hal/rkdec/h264d/hal_h264d_vdpu2.h | 2 +- mpp/hal/rkdec/h265d/hal_h265d_reg.c | 2 +- mpp/hal/rkdec/vp9d/hal_vp9d_api.c | 2 +- mpp/hal/rkenc/h264e/hal_h264e_rkv.c | 2 +- mpp/hal/rkenc/h264e/hal_h264e_rkv.h | 2 +- mpp/hal/vpu/h263d/hal_h263d_api.c | 2 +- mpp/hal/vpu/h263d/hal_h263d_vdpu1.c | 2 +- mpp/hal/vpu/h263d/hal_h263d_vdpu1.h | 2 +- mpp/hal/vpu/h263d/hal_h263d_vdpu2.c | 2 +- mpp/hal/vpu/h263d/hal_h263d_vdpu2.h | 2 +- mpp/hal/vpu/h264e/hal_h264e_vepu1.c | 2 +- mpp/hal/vpu/h264e/hal_h264e_vepu1.h | 2 +- mpp/hal/vpu/h264e/hal_h264e_vepu2.c | 2 +- mpp/hal/vpu/h264e/hal_h264e_vepu2.h | 2 +- mpp/hal/vpu/h265e/hal_h265e_vepu22.c | 6 ++- mpp/hal/vpu/h265e/hal_h265e_vepu22.h | 2 +- mpp/hal/vpu/jpegd/hal_jpegd_api.c | 2 +- mpp/hal/vpu/jpegd/hal_jpegd_vdpu1.c | 2 +- mpp/hal/vpu/jpegd/hal_jpegd_vdpu1.h | 2 +- mpp/hal/vpu/jpegd/hal_jpegd_vdpu2.c | 2 +- mpp/hal/vpu/jpegd/hal_jpegd_vdpu2.h | 2 +- mpp/hal/vpu/jpege/hal_jpege_api.c | 2 +- mpp/hal/vpu/jpege/hal_jpege_vepu1.c | 2 +- mpp/hal/vpu/jpege/hal_jpege_vepu1.h | 23 ++++++++-- mpp/hal/vpu/jpege/hal_jpege_vepu2.c | 2 +- mpp/hal/vpu/jpege/hal_jpege_vepu2.h | 7 ++-- mpp/hal/vpu/m2vd/hal_m2vd_api.c | 2 +- mpp/hal/vpu/m2vd/hal_m2vd_vdpu1.c | 2 +- mpp/hal/vpu/m2vd/hal_m2vd_vdpu2.c | 2 +- mpp/hal/vpu/m2vd/hal_m2vd_vpu1.h | 2 +- mpp/hal/vpu/m2vd/hal_m2vd_vpu2.h | 2 +- mpp/hal/vpu/mpg4d/hal_m4vd_api.c | 2 +- mpp/hal/vpu/mpg4d/hal_m4vd_vdpu1.c | 2 +- mpp/hal/vpu/mpg4d/hal_m4vd_vdpu1.h | 2 +- mpp/hal/vpu/mpg4d/hal_m4vd_vdpu2.c | 2 +- mpp/hal/vpu/mpg4d/hal_m4vd_vdpu2.h | 2 +- mpp/hal/vpu/vp8d/hal_vp8d_api.c | 56 ++++++++++++++++++------- mpp/hal/vpu/vp8d/hal_vp8d_vdpu1.c | 32 -------------- mpp/hal/vpu/vp8d/hal_vp8d_vdpu1.h | 4 +- mpp/hal/vpu/vp8d/hal_vp8d_vdpu2.c | 32 -------------- mpp/hal/vpu/vp8d/hal_vp8d_vdpu2.h | 4 +- mpp/hal/vpu/vp8e/hal_vp8e_api.c | 2 +- mpp/hal/vpu/vp8e/hal_vp8e_vepu1.c | 2 +- mpp/hal/vpu/vp8e/hal_vp8e_vepu1.h | 4 +- mpp/hal/vpu/vp8e/hal_vp8e_vepu2.c | 2 +- mpp/hal/vpu/vp8e/hal_vp8e_vepu2.h | 2 +- mpp/inc/mpp_enc_cfg.h | 49 ++++++++++++++++++++++ mpp/legacy/vpu_api_legacy.cpp | 10 +++-- test/mpi_rc_test.c | 10 +++-- 103 files changed, 249 insertions(+), 303 deletions(-) create mode 100644 mpp/inc/mpp_enc_cfg.h diff --git a/inc/rk_venc_cmd.h b/inc/rk_venc_cmd.h index 8291c5a0..2dc8e7c1 100644 --- a/inc/rk_venc_cmd.h +++ b/inc/rk_venc_cmd.h @@ -984,31 +984,4 @@ typedef struct MppEncOSDData_t { MppEncOSDRegion region[8]; } MppEncOSDData; -typedef struct MppEncMiscCfg_t { - MppEncSliceSplit split; - MppEncGopRef gop_ref; - MppEncROICfg roi; - MppEncOSDData osd_data; - MppEncOSDPlt osd_plt; -} MppEncMiscCfg; - -/* - * MppEncCfgSet shows the relationship between different configuration - * Due to the huge amount of configurable parameters we need to setup - * only minimum amount of necessary parameters. - * - * For normal user rc and prep config are enough. - */ -typedef struct MppEncCfgSet_t { - // esential config - MppEncPrepCfg prep; - MppEncRcCfg rc; - - // codec detail config - MppEncCodecCfg codec; - - // misc extra config - MppEncMiscCfg misc; -} MppEncCfgSet; - #endif /*__RK_VENC_CMD_H__*/ diff --git a/mpp/codec/dec/avs/avsd_api.c b/mpp/codec/dec/avs/avsd_api.c index e17c2970..582ed685 100644 --- a/mpp/codec/dec/avs/avsd_api.c +++ b/mpp/codec/dec/avs/avsd_api.c @@ -163,7 +163,7 @@ MPP_RET avsd_flush(void *decoder) * control/perform *********************************************************************** */ -MPP_RET avsd_control(void *decoder, RK_S32 cmd_type, void *param) +MPP_RET avsd_control(void *decoder, MpiCmd cmd_type, void *param) { MPP_RET ret = MPP_ERR_UNKNOW; diff --git a/mpp/codec/dec/dummy/dummy_dec_api.c b/mpp/codec/dec/dummy/dummy_dec_api.c index 66030a1d..ae54923e 100644 --- a/mpp/codec/dec/dummy/dummy_dec_api.c +++ b/mpp/codec/dec/dummy/dummy_dec_api.c @@ -125,7 +125,7 @@ MPP_RET dummy_dec_flush(void *dec) } -MPP_RET dummy_dec_control(void *dec, RK_S32 cmd_type, void *param) +MPP_RET dummy_dec_control(void *dec, MpiCmd cmd_type, void *param) { if (NULL == dec) { mpp_err_f("found NULL intput\n"); diff --git a/mpp/codec/dec/h263/h263d_api.c b/mpp/codec/dec/h263/h263d_api.c index 9331c8d5..80a42ebf 100644 --- a/mpp/codec/dec/h263/h263d_api.c +++ b/mpp/codec/dec/h263/h263d_api.c @@ -157,7 +157,7 @@ MPP_RET h263d_flush(void *dec) } -MPP_RET h263d_control(void *dec, RK_S32 cmd_type, void *param) +MPP_RET h263d_control(void *dec, MpiCmd cmd_type, void *param) { if (NULL == dec) { mpp_err_f("found NULL intput\n"); diff --git a/mpp/codec/dec/h264/h264d_api.c b/mpp/codec/dec/h264/h264d_api.c index 18369704..77f31368 100644 --- a/mpp/codec/dec/h264/h264d_api.c +++ b/mpp/codec/dec/h264/h264d_api.c @@ -467,7 +467,7 @@ __FAILED: * control/perform *********************************************************************** */ -MPP_RET h264d_control(void *decoder, RK_S32 cmd_type, void *param) +MPP_RET h264d_control(void *decoder, MpiCmd cmd_type, void *param) { MPP_RET ret = MPP_ERR_UNKNOW; H264_DecCtx_t *dec = (H264_DecCtx_t *)decoder; diff --git a/mpp/codec/dec/h265/h265d_parser.c b/mpp/codec/dec/h265/h265d_parser.c index d13647c7..0b5f6258 100644 --- a/mpp/codec/dec/h265/h265d_parser.c +++ b/mpp/codec/dec/h265/h265d_parser.c @@ -27,12 +27,13 @@ #define MODULE_TAG "H265D_PARSER" -#include "mpp_bitread.h" -#include "h265d_parser.h" -#include "mpp_mem.h" #include "mpp_env.h" -#include "h265d_syntax.h" +#include "mpp_mem.h" +#include "mpp_bitread.h" #include "mpp_packet_impl.h" + +#include "h265d_parser.h" +#include "h265d_syntax.h" #include "h265d_api.h" #define START_CODE 0x000001 ///< start_code_prefix_one_3bytes @@ -1988,7 +1989,7 @@ MPP_RET h265d_reset(void *ctx) return MPP_OK; } -MPP_RET h265d_control(void *ctx, RK_S32 cmd, void *param) +MPP_RET h265d_control(void *ctx, MpiCmd cmd, void *param) { H265dContext_t *h265dctx = (H265dContext_t *)ctx; diff --git a/mpp/codec/dec/jpeg/jpegd_parser.c b/mpp/codec/dec/jpeg/jpegd_parser.c index 2b2a194b..e532bce5 100644 --- a/mpp/codec/dec/jpeg/jpegd_parser.c +++ b/mpp/codec/dec/jpeg/jpegd_parser.c @@ -17,9 +17,9 @@ #define MODULE_TAG "jpegd_parser" -#include "mpp_bitread.h" -#include "mpp_mem.h" #include "mpp_env.h" +#include "mpp_mem.h" +#include "mpp_bitread.h" #include "mpp_packet_impl.h" #include "jpegd_api.h" @@ -1347,7 +1347,7 @@ static MPP_RET jpegd_reset(void *ctx) return MPP_OK; } -static MPP_RET jpegd_control(void *ctx, RK_S32 cmd, void *param) +static MPP_RET jpegd_control(void *ctx, MpiCmd cmd, void *param) { jpegd_dbg_func("enter\n"); MPP_RET ret = MPP_OK; diff --git a/mpp/codec/dec/m2v/m2vd_parser.c b/mpp/codec/dec/m2v/m2vd_parser.c index 903712c6..b2aa35a3 100755 --- a/mpp/codec/dec/m2v/m2vd_parser.c +++ b/mpp/codec/dec/m2v/m2vd_parser.c @@ -370,7 +370,7 @@ MPP_RET m2vd_parser_flush(void *ctx) * control/perform *********************************************************************** */ -MPP_RET m2vd_parser_control(void *ctx, RK_S32 cmd_type, void *param) +MPP_RET m2vd_parser_control(void *ctx, MpiCmd cmd_type, void *param) { MPP_RET ret = MPP_OK; m2vd_dbg_func("FUN_I"); diff --git a/mpp/codec/dec/m2v/m2vd_parser.h b/mpp/codec/dec/m2v/m2vd_parser.h index 399c7c9c..5a0d0eea 100644 --- a/mpp/codec/dec/m2v/m2vd_parser.h +++ b/mpp/codec/dec/m2v/m2vd_parser.h @@ -298,7 +298,7 @@ MPP_RET m2vd_parser_init (void *ctx, ParserCfg *cfg); MPP_RET m2vd_parser_deinit (void *ctx); MPP_RET m2vd_parser_reset (void *ctx); MPP_RET m2vd_parser_flush (void *ctx); -MPP_RET m2vd_parser_control(void *ctx, RK_S32 cmd_type, void *param); +MPP_RET m2vd_parser_control(void *ctx, MpiCmd cmd_type, void *param); MPP_RET m2vd_parser_prepare(void *ctx, MppPacket pkt, HalDecTask *task); MPP_RET m2vd_parser_parse (void *ctx, HalDecTask *task); MPP_RET m2vd_parser_callback(void *ctx, void *err_info); diff --git a/mpp/codec/dec/mpg4/mpg4d_api.c b/mpp/codec/dec/mpg4/mpg4d_api.c index bab24c5a..20652d36 100644 --- a/mpp/codec/dec/mpg4/mpg4d_api.c +++ b/mpp/codec/dec/mpg4/mpg4d_api.c @@ -160,7 +160,7 @@ static MPP_RET mpg4d_flush(void *dec) return mpp_mpg4_parser_flush(p->parser); } -static MPP_RET mpg4d_control(void *dec, RK_S32 cmd_type, void *param) +static MPP_RET mpg4d_control(void *dec, MpiCmd cmd_type, void *param) { if (NULL == dec) { mpp_err_f("found NULL intput\n"); diff --git a/mpp/codec/dec/vp8/vp8d_parser.c b/mpp/codec/dec/vp8/vp8d_parser.c index 1f9d306e..854cfaa0 100644 --- a/mpp/codec/dec/vp8/vp8d_parser.c +++ b/mpp/codec/dec/vp8/vp8d_parser.c @@ -368,7 +368,7 @@ MPP_RET vp8d_parser_flush(void *ctx) * control/perform *********************************************************************** */ -MPP_RET vp8d_parser_control(void *ctx, RK_S32 cmd_type, void *param) +MPP_RET vp8d_parser_control(void *ctx, MpiCmd cmd_type, void *param) { MPP_RET ret = MPP_OK; diff --git a/mpp/codec/dec/vp8/vp8d_parser.h b/mpp/codec/dec/vp8/vp8d_parser.h index 143be04b..70b8d7e2 100644 --- a/mpp/codec/dec/vp8/vp8d_parser.h +++ b/mpp/codec/dec/vp8/vp8d_parser.h @@ -186,7 +186,7 @@ MPP_RET vp8d_parser_init (void *ctx, ParserCfg *cfg); MPP_RET vp8d_parser_deinit (void *ctx); MPP_RET vp8d_parser_reset (void *ctx); MPP_RET vp8d_parser_flush (void *ctx); -MPP_RET vp8d_parser_control(void *ctx, RK_S32 cmd_type, void *param); +MPP_RET vp8d_parser_control(void *ctx, MpiCmd cmd_type, void *param); MPP_RET vp8d_parser_prepare(void *ctx, MppPacket pkt, HalDecTask *task); MPP_RET vp8d_parser_parse (void *ctx, HalDecTask *task); MPP_RET vp8d_parser_callback(void *ctx, void *hal_info); diff --git a/mpp/codec/dec/vp9/vp9d_api.c b/mpp/codec/dec/vp9/vp9d_api.c index c985ca26..1d67c352 100644 --- a/mpp/codec/dec/vp9/vp9d_api.c +++ b/mpp/codec/dec/vp9/vp9d_api.c @@ -124,24 +124,6 @@ MPP_RET vp9d_flush(void *ctx) return ret = MPP_OK; } -/*! -*********************************************************************** -* \brief -* control/perform -*********************************************************************** -*/ -MPP_RET vp9d_control(void *ctx, RK_S32 cmd_type, void *param) -{ - MPP_RET ret = MPP_ERR_UNKNOW; - - (void)ctx; - (void)cmd_type; - (void)param; - - return ret = MPP_OK; -} - - /*! *********************************************************************** * \brief @@ -240,7 +222,7 @@ const ParserApi api_vp9d_parser = { .parse = vp9d_parse, .reset = vp9d_reset, .flush = vp9d_flush, - .control = vp9d_control, + .control = NULL, .callback = vp9d_callback, }; diff --git a/mpp/codec/dec/vp9/vp9d_codec.h b/mpp/codec/dec/vp9/vp9d_codec.h index a6122780..895e7da2 100644 --- a/mpp/codec/dec/vp9/vp9d_codec.h +++ b/mpp/codec/dec/vp9/vp9d_codec.h @@ -17,8 +17,7 @@ #ifndef __VP9D_CODEC_H__ #define __VP9D_CODEC_H__ -#include - +#include "mpp_frame.h" #include "hal_task.h" #include "vp9d_syntax.h" diff --git a/mpp/codec/enc/h264/h264e_api.c b/mpp/codec/enc/h264/h264e_api.c index 73c757f6..b3b765be 100644 --- a/mpp/codec/enc/h264/h264e_api.c +++ b/mpp/codec/enc/h264/h264e_api.c @@ -194,7 +194,7 @@ MPP_RET h264e_flush(void *ctx) return MPP_OK; } -MPP_RET h264e_config(void *ctx, RK_S32 cmd, void *param) +MPP_RET h264e_config(void *ctx, MpiCmd cmd, void *param) { MPP_RET ret = MPP_OK; H264eCtx *p = (H264eCtx *)ctx; diff --git a/mpp/codec/enc/h265/h265e_api.c b/mpp/codec/enc/h265/h265e_api.c index 2a655074..f7030b77 100644 --- a/mpp/codec/enc/h265/h265e_api.c +++ b/mpp/codec/enc/h265/h265e_api.c @@ -153,7 +153,7 @@ MPP_RET h265e_flush(void *ctx) return MPP_OK; } -MPP_RET h265e_config(void *ctx, RK_S32 cmd, void *param) +MPP_RET h265e_config(void *ctx, MpiCmd cmd, void *param) { H265eCtx *p = (H265eCtx *)ctx; MPP_RET ret = MPP_NOK; diff --git a/mpp/codec/enc/jpeg/jpege_api.c b/mpp/codec/enc/jpeg/jpege_api.c index be3c9f5f..fa00bf0f 100644 --- a/mpp/codec/enc/jpeg/jpege_api.c +++ b/mpp/codec/enc/jpeg/jpege_api.c @@ -112,7 +112,7 @@ static MPP_RET jpege_flush(void *ctx) return MPP_OK; } -static MPP_RET jpege_config(void *ctx, RK_S32 cmd, void *param) +static MPP_RET jpege_config(void *ctx, MpiCmd cmd, void *param) { MPP_RET ret = MPP_OK; diff --git a/mpp/codec/enc/vp8/vp8e_api.c b/mpp/codec/enc/vp8/vp8e_api.c index 11747a1c..e7ec6468 100644 --- a/mpp/codec/enc/vp8/vp8e_api.c +++ b/mpp/codec/enc/vp8/vp8e_api.c @@ -182,7 +182,7 @@ MPP_RET vp8e_flush(void *ctx) return MPP_OK; } -MPP_RET vp8e_config(void *ctx, RK_S32 cmd, void *param) +MPP_RET vp8e_config(void *ctx, MpiCmd cmd, void *param) { MPP_RET ret = MPP_OK; Vp8eCtx *p = (Vp8eCtx *)ctx; diff --git a/mpp/codec/enc/vp8/vp8e_rc.h b/mpp/codec/enc/vp8/vp8e_rc.h index f6e535df..4b55358c 100644 --- a/mpp/codec/enc/vp8/vp8e_rc.h +++ b/mpp/codec/enc/vp8/vp8e_rc.h @@ -17,6 +17,7 @@ #ifndef __VP8E_RC_H__ #define __VP8E_RC_H__ +#include "mpp_enc_cfg.h" #include "vp8e_syntax.h" #ifdef __cplusplus diff --git a/mpp/codec/inc/avsd_api.h b/mpp/codec/inc/avsd_api.h index 7990fa91..d3063fb2 100644 --- a/mpp/codec/inc/avsd_api.h +++ b/mpp/codec/inc/avsd_api.h @@ -19,7 +19,6 @@ #include "parser_api.h" - #ifdef __cplusplus extern "C" { #endif @@ -29,7 +28,7 @@ MPP_RET avsd_init (void *decoder, ParserCfg *cfg); MPP_RET avsd_deinit (void *decoder); MPP_RET avsd_reset (void *decoder); MPP_RET avsd_flush (void *decoder); -MPP_RET avsd_control(void *decoder, RK_S32 cmd_type, void *param); +MPP_RET avsd_control(void *decoder, MpiCmd cmd_type, void *param); MPP_RET avsd_prepare(void *decoder, MppPacket pkt, HalDecTask *task); MPP_RET avsd_parse (void *decoder, HalDecTask *task); MPP_RET avsd_callback(void *decoder, void *err_info); diff --git a/mpp/codec/inc/dummy_dec_api.h b/mpp/codec/inc/dummy_dec_api.h index c49a9001..fae12d61 100644 --- a/mpp/codec/inc/dummy_dec_api.h +++ b/mpp/codec/inc/dummy_dec_api.h @@ -29,7 +29,7 @@ MPP_RET dummy_dec_init (void *dec, ParserCfg *cfg); MPP_RET dummy_dec_deinit (void *dec); MPP_RET dummy_dec_reset (void *dec); MPP_RET dummy_dec_flush (void *dec); -MPP_RET dummy_dec_control(void *dec, RK_S32 cmd_type, void *param); +MPP_RET dummy_dec_control(void *dec, MpiCmd cmd_type, void *param); MPP_RET dummy_dec_prepare(void *dec, MppPacket pkt, HalDecTask *task); MPP_RET dummy_dec_parse (void *dec, HalDecTask *task); MPP_RET dummy_dec_callback(void *dec, void *err_info); diff --git a/mpp/codec/inc/enc_impl_api.h b/mpp/codec/inc/enc_impl_api.h index 5c734d11..c1f9c1c7 100644 --- a/mpp/codec/inc/enc_impl_api.h +++ b/mpp/codec/inc/enc_impl_api.h @@ -17,7 +17,11 @@ #ifndef __ENC_IMPL_API_H__ #define __ENC_IMPL_API_H__ +#include "rk_mpi_cmd.h" + +#include "mpp_platform.h" #include "hal_task.h" +#include "mpp_enc_cfg.h" /* * the reset wait for extension @@ -57,7 +61,7 @@ typedef struct EncImplApi_t { MPP_RET (*init)(void *ctx, EncImplCfg *ctrlCfg); MPP_RET (*deinit)(void *ctx); - MPP_RET (*proc_cfg)(void *ctx, RK_S32 cmd, void *param); + MPP_RET (*proc_cfg)(void *ctx, MpiCmd cmd, void *param); MPP_RET (*gen_hdr)(void *ctx, MppPacket pkt); MPP_RET (*proc_dpb)(void *ctx); diff --git a/mpp/codec/inc/h264d_api.h b/mpp/codec/inc/h264d_api.h index ccba3564..f9f3ddfb 100644 --- a/mpp/codec/inc/h264d_api.h +++ b/mpp/codec/inc/h264d_api.h @@ -37,7 +37,7 @@ MPP_RET h264d_init (void *decoder, ParserCfg *cfg); MPP_RET h264d_deinit (void *decoder); MPP_RET h264d_reset (void *decoder); MPP_RET h264d_flush (void *decoder); -MPP_RET h264d_control(void *decoder, RK_S32 cmd_type, void *param); +MPP_RET h264d_control(void *decoder, MpiCmd cmd_type, void *param); MPP_RET h264d_prepare(void *decoder, MppPacket pkt, HalDecTask *task); MPP_RET h264d_parse (void *decoder, HalDecTask *task); MPP_RET h264d_callback(void *decoder, void *err_info); diff --git a/mpp/codec/inc/h265d_api.h b/mpp/codec/inc/h265d_api.h index 2f56f9c5..83eaa729 100644 --- a/mpp/codec/inc/h265d_api.h +++ b/mpp/codec/inc/h265d_api.h @@ -30,7 +30,7 @@ MPP_RET h265d_parse(void *ctx, HalDecTask *task); MPP_RET h265d_deinit(void *ctx); MPP_RET h265d_flush(void *ctx); MPP_RET h265d_reset(void *ctx); -MPP_RET h265d_control(void *ctx, RK_S32 cmd, void *param); +MPP_RET h265d_control(void *ctx, MpiCmd cmd, void *param); MPP_RET h265d_callback(void *ctx, void *err_info); RK_S32 mpp_hevc_split_frame(void *sc, const RK_U8 **poutbuf, RK_S32 *poutbuf_size, diff --git a/mpp/codec/inc/mpp_enc_impl.h b/mpp/codec/inc/mpp_enc_impl.h index c4ba47e2..cfaa54f7 100644 --- a/mpp/codec/inc/mpp_enc_impl.h +++ b/mpp/codec/inc/mpp_enc_impl.h @@ -28,7 +28,7 @@ extern "C" { MPP_RET enc_impl_init(EncImpl *ctrl, EncImplCfg *cfg); MPP_RET enc_impl_deinit(EncImpl ctrl); -MPP_RET enc_impl_proc_cfg(EncImpl ctrl, RK_S32 cmd, void *para); +MPP_RET enc_impl_proc_cfg(EncImpl ctrl, MpiCmd cmd, void *para); MPP_RET enc_impl_gen_hdr(EncImpl ctrl, MppPacket pkt); MPP_RET enc_impl_proc_dpb(EncImpl ctrl); diff --git a/mpp/codec/inc/mpp_parser.h b/mpp/codec/inc/mpp_parser.h index aa797528..7a50d945 100644 --- a/mpp/codec/inc/mpp_parser.h +++ b/mpp/codec/inc/mpp_parser.h @@ -33,7 +33,7 @@ MPP_RET mpp_parser_parse(Parser prs, HalDecTask *task); MPP_RET mpp_parser_reset(Parser prs); MPP_RET mpp_parser_flush(Parser prs); -MPP_RET mpp_parser_control(Parser prs, RK_S32 cmd, void *para); +MPP_RET mpp_parser_control(Parser prs, MpiCmd cmd, void *para); MPP_RET mpp_hal_callback(void* prs, void *err_info); #ifdef __cplusplus diff --git a/mpp/codec/inc/parser_api.h b/mpp/codec/inc/parser_api.h index 9f2ce804..99efcdf6 100644 --- a/mpp/codec/inc/parser_api.h +++ b/mpp/codec/inc/parser_api.h @@ -17,6 +17,7 @@ #ifndef __PARSER_API_H__ #define __PARSER_API_H__ +#include "rk_mpi_cmd.h" #include "mpp_packet.h" #include "mpp_buf_slot.h" #include "hal_task.h" @@ -70,7 +71,7 @@ typedef struct ParserApi_t { MPP_RET (*reset)(void *ctx); MPP_RET (*flush)(void *ctx); - MPP_RET (*control)(void *ctx, RK_S32 cmd, void *param); + MPP_RET (*control)(void *ctx, MpiCmd cmd, void *param); MPP_RET (*callback)(void *ctx, void *err_info); } ParserApi; diff --git a/mpp/codec/inc/vp9d_api.h b/mpp/codec/inc/vp9d_api.h index 793be1d5..e5fc74ed 100644 --- a/mpp/codec/inc/vp9d_api.h +++ b/mpp/codec/inc/vp9d_api.h @@ -31,7 +31,7 @@ MPP_RET vp9d_init (void *decoder, ParserCfg *cfg); MPP_RET vp9d_deinit (void *decoder); MPP_RET vp9d_reset (void *decoder); MPP_RET vp9d_flush (void *decoder); -MPP_RET vp9d_control(void *decoder, RK_S32 cmd_type, void *param); +MPP_RET vp9d_control(void *decoder, MpiCmd cmd_type, void *param); MPP_RET vp9d_prepare(void *decoder, MppPacket pkt, HalDecTask *task); MPP_RET vp9d_parse (void *decoder, HalDecTask *task); MPP_RET vp9d_callback(void *decoder, void *info); diff --git a/mpp/codec/mpp_enc_impl.cpp b/mpp/codec/mpp_enc_impl.cpp index c9cb20b9..2dc960c1 100644 --- a/mpp/codec/mpp_enc_impl.cpp +++ b/mpp/codec/mpp_enc_impl.cpp @@ -106,7 +106,7 @@ MPP_RET enc_impl_deinit(EncImpl impl) return MPP_OK; } -MPP_RET enc_impl_proc_cfg(EncImpl impl, RK_S32 cmd, void *para) +MPP_RET enc_impl_proc_cfg(EncImpl impl, MpiCmd cmd, void *para) { if (NULL == impl) { mpp_err_f("found NULL input\n"); diff --git a/mpp/codec/mpp_parser.cpp b/mpp/codec/mpp_parser.cpp index 48bd12ef..6c9d894a 100644 --- a/mpp/codec/mpp_parser.cpp +++ b/mpp/codec/mpp_parser.cpp @@ -200,7 +200,7 @@ MPP_RET mpp_parser_flush(Parser prs) return p->api->flush(p->ctx); } -MPP_RET mpp_parser_control(Parser prs, RK_S32 cmd, void *para) +MPP_RET mpp_parser_control(Parser prs, MpiCmd cmd, void *para) { if (NULL == prs) { mpp_err_f("found NULL input\n"); diff --git a/mpp/common/jpegd_syntax.h b/mpp/common/jpegd_syntax.h index 7da381fb..aeda9173 100644 --- a/mpp/common/jpegd_syntax.h +++ b/mpp/common/jpegd_syntax.h @@ -18,6 +18,8 @@ #ifndef __JPEGD_SYNTAX__ #define __JPEGD_SYNTAX__ +#include "mpp_frame.h" + #define JPEGDEC_YUV400 (0) #define JPEGDEC_YUV420 (2) #define JPEGDEC_YUV422 (3) diff --git a/mpp/hal/common/h264/hal_h264e_api.c b/mpp/hal/common/h264/hal_h264e_api.c index f785a55c..0fd00033 100644 --- a/mpp/hal/common/h264/hal_h264e_api.c +++ b/mpp/hal/common/h264/hal_h264e_api.c @@ -180,7 +180,7 @@ MPP_RET hal_h264e_flush(void *hal) return api->flush(hal); } -MPP_RET hal_h264e_control(void *hal, RK_S32 cmd_type, void *param) +MPP_RET hal_h264e_control(void *hal, MpiCmd cmd_type, void *param) { H264eHalContext *ctx = (H264eHalContext *)hal; MppHalApi *api = &ctx->api; diff --git a/mpp/hal/common/h265/hal_h265e_api.c b/mpp/hal/common/h265/hal_h265e_api.c index 7bd8782b..f1c18616 100644 --- a/mpp/hal/common/h265/hal_h265e_api.c +++ b/mpp/hal/common/h265/hal_h265e_api.c @@ -112,7 +112,7 @@ MPP_RET hal_h265e_flush(void *hal) return ctx->hal_api.flush(hal); } -MPP_RET hal_h265e_control(void *hal, RK_S32 cmd_type, void *param) +MPP_RET hal_h265e_control(void *hal, MpiCmd cmd_type, void *param) { HalH265eCtx* ctx = (HalH265eCtx*)hal; return ctx->hal_api.control(hal, cmd_type, param); diff --git a/mpp/hal/dummy/hal_dummy_dec_api.c b/mpp/hal/dummy/hal_dummy_dec_api.c index 46254871..3dcafaa3 100644 --- a/mpp/hal/dummy/hal_dummy_dec_api.c +++ b/mpp/hal/dummy/hal_dummy_dec_api.c @@ -65,7 +65,7 @@ MPP_RET hal_dummy_dec_flush(void *hal) return MPP_OK; } -MPP_RET hal_dummy_dec_control(void *hal, RK_S32 cmd_type, void *param) +MPP_RET hal_dummy_dec_control(void *hal, MpiCmd cmd_type, void *param) { (void)hal; (void)cmd_type; diff --git a/mpp/hal/dummy/hal_dummy_enc_api.c b/mpp/hal/dummy/hal_dummy_enc_api.c index 71ae0f67..55928102 100644 --- a/mpp/hal/dummy/hal_dummy_enc_api.c +++ b/mpp/hal/dummy/hal_dummy_enc_api.c @@ -65,7 +65,7 @@ MPP_RET hal_dummy_enc_flush(void *hal) return MPP_OK; } -MPP_RET hal_dummy_enc_control(void *hal, RK_S32 cmd_type, void *param) +MPP_RET hal_dummy_enc_control(void *hal, MpiCmd cmd_type, void *param) { (void)hal; (void)cmd_type; diff --git a/mpp/hal/inc/hal_avsd_api.h b/mpp/hal/inc/hal_avsd_api.h index 3a37373d..df9ab275 100644 --- a/mpp/hal/inc/hal_avsd_api.h +++ b/mpp/hal/inc/hal_avsd_api.h @@ -19,26 +19,14 @@ #ifndef __HAL_AVSD_API_H__ #define __HAL_AVSD_API_H__ -#include "rk_type.h" -#include "mpp_err.h" #include "mpp_hal.h" - #ifdef __cplusplus extern "C" { #endif extern const MppHalApi hal_api_avsd; -MPP_RET hal_avsd_init (void *decoder, MppHalCfg *cfg); -MPP_RET hal_avsd_deinit (void *decoder); -MPP_RET hal_avsd_gen_regs(void *decoder, HalTaskInfo *task); -MPP_RET hal_avsd_start (void *decoder, HalTaskInfo *task); -MPP_RET hal_avsd_wait (void *decoder, HalTaskInfo *task); -MPP_RET hal_avsd_reset (void *decoder); -MPP_RET hal_avsd_flush (void *decoder); -MPP_RET hal_avsd_control (void *decoder, RK_S32 cmd_type, void *param); - #ifdef __cplusplus } #endif diff --git a/mpp/hal/inc/hal_h263d_api.h b/mpp/hal/inc/hal_h263d_api.h index 5121a8e0..decc0b64 100644 --- a/mpp/hal/inc/hal_h263d_api.h +++ b/mpp/hal/inc/hal_h263d_api.h @@ -18,8 +18,6 @@ #ifndef __HAL_H263D_API_H__ #define __HAL_H263D_API_H__ -#include "rk_type.h" -#include "mpp_err.h" #include "mpp_hal.h" #define H263D_HAL_DBG_REG_PUT (0x00000001) @@ -33,15 +31,6 @@ extern RK_U32 h263d_hal_debug; extern const MppHalApi hal_api_h263d; -MPP_RET hal_vpu_h263d_init(void *hal, MppHalCfg *cfg); -MPP_RET hal_vpu_h263d_gen_regs(void *hal, HalTaskInfo *syn); -MPP_RET hal_vpu_h263d_deinit(void *hal); -MPP_RET hal_vpu_h263d_start(void *hal, HalTaskInfo *task); -MPP_RET hal_vpu_h263d_wait(void *hal, HalTaskInfo *task); -MPP_RET hal_vpu_h263d_reset(void *hal); -MPP_RET hal_vpu_h263d_flush(void *hal); -MPP_RET hal_vpu_h263d_control(void *hal, RK_S32 cmd_type, void *param); - #ifdef __cplusplus } #endif diff --git a/mpp/hal/inc/hal_h264d_api.h b/mpp/hal/inc/hal_h264d_api.h index 492a7e9e..fe2e92d4 100644 --- a/mpp/hal/inc/hal_h264d_api.h +++ b/mpp/hal/inc/hal_h264d_api.h @@ -38,7 +38,7 @@ MPP_RET hal_h264d_start (void *hal, HalTaskInfo *task); MPP_RET hal_h264d_wait (void *hal, HalTaskInfo *task); MPP_RET hal_h264d_reset (void *hal); MPP_RET hal_h264d_flush (void *hal); -MPP_RET hal_h264d_control (void *hal, RK_S32 cmd_type, void *param); +MPP_RET hal_h264d_control (void *hal, MpiCmd cmd_type, void *param); #ifdef __cplusplus } diff --git a/mpp/hal/inc/hal_h264e_api.h b/mpp/hal/inc/hal_h264e_api.h index 8373a401..67f6ad47 100644 --- a/mpp/hal/inc/hal_h264e_api.h +++ b/mpp/hal/inc/hal_h264e_api.h @@ -32,10 +32,10 @@ MPP_RET hal_h264e_start (void *hal, HalTaskInfo *task); MPP_RET hal_h264e_wait (void *hal, HalTaskInfo *task); MPP_RET hal_h264e_reset (void *hal); MPP_RET hal_h264e_flush (void *hal); -MPP_RET hal_h264e_control (void *hal, RK_S32 cmd_type, void *param); +MPP_RET hal_h264e_control (void *hal, MpiCmd cmd_type, void *param); #ifdef __cplusplus } #endif -#endif \ No newline at end of file +#endif diff --git a/mpp/hal/inc/hal_h265d_api.h b/mpp/hal/inc/hal_h265d_api.h index 4a21dbda..3cbb58ce 100644 --- a/mpp/hal/inc/hal_h265d_api.h +++ b/mpp/hal/inc/hal_h265d_api.h @@ -38,7 +38,7 @@ MPP_RET hal_h265d_start(void *hal, HalTaskInfo *task); MPP_RET hal_h265d_wait(void *hal, HalTaskInfo *task); MPP_RET hal_h265d_reset(void *hal); MPP_RET hal_h265d_flush(void *hal); -MPP_RET hal_h265d_control(void *hal, RK_S32 cmd_type, void *param); +MPP_RET hal_h265d_control(void *hal, MpiCmd cmd_type, void *param); #ifdef __cplusplus } diff --git a/mpp/hal/inc/hal_jpegd_api.h b/mpp/hal/inc/hal_jpegd_api.h index ad0e8610..570e38ed 100644 --- a/mpp/hal/inc/hal_jpegd_api.h +++ b/mpp/hal/inc/hal_jpegd_api.h @@ -38,7 +38,7 @@ MPP_RET hal_jpegd_start(void *hal, HalTaskInfo *task); MPP_RET hal_jpegd_wait(void *hal, HalTaskInfo *task); MPP_RET hal_jpegd_reset(void *hal); MPP_RET hal_jpegd_flush(void *hal); -MPP_RET hal_jpegd_control(void *hal, RK_S32 cmd_type, void *param); +MPP_RET hal_jpegd_control(void *hal, MpiCmd cmd_type, void *param); #ifdef __cplusplus } diff --git a/mpp/hal/inc/hal_m2vd_api.h b/mpp/hal/inc/hal_m2vd_api.h index ae9ba9b1..90eef950 100644 --- a/mpp/hal/inc/hal_m2vd_api.h +++ b/mpp/hal/inc/hal_m2vd_api.h @@ -32,7 +32,7 @@ MPP_RET hal_m2vd_start (void *hal, HalTaskInfo *task); MPP_RET hal_m2vd_wait (void *hal, HalTaskInfo *task); MPP_RET hal_m2vd_reset (void *hal); MPP_RET hal_m2vd_flush (void *hal); -MPP_RET hal_m2vd_control (void *hal, RK_S32 cmd_type, void *param); +MPP_RET hal_m2vd_control (void *hal, MpiCmd cmd_type, void *param); #ifdef __cplusplus } diff --git a/mpp/hal/inc/hal_mpg4d_api.h b/mpp/hal/inc/hal_mpg4d_api.h index 1bd9c38b..c4967425 100644 --- a/mpp/hal/inc/hal_mpg4d_api.h +++ b/mpp/hal/inc/hal_mpg4d_api.h @@ -50,7 +50,7 @@ MPP_RET hal_vpu_mpg4d_start(void *hal, HalTaskInfo *task); MPP_RET hal_vpu_mpg4d_wait(void *hal, HalTaskInfo *task); MPP_RET hal_vpu_mpg4d_reset(void *hal); MPP_RET hal_vpu_mpg4d_flush(void *hal); -MPP_RET hal_vpu_mpg4d_control(void *hal, RK_S32 cmd_type, void *param); +MPP_RET hal_vpu_mpg4d_control(void *hal, MpiCmd cmd_type, void *param); #ifdef __cplusplus } diff --git a/mpp/hal/inc/hal_task.h b/mpp/hal/inc/hal_task.h index 464a8d6a..8430466d 100644 --- a/mpp/hal/inc/hal_task.h +++ b/mpp/hal/inc/hal_task.h @@ -18,7 +18,8 @@ #ifndef __HAL_TASK__ #define __HAL_TASK__ -#include "rk_mpi_cmd.h" +#include "rk_type.h" +#include "mpp_err.h" #define MAX_DEC_REF_NUM 17 diff --git a/mpp/hal/inc/hal_vp9d_api.h b/mpp/hal/inc/hal_vp9d_api.h index c79205e4..99c36dd4 100644 --- a/mpp/hal/inc/hal_vp9d_api.h +++ b/mpp/hal/inc/hal_vp9d_api.h @@ -34,7 +34,7 @@ MPP_RET hal_vp9d_start (void *hal, HalTaskInfo *task); MPP_RET hal_vp9d_wait (void *hal, HalTaskInfo *task); MPP_RET hal_vp9d_reset (void *hal); MPP_RET hal_vp9d_flush (void *hal); -MPP_RET hal_vp9d_control (void *hal, RK_S32 cmd_type, void *param); +MPP_RET hal_vp9d_control (void *hal, MpiCmd cmd_type, void *param); #ifdef __cplusplus } diff --git a/mpp/hal/inc/mpp_hal.h b/mpp/hal/inc/mpp_hal.h index ac53e40b..e38e81fb 100644 --- a/mpp/hal/inc/mpp_hal.h +++ b/mpp/hal/inc/mpp_hal.h @@ -17,9 +17,13 @@ #ifndef __MPP_HAL_H__ #define __MPP_HAL_H__ +#include "rk_mpi_cmd.h" + #include "mpp_buf_slot.h" #include "mpp_platform.h" + #include "hal_task.h" +#include "mpp_enc_cfg.h" typedef enum MppHalType_e { HAL_MODE_LIBVPU, @@ -36,7 +40,6 @@ typedef enum vpu_hard_mode_e { MODE_BUTT, } VpuHardMode; - typedef void* MppHalCtx; typedef struct MppHalCfg_t { @@ -77,7 +80,7 @@ typedef struct MppHalApi_t { MPP_RET (*reset)(void *ctx); MPP_RET (*flush)(void *ctx); - MPP_RET (*control)(void *ctx, RK_S32 cmd, void *param); + MPP_RET (*control)(void *ctx, MpiCmd cmd, void *param); } MppHalApi; typedef void* MppHal; @@ -95,7 +98,7 @@ MPP_RET mpp_hal_hw_wait(MppHal ctx, HalTaskInfo *task); MPP_RET mpp_hal_reset(MppHal ctx); MPP_RET mpp_hal_flush(MppHal ctx); -MPP_RET mpp_hal_control(MppHal ctx, RK_S32 cmd, void *param); +MPP_RET mpp_hal_control(MppHal ctx, MpiCmd cmd, void *param); #ifdef __cplusplus } diff --git a/mpp/hal/mpp_hal.cpp b/mpp/hal/mpp_hal.cpp index bf8922b2..1317b03d 100644 --- a/mpp/hal/mpp_hal.cpp +++ b/mpp/hal/mpp_hal.cpp @@ -230,7 +230,7 @@ MPP_RET mpp_hal_flush(MppHal ctx) return p->api->flush(p->ctx); } -MPP_RET mpp_hal_control(MppHal ctx, RK_S32 cmd, void *param) +MPP_RET mpp_hal_control(MppHal ctx, MpiCmd cmd, void *param) { if (NULL == ctx) { mpp_err_f("found NULL input\n"); diff --git a/mpp/hal/rkdec/avsd/hal_avsd_api.c b/mpp/hal/rkdec/avsd/hal_avsd_api.c index f9a858fe..668bb9ce 100644 --- a/mpp/hal/rkdec/avsd/hal_avsd_api.c +++ b/mpp/hal/rkdec/avsd/hal_avsd_api.c @@ -33,9 +33,11 @@ #include "hal_avsd_api.h" #include "hal_avsd_reg.h" - RK_U32 avsd_hal_debug = 0; +MPP_RET hal_avsd_start(void *decoder, HalTaskInfo *task); +MPP_RET hal_avsd_wait(void *decoder, HalTaskInfo *task); + static RK_U32 avsd_ver_align(RK_U32 val) { return MPP_ALIGN(val, 16); @@ -332,42 +334,6 @@ MPP_RET hal_avsd_reset(void *decoder) return ret = MPP_OK; } -/*! -*********************************************************************** -* \brief -* flush -*********************************************************************** -*/ -//extern "C" -MPP_RET hal_avsd_flush(void *decoder) -{ - MPP_RET ret = MPP_ERR_UNKNOW; - - AVSD_HAL_TRACE("In."); - - (void)decoder; - return ret = MPP_OK; -} -/*! -*********************************************************************** -* \brief -* control -*********************************************************************** -*/ -//extern "C" -MPP_RET hal_avsd_control(void *decoder, RK_S32 cmd_type, void *param) -{ - MPP_RET ret = MPP_ERR_UNKNOW; - - AVSD_HAL_TRACE("In."); - - (void)decoder; - (void)cmd_type; - (void)param; - - return ret = MPP_OK; -} - const MppHalApi hal_api_avsd = { .name = "avsd_rkdec", @@ -381,6 +347,6 @@ const MppHalApi hal_api_avsd = { .start = hal_avsd_start, .wait = hal_avsd_wait, .reset = hal_avsd_reset, - .flush = hal_avsd_flush, - .control = hal_avsd_control, + .flush = NULL, + .control = NULL, }; diff --git a/mpp/hal/rkdec/h264d/hal_h264d_api.c b/mpp/hal/rkdec/h264d/hal_h264d_api.c index d86653cb..649fb1db 100644 --- a/mpp/hal/rkdec/h264d/hal_h264d_api.c +++ b/mpp/hal/rkdec/h264d/hal_h264d_api.c @@ -295,7 +295,7 @@ MPP_RET hal_h264d_flush(void *hal) *********************************************************************** */ //extern "C" -MPP_RET hal_h264d_control(void *hal, RK_S32 cmd_type, void *param) +MPP_RET hal_h264d_control(void *hal, MpiCmd cmd_type, void *param) { H264dHalCtx_t *p_hal = (H264dHalCtx_t *)hal; diff --git a/mpp/hal/rkdec/h264d/hal_h264d_rkv_reg.c b/mpp/hal/rkdec/h264d/hal_h264d_rkv_reg.c index d556fb5d..55f4839f 100644 --- a/mpp/hal/rkdec/h264d/hal_h264d_rkv_reg.c +++ b/mpp/hal/rkdec/h264d/hal_h264d_rkv_reg.c @@ -812,7 +812,7 @@ __RETURN: *********************************************************************** */ //extern "C" -MPP_RET rkv_h264d_control(void *hal, RK_S32 cmd_type, void *param) +MPP_RET rkv_h264d_control(void *hal, MpiCmd cmd_type, void *param) { MPP_RET ret = MPP_ERR_UNKNOW; H264dHalCtx_t *p_hal = (H264dHalCtx_t *)hal; diff --git a/mpp/hal/rkdec/h264d/hal_h264d_rkv_reg.h b/mpp/hal/rkdec/h264d/hal_h264d_rkv_reg.h index 5fdf2379..8b9431dd 100644 --- a/mpp/hal/rkdec/h264d/hal_h264d_rkv_reg.h +++ b/mpp/hal/rkdec/h264d/hal_h264d_rkv_reg.h @@ -240,7 +240,7 @@ MPP_RET rkv_h264d_start (void *hal, HalTaskInfo *task); MPP_RET rkv_h264d_wait (void *hal, HalTaskInfo *task); MPP_RET rkv_h264d_reset (void *hal); MPP_RET rkv_h264d_flush (void *hal); -MPP_RET rkv_h264d_control (void *hal, RK_S32 cmd_type, void *param); +MPP_RET rkv_h264d_control (void *hal, MpiCmd cmd_type, void *param); #ifdef __cplusplus } diff --git a/mpp/hal/rkdec/h264d/hal_h264d_vdpu1.c b/mpp/hal/rkdec/h264d/hal_h264d_vdpu1.c index 9b6b7e3a..d15f35fa 100644 --- a/mpp/hal/rkdec/h264d/hal_h264d_vdpu1.c +++ b/mpp/hal/rkdec/h264d/hal_h264d_vdpu1.c @@ -967,7 +967,7 @@ __RETURN: *********************************************************************** */ //extern "C" -MPP_RET vdpu1_h264d_control(void *hal, RK_S32 cmd_type, void *param) +MPP_RET vdpu1_h264d_control(void *hal, MpiCmd cmd_type, void *param) { MPP_RET ret = MPP_ERR_UNKNOW; H264dHalCtx_t *p_hal = (H264dHalCtx_t *)hal; diff --git a/mpp/hal/rkdec/h264d/hal_h264d_vdpu1.h b/mpp/hal/rkdec/h264d/hal_h264d_vdpu1.h index 2324f035..4bc187b6 100644 --- a/mpp/hal/rkdec/h264d/hal_h264d_vdpu1.h +++ b/mpp/hal/rkdec/h264d/hal_h264d_vdpu1.h @@ -31,7 +31,7 @@ MPP_RET vdpu1_h264d_start (void *hal, HalTaskInfo *task); MPP_RET vdpu1_h264d_wait (void *hal, HalTaskInfo *task); MPP_RET vdpu1_h264d_reset (void *hal); MPP_RET vdpu1_h264d_flush (void *hal); -MPP_RET vdpu1_h264d_control (void *hal, RK_S32 cmd_type, void *param); +MPP_RET vdpu1_h264d_control (void *hal, MpiCmd cmd_type, void *param); #ifdef __cplusplus } diff --git a/mpp/hal/rkdec/h264d/hal_h264d_vdpu2.c b/mpp/hal/rkdec/h264d/hal_h264d_vdpu2.c index 8da9d840..563049b5 100644 --- a/mpp/hal/rkdec/h264d/hal_h264d_vdpu2.c +++ b/mpp/hal/rkdec/h264d/hal_h264d_vdpu2.c @@ -928,7 +928,7 @@ __RETURN: *********************************************************************** */ //extern "C" -MPP_RET vdpu2_h264d_control(void *hal, RK_S32 cmd_type, void *param) +MPP_RET vdpu2_h264d_control(void *hal, MpiCmd cmd_type, void *param) { MPP_RET ret = MPP_ERR_UNKNOW; H264dHalCtx_t *p_hal = (H264dHalCtx_t *)hal; diff --git a/mpp/hal/rkdec/h264d/hal_h264d_vdpu2.h b/mpp/hal/rkdec/h264d/hal_h264d_vdpu2.h index 7f13705a..b4f0eb22 100644 --- a/mpp/hal/rkdec/h264d/hal_h264d_vdpu2.h +++ b/mpp/hal/rkdec/h264d/hal_h264d_vdpu2.h @@ -31,7 +31,7 @@ MPP_RET vdpu2_h264d_start (void *hal, HalTaskInfo *task); MPP_RET vdpu2_h264d_wait (void *hal, HalTaskInfo *task); MPP_RET vdpu2_h264d_reset (void *hal); MPP_RET vdpu2_h264d_flush (void *hal); -MPP_RET vdpu2_h264d_control (void *hal, RK_S32 cmd_type, void *param); +MPP_RET vdpu2_h264d_control (void *hal, MpiCmd cmd_type, void *param); #ifdef __cplusplus diff --git a/mpp/hal/rkdec/h265d/hal_h265d_reg.c b/mpp/hal/rkdec/h265d/hal_h265d_reg.c index b16b005f..5e813a7e 100644 --- a/mpp/hal/rkdec/h265d/hal_h265d_reg.c +++ b/mpp/hal/rkdec/h265d/hal_h265d_reg.c @@ -1621,7 +1621,7 @@ MPP_RET hal_h265d_flush(void *hal) return ret; } -MPP_RET hal_h265d_control(void *hal, RK_S32 cmd_type, void *param) +MPP_RET hal_h265d_control(void *hal, MpiCmd cmd_type, void *param) { MPP_RET ret = MPP_OK; diff --git a/mpp/hal/rkdec/vp9d/hal_vp9d_api.c b/mpp/hal/rkdec/vp9d/hal_vp9d_api.c index 19e7ca02..148d5e58 100644 --- a/mpp/hal/rkdec/vp9d/hal_vp9d_api.c +++ b/mpp/hal/rkdec/vp9d/hal_vp9d_api.c @@ -1083,7 +1083,7 @@ MPP_RET hal_vp9d_flush(void *hal) *********************************************************************** */ //extern "C" -MPP_RET hal_vp9d_control(void *hal, RK_S32 cmd_type, void *param) +MPP_RET hal_vp9d_control(void *hal, MpiCmd cmd_type, void *param) { switch ((MpiCmd)cmd_type) { case MPP_DEC_SET_FRAME_INFO: { diff --git a/mpp/hal/rkenc/h264e/hal_h264e_rkv.c b/mpp/hal/rkenc/h264e/hal_h264e_rkv.c index 0ec0555f..e907bc11 100644 --- a/mpp/hal/rkenc/h264e/hal_h264e_rkv.c +++ b/mpp/hal/rkenc/h264e/hal_h264e_rkv.c @@ -1820,7 +1820,7 @@ MPP_RET hal_h264e_rkv_flush(void *hal) return MPP_OK; } -MPP_RET hal_h264e_rkv_control(void *hal, RK_S32 cmd_type, void *param) +MPP_RET hal_h264e_rkv_control(void *hal, MpiCmd cmd_type, void *param) { H264eHalContext *ctx = (H264eHalContext *)hal; h264e_hal_enter(); diff --git a/mpp/hal/rkenc/h264e/hal_h264e_rkv.h b/mpp/hal/rkenc/h264e/hal_h264e_rkv.h index a116261a..c19266d3 100644 --- a/mpp/hal/rkenc/h264e/hal_h264e_rkv.h +++ b/mpp/hal/rkenc/h264e/hal_h264e_rkv.h @@ -741,6 +741,6 @@ MPP_RET hal_h264e_rkv_start (void *hal, HalTaskInfo *task); MPP_RET hal_h264e_rkv_wait (void *hal, HalTaskInfo *task); MPP_RET hal_h264e_rkv_reset (void *hal); MPP_RET hal_h264e_rkv_flush (void *hal); -MPP_RET hal_h264e_rkv_control (void *hal, RK_S32 cmd_type, void *param); +MPP_RET hal_h264e_rkv_control (void *hal, MpiCmd cmd_type, void *param); #endif diff --git a/mpp/hal/vpu/h263d/hal_h263d_api.c b/mpp/hal/vpu/h263d/hal_h263d_api.c index f4766d2d..bf6fac2c 100644 --- a/mpp/hal/vpu/h263d/hal_h263d_api.c +++ b/mpp/hal/vpu/h263d/hal_h263d_api.c @@ -66,7 +66,7 @@ static MPP_RET hal_h263d_flush(void *hal) return ctx->hal_api.flush(hal); } -static MPP_RET hal_h263d_control(void *hal, RK_S32 cmd_type, void *param) +static MPP_RET hal_h263d_control(void *hal, MpiCmd cmd_type, void *param) { hal_h263_ctx *ctx = (hal_h263_ctx *)hal; return ctx->hal_api.control(hal, cmd_type, param); diff --git a/mpp/hal/vpu/h263d/hal_h263d_vdpu1.c b/mpp/hal/vpu/h263d/hal_h263d_vdpu1.c index 980afa01..6ddc9a15 100644 --- a/mpp/hal/vpu/h263d/hal_h263d_vdpu1.c +++ b/mpp/hal/vpu/h263d/hal_h263d_vdpu1.c @@ -290,7 +290,7 @@ MPP_RET hal_vpu1_h263d_flush(void *hal) return ret; } -MPP_RET hal_vpu1_h263d_control(void *hal, RK_S32 cmd_type, void *param) +MPP_RET hal_vpu1_h263d_control(void *hal, MpiCmd cmd_type, void *param) { MPP_RET ret = MPP_OK; diff --git a/mpp/hal/vpu/h263d/hal_h263d_vdpu1.h b/mpp/hal/vpu/h263d/hal_h263d_vdpu1.h index 88c8af54..a536ac5c 100644 --- a/mpp/hal/vpu/h263d/hal_h263d_vdpu1.h +++ b/mpp/hal/vpu/h263d/hal_h263d_vdpu1.h @@ -30,7 +30,7 @@ MPP_RET hal_vpu1_h263d_start(void *hal, HalTaskInfo *task); MPP_RET hal_vpu1_h263d_wait(void *hal, HalTaskInfo *task); MPP_RET hal_vpu1_h263d_reset(void *hal); MPP_RET hal_vpu1_h263d_flush(void *hal); -MPP_RET hal_vpu1_h263d_control(void *hal, RK_S32 cmd_type, void *param); +MPP_RET hal_vpu1_h263d_control(void *hal, MpiCmd cmd_type, void *param); #ifdef __cplusplus } diff --git a/mpp/hal/vpu/h263d/hal_h263d_vdpu2.c b/mpp/hal/vpu/h263d/hal_h263d_vdpu2.c index d877d31f..d055cbc1 100644 --- a/mpp/hal/vpu/h263d/hal_h263d_vdpu2.c +++ b/mpp/hal/vpu/h263d/hal_h263d_vdpu2.c @@ -290,7 +290,7 @@ MPP_RET hal_vpu2_h263d_flush(void *hal) return ret; } -MPP_RET hal_vpu2_h263d_control(void *hal, RK_S32 cmd_type, void *param) +MPP_RET hal_vpu2_h263d_control(void *hal, MpiCmd cmd_type, void *param) { MPP_RET ret = MPP_OK; diff --git a/mpp/hal/vpu/h263d/hal_h263d_vdpu2.h b/mpp/hal/vpu/h263d/hal_h263d_vdpu2.h index 665edf09..f1e8772a 100644 --- a/mpp/hal/vpu/h263d/hal_h263d_vdpu2.h +++ b/mpp/hal/vpu/h263d/hal_h263d_vdpu2.h @@ -30,7 +30,7 @@ MPP_RET hal_vpu2_h263d_start(void *hal, HalTaskInfo *task); MPP_RET hal_vpu2_h263d_wait(void *hal, HalTaskInfo *task); MPP_RET hal_vpu2_h263d_reset(void *hal); MPP_RET hal_vpu2_h263d_flush(void *hal); -MPP_RET hal_vpu2_h263d_control(void *hal, RK_S32 cmd_type, void *param); +MPP_RET hal_vpu2_h263d_control(void *hal, MpiCmd cmd_type, void *param); #ifdef __cplusplus } diff --git a/mpp/hal/vpu/h264e/hal_h264e_vepu1.c b/mpp/hal/vpu/h264e/hal_h264e_vepu1.c index 8389d1cd..c3984e8e 100644 --- a/mpp/hal/vpu/h264e/hal_h264e_vepu1.c +++ b/mpp/hal/vpu/h264e/hal_h264e_vepu1.c @@ -622,7 +622,7 @@ MPP_RET hal_h264e_vepu1_flush(void *hal) return MPP_OK; } -MPP_RET hal_h264e_vepu1_control(void *hal, RK_S32 cmd_type, void *param) +MPP_RET hal_h264e_vepu1_control(void *hal, MpiCmd cmd_type, void *param) { MPP_RET ret = MPP_OK; H264eHalContext *ctx = (H264eHalContext *)hal; diff --git a/mpp/hal/vpu/h264e/hal_h264e_vepu1.h b/mpp/hal/vpu/h264e/hal_h264e_vepu1.h index 9456662d..5ebed1eb 100644 --- a/mpp/hal/vpu/h264e/hal_h264e_vepu1.h +++ b/mpp/hal/vpu/h264e/hal_h264e_vepu1.h @@ -26,6 +26,6 @@ MPP_RET hal_h264e_vepu1_start (void *hal, HalTaskInfo *task); MPP_RET hal_h264e_vepu1_wait (void *hal, HalTaskInfo *task); MPP_RET hal_h264e_vepu1_reset (void *hal); MPP_RET hal_h264e_vepu1_flush (void *hal); -MPP_RET hal_h264e_vepu1_control (void *hal, RK_S32 cmd_type, void *param); +MPP_RET hal_h264e_vepu1_control (void *hal, MpiCmd cmd_type, void *param); #endif diff --git a/mpp/hal/vpu/h264e/hal_h264e_vepu2.c b/mpp/hal/vpu/h264e/hal_h264e_vepu2.c index fa14dbe4..10442897 100644 --- a/mpp/hal/vpu/h264e/hal_h264e_vepu2.c +++ b/mpp/hal/vpu/h264e/hal_h264e_vepu2.c @@ -648,7 +648,7 @@ MPP_RET hal_h264e_vepu2_flush(void *hal) return MPP_OK; } -MPP_RET hal_h264e_vepu2_control(void *hal, RK_S32 cmd_type, void *param) +MPP_RET hal_h264e_vepu2_control(void *hal, MpiCmd cmd_type, void *param) { H264eHalContext *ctx = (H264eHalContext *)hal; MPP_RET ret = MPP_OK; diff --git a/mpp/hal/vpu/h264e/hal_h264e_vepu2.h b/mpp/hal/vpu/h264e/hal_h264e_vepu2.h index 9c4ad5d7..5720bbed 100644 --- a/mpp/hal/vpu/h264e/hal_h264e_vepu2.h +++ b/mpp/hal/vpu/h264e/hal_h264e_vepu2.h @@ -24,6 +24,6 @@ MPP_RET hal_h264e_vepu2_start (void *hal, HalTaskInfo *task); MPP_RET hal_h264e_vepu2_wait (void *hal, HalTaskInfo *task); MPP_RET hal_h264e_vepu2_reset (void *hal); MPP_RET hal_h264e_vepu2_flush (void *hal); -MPP_RET hal_h264e_vepu2_control (void *hal, RK_S32 cmd_type, void *param); +MPP_RET hal_h264e_vepu2_control (void *hal, MpiCmd cmd_type, void *param); #endif diff --git a/mpp/hal/vpu/h265e/hal_h265e_vepu22.c b/mpp/hal/vpu/h265e/hal_h265e_vepu22.c index 308615ee..aa8bbdff 100644 --- a/mpp/hal/vpu/h265e/hal_h265e_vepu22.c +++ b/mpp/hal/vpu/h265e/hal_h265e_vepu22.c @@ -2112,7 +2112,7 @@ MPP_RET hal_h265e_vepu22_flush(void *hal) return MPP_OK; } -MPP_RET hal_h265e_vepu22_control(void *hal, RK_S32 cmd_type, void *param) +MPP_RET hal_h265e_vepu22_control(void *hal, MpiCmd cmd_type, void *param) { MPP_RET ret = MPP_OK; RK_U32 change = 0; @@ -2171,6 +2171,10 @@ MPP_RET hal_h265e_vepu22_control(void *hal, RK_S32 cmd_type, void *param) ret = vepu22_set_roi(ctx, param); break; } + + default : { + break; + } } hal_h265e_dbg_input("ctx->option = 0x%x H265E_SET_ALL_CFG = 0x%x\n", ctx->option, H265E_SET_ALL_CFG); diff --git a/mpp/hal/vpu/h265e/hal_h265e_vepu22.h b/mpp/hal/vpu/h265e/hal_h265e_vepu22.h index 78218230..af8ca2df 100644 --- a/mpp/hal/vpu/h265e/hal_h265e_vepu22.h +++ b/mpp/hal/vpu/h265e/hal_h265e_vepu22.h @@ -31,7 +31,7 @@ MPP_RET hal_h265e_vepu22_start (void *hal, HalTaskInfo *task); MPP_RET hal_h265e_vepu22_wait (void *hal, HalTaskInfo *task); MPP_RET hal_h265e_vepu22_reset (void *hal); MPP_RET hal_h265e_vepu22_flush (void *hal); -MPP_RET hal_h265e_vepu22_control (void *hal, RK_S32 cmd_type, void *param); +MPP_RET hal_h265e_vepu22_control (void *hal, MpiCmd cmd_type, void *param); #ifdef __cplusplus } diff --git a/mpp/hal/vpu/jpegd/hal_jpegd_api.c b/mpp/hal/vpu/jpegd/hal_jpegd_api.c index 32da9077..c65113ae 100644 --- a/mpp/hal/vpu/jpegd/hal_jpegd_api.c +++ b/mpp/hal/vpu/jpegd/hal_jpegd_api.c @@ -55,7 +55,7 @@ static MPP_RET hal_jpegd_flush (void *hal) return self->hal_api.flush (hal); } -static MPP_RET hal_jpegd_control (void *hal, RK_S32 cmd_type, void *param) +static MPP_RET hal_jpegd_control (void *hal, MpiCmd cmd_type, void *param) { JpegdHalCtx *self = (JpegdHalCtx *)hal; return self->hal_api.control (hal, cmd_type, param); diff --git a/mpp/hal/vpu/jpegd/hal_jpegd_vdpu1.c b/mpp/hal/vpu/jpegd/hal_jpegd_vdpu1.c index a431264f..a3ff268d 100644 --- a/mpp/hal/vpu/jpegd/hal_jpegd_vdpu1.c +++ b/mpp/hal/vpu/jpegd/hal_jpegd_vdpu1.c @@ -1037,7 +1037,7 @@ MPP_RET hal_jpegd_vdpu1_flush(void *hal) return ret; } -MPP_RET hal_jpegd_vdpu1_control(void *hal, RK_S32 cmd_type, void *param) +MPP_RET hal_jpegd_vdpu1_control(void *hal, MpiCmd cmd_type, void *param) { jpegd_dbg_func("enter\n"); MPP_RET ret = MPP_OK; diff --git a/mpp/hal/vpu/jpegd/hal_jpegd_vdpu1.h b/mpp/hal/vpu/jpegd/hal_jpegd_vdpu1.h index 7321e5cf..faffde4c 100644 --- a/mpp/hal/vpu/jpegd/hal_jpegd_vdpu1.h +++ b/mpp/hal/vpu/jpegd/hal_jpegd_vdpu1.h @@ -26,6 +26,6 @@ MPP_RET hal_jpegd_vdpu1_start(void *hal, HalTaskInfo *task); MPP_RET hal_jpegd_vdpu1_wait(void *hal, HalTaskInfo *task); MPP_RET hal_jpegd_vdpu1_reset(void *hal); MPP_RET hal_jpegd_vdpu1_flush(void *hal); -MPP_RET hal_jpegd_vdpu1_control(void *hal, RK_S32 cmd_type, void *param); +MPP_RET hal_jpegd_vdpu1_control(void *hal, MpiCmd cmd_type, void *param); #endif /* __HAL_JPEGD_VDPU1_H__ */ diff --git a/mpp/hal/vpu/jpegd/hal_jpegd_vdpu2.c b/mpp/hal/vpu/jpegd/hal_jpegd_vdpu2.c index 0a0904d5..48a228e0 100644 --- a/mpp/hal/vpu/jpegd/hal_jpegd_vdpu2.c +++ b/mpp/hal/vpu/jpegd/hal_jpegd_vdpu2.c @@ -1016,7 +1016,7 @@ MPP_RET hal_jpegd_vdpu2_flush(void *hal) return ret; } -MPP_RET hal_jpegd_vdpu2_control(void *hal, RK_S32 cmd_type, +MPP_RET hal_jpegd_vdpu2_control(void *hal, MpiCmd cmd_type, void *param) { jpegd_dbg_func("enter\n"); diff --git a/mpp/hal/vpu/jpegd/hal_jpegd_vdpu2.h b/mpp/hal/vpu/jpegd/hal_jpegd_vdpu2.h index 3a53ce04..0cd08389 100644 --- a/mpp/hal/vpu/jpegd/hal_jpegd_vdpu2.h +++ b/mpp/hal/vpu/jpegd/hal_jpegd_vdpu2.h @@ -25,6 +25,6 @@ MPP_RET hal_jpegd_vdpu2_start(void *hal, HalTaskInfo *task); MPP_RET hal_jpegd_vdpu2_wait(void *hal, HalTaskInfo *task); MPP_RET hal_jpegd_vdpu2_reset(void *hal); MPP_RET hal_jpegd_vdpu2_flush(void *hal); -MPP_RET hal_jpegd_vdpu2_control(void *hal, RK_S32 cmd_type, void *param); +MPP_RET hal_jpegd_vdpu2_control(void *hal, MpiCmd cmd_type, void *param); #endif /* __HAL_JPEGD_VDPU2_H__ */ diff --git a/mpp/hal/vpu/jpege/hal_jpege_api.c b/mpp/hal/vpu/jpege/hal_jpege_api.c index 22144027..e154006c 100644 --- a/mpp/hal/vpu/jpege/hal_jpege_api.c +++ b/mpp/hal/vpu/jpege/hal_jpege_api.c @@ -66,7 +66,7 @@ static MPP_RET hal_jpege_flush(void *hal) return ctx->hal_api.flush(ctx); } -static MPP_RET hal_jpege_control(void *hal, RK_S32 cmd_type, void *param) +static MPP_RET hal_jpege_control(void *hal, MpiCmd cmd_type, void *param) { HalJpegeCtx *ctx = (HalJpegeCtx *)hal; return ctx->hal_api.control(ctx, cmd_type, param); diff --git a/mpp/hal/vpu/jpege/hal_jpege_vepu1.c b/mpp/hal/vpu/jpege/hal_jpege_vepu1.c index 4fbb64b2..1d6ce86e 100644 --- a/mpp/hal/vpu/jpege/hal_jpege_vepu1.c +++ b/mpp/hal/vpu/jpege/hal_jpege_vepu1.c @@ -529,7 +529,7 @@ MPP_RET hal_jpege_vepu1_flush(void *hal) return MPP_OK; } -MPP_RET hal_jpege_vepu1_control(void *hal, RK_S32 cmd, void *param) +MPP_RET hal_jpege_vepu1_control(void *hal, MpiCmd cmd, void *param) { (void)hal; MPP_RET ret = MPP_OK; diff --git a/mpp/hal/vpu/jpege/hal_jpege_vepu1.h b/mpp/hal/vpu/jpege/hal_jpege_vepu1.h index d6f5dfdc..0ef8661e 100644 --- a/mpp/hal/vpu/jpege/hal_jpege_vepu1.h +++ b/mpp/hal/vpu/jpege/hal_jpege_vepu1.h @@ -1,5 +1,22 @@ -#ifndef __HAL_JPEGE_VEPU1_H -#define __HAL_JPEGE_VEPU1_H +/* + * Copyright 2015 Rockchip Electronics Co. LTD + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __HAL_JPEGE_VEPU1_H__ +#define __HAL_JPEGE_VEPU1_H__ + #include "rk_type.h" MPP_RET hal_jpege_vepu1_init(void *hal, MppHalCfg *cfg); @@ -9,6 +26,6 @@ MPP_RET hal_jpege_vepu1_start(void *hal, HalTaskInfo *task); MPP_RET hal_jpege_vepu1_wait(void *hal, HalTaskInfo *task); MPP_RET hal_jpege_vepu1_reset(void *hal); MPP_RET hal_jpege_vepu1_flush(void *hal); -MPP_RET hal_jpege_vepu1_control(void *hal, RK_S32 cmd, void *param); +MPP_RET hal_jpege_vepu1_control(void *hal, MpiCmd cmd, void *param); #endif diff --git a/mpp/hal/vpu/jpege/hal_jpege_vepu2.c b/mpp/hal/vpu/jpege/hal_jpege_vepu2.c index 2a847b3a..5258fb49 100644 --- a/mpp/hal/vpu/jpege/hal_jpege_vepu2.c +++ b/mpp/hal/vpu/jpege/hal_jpege_vepu2.c @@ -509,7 +509,7 @@ MPP_RET hal_jpege_vepu2_flush(void *hal) return MPP_OK; } -MPP_RET hal_jpege_vepu2_control(void *hal, RK_S32 cmd, void *param) +MPP_RET hal_jpege_vepu2_control(void *hal, MpiCmd cmd, void *param) { (void)hal; MPP_RET ret = MPP_OK; diff --git a/mpp/hal/vpu/jpege/hal_jpege_vepu2.h b/mpp/hal/vpu/jpege/hal_jpege_vepu2.h index 7b6f0ba2..01eecba8 100644 --- a/mpp/hal/vpu/jpege/hal_jpege_vepu2.h +++ b/mpp/hal/vpu/jpege/hal_jpege_vepu2.h @@ -15,8 +15,9 @@ * limitations under the License. */ -#ifndef __HAL_JPEGE_VEPU2_H -#define __HAL_JPEGE_VEPU2_H +#ifndef __HAL_JPEGE_VEPU2_H__ +#define __HAL_JPEGE_VEPU2_H__ + #include "rk_type.h" MPP_RET hal_jpege_vepu2_init(void *hal, MppHalCfg *cfg); @@ -26,6 +27,6 @@ MPP_RET hal_jpege_vepu2_start(void *hal, HalTaskInfo *task); MPP_RET hal_jpege_vepu2_wait(void *hal, HalTaskInfo *task); MPP_RET hal_jpege_vepu2_reset(void *hal); MPP_RET hal_jpege_vepu2_flush(void *hal); -MPP_RET hal_jpege_vepu2_control(void *hal, RK_S32 cmd, void *param); +MPP_RET hal_jpege_vepu2_control(void *hal, MpiCmd cmd, void *param); #endif diff --git a/mpp/hal/vpu/m2vd/hal_m2vd_api.c b/mpp/hal/vpu/m2vd/hal_m2vd_api.c index d78416fe..fdc6c40a 100644 --- a/mpp/hal/vpu/m2vd/hal_m2vd_api.c +++ b/mpp/hal/vpu/m2vd/hal_m2vd_api.c @@ -58,7 +58,7 @@ static MPP_RET hal_m2vd_flush (void *hal) return self->hal_api.flush(hal); } -static MPP_RET hal_m2vd_control (void *hal, RK_S32 cmd_type, void *param) +static MPP_RET hal_m2vd_control (void *hal, MpiCmd cmd_type, void *param) { M2vdHalCtx *self = (M2vdHalCtx *)hal; return self->hal_api.control(hal, cmd_type, param); diff --git a/mpp/hal/vpu/m2vd/hal_m2vd_vdpu1.c b/mpp/hal/vpu/m2vd/hal_m2vd_vdpu1.c index a61cf568..cd814a0b 100644 --- a/mpp/hal/vpu/m2vd/hal_m2vd_vdpu1.c +++ b/mpp/hal/vpu/m2vd/hal_m2vd_vdpu1.c @@ -310,7 +310,7 @@ MPP_RET hal_m2vd_vdpu1_flush(void *hal) return ret; } -MPP_RET hal_m2vd_vdpu1_control(void *hal, RK_S32 cmd_type, void *param) +MPP_RET hal_m2vd_vdpu1_control(void *hal, MpiCmd cmd_type, void *param) { MPP_RET ret = MPP_OK; (void)hal; diff --git a/mpp/hal/vpu/m2vd/hal_m2vd_vdpu2.c b/mpp/hal/vpu/m2vd/hal_m2vd_vdpu2.c index ee5cad6a..5e66fd28 100644 --- a/mpp/hal/vpu/m2vd/hal_m2vd_vdpu2.c +++ b/mpp/hal/vpu/m2vd/hal_m2vd_vdpu2.c @@ -393,7 +393,7 @@ MPP_RET hal_m2vd_vdpu2_flush(void *hal) return ret; } -MPP_RET hal_m2vd_vdpu2_control(void *hal, RK_S32 cmd_type, void *param) +MPP_RET hal_m2vd_vdpu2_control(void *hal, MpiCmd cmd_type, void *param) { MPP_RET ret = MPP_OK; m2vh_dbg_func("FUN_I"); diff --git a/mpp/hal/vpu/m2vd/hal_m2vd_vpu1.h b/mpp/hal/vpu/m2vd/hal_m2vd_vpu1.h index 205ab208..d337fcb5 100644 --- a/mpp/hal/vpu/m2vd/hal_m2vd_vpu1.h +++ b/mpp/hal/vpu/m2vd/hal_m2vd_vpu1.h @@ -30,7 +30,7 @@ MPP_RET hal_m2vd_vdpu1_start (void *hal, HalTaskInfo *task); MPP_RET hal_m2vd_vdpu1_wait (void *hal, HalTaskInfo *task); MPP_RET hal_m2vd_vdpu1_reset (void *hal); MPP_RET hal_m2vd_vdpu1_flush (void *hal); -MPP_RET hal_m2vd_vdpu1_control (void *hal, RK_S32 cmd_type, void *param); +MPP_RET hal_m2vd_vdpu1_control (void *hal, MpiCmd cmd_type, void *param); #ifdef __cplusplus } diff --git a/mpp/hal/vpu/m2vd/hal_m2vd_vpu2.h b/mpp/hal/vpu/m2vd/hal_m2vd_vpu2.h index f0aa3fbb..bd3c946b 100644 --- a/mpp/hal/vpu/m2vd/hal_m2vd_vpu2.h +++ b/mpp/hal/vpu/m2vd/hal_m2vd_vpu2.h @@ -30,7 +30,7 @@ MPP_RET hal_m2vd_vdpu2_start (void *hal, HalTaskInfo *task); MPP_RET hal_m2vd_vdpu2_wait (void *hal, HalTaskInfo *task); MPP_RET hal_m2vd_vdpu2_reset (void *hal); MPP_RET hal_m2vd_vdpu2_flush (void *hal); -MPP_RET hal_m2vd_vdpu2_control (void *hal, RK_S32 cmd_type, void *param); +MPP_RET hal_m2vd_vdpu2_control (void *hal, MpiCmd cmd_type, void *param); #ifdef __cplusplus } diff --git a/mpp/hal/vpu/mpg4d/hal_m4vd_api.c b/mpp/hal/vpu/mpg4d/hal_m4vd_api.c index eeac21cf..115eb3fa 100644 --- a/mpp/hal/vpu/mpg4d/hal_m4vd_api.c +++ b/mpp/hal/vpu/mpg4d/hal_m4vd_api.c @@ -185,7 +185,7 @@ MPP_RET hal_vpu_mpg4d_flush(void *hal) *********************************************************************** */ //extern "C" -MPP_RET hal_vpu_mpg4d_control(void *hal, RK_S32 cmd_type, void *param) +MPP_RET hal_vpu_mpg4d_control(void *hal, MpiCmd cmd_type, void *param) { hal_mpg4_ctx *p_hal = (hal_mpg4_ctx *)hal; diff --git a/mpp/hal/vpu/mpg4d/hal_m4vd_vdpu1.c b/mpp/hal/vpu/mpg4d/hal_m4vd_vdpu1.c index 8b7972d9..05e8991c 100644 --- a/mpp/hal/vpu/mpg4d/hal_m4vd_vdpu1.c +++ b/mpp/hal/vpu/mpg4d/hal_m4vd_vdpu1.c @@ -458,7 +458,7 @@ MPP_RET vdpu1_mpg4d_flush(void *hal) return ret; } -MPP_RET vdpu1_mpg4d_control(void *hal, RK_S32 cmd_type, void *param) +MPP_RET vdpu1_mpg4d_control(void *hal, MpiCmd cmd_type, void *param) { MPP_RET ret = MPP_OK; diff --git a/mpp/hal/vpu/mpg4d/hal_m4vd_vdpu1.h b/mpp/hal/vpu/mpg4d/hal_m4vd_vdpu1.h index 79142cb7..3e3c47cc 100644 --- a/mpp/hal/vpu/mpg4d/hal_m4vd_vdpu1.h +++ b/mpp/hal/vpu/mpg4d/hal_m4vd_vdpu1.h @@ -30,7 +30,7 @@ MPP_RET vdpu1_mpg4d_start (void *hal, HalTaskInfo *task); MPP_RET vdpu1_mpg4d_wait (void *hal, HalTaskInfo *task); MPP_RET vdpu1_mpg4d_reset (void *hal); MPP_RET vdpu1_mpg4d_flush (void *hal); -MPP_RET vdpu1_mpg4d_control (void *hal, RK_S32 cmd_type, void *param); +MPP_RET vdpu1_mpg4d_control (void *hal, MpiCmd cmd_type, void *param); #ifdef __cplusplus } diff --git a/mpp/hal/vpu/mpg4d/hal_m4vd_vdpu2.c b/mpp/hal/vpu/mpg4d/hal_m4vd_vdpu2.c index 70903d16..546c591f 100644 --- a/mpp/hal/vpu/mpg4d/hal_m4vd_vdpu2.c +++ b/mpp/hal/vpu/mpg4d/hal_m4vd_vdpu2.c @@ -456,7 +456,7 @@ MPP_RET vdpu2_mpg4d_flush(void *hal) return ret; } -MPP_RET vdpu2_mpg4d_control(void *hal, RK_S32 cmd_type, void *param) +MPP_RET vdpu2_mpg4d_control(void *hal, MpiCmd cmd_type, void *param) { MPP_RET ret = MPP_OK; diff --git a/mpp/hal/vpu/mpg4d/hal_m4vd_vdpu2.h b/mpp/hal/vpu/mpg4d/hal_m4vd_vdpu2.h index 555648c6..b7004f3a 100644 --- a/mpp/hal/vpu/mpg4d/hal_m4vd_vdpu2.h +++ b/mpp/hal/vpu/mpg4d/hal_m4vd_vdpu2.h @@ -30,7 +30,7 @@ MPP_RET vdpu2_mpg4d_start (void *hal, HalTaskInfo *task); MPP_RET vdpu2_mpg4d_wait (void *hal, HalTaskInfo *task); MPP_RET vdpu2_mpg4d_reset (void *hal); MPP_RET vdpu2_mpg4d_flush (void *hal); -MPP_RET vdpu2_mpg4d_control (void *hal, RK_S32 cmd_type, void *param); +MPP_RET vdpu2_mpg4d_control (void *hal, MpiCmd cmd_type, void *param); #ifdef __cplusplus } diff --git a/mpp/hal/vpu/vp8d/hal_vp8d_api.c b/mpp/hal/vpu/vp8d/hal_vp8d_api.c index 2445725a..196a7f76 100644 --- a/mpp/hal/vpu/vp8d/hal_vp8d_api.c +++ b/mpp/hal/vpu/vp8d/hal_vp8d_api.c @@ -27,43 +27,71 @@ static MPP_RET hal_vp8d_reg_gen (void *hal, HalTaskInfo *task) { VP8DHalContext_t *self = (VP8DHalContext_t *)hal; - return self->hal_api.reg_gen (hal, task); + + if (!self->hal_api.reg_gen) + return MPP_OK; + + return self->hal_api.reg_gen(hal, task); } static MPP_RET hal_vp8d_start (void *hal, HalTaskInfo *task) { VP8DHalContext_t *self = (VP8DHalContext_t *)hal; - return self->hal_api.start (hal, task); + + if (!self->hal_api.start) + return MPP_OK; + + return self->hal_api.start(hal, task); } static MPP_RET hal_vp8d_wait (void *hal, HalTaskInfo *task) { VP8DHalContext_t *self = (VP8DHalContext_t *)hal; - return self->hal_api.wait (hal, task); + + if (!self->hal_api.wait) + return MPP_OK; + + return self->hal_api.wait(hal, task); } static MPP_RET hal_vp8d_reset (void *hal) { VP8DHalContext_t *self = (VP8DHalContext_t *)hal; - return self->hal_api.reset (hal); + + if (!self->hal_api.reset) + return MPP_OK; + + return self->hal_api.reset(hal);; } static MPP_RET hal_vp8d_flush (void *hal) { VP8DHalContext_t *self = (VP8DHalContext_t *)hal; - return self->hal_api.flush (hal); + + if (!self->hal_api.flush) + return MPP_OK; + + return self->hal_api.flush(hal); } -static MPP_RET hal_vp8d_control (void *hal, RK_S32 cmd_type, void *param) +static MPP_RET hal_vp8d_control (void *hal, MpiCmd cmd_type, void *param) { VP8DHalContext_t *self = (VP8DHalContext_t *)hal; - return self->hal_api.control (hal, cmd_type, param); + + if (!self->hal_api.control) + return MPP_OK; + + return self->hal_api.control(hal, cmd_type, param); } static MPP_RET hal_vp8d_deinit (void *hal) { VP8DHalContext_t *self = (VP8DHalContext_t *)hal; - return self->hal_api.deinit (hal); + + if (!self->hal_api.deinit) + return MPP_OK; + + return self->hal_api.deinit(hal); } static MPP_RET hal_vp8d_init (void *hal, MppHalCfg *cfg) @@ -92,9 +120,9 @@ static MPP_RET hal_vp8d_init (void *hal, MppHalCfg *cfg) p_api->reg_gen = hal_vp8d_vdpu2_gen_regs; p_api->start = hal_vp8d_vdpu2_start; p_api->wait = hal_vp8d_vdpu2_wait; - p_api->reset = hal_vp8d_vdpu2_reset; - p_api->flush = hal_vp8d_vdpu2_flush; - p_api->control = hal_vp8d_vdpu2_control; + p_api->reset = NULL; + p_api->flush = NULL; + p_api->control = NULL; break; case VDPU1_MODE: p_api->init = hal_vp8d_vdpu1_init; @@ -102,9 +130,9 @@ static MPP_RET hal_vp8d_init (void *hal, MppHalCfg *cfg) p_api->reg_gen = hal_vp8d_vdpu1_gen_regs; p_api->start = hal_vp8d_vdpu1_start; p_api->wait = hal_vp8d_vdpu1_wait; - p_api->reset = hal_vp8d_vdpu1_reset; - p_api->flush = hal_vp8d_vdpu1_flush; - p_api->control = hal_vp8d_vdpu1_control; + p_api->reset = NULL; + p_api->flush = NULL; + p_api->control = NULL; break; default: return MPP_ERR_INIT; diff --git a/mpp/hal/vpu/vp8d/hal_vp8d_vdpu1.c b/mpp/hal/vpu/vp8d/hal_vp8d_vdpu1.c index fe56996a..cc557f0d 100644 --- a/mpp/hal/vpu/vp8d/hal_vp8d_vdpu1.c +++ b/mpp/hal/vpu/vp8d/hal_vp8d_vdpu1.c @@ -633,35 +633,3 @@ MPP_RET hal_vp8d_vdpu1_wait(void *hal, HalTaskInfo *task) (void)task; return ret; } - -MPP_RET hal_vp8d_vdpu1_reset(void *hal) -{ - MPP_RET ret = MPP_OK; - - FUN_T("FUN_IN"); - (void)hal; - FUN_T("FUN_OUT"); - return ret; -} - -MPP_RET hal_vp8d_vdpu1_flush(void *hal) -{ - MPP_RET ret = MPP_OK; - - FUN_T("FUN_IN"); - (void)hal; - FUN_T("FUN_OUT"); - return ret; -} - -MPP_RET hal_vp8d_vdpu1_control(void *hal, RK_S32 cmd_type, void *param) -{ - MPP_RET ret = MPP_OK; - - FUN_T("FUN_IN"); - (void)hal; - (void)cmd_type; - (void)param; - FUN_T("FUN_OUT"); - return ret; -} diff --git a/mpp/hal/vpu/vp8d/hal_vp8d_vdpu1.h b/mpp/hal/vpu/vp8d/hal_vp8d_vdpu1.h index c246cd91..ce8e0f6a 100644 --- a/mpp/hal/vpu/vp8d/hal_vp8d_vdpu1.h +++ b/mpp/hal/vpu/vp8d/hal_vp8d_vdpu1.h @@ -16,6 +16,7 @@ #ifndef __HAL_VP8D_VDPU1_H__ #define __HAL_VP8D_VDPU1_H__ + #include "hal_vp8d_base.h" MPP_RET hal_vp8d_vdpu1_init (void *hal, MppHalCfg *cfg); @@ -23,8 +24,5 @@ MPP_RET hal_vp8d_vdpu1_deinit (void *hal); MPP_RET hal_vp8d_vdpu1_gen_regs(void *hal, HalTaskInfo *task); MPP_RET hal_vp8d_vdpu1_start (void *hal, HalTaskInfo *task); MPP_RET hal_vp8d_vdpu1_wait (void *hal, HalTaskInfo *task); -MPP_RET hal_vp8d_vdpu1_reset (void *hal); -MPP_RET hal_vp8d_vdpu1_flush (void *hal); -MPP_RET hal_vp8d_vdpu1_control (void *hal, RK_S32 cmd_type, void *param); #endif diff --git a/mpp/hal/vpu/vp8d/hal_vp8d_vdpu2.c b/mpp/hal/vpu/vp8d/hal_vp8d_vdpu2.c index bac27d7e..3e227acb 100644 --- a/mpp/hal/vpu/vp8d/hal_vp8d_vdpu2.c +++ b/mpp/hal/vpu/vp8d/hal_vp8d_vdpu2.c @@ -608,35 +608,3 @@ MPP_RET hal_vp8d_vdpu2_wait(void *hal, HalTaskInfo *task) (void)task; return ret; } - -MPP_RET hal_vp8d_vdpu2_reset(void *hal) -{ - MPP_RET ret = MPP_OK; - - FUN_T("FUN_IN"); - (void)hal; - FUN_T("FUN_OUT"); - return ret; -} - -MPP_RET hal_vp8d_vdpu2_flush(void *hal) -{ - MPP_RET ret = MPP_OK; - - FUN_T("FUN_IN"); - (void)hal; - FUN_T("FUN_OUT"); - return ret; -} - -MPP_RET hal_vp8d_vdpu2_control(void *hal, RK_S32 cmd_type, void *param) -{ - MPP_RET ret = MPP_OK; - - FUN_T("FUN_IN"); - (void)hal; - (void)cmd_type; - (void)param; - FUN_T("FUN_OUT"); - return ret; -} diff --git a/mpp/hal/vpu/vp8d/hal_vp8d_vdpu2.h b/mpp/hal/vpu/vp8d/hal_vp8d_vdpu2.h index ed233741..08343ac6 100644 --- a/mpp/hal/vpu/vp8d/hal_vp8d_vdpu2.h +++ b/mpp/hal/vpu/vp8d/hal_vp8d_vdpu2.h @@ -16,6 +16,7 @@ #ifndef __HAL_VP8D_VDPU2_H__ #define __HAL_VP8D_VDPU2_H__ + #include "hal_vp8d_base.h" MPP_RET hal_vp8d_vdpu2_init (void *hal, MppHalCfg *cfg); @@ -23,8 +24,5 @@ MPP_RET hal_vp8d_vdpu2_deinit (void *hal); MPP_RET hal_vp8d_vdpu2_gen_regs(void *hal, HalTaskInfo *task); MPP_RET hal_vp8d_vdpu2_start (void *hal, HalTaskInfo *task); MPP_RET hal_vp8d_vdpu2_wait (void *hal, HalTaskInfo *task); -MPP_RET hal_vp8d_vdpu2_reset (void *hal); -MPP_RET hal_vp8d_vdpu2_flush (void *hal); -MPP_RET hal_vp8d_vdpu2_control (void *hal, RK_S32 cmd_type, void *param); #endif diff --git a/mpp/hal/vpu/vp8e/hal_vp8e_api.c b/mpp/hal/vpu/vp8e/hal_vp8e_api.c index 3c9d43e6..209bc153 100644 --- a/mpp/hal/vpu/vp8e/hal_vp8e_api.c +++ b/mpp/hal/vpu/vp8e/hal_vp8e_api.c @@ -68,7 +68,7 @@ static MPP_RET hal_vp8e_flush(void *hal) return ctx->hal_api.flush(ctx); } -static MPP_RET hal_vp8e_control(void *hal, RK_S32 cmd_type, void *param) +static MPP_RET hal_vp8e_control(void *hal, MpiCmd cmd_type, void *param) { HalVp8eCtx *ctx = (HalVp8eCtx *)hal; diff --git a/mpp/hal/vpu/vp8e/hal_vp8e_vepu1.c b/mpp/hal/vpu/vp8e/hal_vp8e_vepu1.c index ab3f3842..843c8116 100644 --- a/mpp/hal/vpu/vp8e/hal_vp8e_vepu1.c +++ b/mpp/hal/vpu/vp8e/hal_vp8e_vepu1.c @@ -479,7 +479,7 @@ MPP_RET hal_vp8e_vepu1_flush(void *hal) return MPP_OK; } -MPP_RET hal_vp8e_vepu1_control(void *hal, RK_S32 cmd, void *param) +MPP_RET hal_vp8e_vepu1_control(void *hal, MpiCmd cmd, void *param) { (void)hal; (void)cmd; diff --git a/mpp/hal/vpu/vp8e/hal_vp8e_vepu1.h b/mpp/hal/vpu/vp8e/hal_vp8e_vepu1.h index de18f7aa..b2643e1e 100644 --- a/mpp/hal/vpu/vp8e/hal_vp8e_vepu1.h +++ b/mpp/hal/vpu/vp8e/hal_vp8e_vepu1.h @@ -22,6 +22,7 @@ #ifdef __cplusplus extern "C" { #endif + MPP_RET hal_vp8e_vepu1_init(void *hal, MppHalCfg *cfg); MPP_RET hal_vp8e_vepu1_deinit(void *hal); MPP_RET hal_vp8e_vepu1_gen_regs(void *hal, HalTaskInfo *task); @@ -29,7 +30,8 @@ MPP_RET hal_vp8e_vepu1_start(void *hal, HalTaskInfo *task); MPP_RET hal_vp8e_vepu1_wait(void *hal, HalTaskInfo *task); MPP_RET hal_vp8e_vepu1_reset(void *hal); MPP_RET hal_vp8e_vepu1_flush(void *hal); -MPP_RET hal_vp8e_vepu1_control(void *hal, RK_S32 cmd, void *param); +MPP_RET hal_vp8e_vepu1_control(void *hal, MpiCmd cmd, void *param); + #ifdef __cplusplus } #endif diff --git a/mpp/hal/vpu/vp8e/hal_vp8e_vepu2.c b/mpp/hal/vpu/vp8e/hal_vp8e_vepu2.c index 10185a1c..c161a7cc 100644 --- a/mpp/hal/vpu/vp8e/hal_vp8e_vepu2.c +++ b/mpp/hal/vpu/vp8e/hal_vp8e_vepu2.c @@ -476,7 +476,7 @@ MPP_RET hal_vp8e_vepu2_flush(void *hal) return MPP_OK; } -MPP_RET hal_vp8e_vepu2_control(void *hal, RK_S32 cmd, void *param) +MPP_RET hal_vp8e_vepu2_control(void *hal, MpiCmd cmd, void *param) { (void)hal; (void)cmd; diff --git a/mpp/hal/vpu/vp8e/hal_vp8e_vepu2.h b/mpp/hal/vpu/vp8e/hal_vp8e_vepu2.h index e26bb1e0..d333ddaa 100644 --- a/mpp/hal/vpu/vp8e/hal_vp8e_vepu2.h +++ b/mpp/hal/vpu/vp8e/hal_vp8e_vepu2.h @@ -29,7 +29,7 @@ MPP_RET hal_vp8e_vepu2_start(void *hal, HalTaskInfo *task); MPP_RET hal_vp8e_vepu2_wait(void *hal, HalTaskInfo *task); MPP_RET hal_vp8e_vepu2_reset(void *hal); MPP_RET hal_vp8e_vepu2_flush(void *hal); -MPP_RET hal_vp8e_vepu2_control(void *hal, RK_S32 cmd, void *param); +MPP_RET hal_vp8e_vepu2_control(void *hal, MpiCmd cmd, void *param); #ifdef __cplusplus } #endif diff --git a/mpp/inc/mpp_enc_cfg.h b/mpp/inc/mpp_enc_cfg.h new file mode 100644 index 00000000..ac7d15f7 --- /dev/null +++ b/mpp/inc/mpp_enc_cfg.h @@ -0,0 +1,49 @@ +/* + * Copyright 2015 Rockchip Electronics Co. LTD + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __MPP_ENC_CFG_H__ +#define __MPP_ENC_CFG_H__ + +#include "rk_venc_cmd.h" + +typedef struct MppEncMiscCfg_t { + MppEncSliceSplit split; + MppEncGopRef gop_ref; + MppEncROICfg roi; + MppEncOSDData osd_data; + MppEncOSDPlt osd_plt; +} MppEncMiscCfg; + +/* + * MppEncCfgSet shows the relationship between different configuration + * Due to the huge amount of configurable parameters we need to setup + * only minimum amount of necessary parameters. + * + * For normal user rc and prep config are enough. + */ +typedef struct MppEncCfgSet_t { + // esential config + MppEncPrepCfg prep; + MppEncRcCfg rc; + + // codec detail config + MppEncCodecCfg codec; + + // misc extra config + MppEncMiscCfg misc; +} MppEncCfgSet; + +#endif /*__MPP_ENC_H__*/ diff --git a/mpp/legacy/vpu_api_legacy.cpp b/mpp/legacy/vpu_api_legacy.cpp index 43da0f5d..66e8af6e 100644 --- a/mpp/legacy/vpu_api_legacy.cpp +++ b/mpp/legacy/vpu_api_legacy.cpp @@ -90,10 +90,12 @@ static MPP_RET vpu_api_set_enc_cfg(MppCtx mpp_ctx, MppApi *mpi, EncParameter_t *cfg) { MPP_RET ret = MPP_OK; - MppEncCfgSet set; - MppEncCodecCfg *codec_cfg = &set.codec; - MppEncPrepCfg *prep_cfg = &set.prep; - MppEncRcCfg *rc_cfg = &set.rc; + MppEncCodecCfg codec; + MppEncPrepCfg prep; + MppEncRcCfg rc; + MppEncCodecCfg *codec_cfg = &codec; + MppEncPrepCfg *prep_cfg = &prep; + MppEncRcCfg *rc_cfg = &rc; RK_S32 width = cfg->width; RK_S32 height = cfg->height; RK_S32 bps = cfg->bitRate; diff --git a/test/mpi_rc_test.c b/test/mpi_rc_test.c index 32bb804a..54f74194 100644 --- a/test/mpi_rc_test.c +++ b/test/mpi_rc_test.c @@ -456,10 +456,12 @@ static MPP_RET mpi_rc_codec(MpiRcTestCtx *ctx) RK_U64 stream_size_1s = 0; // runtime config - MppEncCfgSet cfg; - MppEncRcCfg *rc_cfg = &cfg.rc; - MppEncPrepCfg *prep_cfg = &cfg.prep; - MppEncCodecCfg *codec_cfg = &cfg.codec; + MppEncRcCfg rc; + MppEncPrepCfg prep; + MppEncCodecCfg codec; + MppEncRcCfg *rc_cfg = &rc; + MppEncPrepCfg *prep_cfg = &prep; + MppEncCodecCfg *codec_cfg = &codec; RK_S32 fps = 20; mpp_log_f("test start width %d height %d codingtype %d\n", width, height, type);