Browse code

sdp: add support for H.261

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 1c4c78ee4073b2387681d916a167b758369b9216)

Conflicts:

libavformat/version.h

Thomas Volkert authored on 2014/10/04 07:17:01
Showing 1 changed files
... ...
@@ -414,6 +414,19 @@ static char *sdp_write_media_attributes(char *buff, int size, AVCodecContext *c,
414 414
                                      payload_type, mode, config ? config : "");
415 415
             break;
416 416
         }
417
+        case AV_CODEC_ID_H261:
418
+        {
419
+            const char *pic_fmt = NULL;
420
+            /* only QCIF and CIF are specified as supported in RFC 4587 */
421
+            if (c->width == 176 && c->height == 144)
422
+                pic_fmt = "QCIF=1";
423
+            if (c->width == 352 && c->height == 288)
424
+                pic_fmt = "CIF=1";
425
+            av_strlcatf(buff, size, "a=rtpmap:%d H261/90000\r\n", payload_type);
426
+            if (pic_fmt)
427
+                av_strlcatf(buff, size, "a=fmtp:%d %s\r\n", payload_type, pic_fmt);
428
+            break;
429
+        }
417 430
         case AV_CODEC_ID_H263:
418 431
         case AV_CODEC_ID_H263P:
419 432
             /* a=framesize is required by 3GPP TS 26.234 (PSS). It