Chromium Code Reviews| 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 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 292 // hardware into a state where other applications could use it, free the | 292 // hardware into a state where other applications could use it, free the |
| 293 // memory associated with capture, and delete the |client| pointer passed into | 293 // memory associated with capture, and delete the |client| pointer passed into |
| 294 // AllocateAndStart. | 294 // AllocateAndStart. |
| 295 // | 295 // |
| 296 // If deallocation is done asynchronously, then the device implementation must | 296 // If deallocation is done asynchronously, then the device implementation must |
| 297 // ensure that a subsequent AllocateAndStart() operation targeting the same ID | 297 // ensure that a subsequent AllocateAndStart() operation targeting the same ID |
| 298 // would be sequenced through the same task runner, so that deallocation | 298 // would be sequenced through the same task runner, so that deallocation |
| 299 // happens first. | 299 // happens first. |
| 300 virtual void StopAndDeAllocate() = 0; | 300 virtual void StopAndDeAllocate() = 0; |
| 301 | 301 |
| 302 // Asynchronously takes a photo, possibly reconfiguring the capture objects | |
| 303 // and/or interrupting the capture flow. Returns false if taking the picture | |
| 304 // could not be scheduled at all, or else runs |photo_callback| (on the thread | |
| 305 // where TakePhoto() is run). | |
| 306 using TakePhotoCallback = | |
| 307 base::Callback<void(const std::string&, std::unique_ptr<std::string>)>; | |
| 308 virtual bool TakePhoto(const TakePhotoCallback& photo_callback); | |
|
miu
2016/05/04 23:45:50
Consider adding WARN_UNUSED_RESULT (just before th
mcasas
2016/05/05 00:57:12
Done.
| |
| 309 | |
| 302 // Gets the power line frequency, either from the params if specified by the | 310 // Gets the power line frequency, either from the params if specified by the |
| 303 // user or from the current system time zone. | 311 // user or from the current system time zone. |
| 304 PowerLineFrequency GetPowerLineFrequency( | 312 PowerLineFrequency GetPowerLineFrequency( |
| 305 const VideoCaptureParams& params) const; | 313 const VideoCaptureParams& params) const; |
| 306 | 314 |
| 307 private: | 315 private: |
| 308 // Gets the power line frequency from the current system time zone if this is | 316 // Gets the power line frequency from the current system time zone if this is |
| 309 // defined, otherwise returns 0. | 317 // defined, otherwise returns 0. |
| 310 PowerLineFrequency GetPowerLineFrequencyForLocation() const; | 318 PowerLineFrequency GetPowerLineFrequencyForLocation() const; |
| 311 }; | 319 }; |
| 312 | 320 |
| 313 } // namespace media | 321 } // namespace media |
| 314 | 322 |
| 315 #endif // MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_DEVICE_H_ | 323 #endif // MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_DEVICE_H_ |
| OLD | NEW |