diff mbox series

[FFmpeg-devel,3/3] avcodec/mediacodecenc: configure profile

Message ID tencent_763919C09DB6146B1E0215689A7FEAAC8E0A@qq.com
State Accepted
Commit 2401494e96446c7f9cedf73cee548932db0a6e2a
Headers show
Series [FFmpeg-devel,1/3] avcodec/mediacodecenc: add option to select codec by name | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Zhao Zhili Nov. 27, 2022, 4:55 p.m. UTC
From: Zhao Zhili <zhilizhao@tencent.com>

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

Patch

diff --git a/libavcodec/mediacodecenc.c b/libavcodec/mediacodecenc.c
index 693faca118..69246ad693 100644
--- a/libavcodec/mediacodecenc.c
+++ b/libavcodec/mediacodecenc.c
@@ -213,6 +213,11 @@  static av_cold int mediacodec_init(AVCodecContext *avctx)
     ff_AMediaFormat_setInt32(format, "frame-rate", s->fps);
     ff_AMediaFormat_setInt32(format, "i-frame-interval", gop);
 
+    ret = ff_AMediaCodecProfile_getProfileFromAVCodecContext(avctx);
+    if (ret > 0) {
+        av_log(avctx, AV_LOG_DEBUG, "set profile to 0x%x\n", ret);
+        ff_AMediaFormat_setInt32(format, "profile", ret);
+    }
 
     ret = ff_AMediaCodec_getConfigureFlagEncode(s->codec);
     ret = ff_AMediaCodec_configure(s->codec, format, s->window, NULL, ret);