Chromium Code Reviews| Index: chromecast/media/base/video_plane_controller.cc |
| diff --git a/chromecast/media/base/video_plane_controller.cc b/chromecast/media/base/video_plane_controller.cc |
| index 8f07839f883024cd26af0825818b23fa16e11475..b8e7cef3737d293b23ed7b3921ddc8742bb7ec40 100644 |
| --- a/chromecast/media/base/video_plane_controller.cc |
| +++ b/chromecast/media/base/video_plane_controller.cc |
| @@ -202,8 +202,33 @@ void VideoPlaneController::SetGraphicsPlaneResolution(const Size& resolution) { |
| MaybeRunSetGeometry(); |
| } |
| +void VideoPlaneController::Pause() { |
| + DCHECK(thread_checker_.CalledOnValidThread()); |
| + VLOG(1) << "Pausing controller. No more VideoPlane SetGeometry calls."; |
| + is_paused_ = true; |
| +} |
| + |
| +void VideoPlaneController::Resume() { |
| + DCHECK(thread_checker_.CalledOnValidThread()); |
| + VLOG(1) << "Resuming controller. VideoPlane SetGeometry calls are active."; |
| + is_paused_ = false; |
| +} |
| + |
| +bool VideoPlaneController::is_paused() const { |
| + DCHECK(thread_checker_.CalledOnValidThread()); |
| + return is_paused_; |
| +} |
| + |
| +void VideoPlaneController::ClearGeometryState() { |
| + DCHECK(thread_checker_.CalledOnValidThread()); |
| + have_video_plane_geometry_ = false; |
| + video_plane_display_rect_ = RectF(0, 0, 0, 0); |
| + video_plane_transform_ = VideoPlane::TRANSFORM_NONE; |
| +} |
|
halliwell
2015/12/17 14:46:31
So ... it looks like from the internal CL that whe
esum
2015/12/21 00:39:21
Done.
|
| + |
| VideoPlaneController::VideoPlaneController() |
| - : have_output_res_(false), |
| + : is_paused_(false), |
| + have_output_res_(false), |
| have_graphics_res_(false), |
| output_res_(0, 0), |
| graphics_res_(0, 0), |
| @@ -218,8 +243,15 @@ VideoPlaneController::~VideoPlaneController() {} |
| void VideoPlaneController::MaybeRunSetGeometry() { |
| DCHECK(thread_checker_.CalledOnValidThread()); |
| - if (!HaveDataForSetGeometry()) |
| + if (is_paused_) { |
| + VLOG(2) << "All VideoPlane SetGeometry calls are paused. Ignoring request."; |
| return; |
| + } |
| + |
| + if (!HaveDataForSetGeometry()) { |
| + VLOG(2) << "Don't have all VideoPlane SetGeometry data. Ignoring request."; |
| + return; |
| + } |
| DCHECK(graphics_res_.width != 0 && graphics_res_.height != 0); |