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

Unified Diff: media/capture/content/thread_safe_capture_oracle.h

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: Fix WCVCD unit tests that test resize policies. 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/thread_safe_capture_oracle.h
diff --git a/media/capture/content/thread_safe_capture_oracle.h b/media/capture/content/thread_safe_capture_oracle.h
index 921c6d1fcc3c971bdc729d9ec7e7b504ad0fddad..5e3283a79b147877c0f823d0130839a749692238 100644
--- a/media/capture/content/thread_safe_capture_oracle.h
+++ b/media/capture/content/thread_safe_capture_oracle.h
@@ -42,12 +42,27 @@ class MEDIA_EXPORT ThreadSafeCaptureOracle
base::TimeTicks timestamp,
bool success)> CaptureFrameCallback;
+ // Record a change |event| along with its |damage_rect| and |event_time|, and
+ // then make a decision whether to proceed with capture. The decision is based
+ // on recent event history, capture activity, and the availability of
+ // resources.
+ //
+ // If this method returns false, the caller should take no further action.
+ // Otherwise, |storage| is set to the destination for the video frame capture;
+ // and, the caller should initiate capture, and then run |callback| once the
+ // video frame has been populated with its content.
bool ObserveEventAndDecideCapture(VideoCaptureOracle::Event event,
const gfx::Rect& damage_rect,
base::TimeTicks event_time,
scoped_refptr<VideoFrame>* storage,
CaptureFrameCallback* callback);
+ // Attempt to re-send the last frame to the VideoCaptureDevice::Client.
+ // Returns true if successful. This can fail if the last frame is no longer
+ // available in the buffer pool, or if the VideoCaptureOracle decides to
+ // reject the "passive" refresh.
+ bool AttemptPassiveRefresh();
+
base::TimeDelta min_capture_period() const {
return oracle_.min_capture_period();
}

Powered by Google App Engine
This is Rietveld 408576698