Index: media/ffmpeg/ffmpeg_common.cc |
diff --git a/media/ffmpeg/ffmpeg_common.cc b/media/ffmpeg/ffmpeg_common.cc |
index 396ee03758022f72bceeb195cfc1857f3569a581..8804f7ca8bca561ad19ddfd7a28fa3fa8fab13d7 100644 |
--- a/media/ffmpeg/ffmpeg_common.cc |
+++ b/media/ffmpeg/ffmpeg_common.cc |
@@ -127,6 +127,20 @@ static CodecID VideoCodecToCodecID(VideoCodec video_codec) { |
return CODEC_ID_NONE; |
} |
+static VideoCodecProfile ProfileIDToVideoCodecProfile(int profile) { |
+ switch (profile) { |
+ case FF_PROFILE_H264_BASELINE: return H264PROFILE_BASELINE; |
scherkus (not reviewing)
2011/12/06 00:27:44
let's drop the returns to the next line
Ami GONE FROM CHROMIUM
2011/12/07 00:03:04
What, you think vertical space grows on trees???
D
|
+ case FF_PROFILE_H264_MAIN: return H264PROFILE_MAIN; |
+ case FF_PROFILE_H264_EXTENDED: return H264PROFILE_EXTENDED; |
+ case FF_PROFILE_H264_HIGH: return H264PROFILE_HIGH; |
+ case FF_PROFILE_H264_HIGH_10: return H264PROFILE_HIGH10PROFILE; |
+ case FF_PROFILE_H264_HIGH_422: return H264PROFILE_HIGH422PROFILE; |
+ case FF_PROFILE_H264_HIGH_444_PREDICTIVE: |
+ return H264PROFILE_HIGH444PREDICTIVEPROFILE; |
+ } |
+ return VIDEO_CODEC_PROFILE_UNKNOWN; |
+} |
+ |
void AVCodecContextToAudioDecoderConfig( |
const AVCodecContext* codec_context, |
AudioDecoderConfig* config) { |
@@ -204,6 +218,7 @@ void AVStreamToVideoDecoderConfig( |
aspect_ratio = stream->codec->sample_aspect_ratio; |
config->Initialize(CodecIDToVideoCodec(stream->codec->codec_id), |
+ ProfileIDToVideoCodecProfile(stream->codec->profile), |
PixelFormatToVideoFormat(stream->codec->pix_fmt), |
coded_size, visible_rect, |
stream->r_frame_rate.num, |