| 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 // Windows specific implementation of VideoCaptureDevice. DirectShow is used for | 5 // Windows specific implementation of VideoCaptureDevice. DirectShow is used for |
| 6 // capturing. DirectShow provide its own threads for capturing. | 6 // capturing. DirectShow provide its own threads for capturing. |
| 7 | 7 |
| 8 #ifndef MEDIA_CAPTURE_VIDEO_WIN_VIDEO_CAPTURE_DEVICE_WIN_H_ | 8 #ifndef MEDIA_CAPTURE_VIDEO_WIN_VIDEO_CAPTURE_DEVICE_WIN_H_ |
| 9 #define MEDIA_CAPTURE_VIDEO_WIN_VIDEO_CAPTURE_DEVICE_WIN_H_ | 9 #define MEDIA_CAPTURE_VIDEO_WIN_VIDEO_CAPTURE_DEVICE_WIN_H_ |
| 10 | 10 |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 const VideoCaptureDeviceDescriptor& device_descriptor); | 68 const VideoCaptureDeviceDescriptor& device_descriptor); |
| 69 ~VideoCaptureDeviceWin() override; | 69 ~VideoCaptureDeviceWin() override; |
| 70 // Opens the device driver for this device. | 70 // Opens the device driver for this device. |
| 71 bool Init(); | 71 bool Init(); |
| 72 | 72 |
| 73 // VideoCaptureDevice implementation. | 73 // VideoCaptureDevice implementation. |
| 74 void AllocateAndStart( | 74 void AllocateAndStart( |
| 75 const VideoCaptureParams& params, | 75 const VideoCaptureParams& params, |
| 76 std::unique_ptr<VideoCaptureDevice::Client> client) override; | 76 std::unique_ptr<VideoCaptureDevice::Client> client) override; |
| 77 void StopAndDeAllocate() override; | 77 void StopAndDeAllocate() override; |
| 78 void TakePhoto(TakePhotoCallback callback) override; |
| 78 | 79 |
| 79 private: | 80 private: |
| 80 enum InternalState { | 81 enum InternalState { |
| 81 kIdle, // The device driver is opened but camera is not in use. | 82 kIdle, // The device driver is opened but camera is not in use. |
| 82 kCapturing, // Video is being captured. | 83 kCapturing, // Video is being captured. |
| 83 kError // Error accessing HW functions. | 84 kError // Error accessing HW functions. |
| 84 // User needs to recover by destroying the object. | 85 // User needs to recover by destroying the object. |
| 85 }; | 86 }; |
| 86 | 87 |
| 87 // Implements SinkFilterObserver. | 88 // Implements SinkFilterObserver. |
| (...skipping 20 matching lines...) Expand all Loading... |
| 108 base::win::ScopedComPtr<IPin> output_capture_pin_; | 109 base::win::ScopedComPtr<IPin> output_capture_pin_; |
| 109 | 110 |
| 110 scoped_refptr<SinkFilter> sink_filter_; | 111 scoped_refptr<SinkFilter> sink_filter_; |
| 111 | 112 |
| 112 // Map of all capabilities this device support. | 113 // Map of all capabilities this device support. |
| 113 CapabilityList capabilities_; | 114 CapabilityList capabilities_; |
| 114 VideoCaptureFormat capture_format_; | 115 VideoCaptureFormat capture_format_; |
| 115 | 116 |
| 116 base::TimeTicks first_ref_time_; | 117 base::TimeTicks first_ref_time_; |
| 117 | 118 |
| 119 std::queue<TakePhotoCallback> take_photo_callbacks_; |
| 120 |
| 118 base::ThreadChecker thread_checker_; | 121 base::ThreadChecker thread_checker_; |
| 119 | 122 |
| 120 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoCaptureDeviceWin); | 123 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoCaptureDeviceWin); |
| 121 }; | 124 }; |
| 122 | 125 |
| 123 } // namespace media | 126 } // namespace media |
| 124 | 127 |
| 125 #endif // MEDIA_CAPTURE_VIDEO_WIN_VIDEO_CAPTURE_DEVICE_WIN_H_ | 128 #endif // MEDIA_CAPTURE_VIDEO_WIN_VIDEO_CAPTURE_DEVICE_WIN_H_ |
| OLD | NEW |