Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "media/blink/webmediaplayer_impl.h" | 5 #include "media/blink/webmediaplayer_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 #include <limits> | 9 #include <limits> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 1300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1311 | 1311 |
| 1312 if (overlay_enabled_ && surface_manager_) | 1312 if (overlay_enabled_ && surface_manager_) |
| 1313 surface_manager_->NaturalSizeChanged(rotated_size); | 1313 surface_manager_->NaturalSizeChanged(rotated_size); |
| 1314 | 1314 |
| 1315 if (pipeline_metadata_.natural_size.IsEmpty()) { | 1315 if (pipeline_metadata_.natural_size.IsEmpty()) { |
| 1316 // WatchTimeReporter doesn't report metrics for empty videos. Re-create | 1316 // WatchTimeReporter doesn't report metrics for empty videos. Re-create |
| 1317 // |watch_time_reporter_| if we didn't originally know the video size. | 1317 // |watch_time_reporter_| if we didn't originally know the video size. |
| 1318 CreateWatchTimeReporter(); | 1318 CreateWatchTimeReporter(); |
| 1319 } | 1319 } |
| 1320 | 1320 |
| 1321 pipeline_metadata_.natural_size = rotated_size; | 1321 pipeline_metadata_.natural_size = rotated_size; |
|
sandersd (OOO until July 31)
2017/01/06 19:29:18
Looks like there is a pre-existing bug here, Creat
xjz
2017/01/06 21:59:15
Done.
| |
| 1322 client_->sizeChanged(); | 1322 client_->sizeChanged(); |
| 1323 | |
| 1324 if (observer_) { | |
| 1325 PipelineMetadata metadata = pipeline_metadata_; | |
| 1326 metadata.natural_size = size; | |
|
sandersd (OOO until July 31)
2017/01/06 19:29:18
Almost certainly you want the rotated_size. Since
xjz
2017/01/06 21:59:15
The size will be rotated in RemotingRendererContro
sandersd (OOO until July 31)
2017/01/06 22:18:07
OnMetadata() also applies the rotation, so if Remo
xjz
2017/01/06 22:23:57
OnMetadata() also passed the original size (not th
| |
| 1327 observer_->OnMetadataChanged(metadata); | |
| 1328 } | |
| 1323 } | 1329 } |
| 1324 | 1330 |
| 1325 void WebMediaPlayerImpl::OnVideoOpacityChange(bool opaque) { | 1331 void WebMediaPlayerImpl::OnVideoOpacityChange(bool opaque) { |
| 1326 DCHECK(main_task_runner_->BelongsToCurrentThread()); | 1332 DCHECK(main_task_runner_->BelongsToCurrentThread()); |
| 1327 DCHECK_NE(ready_state_, WebMediaPlayer::ReadyStateHaveNothing); | 1333 DCHECK_NE(ready_state_, WebMediaPlayer::ReadyStateHaveNothing); |
| 1328 | 1334 |
| 1329 opaque_ = opaque; | 1335 opaque_ = opaque; |
| 1330 // Modify content opaqueness of cc::Layer directly so that | 1336 // Modify content opaqueness of cc::Layer directly so that |
| 1331 // SetContentsOpaqueIsFixed is ignored. | 1337 // SetContentsOpaqueIsFixed is ignored. |
| 1332 if (video_weblayer_) | 1338 if (video_weblayer_) |
| (...skipping 701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2034 return pipeline_metadata_.video_rotation == VIDEO_ROTATION_0; | 2040 return pipeline_metadata_.video_rotation == VIDEO_ROTATION_0; |
| 2035 } | 2041 } |
| 2036 | 2042 |
| 2037 void WebMediaPlayerImpl::ActivateViewportIntersectionMonitoring(bool activate) { | 2043 void WebMediaPlayerImpl::ActivateViewportIntersectionMonitoring(bool activate) { |
| 2038 DCHECK(main_task_runner_->BelongsToCurrentThread()); | 2044 DCHECK(main_task_runner_->BelongsToCurrentThread()); |
| 2039 | 2045 |
| 2040 client_->activateViewportIntersectionMonitoring(activate); | 2046 client_->activateViewportIntersectionMonitoring(activate); |
| 2041 } | 2047 } |
| 2042 | 2048 |
| 2043 } // namespace media | 2049 } // namespace media |
| OLD | NEW |