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

Unified Diff: media/capture/video/video_capture_device.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
« no previous file with comments | « media/base/video_capturer_source.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/capture/video/video_capture_device.h
diff --git a/media/capture/video/video_capture_device.h b/media/capture/video/video_capture_device.h
index cbdc8adde4c6e44dd2d764957a6873c267d02109..b662f5c48b7a9d72067c50107e13f1acd663057f 100644
--- a/media/capture/video/video_capture_device.h
+++ b/media/capture/video/video_capture_device.h
@@ -165,8 +165,31 @@ class CAPTURE_EXPORT VideoCaptureDevice {
// configured maximum frame rate. Any VideoCaptureDevice that does self-pause,
// however, should provide an implementation of this method that makes
// reasonable attempts to honor these requests.
+ //
+ // Note: This should only be called after AllocateAndStart() and before
+ // StopAndDeAllocate(). Otherwise, its behavior is undefined.
virtual void RequestRefreshFrame() {}
+ // Optionally suspends frame delivery. The VideoCaptureDevice 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 quickly place the device into a state where it's
+ // resource utilization is minimized while there are no frame consumers; and
+ // then quickly resume once a frame consumer is present.
+ //
+ // Note: This should only be called after AllocateAndStart() and before
+ // StopAndDeAllocate(). 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 AllocateAndStart() and before
+ // StopAndDeAllocate(). Otherwise, its behavior is undefined.
+ virtual void Resume() {}
+
// Deallocates the video capturer, possibly asynchronously.
//
// This call requires the device to do the following things, eventually: put
« no previous file with comments | « media/base/video_capturer_source.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698