| OLD | NEW |
| 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/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/single_thread_task_runner.h" | 9 #include "base/single_thread_task_runner.h" |
| 10 #include "media/capture/video/chromeos/display_rotation_observer.h" |
| 10 #include "media/capture/video/linux/camera_config_chromeos.h" | 11 #include "media/capture/video/linux/camera_config_chromeos.h" |
| 11 #include "media/capture/video/linux/video_capture_device_linux.h" | 12 #include "media/capture/video/linux/video_capture_device_linux.h" |
| 12 | 13 |
| 13 namespace display { | 14 namespace display { |
| 14 class Display; | 15 class Display; |
| 15 } // namespace display | 16 } // namespace display |
| 16 | 17 |
| 17 namespace media { | 18 namespace media { |
| 18 | 19 |
| 19 // This class is functionally the same as VideoCaptureDeviceLinux, with the | 20 // This class is functionally the same as VideoCaptureDeviceLinux, with the |
| 20 // exception that it is aware of the orientation of the internal Display. When | 21 // exception that it is aware of the orientation of the internal Display. When |
| 21 // the internal Display is rotated, the frames captured are rotated to match. | 22 // the internal Display is rotated, the frames captured are rotated to match. |
| 22 class VideoCaptureDeviceChromeOS : public VideoCaptureDeviceLinux { | 23 class VideoCaptureDeviceChromeOS : public VideoCaptureDeviceLinux, |
| 24 public DisplayRotationObserver { |
| 23 public: | 25 public: |
| 24 explicit VideoCaptureDeviceChromeOS( | 26 explicit VideoCaptureDeviceChromeOS( |
| 25 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner, | 27 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner, |
| 26 const VideoCaptureDeviceDescriptor& device_descriptor); | 28 const VideoCaptureDeviceDescriptor& device_descriptor); |
| 27 ~VideoCaptureDeviceChromeOS() override; | 29 ~VideoCaptureDeviceChromeOS() override; |
| 28 | 30 |
| 29 protected: | 31 protected: |
| 30 void SetRotation(int rotation) override; | 32 void SetRotation(int rotation) override; |
| 31 | 33 |
| 32 private: | 34 private: |
| 33 class ScreenObserverDelegate; | 35 // DisplayRotationObserver implementation. |
| 34 | 36 void SetDisplayRotation(const display::Display& display) override; |
| 35 void SetDisplayRotation(const display::Display& display); | |
| 36 scoped_refptr<ScreenObserverDelegate> screen_observer_delegate_; | 37 scoped_refptr<ScreenObserverDelegate> screen_observer_delegate_; |
| 37 const VideoFacingMode lens_facing_; | 38 const VideoFacingMode lens_facing_; |
| 38 const int camera_orientation_; | 39 const int camera_orientation_; |
| 39 // Whether the incoming frames should rotate when the device rotates. | 40 // Whether the incoming frames should rotate when the device rotates. |
| 40 const bool rotates_with_device_; | 41 const bool rotates_with_device_; |
| 41 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoCaptureDeviceChromeOS); | 42 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoCaptureDeviceChromeOS); |
| 42 }; | 43 }; |
| 43 | 44 |
| 44 } // namespace media | 45 } // namespace media |
| 45 | 46 |
| 46 #endif // MEDIA_CAPTURE_VIDEO_LINUX_VIDEO_CAPTURE_DEVICE_CHROMEOS_H_ | 47 #endif // MEDIA_CAPTURE_VIDEO_LINUX_VIDEO_CAPTURE_DEVICE_CHROMEOS_H_ |
| OLD | NEW |