diff mbox series

[FFmpeg-devel,v2,2/4] avformat/rtpdec_rfc4175: add support for TCS

Message ID 1633969392-17937-2-git-send-email-lance.lmwang@gmail.com
State Accepted
Commit ca56fedab50b63b81ee62637df3d0c3eed64d7fe
Headers show
Series [FFmpeg-devel,v2,1/4] avformat/rtpdec_rfc4175: add support for exactframerate
Related show

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/make_ppc success Make finished
andriy/make_fate_ppc success Make fate finished

Commit Message

Limin Wang Oct. 11, 2021, 4:23 p.m. UTC
From: Limin Wang <lance.lmwang@gmail.com>

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
---
 libavformat/rtpdec_rfc4175.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)
diff mbox series

Patch

diff --git a/libavformat/rtpdec_rfc4175.c b/libavformat/rtpdec_rfc4175.c
index 060f725..d45530e 100644
--- a/libavformat/rtpdec_rfc4175.c
+++ b/libavformat/rtpdec_rfc4175.c
@@ -94,6 +94,19 @@  static int rfc4175_parse_fmtp(AVFormatContext *s, AVStream *stream,
     else if (!strncmp(attr, "exactframerate", 14)) {
         if (av_parse_video_rate(&data->framerate, value) < 0)
             return AVERROR(EINVAL);
+    } else if (!strncmp(attr, "TCS", 3)) {
+        if (!strncmp(value, "SDR", 3))
+            stream->codecpar->color_trc = AVCOL_TRC_BT709;
+        else if (!strncmp(value, "PQ", 2))
+            stream->codecpar->color_trc = AVCOL_TRC_SMPTE2084;
+        else if (!strncmp(value, "HLG", 3))
+            stream->codecpar->color_trc = AVCOL_TRC_ARIB_STD_B67;
+        else if (!strncmp(value, "LINEAR", 6))
+            stream->codecpar->color_trc = AVCOL_TRC_LINEAR;
+        else if (!strncmp(value, "ST428-1", 7))
+            stream->codecpar->color_trc = AVCOL_TRC_SMPTEST428_1;
+        else
+            stream->codecpar->color_trc = AVCOL_TRC_UNSPECIFIED;
     }
 
     return 0;