Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(430)

Unified Diff: media/capture/video/linux/video_capture_device_chromeos.cc

Issue 2762603002: Do not rotate frames from external cameras (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698