Commit 77f324ac authored by Sergey Ulanov's avatar Sergey Ulanov Committed by Commit Bot

Fix MediaFoundation format enumeration in VideoCaptureDeviceFactoryWin

After crrev.com/791485 GetSupportedFormatsMediaFoundation() was called
with a null ComPtr<>, so the formats were not enumerated. As result
DirectShow API was used instead of MediaFoundation. Fixed the call to
make sure formats are enumerated properly.

Bug: 1112947
Change-Id: I1beb0ee4c1d66826225efe8a27cb45eeb850d41a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2337635
Auto-Submit: Sergey Ulanov <sergeyu@chromium.org>
Reviewed-by: default avatarGuido Urdaneta <guidou@chromium.org>
Commit-Queue: Guido Urdaneta <guidou@chromium.org>
Cr-Commit-Position: refs/heads/master@{#795453}
parent 406912ae
......@@ -697,16 +697,20 @@ DevicesInfo VideoCaptureDeviceFactoryWin::GetDevicesInfoMediaFoundation() {
if (list_was_empty ||
!DevicesInfoContainsDeviceId(devices_info, device_id)) {
ComPtr<IMFMediaSource> source;
const bool pan_tilt_zoom_supported =
CreateDeviceSourceMediaFoundation(
device_id, api_attributes.first, &source) &&
VideoCaptureDeviceMFWin::IsPanTiltZoomSupported(
std::move(source));
bool pan_tilt_zoom_supported = false;
VideoCaptureFormats supported_formats;
if (CreateDeviceSourceMediaFoundation(
device_id, api_attributes.first, &source)) {
pan_tilt_zoom_supported =
VideoCaptureDeviceMFWin::IsPanTiltZoomSupported(source);
supported_formats =
GetSupportedFormatsMediaFoundation(source, display_name);
}
devices_info.emplace_back(VideoCaptureDeviceDescriptor(
display_name, device_id, model_id, api_attributes.first,
pan_tilt_zoom_supported));
devices_info.back().supported_formats =
GetSupportedFormatsMediaFoundation(source, display_name);
std::move(supported_formats);
}
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment