Chromium Code Reviews| Index: media/capture/video/linux/video_capture_device_chromeos.cc |
| diff --git a/media/capture/video/linux/video_capture_device_chromeos.cc b/media/capture/video/linux/video_capture_device_chromeos.cc |
| index 7003990ad5ee26c23d5dfc2445e6dc2e49cd5f37..8598889e32e4e771d67c1ab7448dd86d1de90b4f 100644 |
| --- a/media/capture/video/linux/video_capture_device_chromeos.cc |
| +++ b/media/capture/video/linux/video_capture_device_chromeos.cc |
| @@ -152,8 +152,13 @@ void VideoCaptureDeviceChromeOS::SetRotation(int rotation) { |
| // |
| // Therefore, for back camera, we need to rotate (360 - |rotation|). |
| rotation = (360 - rotation) % 360; |
| + } else if (lens_facing_ == VideoFacingMode::MEDIA_VIDEO_FACING_NONE) { |
| + // External cameras have lens_facing as MEDIA_VIDEO_FACING_NONE. |
| + // We don't want to rotate the frame even if the device rotates. |
| + rotation = 0; |
|
chfremer
2017/03/20 16:32:47
As a drive-by nit, I wonder if we could make thing
shenghao
2017/03/21 06:06:31
Done.
|
| } |
| - // Take into account camera orientation w.r.t. the display. |
| + // Take into account camera orientation w.r.t. the display. External cameras |
| + // would have camera_orientation_ as 0. |
| rotation = (rotation + camera_orientation_) % 360; |
| VideoCaptureDeviceLinux::SetRotation(rotation); |
| } |