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

Unified Diff: remoting/host/ipc_video_frame_capturer.cc

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
« no previous file with comments | « remoting/host/ipc_video_frame_capturer.h ('k') | remoting/host/resizing_host_observer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/ipc_video_frame_capturer.cc
diff --git a/remoting/host/ipc_video_frame_capturer.cc b/remoting/host/ipc_video_frame_capturer.cc
index ccf72fbef2922f53220c4469c67c34ce631c8fbe..695bf3c25b12305d2dd5672453fce9b9d3161c79 100644
--- a/remoting/host/ipc_video_frame_capturer.cc
+++ b/remoting/host/ipc_video_frame_capturer.cc
@@ -5,40 +5,54 @@
#include "remoting/host/ipc_video_frame_capturer.h"
#include "media/video/capture/screen/mouse_cursor_shape.h"
-#include "media/video/capture/screen/screen_capture_data.h"
#include "remoting/host/desktop_session_proxy.h"
+#include "third_party/webrtc/modules/desktop_capture/desktop_frame.h"
namespace remoting {
IpcVideoFrameCapturer::IpcVideoFrameCapturer(
scoped_refptr<DesktopSessionProxy> desktop_session_proxy)
- : delegate_(NULL),
+ : callback_(NULL),
+ mouse_shape_observer_(NULL),
desktop_session_proxy_(desktop_session_proxy),
+ capture_pending_(false),
weak_factory_(this) {
}
IpcVideoFrameCapturer::~IpcVideoFrameCapturer() {
}
-void IpcVideoFrameCapturer::Start(Delegate* delegate) {
- delegate_ = delegate;
+void IpcVideoFrameCapturer::Start(Callback* callback) {
+ DCHECK(!callback_);
+ DCHECK(callback);
+ callback_ = callback;
desktop_session_proxy_->SetVideoCapturer(weak_factory_.GetWeakPtr());
}
-void IpcVideoFrameCapturer::CaptureFrame() {
+void IpcVideoFrameCapturer::SetMouseShapeObserver(
+ MouseShapeObserver* mouse_shape_observer) {
+ DCHECK(!mouse_shape_observer_);
+ DCHECK(mouse_shape_observer);
+ mouse_shape_observer_ = mouse_shape_observer;
+}
+
+void IpcVideoFrameCapturer::Capture(const webrtc::DesktopRegion& region) {
+ DCHECK(!capture_pending_);
+ capture_pending_ = true;
desktop_session_proxy_->CaptureFrame();
}
void IpcVideoFrameCapturer::OnCaptureCompleted(
- scoped_refptr<media::ScreenCaptureData> capture_data) {
- if (delegate_)
- delegate_->OnCaptureCompleted(capture_data);
+ scoped_ptr<webrtc::DesktopFrame> frame) {
+ DCHECK(capture_pending_);
+ capture_pending_ = false;
+ callback_->OnCaptureCompleted(frame.release());
}
void IpcVideoFrameCapturer::OnCursorShapeChanged(
scoped_ptr<media::MouseCursorShape> cursor_shape) {
- if (delegate_)
- delegate_->OnCursorShapeChanged(cursor_shape.Pass());
+ if (mouse_shape_observer_)
+ mouse_shape_observer_->OnCursorShapeChanged(cursor_shape.Pass());
}
} // namespace remoting
« no previous file with comments | « remoting/host/ipc_video_frame_capturer.h ('k') | remoting/host/resizing_host_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698