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