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. | 5 // Windows specific implementation of VideoCaptureDevice. |
6 // DirectShow is used for capturing. DirectShow provide its own threads | 6 // DirectShow is used for capturing. DirectShow provide its own threads |
7 // for capturing. | 7 // for capturing. |
8 | 8 |
9 #ifndef MEDIA_VIDEO_CAPTURE_WIN_VIDEO_CAPTURE_DEVICE_WIN_H_ | 9 #ifndef MEDIA_VIDEO_CAPTURE_WIN_VIDEO_CAPTURE_DEVICE_WIN_H_ |
10 #define MEDIA_VIDEO_CAPTURE_WIN_VIDEO_CAPTURE_DEVICE_WIN_H_ | 10 #define MEDIA_VIDEO_CAPTURE_WIN_VIDEO_CAPTURE_DEVICE_WIN_H_ |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 virtual ~VideoCaptureDeviceWin(); | 67 virtual ~VideoCaptureDeviceWin(); |
68 // Opens the device driver for this device. | 68 // Opens the device driver for this device. |
69 bool Init(); | 69 bool Init(); |
70 | 70 |
71 // VideoCaptureDevice implementation. | 71 // VideoCaptureDevice implementation. |
72 virtual void AllocateAndStart( | 72 virtual void AllocateAndStart( |
73 const VideoCaptureParams& params, | 73 const VideoCaptureParams& params, |
74 scoped_ptr<VideoCaptureDevice::Client> client) override; | 74 scoped_ptr<VideoCaptureDevice::Client> client) override; |
75 virtual void StopAndDeAllocate() override; | 75 virtual void StopAndDeAllocate() override; |
76 | 76 |
| 77 void GetDeviceSupportedFormats(VideoCaptureFormats* formats); |
| 78 |
77 private: | 79 private: |
78 enum InternalState { | 80 enum InternalState { |
79 kIdle, // The device driver is opened but camera is not in use. | 81 kIdle, // The device driver is opened but camera is not in use. |
80 kCapturing, // Video is being captured. | 82 kCapturing, // Video is being captured. |
81 kError // Error accessing HW functions. | 83 kError // Error accessing HW functions. |
82 // User needs to recover by destroying the object. | 84 // User needs to recover by destroying the object. |
83 }; | 85 }; |
84 | 86 |
85 // Implements SinkFilterObserver. | 87 // Implements SinkFilterObserver. |
86 virtual void FrameReceived(const uint8* buffer, int length); | 88 virtual void FrameReceived(const uint8* buffer, int length); |
(...skipping 28 matching lines...) Expand all Loading... |
115 // Map of all capabilities this device support. | 117 // Map of all capabilities this device support. |
116 CapabilityList capabilities_; | 118 CapabilityList capabilities_; |
117 VideoCaptureFormat capture_format_; | 119 VideoCaptureFormat capture_format_; |
118 | 120 |
119 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoCaptureDeviceWin); | 121 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoCaptureDeviceWin); |
120 }; | 122 }; |
121 | 123 |
122 } // namespace media | 124 } // namespace media |
123 | 125 |
124 #endif // MEDIA_VIDEO_CAPTURE_WIN_VIDEO_CAPTURE_DEVICE_WIN_H_ | 126 #endif // MEDIA_VIDEO_CAPTURE_WIN_VIDEO_CAPTURE_DEVICE_WIN_H_ |
OLD | NEW |