Video Capture: Fix VideoFacingMode & rotation for IR cameras on Windows
Problem: Currently in VideoCaptureDeviceFactoryWin::GetDevicesInfoMediaFoundation we generate |devices_info| with MFAttributes for both KSCATEGORY_VIDEO_CAMERA and KSCATEGORY_SENSOR_CAMERA. The latter attribute adds IR cameras (used for Windows Hello) to |devices_info|. However, in VideoCaptureDeviceFactoryWin::EnumerateDevicesUWP we use FindAllAsyncDeviceClass() to get Device Information for only video capture devices. As a result, we never get_EnclosureLocation() for IR cameras. Consequently, their VideoFacingMode is never set. This results in incorrect camera rotation for IR cameras on pages like: https://webrtc.github.io/samples/src/content/devices/input-output/ Fix: This CL changes the Windows API used in VideoCaptureDeviceFactoryWin::EnumerateDevicesUWP from FindAllAsyncDeviceClass() to FindAllAsyncAqsFilter(). The latter allows us to provide an AQS selector string to filter devices for which DeviceInformation is returned to both KSCATEGORY_VIDEO_CAMERA and KSCATEGORY_SENSOR_CAMERA. Testing: Verified that the above change fixes rotation for IR cameras while keeping rotation behavior for Video cameras the same. Bug: 1090754 Change-Id: I0420cc2034be905e188d7e94f51eed298cdeaa7e Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2366035Reviewed-by:Guido Urdaneta <guidou@chromium.org> Commit-Queue: Rahul Singh <rahsin@microsoft.com> Cr-Commit-Position: refs/heads/master@{#801408}
Showing
Please register or sign in to comment