| 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&, |
| 308 std::unique_ptr<std::vector<uint8_t>>)>; |
| 309 virtual bool TakePhoto(const TakePhotoCallback& photo_callback) |
| 310 WARN_UNUSED_RESULT; |
| 311 |
| 302 // Gets the power line frequency, either from the params if specified by the | 312 // Gets the power line frequency, either from the params if specified by the |
| 303 // user or from the current system time zone. | 313 // user or from the current system time zone. |
| 304 PowerLineFrequency GetPowerLineFrequency( | 314 PowerLineFrequency GetPowerLineFrequency( |
| 305 const VideoCaptureParams& params) const; | 315 const VideoCaptureParams& params) const; |
| 306 | 316 |
| 307 private: | 317 private: |
| 308 // Gets the power line frequency from the current system time zone if this is | 318 // Gets the power line frequency from the current system time zone if this is |
| 309 // defined, otherwise returns 0. | 319 // defined, otherwise returns 0. |
| 310 PowerLineFrequency GetPowerLineFrequencyForLocation() const; | 320 PowerLineFrequency GetPowerLineFrequencyForLocation() const; |
| 311 }; | 321 }; |
| 312 | 322 |
| 313 } // namespace media | 323 } // namespace media |
| 314 | 324 |
| 315 #endif // MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_DEVICE_H_ | 325 #endif // MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_DEVICE_H_ |
| OLD | NEW |