Chromium Code Reviews| Index: media/video/capture/screen/screen_capturer.h |
| diff --git a/media/video/capture/screen/screen_capturer.h b/media/video/capture/screen/screen_capturer.h |
| index bc3d454e945971b618a25ae8c753c120d7a3d911..3ba1fa4de24a5bf07a9a22c79a432de762a7ad87 100644 |
| --- a/media/video/capture/screen/screen_capturer.h |
| +++ b/media/video/capture/screen/screen_capturer.h |
| @@ -8,15 +8,12 @@ |
| #include "base/basictypes.h" |
| #include "base/callback.h" |
| #include "base/memory/ref_counted.h" |
| -#include "base/shared_memory.h" |
| #include "media/base/media_export.h" |
| -#include "media/video/capture/screen/shared_buffer.h" |
| +#include "third_party/webrtc/modules/desktop_capture/desktop_capturer.h" |
| namespace media { |
| -class ScreenCaptureData; |
| struct MouseCursorShape; |
| -class SharedBuffer; |
| // Class used to capture video frames asynchronously. |
| // |
| @@ -36,32 +33,19 @@ class SharedBuffer; |
| // Implementation has to ensure the following guarantees: |
| // 1. Double buffering |
| // Since data can be read while another capture action is happening. |
| -class MEDIA_EXPORT ScreenCapturer { |
| +class MEDIA_EXPORT ScreenCapturer : public webrtc::DesktopCapturer { |
| public: |
| // Provides callbacks used by the capturer to pass captured video frames and |
| // mouse cursor shapes to the processing pipeline. |
| - class MEDIA_EXPORT Delegate { |
| + // TODO(sergeyu): Move cursor shape capturing to a separate class. |
|
alexeypa (please no reviews)
2013/04/26 21:33:58
nit: Indentation. Also add a brief explanation why
Sergey Ulanov
2013/05/07 22:25:50
Done.
|
| + class MEDIA_EXPORT MouseShapeObserver { |
| public: |
| - // Creates a shared memory buffer of the given size. Returns NULL if shared |
| - // buffers are not supported. |
| - virtual scoped_refptr<SharedBuffer> CreateSharedBuffer(uint32 size); |
| - |
| - // Notifies the delegate that the buffer is no longer used and can be |
| - // released. |
| - virtual void ReleaseSharedBuffer(scoped_refptr<SharedBuffer> buffer); |
| - |
| - // Called when a video frame has been captured. |capture_data| describes |
| - // a captured frame. |
| - virtual void OnCaptureCompleted( |
| - scoped_refptr<ScreenCaptureData> capture_data) = 0; |
| - |
| // Called when the cursor shape has changed. |
| - // TODO(sergeyu): Move cursor shape capturing to a separate class. |
| virtual void OnCursorShapeChanged( |
| scoped_ptr<MouseCursorShape> cursor_shape) = 0; |
| protected: |
| - virtual ~Delegate() {} |
| + virtual ~MouseShapeObserver() {} |
| }; |
| virtual ~ScreenCapturer() {} |
| @@ -79,18 +63,10 @@ class MEDIA_EXPORT ScreenCapturer { |
| static scoped_ptr<ScreenCapturer> CreateWithDisableAero(bool disable_aero); |
| #endif |
|
alexeypa (please no reviews)
2013/04/26 21:33:58
nit: add // defined(OS_WIN)
Sergey Ulanov
2013/05/07 22:25:50
Done.
|
| - // Called at the beginning of a capturing session. |delegate| must remain |
| - // valid until Stop() is called. |
| - virtual void Start(Delegate* delegate) = 0; |
| - |
| - // Captures the screen data associated with each of the accumulated |
| - // dirty region. When the capture is complete, the delegate is notified even |
| - // if the dirty region is empty. |
| - // |
| - // It is OK to call this method while another thread is reading |
| - // data of the previous capture. There can be at most one concurrent read |
| - // going on when this method is called. |
| - virtual void CaptureFrame() = 0; |
| + // Called at the beginning of a capturing session. |mouse_shape_observer| must |
| + // remain valid until the capturer is destroyed. |
| + virtual void SetMouseShapeObserver( |
| + MouseShapeObserver* mouse_shape_observer) = 0; |
| }; |
| } // namespace media |