Chromium Code Reviews| Index: content/browser/media/capture/aura_window_capture_machine.h |
| diff --git a/content/browser/media/capture/aura_window_capture_machine.h b/content/browser/media/capture/aura_window_capture_machine.h |
| index f41e73ce460af2a7bdcf3bfe6739b037aa01307f..b17b804e30fc59d911968f88a81f3fe954033aad 100644 |
| --- a/content/browser/media/capture/aura_window_capture_machine.h |
| +++ b/content/browser/media/capture/aura_window_capture_machine.h |
| @@ -8,7 +8,7 @@ |
| #include "base/memory/scoped_ptr.h" |
| #include "base/memory/weak_ptr.h" |
| #include "base/timer/timer.h" |
| -#include "content/browser/media/capture/content_video_capture_device_core.h" |
| +#include "media/capture/media_video_capture_device_core.h" |
| #include "ui/aura/window.h" |
| #include "ui/aura/window_observer.h" |
| #include "ui/base/cursor/cursors_aura.h" |
| @@ -26,7 +26,7 @@ class PowerSaveBlocker; |
| class ReadbackYUVInterface; |
| class AuraWindowCaptureMachine |
| - : public VideoCaptureMachine, |
| + : public media::VideoCaptureMachine, |
| public aura::WindowObserver, |
| public ui::CompositorObserver, |
| public base::SupportsWeakPtr<AuraWindowCaptureMachine> { |
| @@ -34,9 +34,10 @@ class AuraWindowCaptureMachine |
| AuraWindowCaptureMachine(); |
| ~AuraWindowCaptureMachine() override; |
| - // VideoCaptureFrameSource overrides. |
| - bool Start(const scoped_refptr<ThreadSafeCaptureOracle>& oracle_proxy, |
| - const media::VideoCaptureParams& params) override; |
| + // VideoCaptureMachine overrides. |
| + void Start(const scoped_refptr<media::ThreadSafeCaptureOracle>& oracle_proxy, |
| + const media::VideoCaptureParams& params, |
| + const base::Callback<void(bool)> callback) override; |
| void Stop(const base::Closure& callback) override; |
| // Implements aura::WindowObserver. |
| @@ -61,6 +62,11 @@ class AuraWindowCaptureMachine |
| void SetWindow(aura::Window* window); |
| private: |
| + bool InternalStart( |
| + const scoped_refptr<media::ThreadSafeCaptureOracle>& oracle_proxy, |
| + const media::VideoCaptureParams& params); |
| + void InternalStop(const base::Closure& callback); |
| + |
| // Captures a frame. |
| // |dirty| is false for timer polls and true for compositor updates. |
| void Capture(bool dirty); |
| @@ -68,11 +74,14 @@ class AuraWindowCaptureMachine |
| // Update capture size. Must be called on the UI thread. |
| void UpdateCaptureSize(); |
| + typedef media::ThreadSafeCaptureOracle::CaptureFrameCallback |
|
miu
2015/06/05 01:13:36
nit: With C++11, this style is now preferred:
u
jiajia.qin
2015/06/08 04:58:23
Done.
|
| + CaptureFrameCallback; |
| + |
| // Response callback for cc::Layer::RequestCopyOfOutput(). |
| void DidCopyOutput( |
| scoped_refptr<media::VideoFrame> video_frame, |
| base::TimeTicks start_time, |
| - const ThreadSafeCaptureOracle::CaptureFrameCallback& capture_frame_cb, |
| + const CaptureFrameCallback& capture_frame_cb, |
| scoped_ptr<cc::CopyOutputResult> result); |
| // A helper which does the real work for DidCopyOutput. Returns true if |
| @@ -80,7 +89,7 @@ class AuraWindowCaptureMachine |
| bool ProcessCopyOutputResponse( |
| scoped_refptr<media::VideoFrame> video_frame, |
| base::TimeTicks start_time, |
| - const ThreadSafeCaptureOracle::CaptureFrameCallback& capture_frame_cb, |
| + const CaptureFrameCallback& capture_frame_cb, |
| scoped_ptr<cc::CopyOutputResult> result); |
| // Helper function to update cursor state. |
| @@ -102,7 +111,7 @@ class AuraWindowCaptureMachine |
| bool screen_capture_; |
| // Makes all the decisions about which frames to copy, and how. |
| - scoped_refptr<ThreadSafeCaptureOracle> oracle_proxy_; |
| + scoped_refptr<media::ThreadSafeCaptureOracle> oracle_proxy_; |
| // The capture parameters for this capture. |
| media::VideoCaptureParams capture_params_; |