comparison rtpdec_xiph.c @ 6332:2f14ee83c673 libavformat

rtpdec_xiph: Handle the sampling SDP parameter Patch by Josh Allmann, joshua dot allmann at gmail
author mstorsjo
date Wed, 28 Jul 2010 06:43:58 +0000
parents 408722fc3bf1
children 491eea5c52d6
comparison
equal deleted inserted replaced
6331:f782d4b790fc 6332:2f14ee83c673
291 { 291 {
292 AVCodecContext *codec = stream->codec; 292 AVCodecContext *codec = stream->codec;
293 int result = 0; 293 int result = 0;
294 294
295 if (!strcmp(attr, "sampling")) { 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 } else if (!strcmp(attr, "width")) { 307 } else if (!strcmp(attr, "width")) {
298 /* This is an integer between 1 and 1048561 308 /* This is an integer between 1 and 1048561
299 * and MUST be in multiples of 16. */ 309 * and MUST be in multiples of 16. */
300 codec->width = atoi(value); 310 codec->width = atoi(value);
301 return 0; 311 return 0;