mirror of
https://github.com/nyanmisaka/mpp.git
synced 2025-10-07 10:00:55 +08:00
[av1d_api]: fix usr_set_fmt flag assignment err
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com> Change-Id: Ia9e1a7025145acda57b0c8ba2ea8eedcb97945cc
This commit is contained in:
@@ -49,6 +49,7 @@ MPP_RET av1d_init(void *ctx, ParserCfg *init)
|
|||||||
}
|
}
|
||||||
|
|
||||||
av1_ctx->pix_fmt = MPP_FMT_BUTT;
|
av1_ctx->pix_fmt = MPP_FMT_BUTT;
|
||||||
|
av1_ctx->usr_set_fmt = MPP_FMT_BUTT;
|
||||||
|
|
||||||
if ((ret = av1d_parser_init(av1_ctx, init)) != MPP_OK)
|
if ((ret = av1d_parser_init(av1_ctx, init)) != MPP_OK)
|
||||||
goto _err_exit;
|
goto _err_exit;
|
||||||
@@ -252,12 +253,12 @@ MPP_RET av1d_control(void *ctx, MpiCmd cmd, void *param)
|
|||||||
Av1CodecContext *av1_ctx = (Av1CodecContext *)ctx;
|
Av1CodecContext *av1_ctx = (Av1CodecContext *)ctx;
|
||||||
MPP_RET ret = MPP_OK;
|
MPP_RET ret = MPP_OK;
|
||||||
|
|
||||||
if (!ctx || !param)
|
if (!ctx)
|
||||||
return MPP_ERR_VALUE;
|
return MPP_ERR_VALUE;
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case MPP_DEC_SET_OUTPUT_FORMAT : {
|
case MPP_DEC_SET_OUTPUT_FORMAT : {
|
||||||
av1_ctx->usr_set_fmt = *(MppFrameFormat*)param;
|
av1_ctx->usr_set_fmt = param ? *((MppFrameFormat *)param) : MPP_FMT_YUV420SP;
|
||||||
} break;
|
} break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@@ -124,7 +124,7 @@ typedef struct Av1CodecContext_t {
|
|||||||
RK_U32 stream_offset;
|
RK_U32 stream_offset;
|
||||||
|
|
||||||
RK_S32 eos;
|
RK_S32 eos;
|
||||||
RK_U32 usr_set_fmt;
|
MppFrameFormat usr_set_fmt;
|
||||||
} Av1CodecContext;
|
} Av1CodecContext;
|
||||||
|
|
||||||
#endif /*__AV1D_CODEC_H__*/
|
#endif /*__AV1D_CODEC_H__*/
|
||||||
|
@@ -120,7 +120,8 @@ static MPP_RET get_pixel_format(Av1CodecContext *ctx)
|
|||||||
pix_fmt = MPP_FMT_YUV420SP;
|
pix_fmt = MPP_FMT_YUV420SP;
|
||||||
else if (bit_depth == 10) {
|
else if (bit_depth == 10) {
|
||||||
pix_fmt = MPP_FMT_YUV420SP_10BIT;
|
pix_fmt = MPP_FMT_YUV420SP_10BIT;
|
||||||
if (ctx->usr_set_fmt && s->cfg->base.out_fmt == MPP_FMT_YUV420SP)
|
if ((ctx->usr_set_fmt & MPP_FRAME_FMT_MASK) == MPP_FMT_YUV420SP &&
|
||||||
|
(s->cfg->base.out_fmt & MPP_FRAME_FMT_MASK) == MPP_FMT_YUV420SP)
|
||||||
pix_fmt = MPP_FMT_YUV420SP;
|
pix_fmt = MPP_FMT_YUV420SP;
|
||||||
} else {
|
} else {
|
||||||
mpp_err_f("no support MPP_FMT_YUV420SP bit depth > 8\n");
|
mpp_err_f("no support MPP_FMT_YUV420SP bit depth > 8\n");
|
||||||
|
Reference in New Issue
Block a user