| 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_VIDEO_CAPTURE_WIN_VIDEO_CAPTURE_DEVICE_WIN_H_ | 8 #ifndef MEDIA_VIDEO_CAPTURE_WIN_VIDEO_CAPTURE_DEVICE_WIN_H_ |
| 9 #define MEDIA_VIDEO_CAPTURE_WIN_VIDEO_CAPTURE_DEVICE_WIN_H_ | 9 #define MEDIA_VIDEO_CAPTURE_WIN_VIDEO_CAPTURE_DEVICE_WIN_H_ |
| 10 | 10 |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 enum InternalState { | 79 enum InternalState { |
| 80 kIdle, // The device driver is opened but camera is not in use. | 80 kIdle, // The device driver is opened but camera is not in use. |
| 81 kCapturing, // Video is being captured. | 81 kCapturing, // Video is being captured. |
| 82 kError // Error accessing HW functions. | 82 kError // Error accessing HW functions. |
| 83 // User needs to recover by destroying the object. | 83 // User needs to recover by destroying the object. |
| 84 }; | 84 }; |
| 85 | 85 |
| 86 // Implements SinkFilterObserver. | 86 // Implements SinkFilterObserver. |
| 87 void FrameReceived(const uint8_t* buffer, | 87 void FrameReceived(const uint8_t* buffer, |
| 88 int length, | 88 int length, |
| 89 base::TimeTicks timestamp) override; | 89 base::TimeDelta timestamp) override; |
| 90 | 90 |
| 91 bool CreateCapabilityMap(); | 91 bool CreateCapabilityMap(); |
| 92 void SetAntiFlickerInCaptureFilter(const VideoCaptureParams& params); | 92 void SetAntiFlickerInCaptureFilter(const VideoCaptureParams& params); |
| 93 void SetErrorState(const tracked_objects::Location& from_here, | 93 void SetErrorState(const tracked_objects::Location& from_here, |
| 94 const std::string& reason); | 94 const std::string& reason); |
| 95 | 95 |
| 96 const Name device_name_; | 96 const Name device_name_; |
| 97 InternalState state_; | 97 InternalState state_; |
| 98 std::unique_ptr<VideoCaptureDevice::Client> client_; | 98 std::unique_ptr<VideoCaptureDevice::Client> client_; |
| 99 | 99 |
| 100 base::win::ScopedComPtr<IBaseFilter> capture_filter_; | 100 base::win::ScopedComPtr<IBaseFilter> capture_filter_; |
| 101 | 101 |
| 102 base::win::ScopedComPtr<IGraphBuilder> graph_builder_; | 102 base::win::ScopedComPtr<IGraphBuilder> graph_builder_; |
| 103 base::win::ScopedComPtr<ICaptureGraphBuilder2> capture_graph_builder_; | 103 base::win::ScopedComPtr<ICaptureGraphBuilder2> capture_graph_builder_; |
| 104 | 104 |
| 105 base::win::ScopedComPtr<IMediaControl> media_control_; | 105 base::win::ScopedComPtr<IMediaControl> media_control_; |
| 106 base::win::ScopedComPtr<IPin> input_sink_pin_; | 106 base::win::ScopedComPtr<IPin> input_sink_pin_; |
| 107 base::win::ScopedComPtr<IPin> output_capture_pin_; | 107 base::win::ScopedComPtr<IPin> output_capture_pin_; |
| 108 | 108 |
| 109 scoped_refptr<SinkFilter> sink_filter_; | 109 scoped_refptr<SinkFilter> sink_filter_; |
| 110 | 110 |
| 111 // Map of all capabilities this device support. | 111 // Map of all capabilities this device support. |
| 112 CapabilityList capabilities_; | 112 CapabilityList capabilities_; |
| 113 VideoCaptureFormat capture_format_; | 113 VideoCaptureFormat capture_format_; |
| 114 | 114 |
| 115 base::TimeTicks first_ref_time_; |
| 116 |
| 115 base::ThreadChecker thread_checker_; | 117 base::ThreadChecker thread_checker_; |
| 116 | 118 |
| 117 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoCaptureDeviceWin); | 119 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoCaptureDeviceWin); |
| 118 }; | 120 }; |
| 119 | 121 |
| 120 } // namespace media | 122 } // namespace media |
| 121 | 123 |
| 122 #endif // MEDIA_VIDEO_CAPTURE_WIN_VIDEO_CAPTURE_DEVICE_WIN_H_ | 124 #endif // MEDIA_VIDEO_CAPTURE_WIN_VIDEO_CAPTURE_DEVICE_WIN_H_ |
| OLD | NEW |