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

Unified Diff: remoting/host/video_frame_capturer.h

Issue 11363128: Converted VideoFrameCapturer callbacks into a VideoFrameCapturer::Delegate interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More Mac compilation issues. Created 8 years, 1 month 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
« no previous file with comments | « remoting/host/host_mock_objects.cc ('k') | remoting/host/video_frame_capturer_fake.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/video_frame_capturer.h
diff --git a/remoting/host/video_frame_capturer.h b/remoting/host/video_frame_capturer.h
index e2db2b9f7176ae4284d0b3d4fa50b1e7099bc1de..7cc863e79e9119a2c57a4385aab610bc3a440ae8 100644
--- a/remoting/host/video_frame_capturer.h
+++ b/remoting/host/video_frame_capturer.h
@@ -50,13 +50,21 @@ class CaptureData;
// Since data can be read while another capture action is happening.
class VideoFrameCapturer {
public:
- // CaptureCompletedCallback is called when the capturer has completed.
- typedef base::Callback<void(scoped_refptr<CaptureData>)>
- CaptureCompletedCallback;
-
- // CursorShapeChangedCallback is called when the cursor shape has changed.
- typedef base::Callback<void(scoped_ptr<protocol::CursorShapeInfo>)>
- CursorShapeChangedCallback;
+ // Provides callbacks used by the capturer to pass captured video frames and
+ // mouse cursor shapes to the processing pipeline.
+ class Delegate {
+ public:
+ virtual ~Delegate() {}
+
+ // Called when the capturer has completed. |capture_data| describes
+ // a captured frame.
+ virtual void OnCaptureCompleted(
+ scoped_refptr<CaptureData> capture_data) = 0;
+
+ // Called when the cursor shape has changed.
+ virtual void OnCursorShapeChanged(
+ scoped_ptr<protocol::CursorShapeInfo> cursor_shape) = 0;
+ };
virtual ~VideoFrameCapturer() {}
@@ -78,30 +86,27 @@ class VideoFrameCapturer {
static void EnableXDamage(bool enable);
#endif // defined(OS_LINUX)
- // Called at the beginning of a capturing session.
- virtual void Start(
- const CursorShapeChangedCallback& callback) = 0;
+ // Called at the beginning of a capturing session. |delegate| must remain
+ // valid until Stop() is called.
+ virtual void Start(Delegate* delegate) = 0;
// Called at the end of a capturing session.
virtual void Stop() = 0;
- // Return the pixel format of the screen.
+ // Returns the pixel format of the screen.
virtual media::VideoFrame::Format pixel_format() const = 0;
- // Invalidate the specified region.
+ // Invalidates the specified region.
virtual void InvalidateRegion(const SkRegion& invalid_region) = 0;
- // Capture the screen data associated with each of the accumulated
- // dirty region.
- // When the capture is complete, |callback| is called even if the dirty region
- // is empty.
+ // 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 CaptureInvalidRegion(
- const CaptureCompletedCallback& callback) = 0;
+ // data of the previous capture. There can be at most one concurrent read
+ // going on when this method is called.
+ virtual void CaptureInvalidRegion() = 0;
// Get the size of the most recently captured screen.
virtual const SkISize& size_most_recent() const = 0;
« no previous file with comments | « remoting/host/host_mock_objects.cc ('k') | remoting/host/video_frame_capturer_fake.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698