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

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: Created 5 years 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
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..ed373e374135294ffa6f97c4b4b1e0cf7c015a7d 100644
--- a/chromecast/media/base/video_plane_controller.cc
+++ b/chromecast/media/base/video_plane_controller.cc
@@ -168,6 +168,11 @@ void VideoPlaneController::SetGeometry(const RectF& display_rect,
MaybeRunSetGeometry();
}
+void VideoPlaneController::ResetGeometry() {
+ DCHECK(thread_checker_.CalledOnValidThread());
+ MaybeRunSetGeometry();
+}
+
void VideoPlaneController::SetDeviceResolution(const Size& resolution) {
DCHECK(thread_checker_.CalledOnValidThread());
DCHECK(ResolutionSizeValid(resolution));
@@ -202,8 +207,26 @@ 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_;
+}
+
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 +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);

Powered by Google App Engine
This is Rietveld 408576698