Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(184)

Unified Diff: media/video/capture/screen/screen_capturer.h

Issue 13983010: Use webrtc::DesktopCapturer for screen capturer implementation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..5fef2a1ad159d750fa6928a03998e07af4ca1091 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,22 @@ 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 NON_EXPORTED_BASE(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 because it's
+ // unrelated.
+ 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() {}
@@ -77,20 +64,12 @@ class MEDIA_EXPORT ScreenCapturer {
// Creates Windows-specific capturer and instructs it whether or not to
// disable desktop compositing.
static scoped_ptr<ScreenCapturer> CreateWithDisableAero(bool disable_aero);
-#endif
-
- // Called at the beginning of a capturing session. |delegate| must remain
- // valid until Stop() is called.
- virtual void Start(Delegate* delegate) = 0;
+#endif // defined(OS_WIN)
- // 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
« no previous file with comments | « media/video/capture/screen/screen_capture_frame_queue.cc ('k') | media/video/capture/screen/screen_capturer_fake.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698