OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "media/video/capture/win/video_capture_device_factory_win.h" | 5 #include "media/video/capture/win/video_capture_device_factory_win.h" |
6 | 6 |
7 #include <mfapi.h> | 7 #include <mfapi.h> |
8 #include <mferror.h> | 8 #include <mferror.h> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 // CreateClassEnumerator returns S_FALSE on some Windows OS when no camera | 202 // CreateClassEnumerator returns S_FALSE on some Windows OS when no camera |
203 // exists. Therefore the FAILED macro can't be used. | 203 // exists. Therefore the FAILED macro can't be used. |
204 if (hr != S_OK) | 204 if (hr != S_OK) |
205 return; | 205 return; |
206 | 206 |
207 // Walk the capture devices. No need to check for device presence again since | 207 // Walk the capture devices. No need to check for device presence again since |
208 // that is anyway needed in GetDeviceFilter(). "google camera adapter" and old | 208 // that is anyway needed in GetDeviceFilter(). "google camera adapter" and old |
209 // VFW devices are already skipped previously in GetDeviceNames() enumeration. | 209 // VFW devices are already skipped previously in GetDeviceNames() enumeration. |
210 base::win::ScopedComPtr<IBaseFilter> capture_filter; | 210 base::win::ScopedComPtr<IBaseFilter> capture_filter; |
211 hr = VideoCaptureDeviceWin::GetDeviceFilter(device.capabilities_id(), | 211 hr = VideoCaptureDeviceWin::GetDeviceFilter(device.capabilities_id(), |
| 212 CLSID_VideoInputDeviceCategory, |
212 capture_filter.Receive()); | 213 capture_filter.Receive()); |
213 if (!capture_filter) { | 214 if (!capture_filter) { |
214 DLOG(ERROR) << "Failed to create capture filter: " | 215 DLOG(ERROR) << "Failed to create capture filter: " |
215 << logging::SystemErrorCodeToString(hr); | 216 << logging::SystemErrorCodeToString(hr); |
216 return; | 217 return; |
217 } | 218 } |
218 | 219 |
219 base::win::ScopedComPtr<IPin> output_capture_pin( | 220 base::win::ScopedComPtr<IPin> output_capture_pin( |
220 VideoCaptureDeviceWin::GetPin(capture_filter, | 221 VideoCaptureDeviceWin::GetPin(capture_filter, |
221 PINDIR_OUTPUT, | 222 PINDIR_OUTPUT, |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
425 const Name& device, | 426 const Name& device, |
426 VideoCaptureFormats* formats) { | 427 VideoCaptureFormats* formats) { |
427 DCHECK(thread_checker_.CalledOnValidThread()); | 428 DCHECK(thread_checker_.CalledOnValidThread()); |
428 if (use_media_foundation_) | 429 if (use_media_foundation_) |
429 GetDeviceSupportedFormatsMediaFoundation(device, formats); | 430 GetDeviceSupportedFormatsMediaFoundation(device, formats); |
430 else | 431 else |
431 GetDeviceSupportedFormatsDirectShow(device, formats); | 432 GetDeviceSupportedFormatsDirectShow(device, formats); |
432 } | 433 } |
433 | 434 |
434 } // namespace media | 435 } // namespace media |
OLD | NEW |