Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(313)

Unified Diff: media/ffmpeg/ffmpeg_common.cc

Issue 363813002: Update to Pipeline Metadata and Decoder Stream for Orientation Data (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« media/base/video_decoder_config.h ('K') | « media/base/video_decoder_config.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/ffmpeg/ffmpeg_common.cc
diff --git a/media/ffmpeg/ffmpeg_common.cc b/media/ffmpeg/ffmpeg_common.cc
index 42642fbfbecd917c185699e0cc4c95066974b0cf..5e7f706c59a9068ddd476a717e05e6960f8426cc 100644
--- a/media/ffmpeg/ffmpeg_common.cc
+++ b/media/ffmpeg/ffmpeg_common.cc
@@ -411,6 +411,16 @@ 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);
+ if (rotation != 90 && rotation != 180 && rotation != 270)
+ rotation = 0;
+
AVDictionaryEntry* webm_alpha =
av_dict_get(stream->metadata, "alpha_mode", NULL, 0);
if (webm_alpha && !strcmp(webm_alpha->value, "1")) {
@@ -424,6 +434,8 @@ void AVStreamToVideoDecoderConfig(
stream->codec->extradata, stream->codec->extradata_size,
is_encrypted,
record_stats);
+
+ config->set_rotation(rotation);
}
void VideoDecoderConfigToAVCodecContext(
« media/base/video_decoder_config.h ('K') | « media/base/video_decoder_config.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698