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

Side by Side Diff: media/capture/video/linux/video_capture_device_chromeos.cc

Issue 2609863004: Pass camera facing to WebKit (Closed)
Patch Set: change comments Created 3 years, 11 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/capture/video/linux/video_capture_device_chromeos.h" 5 #include "media/capture/video/linux/video_capture_device_chromeos.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 g_camera_facing_.Get().GetCameraFacing(device_descriptor.device_id, 112 g_camera_facing_.Get().GetCameraFacing(device_descriptor.device_id,
113 device_descriptor.model_id)) {} 113 device_descriptor.model_id)) {}
114 114
115 VideoCaptureDeviceChromeOS::~VideoCaptureDeviceChromeOS() { 115 VideoCaptureDeviceChromeOS::~VideoCaptureDeviceChromeOS() {
116 screen_observer_delegate_->RemoveObserver(); 116 screen_observer_delegate_->RemoveObserver();
117 } 117 }
118 118
119 void VideoCaptureDeviceChromeOS::SetRotation(int rotation) { 119 void VideoCaptureDeviceChromeOS::SetRotation(int rotation) {
120 // We assume external camera is facing the users. If not, the users can 120 // We assume external camera is facing the users. If not, the users can
121 // rotate the camera manually by themselves. 121 // rotate the camera manually by themselves.
122 if (lens_facing_ == CameraFacingChromeOS::LensFacing::BACK) { 122 if (lens_facing_ == VideoFacingMode::MEDIA_VIDEO_FACING_ENVIRONMENT) {
123 // Original frame when |rotation| = 0 123 // Original frame when |rotation| = 0
124 // ----------------------- 124 // -----------------------
125 // | * | 125 // | * |
126 // | * * | 126 // | * * |
127 // | * * | 127 // | * * |
128 // | ******* | 128 // | ******* |
129 // | * * | 129 // | * * |
130 // | * * | 130 // | * * |
131 // ----------------------- 131 // -----------------------
132 // 132 //
(...skipping 23 matching lines...) Expand all
156 VideoCaptureDeviceLinux::SetRotation(rotation); 156 VideoCaptureDeviceLinux::SetRotation(rotation);
157 } 157 }
158 158
159 void VideoCaptureDeviceChromeOS::SetDisplayRotation( 159 void VideoCaptureDeviceChromeOS::SetDisplayRotation(
160 const display::Display& display) { 160 const display::Display& display) {
161 if (display.IsInternal()) 161 if (display.IsInternal())
162 SetRotation(display.rotation() * 90); 162 SetRotation(display.rotation() * 90);
163 } 163 }
164 164
165 } // namespace media 165 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698