diff mbox series

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

Message ID tencent_19564BBA6631509EE6C667F82A8C9337DC06@qq.com
State New
Headers show
Series [FFmpeg-devel,v2,1/7] avcodec/mediacodecenc: make each encoder has its own option | expand


Context Check Description
andriy/configure_x86 warning Failed to apply patch
yinshiyou/configure_loongarch64 warning Failed to apply patch

Commit Message

Zhao Zhili Dec. 7, 2022, 9:31 a.m. UTC
From: Zhao Zhili <zhilizhao@tencent.com>

 libavcodec/mediacodecenc.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series


diff --git a/libavcodec/mediacodecenc.c b/libavcodec/mediacodecenc.c
index 8e28a50e0d..e9cff8167a 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);