summaryrefslogtreecommitdiff
path: root/libavformat/sdp.c
diff options
context:
space:
mode:
authorLimin Wang <lance.lmwang@gmail.com>2021-11-13 18:06:02 +0800
committerLimin Wang <lance.lmwang@gmail.com>2021-11-25 15:04:35 +0800
commit4f5352d5fe6ce801cfd0a45e8564373eeec595da (patch)
treee9e806fc7e265e09ca878564177befea8f2bc300 /libavformat/sdp.c
parent05b0c66313abc87505e9298f432476c33588c932 (diff)
avformat/rtpenc: adds partial support for the RFC 4175
Reviewed-by: Lynne <dev@lynne.ee> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Diffstat (limited to 'libavformat/sdp.c')
-rw-r--r--libavformat/sdp.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/libavformat/sdp.c b/libavformat/sdp.c
index 1200e553f9..cc04d70c0d 100644
--- a/libavformat/sdp.c
+++ b/libavformat/sdp.c
@@ -660,6 +660,31 @@ 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_RAWVIDEO: {
+ const char *pix_fmt;
+ int bit_depth = 8;
+
+ switch (p->format) {
+ case AV_PIX_FMT_UYVY422:
+ pix_fmt = "YCbCr-4:2:2";
+ break;
+ case AV_PIX_FMT_YUV420P:
+ pix_fmt = "YCbCr-4:2:0";
+ break;
+ default:
+ av_log(fmt, AV_LOG_ERROR, "Unsupported pixel format.\n");
+ return NULL;
+ }
+
+ av_strlcatf(buff, size, "a=rtpmap:%d raw/90000\r\n"
+ "a=fmtp:%d sampling=%s; "
+ "width=%d; height=%d; "
+ "depth=%d\r\n",
+ payload_type, payload_type,
+ pix_fmt, p->width, p->height, bit_depth);
+ break;
+ }
+
case AV_CODEC_ID_VP8:
av_strlcatf(buff, size, "a=rtpmap:%d VP8/90000\r\n",
payload_type);