[mpp_dec]: add immediate_out flag in mpp struct

tips: control cmd for immediate_out, can send both before and after mpp_init.

Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
Change-Id: Ibe66878cfab1f592b952d01bee3adade7c9d31bc
This commit is contained in:
Ding Wei
2020-05-27 09:30:44 +08:00
parent c21d2dee3b
commit 8d38d4b2f0
6 changed files with 13 additions and 3 deletions

View File

@@ -335,7 +335,7 @@ MPP_RET h264d_init(void *decoder, ParserCfg *init)
FUN_CHECK(ret = init_cur_ctx(p_Dec->p_Cur));
FUN_CHECK(ret = init_vid_ctx(p_Dec->p_Vid));
FUN_CHECK(ret = init_dec_ctx(p_Dec));
p_Dec->immediate_out = init->immediate_out;
__RETURN:
return ret = MPP_OK;
__FAILED:

View File

@@ -28,6 +28,7 @@ typedef struct {
RK_U32 fast_mode;
RK_U32 need_split;
RK_U32 internal_pts;
RK_U32 immedaite_out;
void *mpp;
} MppDecCfg;

View File

@@ -37,6 +37,7 @@ typedef struct DecParserInitCfg_t {
// output
RK_S32 task_count;
RK_U32 need_split;
RK_U32 immediate_out;
RK_U32 internal_pts;
} ParserCfg;

View File

@@ -1300,6 +1300,7 @@ MPP_RET mpp_dec_init(MppDec *dec, MppDecCfg *cfg)
packet_slots,
hal_task_count,
cfg->need_split,
cfg->immedaite_out,
cfg->internal_pts,
};

View File

@@ -169,7 +169,7 @@ private:
RK_U32 mParserFastMode;
RK_U32 mParserNeedSplit;
RK_U32 mParserInternalPts; /* for MPEG2/MPEG4 */
RK_U32 mImmediateOut;
/* backup extra packet for seek */
MppPacket mExtraPacket;

View File

@@ -87,6 +87,7 @@ Mpp::Mpp()
mParserFastMode(0),
mParserNeedSplit(0),
mParserInternalPts(0),
mImmediateOut(0),
mExtraPacket(NULL),
mDump(NULL)
{
@@ -140,6 +141,7 @@ MPP_RET Mpp::init(MppCtxType type, MppCodingType coding)
mParserFastMode,
mParserNeedSplit,
mParserInternalPts,
mImmediateOut,
this,
};
@@ -815,11 +817,16 @@ MPP_RET Mpp::control_dec(MpiCmd cmd, MppParam param)
*((RK_S32 *)param) = mPackets->list_size();
ret = MPP_OK;
} break;
case MPP_DEC_SET_IMMEDIATE_OUT: {
mImmediateOut = *((RK_U32 *)param);
ret = MPP_OK;
if (mDec)
ret = mpp_dec_control(mDec, cmd, param);
} break;
case MPP_DEC_GET_VPUMEM_USED_COUNT:
case MPP_DEC_SET_OUTPUT_FORMAT:
case MPP_DEC_SET_DISABLE_ERROR:
case MPP_DEC_SET_PRESENT_TIME_ORDER:
case MPP_DEC_SET_IMMEDIATE_OUT:
case MPP_DEC_SET_ENABLE_DEINTERLACE: {
ret = mpp_dec_control(mDec, cmd, param);
}