[FFmpeg-devel] [PATCH 6/7] avcodec/mediacodecenc: add max-bframes support

Zhao Zhili quinkblack at foxmail.com
Sun Dec 4 19:12:27 EET 2022


From: Zhao Zhili <zhilizhao at tencent.com>

---
 libavcodec/mediacodecenc.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/mediacodecenc.c b/libavcodec/mediacodecenc.c
index 4b0397d1ea..9378563fac 100644
--- a/libavcodec/mediacodecenc.c
+++ b/libavcodec/mediacodecenc.c
@@ -264,6 +264,8 @@ static av_cold int mediacodec_init(AVCodecContext *avctx)
         av_log(avctx, AV_LOG_DEBUG, "set level to 0x%x\n", s->level);
         ff_AMediaFormat_setInt32(format, "level", s->level);
     }
+    if (avctx->max_b_frames > 0)
+        ff_AMediaFormat_setInt32(format, "max-bframes", avctx->max_b_frames);
 
     ret = ff_AMediaCodec_getConfigureFlagEncode(s->codec);
     ret = ff_AMediaCodec_configure(s->codec, format, s->window, NULL, ret);
-- 
2.25.1



More information about the ffmpeg-devel mailing list