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

Unified Diff: remoting/host/video_scheduler.h

Issue 13983010: Use webrtc::DesktopCapturer for screen capturer implementation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: q Created 7 years, 8 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: remoting/host/video_scheduler.h
diff --git a/remoting/host/video_scheduler.h b/remoting/host/video_scheduler.h
index 666e1ab01abedb229aef060ac71a90b7b58fb20f..534ed5dabc676450849b121918fa123ed153652f 100644
--- a/remoting/host/video_scheduler.h
+++ b/remoting/host/video_scheduler.h
@@ -23,7 +23,6 @@ class SingleThreadTaskRunner;
} // namespace base
namespace media {
-class ScreenCaptureData;
class ScreenCapturer;
} // namespace media
@@ -74,7 +73,8 @@ class VideoStub;
// too much CPU, or hogging the host's graphics subsystem.
class VideoScheduler : public base::RefCountedThreadSafe<VideoScheduler>,
- public media::ScreenCapturer::Delegate {
+ public webrtc::DesktopCapturer::Callback,
+ public media::ScreenCapturer::MouseShapeObserver {
public:
// Creates a VideoScheduler running capture, encode and network tasks on the
// supplied TaskRunners. Video and cursor shape updates will be pumped to
@@ -89,9 +89,11 @@ class VideoScheduler : public base::RefCountedThreadSafe<VideoScheduler>,
protocol::CursorShapeStub* cursor_stub,
protocol::VideoStub* video_stub);
- // media::ScreenCapturer::Delegate implementation.
- virtual void OnCaptureCompleted(
- scoped_refptr<media::ScreenCaptureData> capture_data) OVERRIDE;
+ // webrtc::DesktopCapturer::Callback implementation.
+ virtual webrtc::SharedMemory* CreateSharedMemory(size_t size) OVERRIDE;
+ virtual void OnCaptureCompleted(webrtc::DesktopFrame* frame) OVERRIDE;
+
+ // media::ScreenCapturer::MouseShapeObserver implementation.
virtual void OnCursorShapeChanged(
scoped_ptr<media::MouseCursorShape> cursor_shape) OVERRIDE;
@@ -125,8 +127,7 @@ class VideoScheduler : public base::RefCountedThreadSafe<VideoScheduler>,
// Starts the capturer on the capture thread.
void StartOnCaptureThread();
- // Stops scheduling frame captures on the capture thread, and posts
- // StopOnEncodeThread() to the network thread when done.
+ // Stops scheduling frame captures on the capture thread.
void StopOnCaptureThread();
// Schedules the next call to CaptureNextFrame.
@@ -153,13 +154,11 @@ class VideoScheduler : public base::RefCountedThreadSafe<VideoScheduler>,
// Encoder thread -----------------------------------------------------------
// Encode a frame, passing generated VideoPackets to SendVideoPacket().
- void EncodeFrame(scoped_refptr<media::ScreenCaptureData> capture_data);
-
- void EncodedDataAvailableCallback(scoped_ptr<VideoPacket> packet);
+ void EncodeFrame(scoped_ptr<webrtc::DesktopFrame> frame,
+ int sequence_number);
- // Used to synchronize capture and encode thread teardown, notifying the
- // network thread when done.
- void StopOnEncodeThread(scoped_ptr<media::ScreenCapturer> capturer);
+ void EncodedDataAvailableCallback(int sequence_number,
+ scoped_ptr<VideoPacket> packet);
// Task runners used by this class.
scoped_refptr<base::SingleThreadTaskRunner> capture_task_runner_;

Powered by Google App Engine
This is Rietveld 408576698