aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZhao Zhili <zhilizhao@tencent.com>2022-11-28 00:51:37 +0800
committerZhao Zhili <zhilizhao@tencent.com>2022-12-08 23:55:37 +0800
commit2401494e96446c7f9cedf73cee548932db0a6e2a (patch)
treebd1123621467881f4d46cbd50e3ee4e540dd1fa8
parent0da8802e957783ba4131fbf306f1f53b4b78ab4e (diff)
downloadffmpeg-2401494e96446c7f9cedf73cee548932db0a6e2a.tar.gz
avcodec/mediacodecenc: configure profile
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
-rw-r--r--libavcodec/mediacodecenc.c5
1 files changed, 5 insertions, 0 deletions
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);