[FFmpeg-devel] [PATCH 09/11] avformat: suppport for 4:2:2 10-bit for rfc4175

lance.lmwang at gmail.com lance.lmwang at gmail.com
Fri Nov 12 12:22:14 EET 2021


From: Limin Wang <lance.lmwang at gmail.com>

Signed-off-by: Limin Wang <lance.lmwang at gmail.com>
---
 libavformat/rtpenc.c         | 2 ++
 libavformat/rtpenc_rfc4175.c | 4 ++++
 libavformat/sdp.c            | 5 +++++
 3 files changed, 11 insertions(+)

diff --git a/libavformat/rtpenc.c b/libavformat/rtpenc.c
index 4f115cc..a60e647 100644
--- a/libavformat/rtpenc.c
+++ b/libavformat/rtpenc.c
@@ -85,6 +85,7 @@ static int is_supported(enum AVCodecID id)
     case AV_CODEC_ID_SPEEX:
     case AV_CODEC_ID_OPUS:
     case AV_CODEC_ID_RAWVIDEO:
+    case AV_CODEC_ID_S210:
         return 1;
     default:
         return 0;
@@ -620,6 +621,7 @@ static int rtp_write_packet(AVFormatContext *s1, AVPacket *pkt)
     case AV_CODEC_ID_MJPEG:
         ff_rtp_send_jpeg(s1, pkt->data, size);
         break;
+    case AV_CODEC_ID_S210:
     case AV_CODEC_ID_RAWVIDEO:
         ff_rtp_send_raw_rfc4175 (s1, pkt->data, size);
         break;
diff --git a/libavformat/rtpenc_rfc4175.c b/libavformat/rtpenc_rfc4175.c
index b6f833b..38f9611 100644
--- a/libavformat/rtpenc_rfc4175.c
+++ b/libavformat/rtpenc_rfc4175.c
@@ -37,6 +37,10 @@ void ff_rtp_send_raw_rfc4175(AVFormatContext *s1, const uint8_t *buf, int size)
             xinc = yinc = 2;
             pgroup = 4;
             break;
+        case AV_PIX_FMT_YUV422P10:
+            xinc = yinc = 2;
+            pgroup = 5;
+            break;
         case AV_PIX_FMT_YUV420P:
             xinc = yinc = 4;
             pgroup = 6;
diff --git a/libavformat/sdp.c b/libavformat/sdp.c
index cc04d70..fdce4f5 100644
--- a/libavformat/sdp.c
+++ b/libavformat/sdp.c
@@ -660,6 +660,7 @@ static char *sdp_write_media_attributes(char *buff, int size, AVStream *st, int
                                     p->width, p->height, pix_fmt, config);
             break;
         }
+        case AV_CODEC_ID_S210:
         case AV_CODEC_ID_RAWVIDEO: {
             const char *pix_fmt;
             int bit_depth = 8;
@@ -668,6 +669,10 @@ static char *sdp_write_media_attributes(char *buff, int size, AVStream *st, int
             case AV_PIX_FMT_UYVY422:
                 pix_fmt = "YCbCr-4:2:2";
                 break;
+            case AV_PIX_FMT_YUV422P10:
+                pix_fmt = "YCbCr-4:2:2";
+                bit_depth = 10;
+                break;
             case AV_PIX_FMT_YUV420P:
                 pix_fmt = "YCbCr-4:2:0";
                 break;
-- 
1.8.3.1



More information about the ffmpeg-devel mailing list