diff mbox series

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

Message ID tencent_92A7F0AA875313DC5A4B9A663B109CE6D806@qq.com
State New
Headers show
Series [FFmpeg-devel,1/7] avcodec/mediacodecenc: add bitrate_mode option | expand

Checks

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

Commit Message

zhilizhao(赵志立) Dec. 4, 2022, 5:12 p.m. UTC
From: Zhao Zhili <zhilizhao@tencent.com>

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

Patch

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);