Browse code

rtpdec_xiph: Handle the sampling SDP parameter

Patch by Josh Allmann, joshua dot allmann at gmail

Originally committed as revision 24565 to svn://svn.ffmpeg.org/ffmpeg/trunk

Josh Allmann authored on 2010/07/28 15:43:58
Showing 1 changed files
... ...
@@ -293,7 +293,17 @@ static int xiph_parse_fmtp_pair(AVStream* stream,
293 293
     int result = 0;
294 294
 
295 295
     if (!strcmp(attr, "sampling")) {
296
-        return AVERROR_PATCHWELCOME;
296
+        if (!strcmp(value, "YCbCr-4:2:0")) {
297
+            codec->pix_fmt = PIX_FMT_YUV420P;
298
+        } else if (!strcmp(value, "YCbCr-4:4:2")) {
299
+            codec->pix_fmt = PIX_FMT_YUV422P;
300
+        } else if (!strcmp(value, "YCbCr-4:4:4")) {
301
+            codec->pix_fmt = PIX_FMT_YUV444P;
302
+        } else {
303
+            av_log(codec, AV_LOG_ERROR,
304
+                   "Unsupported pixel format %s\n", attr);
305
+            return AVERROR_INVALIDDATA;
306
+        }
297 307
     } else if (!strcmp(attr, "width")) {
298 308
         /* This is an integer between 1 and 1048561
299 309
          * and MUST be in multiples of 16. */