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. | |
miu
2017/02/09 22:21:49
There are two things you'll want to consider here:
chfremer
2017/02/09 23:34:52
Regardless of which exact thread it comes from, we
braveyao
2017/02/14 01:05:49
All the events will be posted to IO thread. See ht
braveyao
2017/02/14 01:05:49
All the methods will be posted to IO thread (https
chfremer
2017/02/14 19:21:22
Please see my follow-up comment in Patch Set 2.
| |
219 virtual void OnStarted() = 0; | |
217 }; | 220 }; |
218 | 221 |
219 ~VideoCaptureDevice() override; | 222 ~VideoCaptureDevice() override; |
220 | 223 |
221 // Prepares the video capturer for use. StopAndDeAllocate() must be called | 224 // Prepares the video capturer for use. StopAndDeAllocate() must be called |
222 // before the object is deleted. | 225 // before the object is deleted. |
223 virtual void AllocateAndStart(const VideoCaptureParams& params, | 226 virtual void AllocateAndStart(const VideoCaptureParams& params, |
224 std::unique_ptr<Client> client) = 0; | 227 std::unique_ptr<Client> client) = 0; |
225 | 228 |
226 // In cases where the video capturer self-pauses (e.g., a screen capturer | 229 // 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 | 305 |
303 private: | 306 private: |
304 // Gets the power line frequency from the current system time zone if this is | 307 // Gets the power line frequency from the current system time zone if this is |
305 // defined, otherwise returns 0. | 308 // defined, otherwise returns 0. |
306 PowerLineFrequency GetPowerLineFrequencyForLocation() const; | 309 PowerLineFrequency GetPowerLineFrequencyForLocation() const; |
307 }; | 310 }; |
308 | 311 |
309 } // namespace media | 312 } // namespace media |
310 | 313 |
311 #endif // MEDIA_CAPTURE_VIDEO_VIDEO_CAPTURE_DEVICE_H_ | 314 #endif // MEDIA_CAPTURE_VIDEO_VIDEO_CAPTURE_DEVICE_H_ |
OLD | NEW |