From 5df6206e87edb644a18669c72411aa31e44be1d1 Mon Sep 17 00:00:00 2001 From: "arvin.zhu" Date: Thu, 8 Sep 2022 10:30:00 +0800 Subject: [PATCH] omx: support to change gop of hevc support to change gop of hevc Signed-off-by: arvin.zhu --- libavcodec/omx.c | 11 +++++++++++ 1 file changed, 11 insertions(+) mode change 100644 => 100755 libavcodec/omx.c diff --git a/libavcodec/omx.c b/libavcodec/omx.c old mode 100644 new mode 100755 index 84b0835..1040094 --- a/libavcodec/omx.c +++ b/libavcodec/omx.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -545,6 +546,16 @@ static av_cold int omx_component_init(AVCodecContext *avctx, const char *role) } err = OMX_SetParameter(s->handle, OMX_IndexParamVideoAvc, &avc); CHECK(err); + } else if (avctx->codec->id == AV_CODEC_ID_HEVC) { + OMX_VIDEO_PARAM_AVCTYPE hevc = { 0 }; + INIT_STRUCT(hevc); + hevc.nPortIndex = s->out_port; + err = OMX_GetParameter(s->handle, OMX_IndexParamVideoHevc, &hevc); + CHECK(err); + hevc.nBFrames = 0; + hevc.nPFrames = avctx->gop_size; + err = OMX_SetParameter(s->handle, OMX_IndexParamVideoHevc, &hevc); + CHECK(err); } err = OMX_SendCommand(s->handle, OMX_CommandStateSet, OMX_StateIdle, NULL); -- 2.17.1