[FFmpeg-cvslog] avformat/rtpdec_rfc4175: add support for colorimetry

Limin Wang git at videolan.org
Sun Oct 17 12:03:09 EEST 2021


ffmpeg | branch: master | Limin Wang <lance.lmwang at gmail.com> | Tue Oct 12 00:13:28 2021 +0800| [bad48dfe9ae345966a94852b45d4deb327895372] | committer: Limin Wang

avformat/rtpdec_rfc4175: add support for colorimetry

Signed-off-by: Limin Wang <lance.lmwang at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=bad48dfe9ae345966a94852b45d4deb327895372
---

 libavformat/rtpdec_rfc4175.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

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;



More information about the ffmpeg-cvslog mailing list