diff mbox series

[FFmpeg-devel,04/11] avformat/rtpdec_rfc4175: support for yuv420p format

Message ID 1636712536-13114-4-git-send-email-lance.lmwang@gmail.com
State New
Headers show
Series [FFmpeg-devel,01/11] avformat/rtpdec_rfc4175: use rawvideo for uyvy422
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 Nov. 12, 2021, 10:22 a.m. UTC
From: Limin Wang <lance.lmwang@gmail.com>

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

Patch

diff --git a/libavformat/rtpdec_rfc4175.c b/libavformat/rtpdec_rfc4175.c
index fe0754f..81930ce 100644
--- a/libavformat/rtpdec_rfc4175.c
+++ b/libavformat/rtpdec_rfc4175.c
@@ -61,6 +61,17 @@  static int rfc4175_parse_format(AVStream *stream, PayloadContext *data)
         } else {
             return AVERROR_INVALIDDATA;
         }
+    } else if (!strncmp(data->sampling, "YCbCr-4:2:0", 11)) {
+        data->xinc = 4;
+
+        if (data->depth == 8) {
+            data->pgroup = 6;
+            pixfmt = AV_PIX_FMT_YUV420P;
+            stream->codecpar->codec_id = AV_CODEC_ID_RAWVIDEO;
+        } else {
+            return AVERROR_INVALIDDATA;
+        }
+
     } else {
         return AVERROR_INVALIDDATA;
     }