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

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

Issue 2508803002: Rotate frames correctly for back camera (Closed)
Patch Set: move from linux to chromeos Created 4 years 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 #ifndef MEDIA_CAPTURE_VIDEO_LINUX_VIDEO_CAPTURE_DEVICE_CHROMEOS_H_ 5 #ifndef MEDIA_CAPTURE_VIDEO_LINUX_VIDEO_CAPTURE_DEVICE_CHROMEOS_H_
6 #define MEDIA_CAPTURE_VIDEO_LINUX_VIDEO_CAPTURE_DEVICE_CHROMEOS_H_ 6 #define MEDIA_CAPTURE_VIDEO_LINUX_VIDEO_CAPTURE_DEVICE_CHROMEOS_H_
7 7
8 #include "base/lazy_instance.h"
8 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "media/capture/video/linux/camera_characteristics.h"
9 #include "media/capture/video/linux/video_capture_device_linux.h" 11 #include "media/capture/video/linux/video_capture_device_linux.h"
10 12
11 namespace display { 13 namespace display {
12 class Display; 14 class Display;
13 } // namespace display 15 } // namespace display
14 16
15 namespace media { 17 namespace media {
16 18
17 // This class is functionally the same as VideoCaptureDeviceLinux, with the 19 // This class is functionally the same as VideoCaptureDeviceLinux, with the
18 // exception that it is aware of the orientation of the internal Display. When 20 // exception that it is aware of the orientation of the internal Display. When
19 // the internal Display is rotated, the frames captured are rotated to match. 21 // the internal Display is rotated, the frames captured are rotated to match.
20 class VideoCaptureDeviceChromeOS : public VideoCaptureDeviceLinux { 22 class VideoCaptureDeviceChromeOS : public VideoCaptureDeviceLinux {
21 public: 23 public:
22 explicit VideoCaptureDeviceChromeOS( 24 explicit VideoCaptureDeviceChromeOS(
23 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner, 25 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner,
24 const VideoCaptureDeviceDescriptor& device_descriptor); 26 const VideoCaptureDeviceDescriptor& device_descriptor);
25 ~VideoCaptureDeviceChromeOS() override; 27 ~VideoCaptureDeviceChromeOS() override;
26 28
29 protected:
30 void SetRotation(int rotation) override;
31
27 private: 32 private:
28 class ScreenObserverDelegate; 33 class ScreenObserverDelegate;
29 34
30 void SetDisplayRotation(const display::Display& display); 35 void SetDisplayRotation(const display::Display& display);
31 scoped_refptr<ScreenObserverDelegate> screen_observer_delegate_; 36 scoped_refptr<ScreenObserverDelegate> screen_observer_delegate_;
37 int lens_facing_;
38 base::LazyInstance<CameraCharacteristics> camera_characteristics_;
kcwu 2016/11/24 15:48:52 This should be static or global, otherwise no poin
shenghao 2016/11/28 08:52:04 Done.
32 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoCaptureDeviceChromeOS); 39 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoCaptureDeviceChromeOS);
33 }; 40 };
34 41
35 } // namespace media 42 } // namespace media
36 43
37 #endif // MEDIA_CAPTURE_VIDEO_LINUX_VIDEO_CAPTURE_DEVICE_CHROMEOS_H_ 44 #endif // MEDIA_CAPTURE_VIDEO_LINUX_VIDEO_CAPTURE_DEVICE_CHROMEOS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698