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

Unified Diff: chromecast/media/base/video_plane_controller.cc

Issue 1531543002: [Chromecast] Adding pause/resume operations to VideoPlaneController. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase of Patch Set 8. Created 4 years, 11 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 | « chromecast/media/base/video_plane_controller.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 7202b00f68cc0193f76b767037906fb47962f092..e6496f42186e93e637134afe7aec850bc32fa518 100644
--- a/chromecast/media/base/video_plane_controller.cc
+++ b/chromecast/media/base/video_plane_controller.cc
@@ -206,8 +206,27 @@ 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;
+ MaybeRunSetGeometry();
+}
+
+bool VideoPlaneController::is_paused() const {
+ DCHECK(thread_checker_.CalledOnValidThread());
+ return is_paused_;
+}
+
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),
@@ -222,8 +241,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);
« no previous file with comments | « chromecast/media/base/video_plane_controller.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698