Video Capture: Fix VideoFacingMode and rear camera rotation for Windows
This CL addresses a couple issues with Windows Video Capture. 1. VideoFacingMode was incorrectly set for inbuilt cameras. This was because we were using model_id to find devices in devices_info. For inbuilt cameras this was an empty string. As a result, on devices with multiple inbuilt cameras, all cameras had the same model_id and the VideoFacingMode was set for the wrong camera. Solution: Changed the code to use device_id instead of model_id. 2. Rear camera feed was incorrectly rotated. This was because we had the same camera rotation values for Front and Rear cameras. With this, when a device was rotated 90 or 270 degrees, the rear camera was off by 180 degrees. Solution: Set the camera rotation value in GetCameraRotation() for the 90 degree and 270 degree case after checking the VideoFacingMode. Testing: Verified that with these changes: 1. Windows devices with front and back cameras showed the correct rotation behavior for both cameras. 2. Devices with external cameras connected over USB were unaffected. Bug: 1090754 Change-Id: I44c13a9e77c050fe27875b8b22f5e2ee2f09f95b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2357556Reviewed-by:Guido Urdaneta <guidou@chromium.org> Commit-Queue: Rahul Singh <rahsin@microsoft.com> Cr-Commit-Position: refs/heads/master@{#800855}
Showing
Please register or sign in to comment