Chromium Code Reviews| Index: media/ffmpeg/ffmpeg_common.cc |
| diff --git a/media/ffmpeg/ffmpeg_common.cc b/media/ffmpeg/ffmpeg_common.cc |
| index 42642fbfbecd917c185699e0cc4c95066974b0cf..50f36cdaab4eb607175c775b2f3420094be9e584 100644 |
| --- a/media/ffmpeg/ffmpeg_common.cc |
| +++ b/media/ffmpeg/ffmpeg_common.cc |
| @@ -411,6 +411,14 @@ void AVStreamToVideoDecoderConfig( |
| if (key) |
| is_encrypted = true; |
| + AVDictionaryEntry* rotation_entry = |
| + av_dict_get(stream->metadata, "rotate", NULL, 0); |
| + int rotation = 0; |
| + if (rotation_entry && rotation_entry->value && rotation_entry->value[0]) |
| + base::StringToInt(rotation_entry->value, &rotation); |
| + |
| + DCHECK(rotation == 0 || rotation == 90 || rotation == 180 || rotation == 270); |
|
scherkus (not reviewing)
2014/07/07 20:52:38
are we certain FFmpeg can't spit out values other
|
| + |
| AVDictionaryEntry* webm_alpha = |
| av_dict_get(stream->metadata, "alpha_mode", NULL, 0); |
| if (webm_alpha && !strcmp(webm_alpha->value, "1")) { |
| @@ -424,6 +432,22 @@ void AVStreamToVideoDecoderConfig( |
| stream->codec->extradata, stream->codec->extradata_size, |
| is_encrypted, |
| record_stats); |
| + |
| + switch (rotation) { |
| + case 0: |
| + config->set_rotation(kRotate0); |
| + break; |
| + case 90: |
| + config->set_rotation(kRotate90); |
| + break; |
| + case 180: |
| + config->set_rotation(kRotate180); |
| + break; |
| + case 270: |
| + config->set_rotation(kRotate270); |
| + default: |
| + break; |
| + } |
| } |
| void VideoDecoderConfigToAVCodecContext( |