diff mbox series

[FFmpeg-devel,v3,6/7] avformat: suppport for 4:2:2 10-bit for rfc4175

Message ID 1637767665-6777-6-git-send-email-lance.lmwang@gmail.com
State Accepted
Commit 7b55f95f71559b2e76bdc6e7d6dcf12b3b5a8677
Headers show
Series [FFmpeg-devel,v3,1/7] avformat/rtpdec_rfc4175: use rawvideo for uyvy422 | expand

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

Lance Wang Nov. 24, 2021, 3:27 p.m. UTC
From: Limin Wang <lance.lmwang@gmail.com>

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

Patch

diff --git a/libavformat/rtpenc.c b/libavformat/rtpenc.c
index 4f115cc..17f5d9d 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 6fa34b6..4623b4a 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..5ad2a54 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;