sdp: add support for H.261
authorThomas Volkert <thomas@homer-conferencing.com>
Fri, 3 Oct 2014 22:17:01 +0000 (00:17 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 4 Oct 2014 21:52:29 +0000 (23:52 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 1c4c78ee4073b2387681d916a167b758369b9216)

Conflicts:

libavformat/version.h

libavformat/sdp.c

index 8c831f3..bc27eae 100644 (file)
@@ -414,6 +414,19 @@ static char *sdp_write_media_attributes(char *buff, int size, AVCodecContext *c,
                                      payload_type, mode, config ? config : "");
             break;
         }
+        case AV_CODEC_ID_H261:
+        {
+            const char *pic_fmt = NULL;
+            /* only QCIF and CIF are specified as supported in RFC 4587 */
+            if (c->width == 176 && c->height == 144)
+                pic_fmt = "QCIF=1";
+            if (c->width == 352 && c->height == 288)
+                pic_fmt = "CIF=1";
+            av_strlcatf(buff, size, "a=rtpmap:%d H261/90000\r\n", payload_type);
+            if (pic_fmt)
+                av_strlcatf(buff, size, "a=fmtp:%d %s\r\n", payload_type, pic_fmt);
+            break;
+        }
         case AV_CODEC_ID_H263:
         case AV_CODEC_ID_H263P:
             /* a=framesize is required by 3GPP TS 26.234 (PSS). It