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 will be called either synchronously or asynchronously by any | |
220 // thread. This is OK because it will be posted to IO thread and handled | |
221 // there by state machines. | |
222 virtual void OnStarted() = 0; | |
chfremer
2017/02/14 19:21:23
A couple of recommendations here:
1.) I recommend
braveyao
2017/02/15 21:47:16
Done.
Basically, there is hundreds of millisecond
chfremer
2017/02/16 01:00:50
I looked at the device implementations and had som
braveyao
2017/02/17 20:37:21
Acknowledged.
From this point of view, it is the t
| |
217 }; | 223 }; |
218 | 224 |
219 ~VideoCaptureDevice() override; | 225 ~VideoCaptureDevice() override; |
220 | 226 |
221 // Prepares the video capturer for use. StopAndDeAllocate() must be called | 227 // Prepares the video capturer for use. StopAndDeAllocate() must be called |
222 // before the object is deleted. | 228 // before the object is deleted. |
223 virtual void AllocateAndStart(const VideoCaptureParams& params, | 229 virtual void AllocateAndStart(const VideoCaptureParams& params, |
224 std::unique_ptr<Client> client) = 0; | 230 std::unique_ptr<Client> client) = 0; |
225 | 231 |
226 // In cases where the video capturer self-pauses (e.g., a screen capturer | 232 // 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 | 308 |
303 private: | 309 private: |
304 // Gets the power line frequency from the current system time zone if this is | 310 // Gets the power line frequency from the current system time zone if this is |
305 // defined, otherwise returns 0. | 311 // defined, otherwise returns 0. |
306 PowerLineFrequency GetPowerLineFrequencyForLocation() const; | 312 PowerLineFrequency GetPowerLineFrequencyForLocation() const; |
307 }; | 313 }; |
308 | 314 |
309 } // namespace media | 315 } // namespace media |
310 | 316 |
311 #endif // MEDIA_CAPTURE_VIDEO_VIDEO_CAPTURE_DEVICE_H_ | 317 #endif // MEDIA_CAPTURE_VIDEO_VIDEO_CAPTURE_DEVICE_H_ |
OLD | NEW |