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

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: 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
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..29b6ed94f8701ecb557133df2da30d195e334a3c 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(
Wez 2012/11/07 19:58:29 nit: OnCaptureFrameCompleted; I'd like to rename C
alexeypa (please no reviews) 2012/11/07 20:54:41 Ack.
+ 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() {}
@@ -79,29 +87,25 @@ class VideoFrameCapturer {
#endif // defined(OS_LINUX)
// Called at the beginning of a capturing session.
Wez 2012/11/07 19:58:29 nit: |delegate| remain valid until Stop() is calle
alexeypa (please no reviews) 2012/11/07 20:54:41 Done.
- virtual void Start(
- const CursorShapeChangedCallback& callback) = 0;
+ 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;

Powered by Google App Engine
This is Rietveld 408576698