aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorLimin Wang <lance.lmwang@gmail.com>2021-10-12 00:13:28 +0800
committerLimin Wang <lance.lmwang@gmail.com>2021-10-17 16:54:03 +0800
commitbad48dfe9ae345966a94852b45d4deb327895372 (patch)
tree38a8c5ea9b238205f4ffe1378392c51c2bc68551 /libavformat
parentca56fedab50b63b81ee62637df3d0c3eed64d7fe (diff)
downloadffmpeg-bad48dfe9ae345966a94852b45d4deb327895372.tar.gz
avformat/rtpdec_rfc4175: add support for colorimetry
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/rtpdec_rfc4175.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/libavformat/rtpdec_rfc4175.c b/libavformat/rtpdec_rfc4175.c
index d45530e228..93607d74e0 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;