[FFmpeg-cvslog] avcodec/mediacodecenc: add max-bframes support

Zhao Zhili git at videolan.org
Fri Dec 16 14:35:57 EET 2022


ffmpeg | branch: master | Zhao Zhili <zhilizhao at tencent.com> | Wed Dec  7 17:31:21 2022 +0800| [a86bb1d2ce9b11a00fa343748b4768c6534b416f] | committer: Zhao Zhili

avcodec/mediacodecenc: add max-bframes support

Signed-off-by: Zhao Zhili <zhilizhao at tencent.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a86bb1d2ce9b11a00fa343748b4768c6534b416f
---

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

diff --git a/libavcodec/mediacodecenc.c b/libavcodec/mediacodecenc.c
index 96bc9c9c28..50994ce864 100644
--- a/libavcodec/mediacodecenc.c
+++ b/libavcodec/mediacodecenc.c
@@ -275,6 +275,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);



More information about the ffmpeg-cvslog mailing list