| 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 #include "media/capture/video/linux/video_capture_device_chromeos.h" | 5 #include "device/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/macros.h" | 10 #include "base/macros.h" |
| 11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 #include "base/single_thread_task_runner.h" | 12 #include "base/single_thread_task_runner.h" |
| 13 #include "base/threading/thread_task_runner_handle.h" | 13 #include "base/threading/thread_task_runner_handle.h" |
| 14 #include "ui/display/display.h" | 14 #include "ui/display/display.h" |
| 15 #include "ui/display/display_observer.h" | 15 #include "ui/display/display_observer.h" |
| 16 #include "ui/display/screen.h" | 16 #include "ui/display/screen.h" |
| 17 | 17 |
| 18 namespace media { | 18 namespace device { |
| 19 | 19 |
| 20 // This is a delegate class used to transfer Display change events from the UI | 20 // This is a delegate class used to transfer Display change events from the UI |
| 21 // thread to the media thread. | 21 // thread to the media thread. |
| 22 class VideoCaptureDeviceChromeOS::ScreenObserverDelegate | 22 class VideoCaptureDeviceChromeOS::ScreenObserverDelegate |
| 23 : public display::DisplayObserver, | 23 : public display::DisplayObserver, |
| 24 public base::RefCountedThreadSafe<ScreenObserverDelegate> { | 24 public base::RefCountedThreadSafe<ScreenObserverDelegate> { |
| 25 public: | 25 public: |
| 26 ScreenObserverDelegate( | 26 ScreenObserverDelegate( |
| 27 VideoCaptureDeviceChromeOS* capture_device, | 27 VideoCaptureDeviceChromeOS* capture_device, |
| 28 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) | 28 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 VideoCaptureDeviceChromeOS::~VideoCaptureDeviceChromeOS() { | 104 VideoCaptureDeviceChromeOS::~VideoCaptureDeviceChromeOS() { |
| 105 screen_observer_delegate_->RemoveObserver(); | 105 screen_observer_delegate_->RemoveObserver(); |
| 106 } | 106 } |
| 107 | 107 |
| 108 void VideoCaptureDeviceChromeOS::SetDisplayRotation( | 108 void VideoCaptureDeviceChromeOS::SetDisplayRotation( |
| 109 const display::Display& display) { | 109 const display::Display& display) { |
| 110 if (display.IsInternal()) | 110 if (display.IsInternal()) |
| 111 SetRotation(display.rotation() * 90); | 111 SetRotation(display.rotation() * 90); |
| 112 } | 112 } |
| 113 | 113 |
| 114 } // namespace media | 114 } // namespace device |
| OLD | NEW |