Commit a9840260 authored by Peter Qiu's avatar Peter Qiu Committed by Chromium LUCI CQ

V4L2: ignore device without supported capture formats

Bug: internal b/174649142
Test: manual on device
Change-Id: I737054f7aa7fbfed193dc7cd5dba29cd4ba3902c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2582824
Commit-Queue: Peter Qiu <zqiu@chromium.org>
Reviewed-by: default avatarGuido Urdaneta <guidou@chromium.org>
Cr-Commit-Position: refs/heads/master@{#835847}
parent f6e3fa0f
......@@ -237,13 +237,19 @@ void VideoCaptureDeviceFactoryLinux::GetDevicesInfo(
VideoFacingMode::MEDIA_VIDEO_FACING_NONE;
#endif
VideoCaptureFormats supported_formats;
GetSupportedFormatsForV4L2BufferType(fd.get(), &supported_formats);
if (supported_formats.empty()) {
DVLOG(1) << "No supported formats: " << unique_id;
continue;
}
devices_info.emplace_back(VideoCaptureDeviceDescriptor(
display_name, unique_id, model_id,
VideoCaptureApi::LINUX_V4L2_SINGLE_PLANE, GetControlSupport(fd.get()),
VideoCaptureTransportType::OTHER_TRANSPORT, facing_mode));
GetSupportedFormatsForV4L2BufferType(
fd.get(), &devices_info.back().supported_formats);
devices_info.back().supported_formats = 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