Skip to content

Commit

Permalink
avcodec/mediacodecenc: configure profile
Browse files Browse the repository at this point in the history
Signed-off-by: Zhao Zhili <[email protected]>
  • Loading branch information
quink-black committed Dec 8, 2022
1 parent 0da8802 commit 2401494
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions libavcodec/mediacodecenc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 2401494

Please sign in to comment.