1From b246955a142dd919e26659aa7695302bd7adc08d Mon Sep 17 00:00:00 2001
2From: Jeffy Chen <jeffy.chen@rock-chips.com>
3Date: Mon, 31 May 2021 07:25:58 +0800
4Subject: [PATCH 12/18] HACK: media: capture: linux: Allow camera without
5 supported format
6
7The chromium would only accept discrete frame sizes.
8
9Hack it to make Rockchip ISP camera working.
10
11Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
12---
13 .../video/linux/video_capture_device_factory_linux.cc       | 6 ++----
14 1 file changed, 2 insertions(+), 4 deletions(-)
15
16diff --git a/media/capture/video/linux/video_capture_device_factory_linux.cc b/media/capture/video/linux/video_capture_device_factory_linux.cc
17index bbbd6cc9e..4f2bc62c3 100644
18--- a/media/capture/video/linux/video_capture_device_factory_linux.cc
19+++ b/media/capture/video/linux/video_capture_device_factory_linux.cc
20@@ -193,10 +193,8 @@ void VideoCaptureDeviceFactoryLinux::GetDevicesInfo(
21
22       VideoCaptureFormats supported_formats;
23       GetSupportedFormatsForV4L2BufferType(fd.get(), &supported_formats);
24-      if (supported_formats.empty()) {
25-        DVLOG(1) << "No supported formats: " << unique_id;
26-        continue;
27-      }
28+      if (supported_formats.empty())
29+        LOG(WARNING) << "No supported formats: " << unique_id;
30
31       // HACK: Somehow the newest chromium would prefer using the last device in some cases, e.g. apprtc
32       devices_info.emplace(devices_info.begin(), VideoCaptureDeviceDescriptor(
33--
342.20.1
35
36