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

Unified Diff: media/blink/webmediaplayer_impl.cc

Issue 2198403002: Account for video rotation in OnVideoNaturalSizeChange() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/blink/webmediaplayer_impl.cc
diff --git a/media/blink/webmediaplayer_impl.cc b/media/blink/webmediaplayer_impl.cc
index ed3d7b8496e89124b5415c74ab5e37da3a673f2f..3444fd4fc40127af1be4603b96c5f8c4a1070c5b 100644
--- a/media/blink/webmediaplayer_impl.cc
+++ b/media/blink/webmediaplayer_impl.cc
@@ -1127,17 +1127,23 @@ void WebMediaPlayerImpl::OnVideoNaturalSizeChange(const gfx::Size& size) {
DCHECK(main_task_runner_->BelongsToCurrentThread());
DCHECK_NE(ready_state_, WebMediaPlayer::ReadyStateHaveNothing);
- if (size == pipeline_metadata_.natural_size)
+ gfx::Size rotated_size = size;
DaleCurtis 2016/08/01 23:32:51 Probably this should be deduped into a GetRotation
sandersd (OOO until July 31) 2016/08/01 23:55:19 Done.
+ if (pipeline_metadata_.video_rotation == VIDEO_ROTATION_90 ||
+ pipeline_metadata_.video_rotation == VIDEO_ROTATION_270) {
+ rotated_size = gfx::Size(size.height(), size.width());
+ }
+
+ if (rotated_size == pipeline_metadata_.natural_size)
return;
TRACE_EVENT0("media", "WebMediaPlayerImpl::OnNaturalSizeChanged");
- media_log_->AddEvent(
- media_log_->CreateVideoSizeSetEvent(size.width(), size.height()));
+ media_log_->AddEvent(media_log_->CreateVideoSizeSetEvent(
+ rotated_size.width(), rotated_size.height()));
if (overlay_enabled_ && surface_manager_)
- surface_manager_->NaturalSizeChanged(size);
+ surface_manager_->NaturalSizeChanged(rotated_size);
- pipeline_metadata_.natural_size = size;
+ pipeline_metadata_.natural_size = rotated_size;
client_->sizeChanged();
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698