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

Side by Side 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, 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
« no previous file with comments | « media/base/video_capturer_source.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // VideoCaptureDevice is the abstract base class for realizing video capture 5 // VideoCaptureDevice is the abstract base class for realizing video capture
6 // device support in Chromium. It provides the interface for OS dependent 6 // device support in Chromium. It provides the interface for OS dependent
7 // implementations. 7 // implementations.
8 // The class is created and functions are invoked on a thread owned by 8 // The class is created and functions are invoked on a thread owned by
9 // VideoCaptureManager. Capturing is done on other threads, depending on the OS 9 // VideoCaptureManager. Capturing is done on other threads, depending on the OS
10 // specific implementation. 10 // specific implementation.
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 // amount of time). 158 // amount of time).
159 // 2. A few repeats of the same frame would allow a lossy video encoder to 159 // 2. A few repeats of the same frame would allow a lossy video encoder to
160 // improve the video quality of unchanging content. 160 // improve the video quality of unchanging content.
161 // 161 //
162 // The default implementation is a no-op. VideoCaptureDevice implementations 162 // The default implementation is a no-op. VideoCaptureDevice implementations
163 // are not required to honor this request, especially if they do not 163 // are not required to honor this request, especially if they do not
164 // self-pause and/or if honoring the request would cause them to exceed their 164 // self-pause and/or if honoring the request would cause them to exceed their
165 // configured maximum frame rate. Any VideoCaptureDevice that does self-pause, 165 // configured maximum frame rate. Any VideoCaptureDevice that does self-pause,
166 // however, should provide an implementation of this method that makes 166 // however, should provide an implementation of this method that makes
167 // reasonable attempts to honor these requests. 167 // reasonable attempts to honor these requests.
168 //
169 // Note: This should only be called after AllocateAndStart() and before
170 // StopAndDeAllocate(). Otherwise, its behavior is undefined.
168 virtual void RequestRefreshFrame() {} 171 virtual void RequestRefreshFrame() {}
169 172
173 // Optionally suspends frame delivery. The VideoCaptureDevice may or may not
174 // honor this request. Thus, the caller cannot assume frame delivery will
175 // actually stop. Even if frame delivery is suspended, this might not take
176 // effect immediately.
177 //
178 // The purpose of this is to quickly place the device into a state where it's
179 // resource utilization is minimized while there are no frame consumers; and
180 // then quickly resume once a frame consumer is present.
181 //
182 // Note: This should only be called after AllocateAndStart() and before
183 // StopAndDeAllocate(). Otherwise, its behavior is undefined.
184 virtual void MaybeSuspend() {}
185
186 // Resumes frame delivery, if it was suspended. If frame delivery was not
187 // suspended, this is a no-op, and frame delivery will continue.
188 //
189 // Note: This should only be called after AllocateAndStart() and before
190 // StopAndDeAllocate(). Otherwise, its behavior is undefined.
191 virtual void Resume() {}
192
170 // Deallocates the video capturer, possibly asynchronously. 193 // Deallocates the video capturer, possibly asynchronously.
171 // 194 //
172 // This call requires the device to do the following things, eventually: put 195 // This call requires the device to do the following things, eventually: put
173 // hardware into a state where other applications could use it, free the 196 // hardware into a state where other applications could use it, free the
174 // memory associated with capture, and delete the |client| pointer passed into 197 // memory associated with capture, and delete the |client| pointer passed into
175 // AllocateAndStart. 198 // AllocateAndStart.
176 // 199 //
177 // If deallocation is done asynchronously, then the device implementation must 200 // If deallocation is done asynchronously, then the device implementation must
178 // ensure that a subsequent AllocateAndStart() operation targeting the same ID 201 // ensure that a subsequent AllocateAndStart() operation targeting the same ID
179 // would be sequenced through the same task runner, so that deallocation 202 // would be sequenced through the same task runner, so that deallocation
(...skipping 24 matching lines...) Expand all
204 227
205 private: 228 private:
206 // Gets the power line frequency from the current system time zone if this is 229 // Gets the power line frequency from the current system time zone if this is
207 // defined, otherwise returns 0. 230 // defined, otherwise returns 0.
208 PowerLineFrequency GetPowerLineFrequencyForLocation() const; 231 PowerLineFrequency GetPowerLineFrequencyForLocation() const;
209 }; 232 };
210 233
211 } // namespace media 234 } // namespace media
212 235
213 #endif // MEDIA_CAPTURE_VIDEO_VIDEO_CAPTURE_DEVICE_H_ 236 #endif // MEDIA_CAPTURE_VIDEO_VIDEO_CAPTURE_DEVICE_H_
OLDNEW
« 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