OLD | NEW |
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 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 // be StopAndDeAllocate()-ed. |reason| is a text description of the error. | 207 // be StopAndDeAllocate()-ed. |reason| is a text description of the error. |
208 virtual void OnError(const tracked_objects::Location& from_here, | 208 virtual void OnError(const tracked_objects::Location& from_here, |
209 const std::string& reason) = 0; | 209 const std::string& reason) = 0; |
210 | 210 |
211 // VideoCaptureDevice requests the |message| to be logged. | 211 // VideoCaptureDevice requests the |message| to be logged. |
212 virtual void OnLog(const std::string& message) {} | 212 virtual void OnLog(const std::string& message) {} |
213 | 213 |
214 // Returns the current buffer pool utilization, in the range 0.0 (no buffers | 214 // Returns the current buffer pool utilization, in the range 0.0 (no buffers |
215 // are in use by producers or consumers) to 1.0 (all buffers are in use). | 215 // are in use by producers or consumers) to 1.0 (all buffers are in use). |
216 virtual double GetBufferPoolUtilization() const = 0; | 216 virtual double GetBufferPoolUtilization() const = 0; |
| 217 |
| 218 // VideoCaptureDevice reports it's successfully started. |
| 219 // This method may be called either synchronously from an invocation of |
| 220 // VideoCaptureDevice::AllocateAndStart() or asynchronously from any thread |
| 221 // after AllocateAndStart() has returned. It is guaranteed to get called |
| 222 // before any video frames are delivered. |
| 223 virtual void OnStarted() = 0; |
217 }; | 224 }; |
218 | 225 |
219 ~VideoCaptureDevice() override; | 226 ~VideoCaptureDevice() override; |
220 | 227 |
221 // Prepares the video capturer for use. StopAndDeAllocate() must be called | 228 // Prepares the video capturer for use. StopAndDeAllocate() must be called |
222 // before the object is deleted. | 229 // before the object is deleted. |
223 virtual void AllocateAndStart(const VideoCaptureParams& params, | 230 virtual void AllocateAndStart(const VideoCaptureParams& params, |
224 std::unique_ptr<Client> client) = 0; | 231 std::unique_ptr<Client> client) = 0; |
225 | 232 |
226 // In cases where the video capturer self-pauses (e.g., a screen capturer | 233 // In cases where the video capturer self-pauses (e.g., a screen capturer |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
302 | 309 |
303 private: | 310 private: |
304 // Gets the power line frequency from the current system time zone if this is | 311 // Gets the power line frequency from the current system time zone if this is |
305 // defined, otherwise returns 0. | 312 // defined, otherwise returns 0. |
306 PowerLineFrequency GetPowerLineFrequencyForLocation() const; | 313 PowerLineFrequency GetPowerLineFrequencyForLocation() const; |
307 }; | 314 }; |
308 | 315 |
309 } // namespace media | 316 } // namespace media |
310 | 317 |
311 #endif // MEDIA_CAPTURE_VIDEO_VIDEO_CAPTURE_DEVICE_H_ | 318 #endif // MEDIA_CAPTURE_VIDEO_VIDEO_CAPTURE_DEVICE_H_ |
OLD | NEW |