aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorZhao Zhili <zhilizhao@tencent.com>2023-03-11 04:48:45 +0800
committerZhao Zhili <zhilizhao@tencent.com>2023-03-18 00:13:17 +0800
commitf543f12817a2c11e942dc3f3eca78287417e13fa (patch)
treea478d24c2c0c091f83b587e3b2d395f195f4e731 /libavcodec
parentd0c6389e91f2e3254c602be9b5ca2e35922c39a3 (diff)
downloadffmpeg-f543f12817a2c11e942dc3f3eca78287417e13fa.tar.gz
avcodec/mediacodecenc: pass colorspace info to encoder
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/mediacodecenc.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/libavcodec/mediacodecenc.c b/libavcodec/mediacodecenc.c
index a92a8dc5a9..2ab56597fe 100644
--- a/libavcodec/mediacodecenc.c
+++ b/libavcodec/mediacodecenc.c
@@ -243,6 +243,16 @@ static av_cold int mediacodec_init(AVCodecContext *avctx)
}
}
+ ret = ff_AMediaFormatColorRange_from_AVColorRange(avctx->color_range);
+ if (ret != COLOR_RANGE_UNSPECIFIED)
+ ff_AMediaFormat_setInt32(format, "color-range", ret);
+ ret = ff_AMediaFormatColorStandard_from_AVColorSpace(avctx->colorspace);
+ if (ret != COLOR_STANDARD_UNSPECIFIED)
+ ff_AMediaFormat_setInt32(format, "color-standard", ret);
+ ret = ff_AMediaFormatColorTransfer_from_AVColorTransfer(avctx->color_trc);
+ if (ret != COLOR_TRANSFER_UNSPECIFIED)
+ ff_AMediaFormat_setInt32(format, "color-transfer", ret);
+
if (avctx->bit_rate)
ff_AMediaFormat_setInt32(format, "bitrate", avctx->bit_rate);
if (s->bitrate_mode >= 0)