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

Unified Diff: media/capture/content/screen_capture_device_core.cc

Issue 1864813002: Tab/Desktop Capture: Use requests instead of timer-based refreshing. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@video_refresh_from_sinks
Patch Set: Addressed comments from PS2, and sampling decision logic change w.r.t. recent animation. Created 4 years, 8 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
Index: media/capture/content/screen_capture_device_core.cc
diff --git a/media/capture/content/screen_capture_device_core.cc b/media/capture/content/screen_capture_device_core.cc
index 2b3f3cfaecfe3e799e2ef4821a7a1f93b23e5f09..6e9f3355888d0f0a36cd1e3ce5202aae7d1f6490 100644
--- a/media/capture/content/screen_capture_device_core.cc
+++ b/media/capture/content/screen_capture_device_core.cc
@@ -65,6 +65,17 @@ void ScreenCaptureDeviceCore::AllocateAndStart(
TransitionStateTo(kCapturing);
}
+void ScreenCaptureDeviceCore::RequestRefreshFrame() {
+ DCHECK(thread_checker_.CalledOnValidThread());
+
+ if (state_ != kCapturing)
+ return;
+
+ if (oracle_proxy_->AttemptPassiveRefresh())
+ return;
+ capture_machine_->MaybeCaptureForRefresh();
+}
+
void ScreenCaptureDeviceCore::StopAndDeAllocate() {
DCHECK(thread_checker_.CalledOnValidThread());

Powered by Google App Engine
This is Rietveld 408576698