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

Unified Diff: media/base/video_capturer_source.h

Issue 2365223002: Video Capture: Allow suspension of individual devices. (Closed)
Patch Set: Style tweaks, per mcasas's comments. Created 4 years, 3 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/base/video_capturer_source.h
diff --git a/media/base/video_capturer_source.h b/media/base/video_capturer_source.h
index ddec90c6599b26b564984e0b347d22472b4ca0df..760530176d13ac0682a4ca5b1fb7821956652ee7 100644
--- a/media/base/video_capturer_source.h
+++ b/media/base/video_capturer_source.h
@@ -81,11 +81,34 @@ class MEDIA_EXPORT VideoCapturerSource {
// the screen's content has not changed in a while), consumers may request a
// "refresh frame" to be delivered. For instance, this would be needed when
// a new sink is added to a MediaStreamTrack.
+ //
// The default implementation is a no-op and implementations are not required
// to honor this request. If they decide to and capturing is started
// successfully, then |new_frame_callback| should be called with a frame.
+ //
+ // Note: This should only be called after StartCapture() and before
+ // StopCapture(). Otherwise, its behavior is undefined.
virtual void RequestRefreshFrame() {}
+ // Optionally suspends frame delivery. The source may or may not honor this
+ // request. Thus, the caller cannot assume frame delivery will actually
+ // stop. Even if frame delivery is suspended, this might not take effect
+ // immediately.
+ //
+ // The purpose of this is to allow minimizing resource usage while
+ // there are no frame consumers present.
+ //
+ // Note: This should only be called after StartCapture() and before
+ // StopCapture(). Otherwise, its behavior is undefined.
+ virtual void MaybeSuspend() {}
+
+ // Resumes frame delivery, if it was suspended. If frame delivery was not
+ // suspended, this is a no-op, and frame delivery will continue.
+ //
+ // Note: This should only be called after StartCapture() and before
+ // StopCapture(). Otherwise, its behavior is undefined.
+ virtual void Resume() {}
+
// Stops capturing frames and clears all callbacks including the
// SupportedFormatsCallback callback. Note that queued frame callbacks
// may still occur after this call, so the caller must take care to
« no previous file with comments | « content/renderer/media/video_capture_impl_manager_unittest.cc ('k') | media/capture/video/video_capture_device.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698