diff options
author | Zhao Zhili <zhilizhao@tencent.com> | 2022-11-24 00:49:25 +0800 |
---|---|---|
committer | Zhao Zhili <zhilizhao@tencent.com> | 2022-12-08 23:52:39 +0800 |
commit | a63834b236c17eae72faf23aebcba32f911809e6 (patch) | |
tree | f8caca1863df9ce0b064d270409392b473d42676 /libavcodec/mediacodecdec_common.c | |
parent | f0f19f3d3d58eb9030fdf54884c5ea94e5481604 (diff) |
avcodec/mediacodec: fix missing crop info when use NDK MediaCodec
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
Diffstat (limited to 'libavcodec/mediacodecdec_common.c')
-rw-r--r-- | libavcodec/mediacodecdec_common.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/mediacodecdec_common.c b/libavcodec/mediacodecdec_common.c index 80089439ea..03bee11918 100644 --- a/libavcodec/mediacodecdec_common.c +++ b/libavcodec/mediacodecdec_common.c @@ -486,6 +486,10 @@ static int mediacodec_dec_parse_format(AVCodecContext *avctx, MediaCodecDecConte AMEDIAFORMAT_GET_INT32(s->crop_left, "crop-left", 0); AMEDIAFORMAT_GET_INT32(s->crop_right, "crop-right", 0); + // Try "crop" for NDK + if (!(s->crop_right && s->crop_bottom) && s->use_ndk_codec) + ff_AMediaFormat_getRect(s->format, "crop", &s->crop_left, &s->crop_top, &s->crop_right, &s->crop_bottom); + if (s->crop_right && s->crop_bottom) { width = s->crop_right + 1 - s->crop_left; height = s->crop_bottom + 1 - s->crop_top; |