[FFmpeg-cvslog] avformat: suppport YUV 4:2:2 10-bit for rfc4175

Limin Wang git at videolan.org
Thu Nov 25 12:19:58 EET 2021


ffmpeg | branch: master | Limin Wang <lance.lmwang at gmail.com> | Thu Nov 11 22:39:14 2021 +0800| [7b55f95f71559b2e76bdc6e7d6dcf12b3b5a8677] | committer: Limin Wang

avformat: suppport YUV 4:2:2 10-bit for rfc4175

Reviewed-by: Lynne <dev at lynne.ee>
Signed-off-by: Limin Wang <lance.lmwang at gmail.com>

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

 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 4f115cc77e..17f5d9d308 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_BITPACKED:
         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_BITPACKED:
     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 6fa34b64cb..4623b4ac23 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 cc04d70c0d..5ad2a54474 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_BITPACKED:
         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;



More information about the ffmpeg-cvslog mailing list