[FFmpeg-devel] [PATCH v2 3/4] avformat/rtpdec_rfc4175: add support for colorimetry
lance.lmwang at gmail.com
lance.lmwang at gmail.com
Mon Oct 11 19:23:11 EEST 2021
From: Limin Wang <lance.lmwang at gmail.com>
Signed-off-by: Limin Wang <lance.lmwang at gmail.com>
---
libavformat/rtpdec_rfc4175.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/libavformat/rtpdec_rfc4175.c b/libavformat/rtpdec_rfc4175.c
index d45530e..93607d7 100644
--- a/libavformat/rtpdec_rfc4175.c
+++ b/libavformat/rtpdec_rfc4175.c
@@ -107,6 +107,17 @@ static int rfc4175_parse_fmtp(AVFormatContext *s, AVStream *stream,
stream->codecpar->color_trc = AVCOL_TRC_SMPTEST428_1;
else
stream->codecpar->color_trc = AVCOL_TRC_UNSPECIFIED;
+ } else if (!strncmp(attr, "colorimetry", 11)) {
+ if (!strncmp(value, "BT601", 5)) {
+ stream->codecpar->color_primaries = AVCOL_PRI_BT470BG;
+ stream->codecpar->color_space = AVCOL_SPC_BT470BG;
+ } else if (!strncmp(value, "BT709", 5)) {
+ stream->codecpar->color_primaries = AVCOL_PRI_BT709;
+ stream->codecpar->color_space = AVCOL_SPC_BT709;
+ } else if (!strncmp(value, "BT2020", 6)) {
+ stream->codecpar->color_primaries = AVCOL_PRI_BT2020;
+ stream->codecpar->color_space = AVCOL_SPC_BT2020_NCL;
+ }
}
return 0;
--
1.8.3.1
More information about the ffmpeg-devel
mailing list