OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "content/browser/media/capture/desktop_capture_device_aura.h" | 5 #include "content/browser/media/capture/desktop_capture_device_aura.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
9 #include "base/timer/timer.h" | 9 #include "base/timer/timer.h" |
10 #include "cc/output/copy_output_request.h" | 10 #include "cc/output/copy_output_request.h" |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 : public VideoCaptureMachine, | 93 : public VideoCaptureMachine, |
94 public aura::WindowObserver, | 94 public aura::WindowObserver, |
95 public ui::CompositorObserver, | 95 public ui::CompositorObserver, |
96 public base::SupportsWeakPtr<DesktopVideoCaptureMachine> { | 96 public base::SupportsWeakPtr<DesktopVideoCaptureMachine> { |
97 public: | 97 public: |
98 DesktopVideoCaptureMachine(const DesktopMediaID& source); | 98 DesktopVideoCaptureMachine(const DesktopMediaID& source); |
99 virtual ~DesktopVideoCaptureMachine(); | 99 virtual ~DesktopVideoCaptureMachine(); |
100 | 100 |
101 // VideoCaptureFrameSource overrides. | 101 // VideoCaptureFrameSource overrides. |
102 virtual bool Start(const scoped_refptr<ThreadSafeCaptureOracle>& oracle_proxy, | 102 virtual bool Start(const scoped_refptr<ThreadSafeCaptureOracle>& oracle_proxy, |
103 const media::VideoCaptureParams& params) OVERRIDE; | 103 const media::VideoCaptureParams& params) override; |
104 virtual void Stop(const base::Closure& callback) OVERRIDE; | 104 virtual void Stop(const base::Closure& callback) override; |
105 | 105 |
106 // Implements aura::WindowObserver. | 106 // Implements aura::WindowObserver. |
107 virtual void OnWindowBoundsChanged(aura::Window* window, | 107 virtual void OnWindowBoundsChanged(aura::Window* window, |
108 const gfx::Rect& old_bounds, | 108 const gfx::Rect& old_bounds, |
109 const gfx::Rect& new_bounds) OVERRIDE; | 109 const gfx::Rect& new_bounds) override; |
110 virtual void OnWindowDestroyed(aura::Window* window) OVERRIDE; | 110 virtual void OnWindowDestroyed(aura::Window* window) override; |
111 virtual void OnWindowAddedToRootWindow(aura::Window* window) OVERRIDE; | 111 virtual void OnWindowAddedToRootWindow(aura::Window* window) override; |
112 virtual void OnWindowRemovingFromRootWindow(aura::Window* window, | 112 virtual void OnWindowRemovingFromRootWindow(aura::Window* window, |
113 aura::Window* new_root) OVERRIDE; | 113 aura::Window* new_root) override; |
114 | 114 |
115 // Implements ui::CompositorObserver. | 115 // Implements ui::CompositorObserver. |
116 virtual void OnCompositingDidCommit(ui::Compositor* compositor) OVERRIDE {} | 116 virtual void OnCompositingDidCommit(ui::Compositor* compositor) override {} |
117 virtual void OnCompositingStarted(ui::Compositor* compositor, | 117 virtual void OnCompositingStarted(ui::Compositor* compositor, |
118 base::TimeTicks start_time) OVERRIDE {} | 118 base::TimeTicks start_time) override {} |
119 virtual void OnCompositingEnded(ui::Compositor* compositor) OVERRIDE; | 119 virtual void OnCompositingEnded(ui::Compositor* compositor) override; |
120 virtual void OnCompositingAborted(ui::Compositor* compositor) OVERRIDE {} | 120 virtual void OnCompositingAborted(ui::Compositor* compositor) override {} |
121 virtual void OnCompositingLockStateChanged( | 121 virtual void OnCompositingLockStateChanged( |
122 ui::Compositor* compositor) OVERRIDE {} | 122 ui::Compositor* compositor) override {} |
123 | 123 |
124 private: | 124 private: |
125 // Captures a frame. | 125 // Captures a frame. |
126 // |dirty| is false for timer polls and true for compositor updates. | 126 // |dirty| is false for timer polls and true for compositor updates. |
127 void Capture(bool dirty); | 127 void Capture(bool dirty); |
128 | 128 |
129 // Update capture size. Must be called on the UI thread. | 129 // Update capture size. Must be called on the UI thread. |
130 void UpdateCaptureSize(); | 130 void UpdateCaptureSize(); |
131 | 131 |
132 // Response callback for cc::Layer::RequestCopyOfOutput(). | 132 // Response callback for cc::Layer::RequestCopyOfOutput(). |
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
533 scoped_ptr<Client> client) { | 533 scoped_ptr<Client> client) { |
534 DVLOG(1) << "Allocating " << params.requested_format.frame_size.ToString(); | 534 DVLOG(1) << "Allocating " << params.requested_format.frame_size.ToString(); |
535 core_->AllocateAndStart(params, client.Pass()); | 535 core_->AllocateAndStart(params, client.Pass()); |
536 } | 536 } |
537 | 537 |
538 void DesktopCaptureDeviceAura::StopAndDeAllocate() { | 538 void DesktopCaptureDeviceAura::StopAndDeAllocate() { |
539 core_->StopAndDeAllocate(); | 539 core_->StopAndDeAllocate(); |
540 } | 540 } |
541 | 541 |
542 } // namespace content | 542 } // namespace content |
OLD | NEW |