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

Side by Side Diff: media/base/video_capturer_source.h

Issue 2365223002: Video Capture: Allow suspension of individual devices. (Closed)
Patch Set: REBASE, and clean-ups+tests suggested by chfremer@. Created 4 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef MEDIA_BASE_VIDEO_CAPTURER_SOURCE_H_ 5 #ifndef MEDIA_BASE_VIDEO_CAPTURER_SOURCE_H_
6 #define MEDIA_BASE_VIDEO_CAPTURER_SOURCE_H_ 6 #define MEDIA_BASE_VIDEO_CAPTURER_SOURCE_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 // Asks source to send a refresh frame. In cases where source does not provide 79 // Asks source to send a refresh frame. In cases where source does not provide
80 // a continuous rate of new frames (e.g. canvas capture, screen capture where 80 // a continuous rate of new frames (e.g. canvas capture, screen capture where
81 // the screen's content has not changed in a while), consumers may request a 81 // the screen's content has not changed in a while), consumers may request a
82 // "refresh frame" to be delivered. For instance, this would be needed when 82 // "refresh frame" to be delivered. For instance, this would be needed when
83 // a new sink is added to a MediaStreamTrack. 83 // a new sink is added to a MediaStreamTrack.
84 // The default implementation is a no-op and implementations are not required 84 // The default implementation is a no-op and implementations are not required
85 // to honor this request. If they decide to and capturing is started 85 // to honor this request. If they decide to and capturing is started
86 // successfully, then |new_frame_callback| should be called with a frame. 86 // successfully, then |new_frame_callback| should be called with a frame.
87 virtual void RequestRefreshFrame() {} 87 virtual void RequestRefreshFrame() {}
88 88
89 // Optionally suspends frame delivery. The source may or may not honor this
90 // request. The purpose of this is to allow minimizing resource usage while
91 // there are no frame consumers present.
92 virtual void MaybeSuspend() {}
xhwang 2016/09/28 21:09:56 nit: How will the caller know whether it can/shoul
miu 2016/09/28 21:52:14 Added explanation in comments.
93
94 // Resumes frame delivery, if it was suspended.
xhwang 2016/09/28 21:09:56 nit: What if "it was not suspended"? Will it fail,
miu 2016/09/28 21:52:14 Added explanation in comments for this too.
95 virtual void Resume() {}
96
89 // Stops capturing frames and clears all callbacks including the 97 // Stops capturing frames and clears all callbacks including the
90 // SupportedFormatsCallback callback. Note that queued frame callbacks 98 // SupportedFormatsCallback callback. Note that queued frame callbacks
91 // may still occur after this call, so the caller must take care to 99 // may still occur after this call, so the caller must take care to
92 // use refcounted or weak references in |new_frame_callback|. 100 // use refcounted or weak references in |new_frame_callback|.
93 virtual void StopCapture() = 0; 101 virtual void StopCapture() = 0;
94 }; 102 };
95 103
96 } // namespace media 104 } // namespace media
97 105
98 #endif // MEDIA_BASE_VIDEO_CAPTURER_SOURCE_H_ 106 #endif // MEDIA_BASE_VIDEO_CAPTURER_SOURCE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698