1*4882a593SmuzhiyunFrom be17a4bc7b1c436c870f390c96f2b71be4cb9ff9 Mon Sep 17 00:00:00 2001 2*4882a593SmuzhiyunFrom: Jeffy Chen <jeffy.chen@rock-chips.com> 3*4882a593SmuzhiyunDate: Thu, 5 Nov 2020 12:22:52 +0800 4*4882a593SmuzhiyunSubject: [PATCH 06/17] media: capture: linux: Prefer using the first device 5*4882a593Smuzhiyun 6*4882a593SmuzhiyunSomehow the newest chromium would prefer using the last device in some 7*4882a593Smuzhiyuncases, e.g. apprtc. 8*4882a593Smuzhiyun 9*4882a593SmuzhiyunLet's reverse the device array to workaround it. 10*4882a593Smuzhiyun 11*4882a593SmuzhiyunSigned-off-by: Jeffy Chen <jeffy.chen@rock-chips.com> 12*4882a593Smuzhiyun--- 13*4882a593Smuzhiyun .../capture/video/linux/video_capture_device_factory_linux.cc | 3 ++- 14*4882a593Smuzhiyun 1 file changed, 2 insertions(+), 1 deletion(-) 15*4882a593Smuzhiyun 16*4882a593Smuzhiyundiff --git a/media/capture/video/linux/video_capture_device_factory_linux.cc b/media/capture/video/linux/video_capture_device_factory_linux.cc 17*4882a593Smuzhiyunindex 7c90f5c46..1351093ed 100644 18*4882a593Smuzhiyun--- a/media/capture/video/linux/video_capture_device_factory_linux.cc 19*4882a593Smuzhiyun+++ b/media/capture/video/linux/video_capture_device_factory_linux.cc 20*4882a593Smuzhiyun@@ -197,7 +197,8 @@ void VideoCaptureDeviceFactoryLinux::GetDevicesInfo( 21*4882a593Smuzhiyun continue; 22*4882a593Smuzhiyun } 23*4882a593Smuzhiyun 24*4882a593Smuzhiyun- devices_info.emplace_back(VideoCaptureDeviceDescriptor( 25*4882a593Smuzhiyun+ // HACK: Somehow the newest chromium would prefer using the last device in some cases, e.g. apprtc 26*4882a593Smuzhiyun+ devices_info.emplace(devices_info.begin(), VideoCaptureDeviceDescriptor( 27*4882a593Smuzhiyun display_name, unique_id, model_id, 28*4882a593Smuzhiyun VideoCaptureApi::LINUX_V4L2_SINGLE_PLANE, GetControlSupport(fd.get()), 29*4882a593Smuzhiyun VideoCaptureTransportType::OTHER_TRANSPORT, facing_mode)); 30*4882a593Smuzhiyun-- 31*4882a593Smuzhiyun2.20.1 32*4882a593Smuzhiyun 33