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

lance.lmwang at gmail.com lance.lmwang at gmail.com
Fri Nov 12 12:22:09 EET 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 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;
     }
-- 
1.8.3.1



More information about the ffmpeg-devel mailing list