summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--remoting/host/basic_desktop_environment.cc4
-rw-r--r--remoting/host/basic_desktop_environment.h4
-rw-r--r--remoting/host/chromoting_host.h2
-rw-r--r--remoting/host/chromoting_host_unittest.cc10
-rw-r--r--remoting/host/client_session.cc8
-rw-r--r--remoting/host/client_session_unittest.cc16
-rw-r--r--remoting/host/desktop_environment.h4
-rw-r--r--remoting/host/desktop_process_unittest.cc12
-rw-r--r--remoting/host/desktop_session_agent.cc4
-rw-r--r--remoting/host/desktop_session_agent.h4
-rw-r--r--remoting/host/desktop_session_proxy.cc4
-rw-r--r--remoting/host/desktop_session_proxy.h5
-rw-r--r--remoting/host/fake_desktop_capturer.cc (renamed from remoting/host/fake_screen_capturer.cc)44
-rw-r--r--remoting/host/fake_desktop_capturer.h50
-rw-r--r--remoting/host/fake_desktop_environment.cc8
-rw-r--r--remoting/host/fake_desktop_environment.h18
-rw-r--r--remoting/host/fake_host_extension.cc10
-rw-r--r--remoting/host/fake_screen_capturer.h57
-rw-r--r--remoting/host/host_extension_session.cc6
-rw-r--r--remoting/host/host_extension_session.h7
-rw-r--r--remoting/host/host_extension_session_manager.cc6
-rw-r--r--remoting/host/host_extension_session_manager.h6
-rw-r--r--remoting/host/host_extension_session_manager_unittest.cc8
-rw-r--r--remoting/host/host_mock_objects.cc6
-rw-r--r--remoting/host/host_mock_objects.h4
-rw-r--r--remoting/host/ipc_desktop_environment.cc2
-rw-r--r--remoting/host/ipc_desktop_environment.h2
-rw-r--r--remoting/host/ipc_desktop_environment_unittest.cc32
-rw-r--r--remoting/host/ipc_video_frame_capturer.cc24
-rw-r--r--remoting/host/ipc_video_frame_capturer.h27
-rw-r--r--remoting/host/shaped_desktop_capturer.cc42
-rw-r--r--remoting/host/shaped_desktop_capturer.h41
-rw-r--r--remoting/host/shaped_desktop_capturer_unittest.cc (renamed from remoting/host/shaped_screen_capturer_unittest.cc)14
-rw-r--r--remoting/host/shaped_screen_capturer.cc67
-rw-r--r--remoting/host/shaped_screen_capturer.h48
-rw-r--r--remoting/host/video_scheduler.cc4
-rw-r--r--remoting/host/video_scheduler.h10
-rw-r--r--remoting/host/video_scheduler_unittest.cc32
-rw-r--r--remoting/remoting_host.gypi4
-rw-r--r--remoting/remoting_test.gypi10
-rw-r--r--remoting/test/protocol_perftest.cc2
41 files changed, 287 insertions, 381 deletions
diff --git a/remoting/host/basic_desktop_environment.cc b/remoting/host/basic_desktop_environment.cc
index a28b118..f821d59 100644
--- a/remoting/host/basic_desktop_environment.cc
+++ b/remoting/host/basic_desktop_environment.cc
@@ -60,13 +60,13 @@ scoped_ptr<GnubbyAuthHandler> BasicDesktopEnvironment::CreateGnubbyAuthHandler(
return scoped_ptr<GnubbyAuthHandler>();
}
-scoped_ptr<webrtc::ScreenCapturer>
+scoped_ptr<webrtc::DesktopCapturer>
BasicDesktopEnvironment::CreateVideoCapturer() {
DCHECK(caller_task_runner_->BelongsToCurrentThread());
// The basic desktop environment does not use X DAMAGE, since it is
// broken on many systems - see http://crbug.com/73423.
- return scoped_ptr<webrtc::ScreenCapturer>(
+ return scoped_ptr<webrtc::DesktopCapturer>(
webrtc::ScreenCapturer::Create(*desktop_capture_options_));
}
diff --git a/remoting/host/basic_desktop_environment.h b/remoting/host/basic_desktop_environment.h
index 9d97dbc..543ad90 100644
--- a/remoting/host/basic_desktop_environment.h
+++ b/remoting/host/basic_desktop_environment.h
@@ -33,7 +33,7 @@ class BasicDesktopEnvironment : public DesktopEnvironment {
virtual scoped_ptr<AudioCapturer> CreateAudioCapturer() OVERRIDE;
virtual scoped_ptr<InputInjector> CreateInputInjector() OVERRIDE;
virtual scoped_ptr<ScreenControls> CreateScreenControls() OVERRIDE;
- virtual scoped_ptr<webrtc::ScreenCapturer> CreateVideoCapturer() OVERRIDE;
+ virtual scoped_ptr<webrtc::DesktopCapturer> CreateVideoCapturer() OVERRIDE;
virtual scoped_ptr<webrtc::MouseCursorMonitor> CreateMouseCursorMonitor()
OVERRIDE;
virtual std::string GetCapabilities() const OVERRIDE;
@@ -76,7 +76,7 @@ class BasicDesktopEnvironment : public DesktopEnvironment {
// Used to run UI code.
scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_;
- // Options shared between |ScreenCapturer| and |MouseCursorMonitor|. It
+ // Options shared between |DesktopCapturer| and |MouseCursorMonitor|. It
// might contain expensive resources, thus justifying the sharing.
// Also: it's dynamically allocated to avoid having to bring in
// desktop_capture_options.h which brings in X11 headers which causes hard to
diff --git a/remoting/host/chromoting_host.h b/remoting/host/chromoting_host.h
index ab35224..814a1a3 100644
--- a/remoting/host/chromoting_host.h
+++ b/remoting/host/chromoting_host.h
@@ -49,7 +49,7 @@ class DesktopEnvironmentFactory;
//
// 2. We listen for incoming connection using libjingle. We will create
// a ConnectionToClient object that wraps around linjingle for transport.
-// A VideoScheduler is created with an Encoder and a webrtc::ScreenCapturer.
+// A VideoScheduler is created with an Encoder and a webrtc::DesktopCapturer.
// A ConnectionToClient is added to the ScreenRecorder for transporting
// the screen captures. An InputStub is created and registered with the
// ConnectionToClient to receive mouse / keyboard events from the remote
diff --git a/remoting/host/chromoting_host_unittest.cc b/remoting/host/chromoting_host_unittest.cc
index 6799195..2177dca 100644
--- a/remoting/host/chromoting_host_unittest.cc
+++ b/remoting/host/chromoting_host_unittest.cc
@@ -11,8 +11,8 @@
#include "remoting/host/chromoting_host.h"
#include "remoting/host/chromoting_host_context.h"
#include "remoting/host/desktop_environment.h"
+#include "remoting/host/fake_desktop_capturer.h"
#include "remoting/host/fake_mouse_cursor_monitor.h"
-#include "remoting/host/fake_screen_capturer.h"
#include "remoting/host/host_mock_objects.h"
#include "remoting/proto/video.pb.h"
#include "remoting/protocol/errors.h"
@@ -236,7 +236,7 @@ class ChromotingHostTest : public testing::Test {
host_->OnSessionRouteChange(get_client(0), channel_name, route);
}
- // Creates a DesktopEnvironment with a fake webrtc::ScreenCapturer, to mock
+ // Creates a DesktopEnvironment with a fake webrtc::DesktopCapturer, to mock
// DesktopEnvironmentFactory::Create().
DesktopEnvironment* CreateDesktopEnvironment() {
MockDesktopEnvironment* desktop_environment = new MockDesktopEnvironment();
@@ -269,10 +269,10 @@ class ChromotingHostTest : public testing::Test {
return input_injector;
}
- // Creates a fake webrtc::ScreenCapturer, to mock
+ // Creates a fake webrtc::DesktopCapturer, to mock
// DesktopEnvironment::CreateVideoCapturer().
- webrtc::ScreenCapturer* CreateVideoCapturer() {
- return new FakeScreenCapturer();
+ webrtc::DesktopCapturer* CreateVideoCapturer() {
+ return new FakeDesktopCapturer();
}
// Creates a MockMouseCursorMonitor, to mock
diff --git a/remoting/host/client_session.cc b/remoting/host/client_session.cc
index 59c124f..31c3bf1 100644
--- a/remoting/host/client_session.cc
+++ b/remoting/host/client_session.cc
@@ -28,7 +28,7 @@
#include "remoting/protocol/client_stub.h"
#include "remoting/protocol/clipboard_thread_proxy.h"
#include "remoting/protocol/pairing_registry.h"
-#include "third_party/webrtc/modules/desktop_capture/screen_capturer.h"
+#include "third_party/webrtc/modules/desktop_capture/desktop_capturer.h"
// Default DPI to assume for old clients that use notifyClientDimensions.
const int kDefaultDPI = 96;
@@ -453,9 +453,9 @@ void ClientSession::ResetVideoPipeline() {
video_scheduler_ = NULL;
}
- // Create VideoEncoder and ScreenCapturer to match the session's video channel
- // configuration.
- scoped_ptr<webrtc::ScreenCapturer> video_capturer =
+ // Create VideoEncoder and DesktopCapturer to match the session's video
+ // channel configuration.
+ scoped_ptr<webrtc::DesktopCapturer> video_capturer =
extension_manager_->OnCreateVideoCapturer(
desktop_environment_->CreateVideoCapturer());
scoped_ptr<VideoEncoder> video_encoder =
diff --git a/remoting/host/client_session_unittest.cc b/remoting/host/client_session_unittest.cc
index 112afbf..b3dfa45 100644
--- a/remoting/host/client_session_unittest.cc
+++ b/remoting/host/client_session_unittest.cc
@@ -15,9 +15,9 @@
#include "remoting/host/audio_capturer.h"
#include "remoting/host/client_session.h"
#include "remoting/host/desktop_environment.h"
+#include "remoting/host/fake_desktop_capturer.h"
#include "remoting/host/fake_host_extension.h"
#include "remoting/host/fake_mouse_cursor_monitor.h"
-#include "remoting/host/fake_screen_capturer.h"
#include "remoting/host/host_extension.h"
#include "remoting/host/host_extension_session.h"
#include "remoting/host/host_mock_objects.h"
@@ -135,7 +135,7 @@ class ClientSessionTest : public testing::Test {
void StopClientSession();
protected:
- // Creates a DesktopEnvironment with a fake webrtc::ScreenCapturer, to mock
+ // Creates a DesktopEnvironment with a fake webrtc::DesktopCapturer, to mock
// DesktopEnvironmentFactory::Create().
DesktopEnvironment* CreateDesktopEnvironment();
@@ -143,9 +143,9 @@ class ClientSessionTest : public testing::Test {
// DesktopEnvironment::CreateInputInjector().
InputInjector* CreateInputInjector();
- // Creates a fake webrtc::ScreenCapturer, to mock
+ // Creates a fake webrtc::DesktopCapturer, to mock
// DesktopEnvironment::CreateVideoCapturer().
- webrtc::ScreenCapturer* CreateVideoCapturer();
+ webrtc::DesktopCapturer* CreateVideoCapturer();
// Creates a MockMouseCursorMonitor, to mock
// DesktopEnvironment::CreateMouseCursorMonitor
@@ -301,8 +301,8 @@ InputInjector* ClientSessionTest::CreateInputInjector() {
return input_injector_.release();
}
-webrtc::ScreenCapturer* ClientSessionTest::CreateVideoCapturer() {
- return new FakeScreenCapturer();
+webrtc::DesktopCapturer* ClientSessionTest::CreateVideoCapturer() {
+ return new FakeDesktopCapturer();
}
webrtc::MouseCursorMonitor* ClientSessionTest::CreateMouseCursorMonitor() {
@@ -596,9 +596,9 @@ TEST_F(ClientSessionTest, ClampMouseEvents) {
Expectation connected = authenticated;
int input_x[3] = { -999, 100, 999 };
- int expected_x[3] = { 0, 100, FakeScreenCapturer::kWidth - 1 };
+ int expected_x[3] = { 0, 100, FakeDesktopCapturer::kWidth - 1 };
int input_y[3] = { -999, 50, 999 };
- int expected_y[3] = { 0, 50, FakeScreenCapturer::kHeight - 1 };
+ int expected_y[3] = { 0, 50, FakeDesktopCapturer::kHeight - 1 };
protocol::MouseEvent expected_event;
for (int j = 0; j < 3; j++) {
diff --git a/remoting/host/desktop_environment.h b/remoting/host/desktop_environment.h
index 50a163a..dbeebb8 100644
--- a/remoting/host/desktop_environment.h
+++ b/remoting/host/desktop_environment.h
@@ -18,7 +18,7 @@ class SingleThreadTaskRunner;
} // namespace base
namespace webrtc {
-class ScreenCapturer;
+class DesktopCapturer;
class MouseCursorMonitor;
} // namespace webrtc
@@ -45,7 +45,7 @@ class DesktopEnvironment {
virtual scoped_ptr<AudioCapturer> CreateAudioCapturer() = 0;
virtual scoped_ptr<InputInjector> CreateInputInjector() = 0;
virtual scoped_ptr<ScreenControls> CreateScreenControls() = 0;
- virtual scoped_ptr<webrtc::ScreenCapturer> CreateVideoCapturer() = 0;
+ virtual scoped_ptr<webrtc::DesktopCapturer> CreateVideoCapturer() = 0;
virtual scoped_ptr<webrtc::MouseCursorMonitor> CreateMouseCursorMonitor() = 0;
// Returns the set of all capabilities supported by |this|.
diff --git a/remoting/host/desktop_process_unittest.cc b/remoting/host/desktop_process_unittest.cc
index 55e547d..7a188a8 100644
--- a/remoting/host/desktop_process_unittest.cc
+++ b/remoting/host/desktop_process_unittest.cc
@@ -19,7 +19,7 @@
#include "remoting/base/auto_thread_task_runner.h"
#include "remoting/host/chromoting_messages.h"
#include "remoting/host/desktop_process.h"
-#include "remoting/host/fake_screen_capturer.h"
+#include "remoting/host/fake_desktop_capturer.h"
#include "remoting/host/host_exit_codes.h"
#include "remoting/host/host_mock_objects.h"
#include "remoting/host/screen_resolution.h"
@@ -105,7 +105,7 @@ class DesktopProcessTest : public testing::Test {
void ConnectNetworkChannel(IPC::PlatformFileForTransit desktop_process);
void OnDesktopAttached(IPC::PlatformFileForTransit desktop_process);
- // Creates a DesktopEnvironment with a fake webrtc::ScreenCapturer, to mock
+ // Creates a DesktopEnvironment with a fake webrtc::DesktopCapturer, to mock
// DesktopEnvironmentFactory::Create().
DesktopEnvironment* CreateDesktopEnvironment();
@@ -113,9 +113,9 @@ class DesktopProcessTest : public testing::Test {
// DesktopEnvironment::CreateInputInjector().
InputInjector* CreateInputInjector();
- // Creates a fake webrtc::ScreenCapturer, to mock
+ // Creates a fake webrtc::DesktopCapturer, to mock
// DesktopEnvironment::CreateVideoCapturer().
- webrtc::ScreenCapturer* CreateVideoCapturer();
+ webrtc::DesktopCapturer* CreateVideoCapturer();
// Disconnects the daemon-to-desktop channel causing the desktop process to
// exit.
@@ -218,8 +218,8 @@ InputInjector* DesktopProcessTest::CreateInputInjector() {
return input_injector;
}
-webrtc::ScreenCapturer* DesktopProcessTest::CreateVideoCapturer() {
- return new FakeScreenCapturer();
+webrtc::DesktopCapturer* DesktopProcessTest::CreateVideoCapturer() {
+ return new FakeDesktopCapturer();
}
void DesktopProcessTest::DisconnectChannels() {
diff --git a/remoting/host/desktop_session_agent.cc b/remoting/host/desktop_session_agent.cc
index b36388f..1f75d94 100644
--- a/remoting/host/desktop_session_agent.cc
+++ b/remoting/host/desktop_session_agent.cc
@@ -441,11 +441,11 @@ void DesktopSessionAgent::OnCaptureFrame() {
mouse_cursor_monitor_->Capture();
- // webrtc::ScreenCapturer supports a very few (currently 2) outstanding
+ // webrtc::DesktopCapturer supports a very few (currently 2) outstanding
// capture requests. The requests are serialized on
// |video_capture_task_runner()| task runner. If the client issues more
// requests, pixel data in captured frames will likely be corrupted but
- // stability of webrtc::ScreenCapturer will not be affected.
+ // stability of webrtc::DesktopCapturer will not be affected.
video_capturer_->Capture(webrtc::DesktopRegion());
}
diff --git a/remoting/host/desktop_session_agent.h b/remoting/host/desktop_session_agent.h
index b9bd8a4..b971b6f 100644
--- a/remoting/host/desktop_session_agent.h
+++ b/remoting/host/desktop_session_agent.h
@@ -17,9 +17,9 @@
#include "ipc/ipc_platform_file.h"
#include "remoting/host/client_session_control.h"
#include "remoting/protocol/clipboard_stub.h"
+#include "third_party/webrtc/modules/desktop_capture/desktop_capturer.h"
#include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h"
#include "third_party/webrtc/modules/desktop_capture/mouse_cursor_monitor.h"
-#include "third_party/webrtc/modules/desktop_capture/screen_capturer.h"
namespace IPC {
class ChannelProxy;
@@ -219,7 +219,7 @@ class DesktopSessionAgent
bool started_;
// Captures the screen.
- scoped_ptr<webrtc::ScreenCapturer> video_capturer_;
+ scoped_ptr<webrtc::DesktopCapturer> video_capturer_;
// Captures mouse shapes.
scoped_ptr<webrtc::MouseCursorMonitor> mouse_cursor_monitor_;
diff --git a/remoting/host/desktop_session_proxy.cc b/remoting/host/desktop_session_proxy.cc
index 5094a77..4cda02a 100644
--- a/remoting/host/desktop_session_proxy.cc
+++ b/remoting/host/desktop_session_proxy.cc
@@ -139,10 +139,10 @@ scoped_ptr<ScreenControls> DesktopSessionProxy::CreateScreenControls() {
return scoped_ptr<ScreenControls>(new IpcScreenControls(this));
}
-scoped_ptr<webrtc::ScreenCapturer> DesktopSessionProxy::CreateVideoCapturer() {
+scoped_ptr<webrtc::DesktopCapturer> DesktopSessionProxy::CreateVideoCapturer() {
DCHECK(caller_task_runner_->BelongsToCurrentThread());
- return scoped_ptr<webrtc::ScreenCapturer>(new IpcVideoFrameCapturer(this));
+ return scoped_ptr<webrtc::DesktopCapturer>(new IpcVideoFrameCapturer(this));
}
scoped_ptr<webrtc::MouseCursorMonitor>
diff --git a/remoting/host/desktop_session_proxy.h b/remoting/host/desktop_session_proxy.h
index e143228..941b4e5 100644
--- a/remoting/host/desktop_session_proxy.h
+++ b/remoting/host/desktop_session_proxy.h
@@ -36,7 +36,6 @@ class MouseCursor;
} // namespace webrtc
struct SerializedDesktopFrame;
-struct SerializedMouseCursor;
namespace remoting {
@@ -82,7 +81,7 @@ class DesktopSessionProxy
scoped_ptr<AudioCapturer> CreateAudioCapturer();
scoped_ptr<InputInjector> CreateInputInjector();
scoped_ptr<ScreenControls> CreateScreenControls();
- scoped_ptr<webrtc::ScreenCapturer> CreateVideoCapturer();
+ scoped_ptr<webrtc::DesktopCapturer> CreateVideoCapturer();
scoped_ptr<webrtc::MouseCursorMonitor> CreateMouseCursorMonitor();
std::string GetCapabilities() const;
void SetCapabilities(const std::string& capabilities);
@@ -107,7 +106,7 @@ class DesktopSessionProxy
// on the |audio_capture_task_runner_| thread.
void SetAudioCapturer(const base::WeakPtr<IpcAudioCapturer>& audio_capturer);
- // APIs used to implement the webrtc::ScreenCapturer interface. These must be
+ // APIs used to implement the webrtc::DesktopCapturer interface. These must be
// called on the |video_capture_task_runner_| thread.
void CaptureFrame();
diff --git a/remoting/host/fake_screen_capturer.cc b/remoting/host/fake_desktop_capturer.cc
index 355b796..a90935f 100644
--- a/remoting/host/fake_screen_capturer.cc
+++ b/remoting/host/fake_desktop_capturer.cc
@@ -1,8 +1,8 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
+// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "remoting/host/fake_screen_capturer.h"
+#include "remoting/host/fake_desktop_capturer.h"
#include "base/bind.h"
#include "base/logging.h"
@@ -12,11 +12,11 @@
namespace remoting {
-// FakeScreenCapturer generates a white picture of size kWidth x kHeight
+// FakeDesktopCapturer generates a white picture of size kWidth x kHeight
// with a rectangle of size kBoxWidth x kBoxHeight. The rectangle moves kSpeed
// pixels per frame along both axes, and bounces off the sides of the screen.
-static const int kWidth = FakeScreenCapturer::kWidth;
-static const int kHeight = FakeScreenCapturer::kHeight;
+static const int kWidth = FakeDesktopCapturer::kWidth;
+static const int kHeight = FakeDesktopCapturer::kHeight;
static const int kBoxWidth = 140;
static const int kBoxHeight = 140;
static const int kSpeed = 20;
@@ -40,7 +40,7 @@ class DefaultFrameGenerator
first_frame_(true) {}
scoped_ptr<webrtc::DesktopFrame> GenerateFrame(
- webrtc::ScreenCapturer::Callback* callback);
+ webrtc::DesktopCapturer::Callback* callback);
private:
friend class base::RefCountedThreadSafe<DefaultFrameGenerator>;
@@ -58,7 +58,7 @@ class DefaultFrameGenerator
};
scoped_ptr<webrtc::DesktopFrame> DefaultFrameGenerator::GenerateFrame(
- webrtc::ScreenCapturer::Callback* callback) {
+ webrtc::DesktopCapturer::Callback* callback) {
const int kBytesPerPixel = webrtc::DesktopFrame::kBytesPerPixel;
int buffer_size = kWidth * kHeight * kBytesPerPixel;
webrtc::SharedMemory* shared_memory =
@@ -120,28 +120,27 @@ scoped_ptr<webrtc::DesktopFrame> DefaultFrameGenerator::GenerateFrame(
} // namespace
-FakeScreenCapturer::FakeScreenCapturer()
- : callback_(NULL),
- mouse_shape_observer_(NULL) {
+FakeDesktopCapturer::FakeDesktopCapturer()
+ : callback_(NULL) {
frame_generator_ = base::Bind(&DefaultFrameGenerator::GenerateFrame,
new DefaultFrameGenerator());
}
-FakeScreenCapturer::~FakeScreenCapturer() {}
+FakeDesktopCapturer::~FakeDesktopCapturer() {}
-void FakeScreenCapturer::set_frame_generator(
+void FakeDesktopCapturer::set_frame_generator(
const FrameGenerator& frame_generator) {
DCHECK(!callback_);
frame_generator_ = frame_generator;
}
-void FakeScreenCapturer::Start(Callback* callback) {
+void FakeDesktopCapturer::Start(Callback* callback) {
DCHECK(!callback_);
DCHECK(callback);
callback_ = callback;
}
-void FakeScreenCapturer::Capture(const webrtc::DesktopRegion& region) {
+void FakeDesktopCapturer::Capture(const webrtc::DesktopRegion& region) {
base::Time capture_start_time = base::Time::Now();
scoped_ptr<webrtc::DesktopFrame> frame = frame_generator_.Run(callback_);
frame->set_capture_time_ms(
@@ -149,21 +148,4 @@ void FakeScreenCapturer::Capture(const webrtc::DesktopRegion& region) {
callback_->OnCaptureCompleted(frame.release());
}
-void FakeScreenCapturer::SetMouseShapeObserver(
- MouseShapeObserver* mouse_shape_observer) {
- DCHECK(!mouse_shape_observer_);
- DCHECK(mouse_shape_observer);
- mouse_shape_observer_ = mouse_shape_observer;
-}
-
-bool FakeScreenCapturer::GetScreenList(ScreenList* screens) {
- NOTIMPLEMENTED();
- return false;
-}
-
-bool FakeScreenCapturer::SelectScreen(webrtc::ScreenId id) {
- NOTIMPLEMENTED();
- return false;
-}
-
} // namespace remoting
diff --git a/remoting/host/fake_desktop_capturer.h b/remoting/host/fake_desktop_capturer.h
new file mode 100644
index 0000000..b7dbc74
--- /dev/null
+++ b/remoting/host/fake_desktop_capturer.h
@@ -0,0 +1,50 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef REMOTING_HOST_FAKE_DESKTOP_CAPTURER_H_
+#define REMOTING_HOST_FAKE_DESKTOP_CAPTURER_H_
+
+#include "base/callback.h"
+#include "base/memory/scoped_ptr.h"
+#include "media/base/media_export.h"
+#include "third_party/webrtc/modules/desktop_capture/desktop_capturer.h"
+#include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h"
+#include "third_party/webrtc/modules/desktop_capture/screen_capture_frame_queue.h"
+
+namespace remoting {
+
+// A FakeDesktopCapturer generates artificial image for testing purpose.
+//
+// FakeDesktopCapturer is double-buffered as required by DesktopCapturer.
+class FakeDesktopCapturer : public webrtc::DesktopCapturer {
+ public:
+ // By default FakeDesktopCapturer generates frames of size kWidth x kHeight,
+ // but custom frame generator set using set_frame_generator() may generate
+ // frames of different size.
+ static const int kWidth = 800;
+ static const int kHeight = 600;
+
+ typedef base::Callback<scoped_ptr<webrtc::DesktopFrame>(
+ webrtc::DesktopCapturer::Callback* callback)> FrameGenerator;
+
+ FakeDesktopCapturer();
+ virtual ~FakeDesktopCapturer();
+
+ void set_frame_generator(const FrameGenerator& frame_generator);
+
+ // webrtc::DesktopCapturer interface.
+ virtual void Start(Callback* callback) OVERRIDE;
+ virtual void Capture(const webrtc::DesktopRegion& rect) OVERRIDE;
+
+ private:
+ FrameGenerator frame_generator_;
+
+ Callback* callback_;
+
+ DISALLOW_COPY_AND_ASSIGN(FakeDesktopCapturer);
+};
+
+} // namespace remoting
+
+#endif // REMOTING_HOST_FAKE_DESKTOP_CAPTURER_H_
diff --git a/remoting/host/fake_desktop_environment.cc b/remoting/host/fake_desktop_environment.cc
index 135844c..f399ae8 100644
--- a/remoting/host/fake_desktop_environment.cc
+++ b/remoting/host/fake_desktop_environment.cc
@@ -5,7 +5,7 @@
#include "remoting/host/fake_desktop_environment.h"
#include "remoting/host/audio_capturer.h"
-#include "remoting/host/fake_screen_capturer.h"
+#include "remoting/host/fake_desktop_capturer.h"
#include "remoting/host/gnubby_auth_handler.h"
#include "remoting/host/input_injector.h"
@@ -55,12 +55,12 @@ scoped_ptr<ScreenControls> FakeDesktopEnvironment::CreateScreenControls() {
return scoped_ptr<ScreenControls>(new FakeScreenControls());
}
-scoped_ptr<webrtc::ScreenCapturer>
+scoped_ptr<webrtc::DesktopCapturer>
FakeDesktopEnvironment::CreateVideoCapturer() {
- scoped_ptr<FakeScreenCapturer> result(new FakeScreenCapturer());
+ scoped_ptr<FakeDesktopCapturer> result(new FakeDesktopCapturer());
if (!frame_generator_.is_null())
result->set_frame_generator(frame_generator_);
- return result.PassAs<webrtc::ScreenCapturer>();
+ return result.PassAs<webrtc::DesktopCapturer>();
}
scoped_ptr<webrtc::MouseCursorMonitor>
diff --git a/remoting/host/fake_desktop_environment.h b/remoting/host/fake_desktop_environment.h
index 5f6c93a..91fd9bb 100644
--- a/remoting/host/fake_desktop_environment.h
+++ b/remoting/host/fake_desktop_environment.h
@@ -6,8 +6,8 @@
#define REMOTING_HOST_FAKE_DESKTOP_ENVIRONMENT_H_
#include "remoting/host/desktop_environment.h"
+#include "remoting/host/fake_desktop_capturer.h"
#include "remoting/host/fake_mouse_cursor_monitor.h"
-#include "remoting/host/fake_screen_capturer.h"
#include "remoting/host/input_injector.h"
#include "remoting/host/screen_controls.h"
@@ -41,9 +41,10 @@ class FakeDesktopEnvironment : public DesktopEnvironment {
FakeDesktopEnvironment();
virtual ~FakeDesktopEnvironment();
- // Sets frame generator to be used for FakeScreenCapturer created by
+ // Sets frame generator to be used for FakeDesktopCapturer created by
// FakeDesktopEnvironment.
- void set_frame_generator(FakeScreenCapturer::FrameGenerator frame_generator) {
+ void set_frame_generator(
+ FakeDesktopCapturer::FrameGenerator frame_generator) {
frame_generator_ = frame_generator;
}
@@ -51,7 +52,7 @@ class FakeDesktopEnvironment : public DesktopEnvironment {
virtual scoped_ptr<AudioCapturer> CreateAudioCapturer() OVERRIDE;
virtual scoped_ptr<InputInjector> CreateInputInjector() OVERRIDE;
virtual scoped_ptr<ScreenControls> CreateScreenControls() OVERRIDE;
- virtual scoped_ptr<webrtc::ScreenCapturer> CreateVideoCapturer() OVERRIDE;
+ virtual scoped_ptr<webrtc::DesktopCapturer> CreateVideoCapturer() OVERRIDE;
virtual scoped_ptr<webrtc::MouseCursorMonitor> CreateMouseCursorMonitor()
OVERRIDE;
virtual std::string GetCapabilities() const OVERRIDE;
@@ -60,7 +61,7 @@ class FakeDesktopEnvironment : public DesktopEnvironment {
protocol::ClientStub* client_stub) OVERRIDE;
private:
- FakeScreenCapturer::FrameGenerator frame_generator_;
+ FakeDesktopCapturer::FrameGenerator frame_generator_;
DISALLOW_COPY_AND_ASSIGN(FakeDesktopEnvironment);
};
@@ -70,9 +71,10 @@ class FakeDesktopEnvironmentFactory : public DesktopEnvironmentFactory {
FakeDesktopEnvironmentFactory();
virtual ~FakeDesktopEnvironmentFactory();
- // Sets frame generator to be used for FakeScreenCapturer created by
+ // Sets frame generator to be used for FakeDesktopCapturer created by
// FakeDesktopEnvironment.
- void set_frame_generator(FakeScreenCapturer::FrameGenerator frame_generator) {
+ void set_frame_generator(
+ FakeDesktopCapturer::FrameGenerator frame_generator) {
frame_generator_ = frame_generator;
}
@@ -84,7 +86,7 @@ class FakeDesktopEnvironmentFactory : public DesktopEnvironmentFactory {
virtual void SetEnableGnubbyAuth(bool enable) OVERRIDE;
private:
- FakeScreenCapturer::FrameGenerator frame_generator_;
+ FakeDesktopCapturer::FrameGenerator frame_generator_;
DISALLOW_COPY_AND_ASSIGN(FakeDesktopEnvironmentFactory);
};
diff --git a/remoting/host/fake_host_extension.cc b/remoting/host/fake_host_extension.cc
index ed93791..7f5c8c3 100644
--- a/remoting/host/fake_host_extension.cc
+++ b/remoting/host/fake_host_extension.cc
@@ -10,7 +10,7 @@
#include "remoting/codec/video_encoder.h"
#include "remoting/host/host_extension_session.h"
#include "remoting/proto/control.pb.h"
-#include "third_party/webrtc/modules/desktop_capture/screen_capturer.h"
+#include "third_party/webrtc/modules/desktop_capture/desktop_capturer.h"
namespace remoting {
@@ -19,8 +19,8 @@ class FakeExtension::Session : public HostExtensionSession {
Session(FakeExtension* extension, const std::string& message_type);
virtual ~Session() {}
- virtual scoped_ptr<webrtc::ScreenCapturer> OnCreateVideoCapturer(
- scoped_ptr<webrtc::ScreenCapturer> encoder) OVERRIDE;
+ virtual scoped_ptr<webrtc::DesktopCapturer> OnCreateVideoCapturer(
+ scoped_ptr<webrtc::DesktopCapturer> encoder) OVERRIDE;
virtual scoped_ptr<VideoEncoder> OnCreateVideoEncoder(
scoped_ptr<VideoEncoder> encoder) OVERRIDE;
virtual bool ModifiesVideoPipeline() const OVERRIDE;
@@ -42,9 +42,9 @@ FakeExtension::Session::Session(
message_type_(message_type) {
}
-scoped_ptr<webrtc::ScreenCapturer>
+scoped_ptr<webrtc::DesktopCapturer>
FakeExtension::Session::OnCreateVideoCapturer(
- scoped_ptr<webrtc::ScreenCapturer> capturer) {
+ scoped_ptr<webrtc::DesktopCapturer> capturer) {
extension_->has_wrapped_video_capturer_ = true;
if (extension_->steal_video_capturer_) {
capturer.reset();
diff --git a/remoting/host/fake_screen_capturer.h b/remoting/host/fake_screen_capturer.h
deleted file mode 100644
index 2fd59cc..0000000
--- a/remoting/host/fake_screen_capturer.h
+++ /dev/null
@@ -1,57 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef REMOTING_HOST_FAKE_SCREEN_CAPTURER_H_
-#define REMOTING_HOST_FAKE_SCREEN_CAPTURER_H_
-
-#include "base/callback.h"
-#include "base/memory/scoped_ptr.h"
-#include "media/base/media_export.h"
-#include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h"
-#include "third_party/webrtc/modules/desktop_capture/screen_capture_frame_queue.h"
-#include "third_party/webrtc/modules/desktop_capture/screen_capturer.h"
-
-namespace remoting {
-
-// A FakeScreenCapturer generates artificial image for testing purpose.
-//
-// FakeScreenCapturer is double-buffered as required by ScreenCapturer.
-class FakeScreenCapturer : public webrtc::ScreenCapturer {
- public:
- // By default FakeScreenCapturer generates frames of size kWidth x kHeight,
- // but custom frame generator set using set_frame_generator() may generate
- // frames of different size.
- static const int kWidth = 800;
- static const int kHeight = 600;
-
- typedef base::Callback<scoped_ptr<webrtc::DesktopFrame>(
- webrtc::ScreenCapturer::Callback* callback)> FrameGenerator;
-
- FakeScreenCapturer();
- virtual ~FakeScreenCapturer();
-
- void set_frame_generator(const FrameGenerator& frame_generator);
-
- // webrtc::DesktopCapturer interface.
- virtual void Start(Callback* callback) OVERRIDE;
- virtual void Capture(const webrtc::DesktopRegion& rect) OVERRIDE;
-
- // webrtc::ScreenCapturer interface.
- virtual void SetMouseShapeObserver(
- MouseShapeObserver* mouse_shape_observer) OVERRIDE;
- virtual bool GetScreenList(ScreenList* screens) OVERRIDE;
- virtual bool SelectScreen(webrtc::ScreenId id) OVERRIDE;
-
- private:
- FrameGenerator frame_generator_;
-
- Callback* callback_;
- MouseShapeObserver* mouse_shape_observer_;
-
- DISALLOW_COPY_AND_ASSIGN(FakeScreenCapturer);
-};
-
-} // namespace remoting
-
-#endif // REMOTING_HOST_FAKE_SCREEN_CAPTURER_H_
diff --git a/remoting/host/host_extension_session.cc b/remoting/host/host_extension_session.cc
index 949b3b2..5f54865 100644
--- a/remoting/host/host_extension_session.cc
+++ b/remoting/host/host_extension_session.cc
@@ -5,12 +5,12 @@
#include "remoting/host/host_extension_session.h"
#include "remoting/codec/video_encoder.h"
-#include "third_party/webrtc/modules/desktop_capture/screen_capturer.h"
+#include "third_party/webrtc/modules/desktop_capture/desktop_capturer.h"
namespace remoting {
-scoped_ptr<webrtc::ScreenCapturer> HostExtensionSession::OnCreateVideoCapturer(
- scoped_ptr<webrtc::ScreenCapturer> capturer) {
+scoped_ptr<webrtc::DesktopCapturer> HostExtensionSession::OnCreateVideoCapturer(
+ scoped_ptr<webrtc::DesktopCapturer> capturer) {
return capturer.Pass();
}
diff --git a/remoting/host/host_extension_session.h b/remoting/host/host_extension_session.h
index 1e71180..a4a0bd7 100644
--- a/remoting/host/host_extension_session.h
+++ b/remoting/host/host_extension_session.h
@@ -8,7 +8,7 @@
#include "base/memory/scoped_ptr.h"
namespace webrtc {
-class ScreenCapturer;
+class DesktopCapturer;
}
namespace remoting {
@@ -30,8 +30,8 @@ class HostExtensionSession {
// Optional hook functions for HostExtensions which need to wrap or replace
// parts of the video, audio, input, etc pipelines.
// These are called in response to ResetVideoPipeline().
- virtual scoped_ptr<webrtc::ScreenCapturer> OnCreateVideoCapturer(
- scoped_ptr<webrtc::ScreenCapturer> capturer);
+ virtual scoped_ptr<webrtc::DesktopCapturer> OnCreateVideoCapturer(
+ scoped_ptr<webrtc::DesktopCapturer> capturer);
virtual scoped_ptr<VideoEncoder> OnCreateVideoEncoder(
scoped_ptr<VideoEncoder> encoder);
virtual bool ModifiesVideoPipeline() const;
@@ -48,4 +48,3 @@ class HostExtensionSession {
} // namespace remoting
#endif // REMOTING_HOST_HOST_EXTENSION_SESSION_H_
-
diff --git a/remoting/host/host_extension_session_manager.cc b/remoting/host/host_extension_session_manager.cc
index a3446d1..31ed590 100644
--- a/remoting/host/host_extension_session_manager.cc
+++ b/remoting/host/host_extension_session_manager.cc
@@ -9,7 +9,7 @@
#include "remoting/host/client_session_control.h"
#include "remoting/host/host_extension.h"
#include "remoting/host/host_extension_session.h"
-#include "third_party/webrtc/modules/desktop_capture/screen_capturer.h"
+#include "third_party/webrtc/modules/desktop_capture/desktop_capturer.h"
namespace remoting {
HostExtensionSessionManager::HostExtensionSessionManager(
@@ -39,9 +39,9 @@ std::string HostExtensionSessionManager::GetCapabilities() {
return capabilities;
}
-scoped_ptr<webrtc::ScreenCapturer>
+scoped_ptr<webrtc::DesktopCapturer>
HostExtensionSessionManager::OnCreateVideoCapturer(
- scoped_ptr<webrtc::ScreenCapturer> capturer) {
+ scoped_ptr<webrtc::DesktopCapturer> capturer) {
for(HostExtensionSessionList::const_iterator it = extension_sessions_.begin();
it != extension_sessions_.end(); ++it) {
if ((*it)->ModifiesVideoPipeline()) {
diff --git a/remoting/host/host_extension_session_manager.h b/remoting/host/host_extension_session_manager.h
index 0c953e9..b84d520 100644
--- a/remoting/host/host_extension_session_manager.h
+++ b/remoting/host/host_extension_session_manager.h
@@ -12,7 +12,7 @@
#include "base/memory/scoped_vector.h"
namespace webrtc {
-class ScreenCapturer;
+class DesktopCapturer;
}
namespace remoting {
@@ -42,8 +42,8 @@ class HostExtensionSessionManager {
// Calls the corresponding hook functions in each extension in turn, to give
// them an opportunity to wrap or replace video components.
- scoped_ptr<webrtc::ScreenCapturer> OnCreateVideoCapturer(
- scoped_ptr<webrtc::ScreenCapturer> capturer);
+ scoped_ptr<webrtc::DesktopCapturer> OnCreateVideoCapturer(
+ scoped_ptr<webrtc::DesktopCapturer> capturer);
scoped_ptr<VideoEncoder> OnCreateVideoEncoder(
scoped_ptr<VideoEncoder> encoder);
diff --git a/remoting/host/host_extension_session_manager_unittest.cc b/remoting/host/host_extension_session_manager_unittest.cc
index 53df16a..f2c875c 100644
--- a/remoting/host/host_extension_session_manager_unittest.cc
+++ b/remoting/host/host_extension_session_manager_unittest.cc
@@ -9,7 +9,7 @@
#include "remoting/proto/control.pb.h"
#include "remoting/protocol/protocol_mock_objects.h"
#include "testing/gtest/include/gtest/gtest.h"
-#include "third_party/webrtc/modules/desktop_capture/screen_capturer.h"
+#include "third_party/webrtc/modules/desktop_capture/desktop_capturer.h"
namespace remoting {
@@ -107,7 +107,8 @@ TEST_F(HostExtensionSessionManagerTest, CanWrapVideoCapturer) {
extension3_.set_steal_video_capturer(true);
extension_manager.OnNegotiatedCapabilities(&client_stub_, "cap1");
- extension_manager.OnCreateVideoCapturer(scoped_ptr<webrtc::ScreenCapturer>());
+ extension_manager.OnCreateVideoCapturer(
+ scoped_ptr<webrtc::DesktopCapturer>());
EXPECT_FALSE(extension1_.has_wrapped_video_encoder());
EXPECT_TRUE(extension1_.has_wrapped_video_capturer());
@@ -147,7 +148,8 @@ TEST_F(HostExtensionSessionManagerTest, RespectModifiesVideoPipeline) {
extension2_.set_steal_video_capturer(true);
extension_manager.OnNegotiatedCapabilities(&client_stub_, "cap1");
- extension_manager.OnCreateVideoCapturer(scoped_ptr<webrtc::ScreenCapturer>());
+ extension_manager.OnCreateVideoCapturer(
+ scoped_ptr<webrtc::DesktopCapturer>());
extension_manager.OnCreateVideoEncoder(scoped_ptr<VideoEncoder>());
EXPECT_FALSE(extension1_.has_wrapped_video_encoder());
diff --git a/remoting/host/host_mock_objects.cc b/remoting/host/host_mock_objects.cc
index aad673d..775314c 100644
--- a/remoting/host/host_mock_objects.cc
+++ b/remoting/host/host_mock_objects.cc
@@ -14,7 +14,7 @@
#include "remoting/host/input_injector.h"
#include "remoting/proto/event.pb.h"
#include "remoting/protocol/transport.h"
-#include "third_party/webrtc/modules/desktop_capture/screen_capturer.h"
+#include "third_party/webrtc/modules/desktop_capture/desktop_capturer.h"
namespace remoting {
@@ -34,9 +34,9 @@ scoped_ptr<ScreenControls> MockDesktopEnvironment::CreateScreenControls() {
return scoped_ptr<ScreenControls>(CreateScreenControlsPtr());
}
-scoped_ptr<webrtc::ScreenCapturer>
+scoped_ptr<webrtc::DesktopCapturer>
MockDesktopEnvironment::CreateVideoCapturer() {
- return scoped_ptr<webrtc::ScreenCapturer>(CreateVideoCapturerPtr());
+ return scoped_ptr<webrtc::DesktopCapturer>(CreateVideoCapturerPtr());
}
scoped_ptr<GnubbyAuthHandler>
diff --git a/remoting/host/host_mock_objects.h b/remoting/host/host_mock_objects.h
index 348c591..bbddd08 100644
--- a/remoting/host/host_mock_objects.h
+++ b/remoting/host/host_mock_objects.h
@@ -35,7 +35,7 @@ class MockDesktopEnvironment : public DesktopEnvironment {
MOCK_METHOD0(CreateAudioCapturerPtr, AudioCapturer*());
MOCK_METHOD0(CreateInputInjectorPtr, InputInjector*());
MOCK_METHOD0(CreateScreenControlsPtr, ScreenControls*());
- MOCK_METHOD0(CreateVideoCapturerPtr, webrtc::ScreenCapturer*());
+ MOCK_METHOD0(CreateVideoCapturerPtr, webrtc::DesktopCapturer*());
MOCK_METHOD0(CreateMouseCursorMonitorPtr, webrtc::MouseCursorMonitor*());
MOCK_CONST_METHOD0(GetCapabilities, std::string());
MOCK_METHOD1(SetCapabilities, void(const std::string&));
@@ -46,7 +46,7 @@ class MockDesktopEnvironment : public DesktopEnvironment {
virtual scoped_ptr<AudioCapturer> CreateAudioCapturer() OVERRIDE;
virtual scoped_ptr<InputInjector> CreateInputInjector() OVERRIDE;
virtual scoped_ptr<ScreenControls> CreateScreenControls() OVERRIDE;
- virtual scoped_ptr<webrtc::ScreenCapturer> CreateVideoCapturer() OVERRIDE;
+ virtual scoped_ptr<webrtc::DesktopCapturer> CreateVideoCapturer() OVERRIDE;
virtual scoped_ptr<GnubbyAuthHandler> CreateGnubbyAuthHandler(
protocol::ClientStub* client_stub) OVERRIDE;
virtual scoped_ptr<webrtc::MouseCursorMonitor> CreateMouseCursorMonitor()
diff --git a/remoting/host/ipc_desktop_environment.cc b/remoting/host/ipc_desktop_environment.cc
index d19c342..c8d60f3 100644
--- a/remoting/host/ipc_desktop_environment.cc
+++ b/remoting/host/ipc_desktop_environment.cc
@@ -63,7 +63,7 @@ IpcDesktopEnvironment::CreateMouseCursorMonitor() {
return desktop_session_proxy_->CreateMouseCursorMonitor();
}
-scoped_ptr<webrtc::ScreenCapturer>
+scoped_ptr<webrtc::DesktopCapturer>
IpcDesktopEnvironment::CreateVideoCapturer() {
return desktop_session_proxy_->CreateVideoCapturer();
}
diff --git a/remoting/host/ipc_desktop_environment.h b/remoting/host/ipc_desktop_environment.h
index 6cdcc7e..ca3dfcd 100644
--- a/remoting/host/ipc_desktop_environment.h
+++ b/remoting/host/ipc_desktop_environment.h
@@ -52,7 +52,7 @@ class IpcDesktopEnvironment : public DesktopEnvironment {
virtual scoped_ptr<AudioCapturer> CreateAudioCapturer() OVERRIDE;
virtual scoped_ptr<InputInjector> CreateInputInjector() OVERRIDE;
virtual scoped_ptr<ScreenControls> CreateScreenControls() OVERRIDE;
- virtual scoped_ptr<webrtc::ScreenCapturer> CreateVideoCapturer() OVERRIDE;
+ virtual scoped_ptr<webrtc::DesktopCapturer> CreateVideoCapturer() OVERRIDE;
virtual scoped_ptr<webrtc::MouseCursorMonitor> CreateMouseCursorMonitor()
OVERRIDE;
virtual std::string GetCapabilities() const OVERRIDE;
diff --git a/remoting/host/ipc_desktop_environment_unittest.cc b/remoting/host/ipc_desktop_environment_unittest.cc
index 542fec6..9e13e8f 100644
--- a/remoting/host/ipc_desktop_environment_unittest.cc
+++ b/remoting/host/ipc_desktop_environment_unittest.cc
@@ -24,8 +24,8 @@
#include "remoting/host/desktop_session.h"
#include "remoting/host/desktop_session_connector.h"
#include "remoting/host/desktop_session_proxy.h"
+#include "remoting/host/fake_desktop_capturer.h"
#include "remoting/host/fake_mouse_cursor_monitor.h"
-#include "remoting/host/fake_screen_capturer.h"
#include "remoting/host/host_mock_objects.h"
#include "remoting/host/ipc_desktop_environment.h"
#include "remoting/protocol/protocol_mock_objects.h"
@@ -130,7 +130,7 @@ class IpcDesktopEnvironmentTest : public testing::Test {
bool virtual_terminal);
void DisconnectTerminal(int terminal_id);
- // Creates a DesktopEnvironment with a fake webrtc::ScreenCapturer, to mock
+ // Creates a DesktopEnvironment with a fake webrtc::DesktopCapturer, to mock
// DesktopEnvironmentFactory::Create().
DesktopEnvironment* CreateDesktopEnvironment();
@@ -138,9 +138,9 @@ class IpcDesktopEnvironmentTest : public testing::Test {
// DesktopEnvironment::CreateInputInjector().
InputInjector* CreateInputInjector();
- // Creates a fake webrtc::ScreenCapturer, to mock
+ // Creates a fake webrtc::DesktopCapturer, to mock
// DesktopEnvironment::CreateVideoCapturer().
- webrtc::ScreenCapturer* CreateVideoCapturer();
+ webrtc::DesktopCapturer* CreateVideoCapturer();
// Creates a MockMouseCursorMonitor, to mock
// DesktopEnvironment::CreateMouseCursorMonitor
@@ -202,7 +202,7 @@ class IpcDesktopEnvironmentTest : public testing::Test {
scoped_ptr<ScreenControls> screen_controls_;
// The IPC screen capturer.
- scoped_ptr<webrtc::ScreenCapturer> video_capturer_;
+ scoped_ptr<webrtc::DesktopCapturer> video_capturer_;
// Represents the desktop process running in a user session.
scoped_ptr<DesktopProcess> desktop_process_;
@@ -213,7 +213,7 @@ class IpcDesktopEnvironmentTest : public testing::Test {
// The last |terminal_id| passed to ConnectTermina();
int terminal_id_;
- webrtc::MockScreenCapturerCallback screen_capturer_callback_;
+ webrtc::MockScreenCapturerCallback desktop_capturer_callback_;
MockClientSessionControl client_session_control_;
base::WeakPtrFactory<ClientSessionControl> client_session_control_factory_;
@@ -352,8 +352,8 @@ InputInjector* IpcDesktopEnvironmentTest::CreateInputInjector() {
return remote_input_injector_;
}
-webrtc::ScreenCapturer* IpcDesktopEnvironmentTest::CreateVideoCapturer() {
- return new FakeScreenCapturer();
+webrtc::DesktopCapturer* IpcDesktopEnvironmentTest::CreateVideoCapturer() {
+ return new FakeDesktopCapturer();
}
webrtc::MouseCursorMonitor*
@@ -457,13 +457,13 @@ TEST_F(IpcDesktopEnvironmentTest, CaptureFrame) {
// Start the input injector and screen capturer.
input_injector_->Start(clipboard_stub.PassAs<protocol::ClipboardStub>());
- video_capturer_->Start(&screen_capturer_callback_);
+ video_capturer_->Start(&desktop_capturer_callback_);
// Run the message loop until the desktop is attached.
setup_run_loop_->Run();
// Stop the test when the first frame is captured.
- EXPECT_CALL(screen_capturer_callback_, OnCaptureCompleted(_))
+ EXPECT_CALL(desktop_capturer_callback_, OnCaptureCompleted(_))
.WillOnce(DoAll(
DeleteArg<0>(),
InvokeWithoutArgs(
@@ -486,7 +486,7 @@ TEST_F(IpcDesktopEnvironmentTest, Reattach) {
// Start the input injector and screen capturer.
input_injector_->Start(clipboard_stub.PassAs<protocol::ClipboardStub>());
- video_capturer_->Start(&screen_capturer_callback_);
+ video_capturer_->Start(&desktop_capturer_callback_);
// Run the message loop until the desktop is attached.
setup_run_loop_->Run();
@@ -519,7 +519,7 @@ TEST_F(IpcDesktopEnvironmentTest, InjectClipboardEvent) {
// Start the input injector and screen capturer.
input_injector_->Start(clipboard_stub.PassAs<protocol::ClipboardStub>());
- video_capturer_->Start(&screen_capturer_callback_);
+ video_capturer_->Start(&desktop_capturer_callback_);
// Run the message loop until the desktop is attached.
setup_run_loop_->Run();
@@ -550,7 +550,7 @@ TEST_F(IpcDesktopEnvironmentTest, InjectKeyEvent) {
// Start the input injector and screen capturer.
input_injector_->Start(clipboard_stub.PassAs<protocol::ClipboardStub>());
- video_capturer_->Start(&screen_capturer_callback_);
+ video_capturer_->Start(&desktop_capturer_callback_);
// Run the message loop until the desktop is attached.
setup_run_loop_->Run();
@@ -581,7 +581,7 @@ TEST_F(IpcDesktopEnvironmentTest, InjectTextEvent) {
// Start the input injector and screen capturer.
input_injector_->Start(clipboard_stub.PassAs<protocol::ClipboardStub>());
- video_capturer_->Start(&screen_capturer_callback_);
+ video_capturer_->Start(&desktop_capturer_callback_);
// Run the message loop until the desktop is attached.
setup_run_loop_->Run();
@@ -611,7 +611,7 @@ TEST_F(IpcDesktopEnvironmentTest, InjectMouseEvent) {
// Start the input injector and screen capturer.
input_injector_->Start(clipboard_stub.PassAs<protocol::ClipboardStub>());
- video_capturer_->Start(&screen_capturer_callback_);
+ video_capturer_->Start(&desktop_capturer_callback_);
// Run the message loop until the desktop is attached.
setup_run_loop_->Run();
@@ -642,7 +642,7 @@ TEST_F(IpcDesktopEnvironmentTest, SetScreenResolution) {
// Start the input injector and screen capturer.
input_injector_->Start(clipboard_stub.PassAs<protocol::ClipboardStub>());
- video_capturer_->Start(&screen_capturer_callback_);
+ video_capturer_->Start(&desktop_capturer_callback_);
// Run the message loop until the desktop is attached.
setup_run_loop_->Run();
diff --git a/remoting/host/ipc_video_frame_capturer.cc b/remoting/host/ipc_video_frame_capturer.cc
index c56c20e..7f39a3dc 100644
--- a/remoting/host/ipc_video_frame_capturer.cc
+++ b/remoting/host/ipc_video_frame_capturer.cc
@@ -13,7 +13,6 @@ namespace remoting {
IpcVideoFrameCapturer::IpcVideoFrameCapturer(
scoped_refptr<DesktopSessionProxy> desktop_session_proxy)
: callback_(NULL),
- mouse_shape_observer_(NULL),
desktop_session_proxy_(desktop_session_proxy),
capture_pending_(false),
weak_factory_(this) {
@@ -29,23 +28,6 @@ void IpcVideoFrameCapturer::Start(Callback* callback) {
desktop_session_proxy_->SetVideoCapturer(weak_factory_.GetWeakPtr());
}
-void IpcVideoFrameCapturer::SetMouseShapeObserver(
- MouseShapeObserver* mouse_shape_observer) {
- DCHECK(!mouse_shape_observer_);
- DCHECK(mouse_shape_observer);
- mouse_shape_observer_ = mouse_shape_observer;
-}
-
-bool IpcVideoFrameCapturer::GetScreenList(ScreenList* screens) {
- NOTIMPLEMENTED();
- return false;
-}
-
-bool IpcVideoFrameCapturer::SelectScreen(webrtc::ScreenId id) {
- NOTIMPLEMENTED();
- return false;
-}
-
void IpcVideoFrameCapturer::Capture(const webrtc::DesktopRegion& region) {
DCHECK(!capture_pending_);
capture_pending_ = true;
@@ -59,10 +41,4 @@ void IpcVideoFrameCapturer::OnCaptureCompleted(
callback_->OnCaptureCompleted(frame.release());
}
-void IpcVideoFrameCapturer::OnCursorShapeChanged(
- scoped_ptr<webrtc::MouseCursorShape> cursor_shape) {
- if (mouse_shape_observer_)
- mouse_shape_observer_->OnCursorShapeChanged(cursor_shape.release());
-}
-
} // namespace remoting
diff --git a/remoting/host/ipc_video_frame_capturer.h b/remoting/host/ipc_video_frame_capturer.h
index fd2cdff..396bdd5 100644
--- a/remoting/host/ipc_video_frame_capturer.h
+++ b/remoting/host/ipc_video_frame_capturer.h
@@ -8,19 +8,15 @@
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
#include "base/memory/scoped_ptr.h"
-#include "third_party/webrtc/modules/desktop_capture/screen_capturer.h"
-
-namespace media {
-struct MouseCursorShape;
-} // namespace media
+#include "third_party/webrtc/modules/desktop_capture/desktop_capturer.h"
namespace remoting {
class DesktopSessionProxy;
-// Routes webrtc::ScreenCapturer calls though the IPC channel to the desktop
+// Routes webrtc::DesktopCapturer calls though the IPC channel to the desktop
// session agent running in the desktop integration process.
-class IpcVideoFrameCapturer : public webrtc::ScreenCapturer {
+class IpcVideoFrameCapturer : public webrtc::DesktopCapturer {
public:
explicit IpcVideoFrameCapturer(
scoped_refptr<DesktopSessionProxy> desktop_session_proxy);
@@ -30,25 +26,12 @@ class IpcVideoFrameCapturer : public webrtc::ScreenCapturer {
virtual void Start(Callback* callback) OVERRIDE;
virtual void Capture(const webrtc::DesktopRegion& region) OVERRIDE;
- // webrtc::ScreenCapturer interface.
- virtual void SetMouseShapeObserver(
- MouseShapeObserver* mouse_shape_observer) OVERRIDE;
-
- virtual bool GetScreenList(ScreenList* screens) OVERRIDE;
-
- virtual bool SelectScreen(webrtc::ScreenId id) OVERRIDE;
-
// Called when a video |frame| has been captured.
void OnCaptureCompleted(scoped_ptr<webrtc::DesktopFrame> frame);
- // Called when the cursor shape has changed.
- void OnCursorShapeChanged(scoped_ptr<webrtc::MouseCursorShape> cursor_shape);
-
private:
- // Points to the callback passed to webrtc::ScreenCapturer::Start().
- webrtc::ScreenCapturer::Callback* callback_;
-
- MouseShapeObserver* mouse_shape_observer_;
+ // Points to the callback passed to webrtc::DesktopCapturer::Start().
+ webrtc::DesktopCapturer::Callback* callback_;
// Wraps the IPC channel to the desktop session agent.
scoped_refptr<DesktopSessionProxy> desktop_session_proxy_;
diff --git a/remoting/host/shaped_desktop_capturer.cc b/remoting/host/shaped_desktop_capturer.cc
new file mode 100644
index 0000000..14b3e99
--- /dev/null
+++ b/remoting/host/shaped_desktop_capturer.cc
@@ -0,0 +1,42 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "remoting/host/shaped_desktop_capturer.h"
+
+#include "base/logging.h"
+#include "remoting/host/desktop_shape_tracker.h"
+#include "third_party/webrtc/modules/desktop_capture/desktop_frame.h"
+
+namespace remoting {
+
+ShapedDesktopCapturer::ShapedDesktopCapturer(
+ scoped_ptr<webrtc::DesktopCapturer> desktop_capturer,
+ scoped_ptr<DesktopShapeTracker> shape_tracker)
+ : desktop_capturer_(desktop_capturer.Pass()),
+ shape_tracker_(shape_tracker.Pass()),
+ callback_(NULL) {
+}
+
+ShapedDesktopCapturer::~ShapedDesktopCapturer() {}
+
+void ShapedDesktopCapturer::Start(webrtc::DesktopCapturer::Callback* callback) {
+ callback_ = callback;
+ desktop_capturer_->Start(this);
+}
+
+void ShapedDesktopCapturer::Capture(const webrtc::DesktopRegion& region) {
+ desktop_capturer_->Capture(region);
+}
+
+webrtc::SharedMemory* ShapedDesktopCapturer::CreateSharedMemory(size_t size) {
+ return callback_->CreateSharedMemory(size);
+}
+
+void ShapedDesktopCapturer::OnCaptureCompleted(webrtc::DesktopFrame* frame) {
+ shape_tracker_->RefreshDesktopShape();
+ frame->set_shape(new webrtc::DesktopRegion(shape_tracker_->desktop_shape()));
+ callback_->OnCaptureCompleted(frame);
+}
+
+} // namespace remoting
diff --git a/remoting/host/shaped_desktop_capturer.h b/remoting/host/shaped_desktop_capturer.h
new file mode 100644
index 0000000..a497439
--- /dev/null
+++ b/remoting/host/shaped_desktop_capturer.h
@@ -0,0 +1,41 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef REMOTING_HOST_SHAPED_DESKTOP_CAPTURER_H_
+#define REMOTING_HOST_SHAPED_DESKTOP_CAPTURER_H_
+
+#include "base/memory/scoped_ptr.h"
+#include "third_party/webrtc/modules/desktop_capture/desktop_capturer.h"
+
+namespace remoting {
+
+class DesktopShapeTracker;
+
+// Screen capturer that also captures desktop shape.
+class ShapedDesktopCapturer : public webrtc::DesktopCapturer,
+ public webrtc::DesktopCapturer::Callback {
+ public:
+ ShapedDesktopCapturer(scoped_ptr<webrtc::DesktopCapturer> screen_capturer,
+ scoped_ptr<DesktopShapeTracker> shape_tracker);
+ virtual ~ShapedDesktopCapturer();
+
+ // webrtc::DesktopCapturer interface.
+ virtual void Start(webrtc::DesktopCapturer::Callback* callback) OVERRIDE;
+ virtual void Capture(const webrtc::DesktopRegion& region) OVERRIDE;
+
+ private:
+ // webrtc::DesktopCapturer::Callback interface.
+ virtual webrtc::SharedMemory* CreateSharedMemory(size_t size) OVERRIDE;
+ virtual void OnCaptureCompleted(webrtc::DesktopFrame* frame) OVERRIDE;
+
+ scoped_ptr<webrtc::DesktopCapturer> desktop_capturer_;
+ scoped_ptr<DesktopShapeTracker> shape_tracker_;
+ webrtc::DesktopCapturer::Callback* callback_;
+
+ DISALLOW_COPY_AND_ASSIGN(ShapedDesktopCapturer);
+};
+
+} // namespace remoting
+
+#endif // REMOTING_HOST_SHAPED_DESKTOP_CAPTURER_H_
diff --git a/remoting/host/shaped_screen_capturer_unittest.cc b/remoting/host/shaped_desktop_capturer_unittest.cc
index 1be21bf..d0acc3d 100644
--- a/remoting/host/shaped_screen_capturer_unittest.cc
+++ b/remoting/host/shaped_desktop_capturer_unittest.cc
@@ -1,11 +1,11 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
+// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "remoting/host/shaped_screen_capturer.h"
+#include "remoting/host/shaped_desktop_capturer.h"
#include "remoting/host/desktop_shape_tracker.h"
-#include "remoting/host/fake_screen_capturer.h"
+#include "remoting/host/fake_desktop_capturer.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/webrtc/modules/desktop_capture/desktop_frame.h"
#include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h"
@@ -39,7 +39,7 @@ class FakeDesktopShapeTracker : public DesktopShapeTracker {
webrtc::DesktopRegion shape_;
};
-class ShapedScreenCapturerTest : public testing::Test,
+class ShapedDesktopCapturerTest : public testing::Test,
public webrtc::DesktopCapturer::Callback {
public:
// webrtc::DesktopCapturer::Callback interface
@@ -55,9 +55,9 @@ class ShapedScreenCapturerTest : public testing::Test,
};
// Verify that captured frame have shape.
-TEST_F(ShapedScreenCapturerTest, Basic) {
- ShapedScreenCapturer capturer(
- scoped_ptr<webrtc::ScreenCapturer>(new FakeScreenCapturer()),
+TEST_F(ShapedDesktopCapturerTest, Basic) {
+ ShapedDesktopCapturer capturer(
+ scoped_ptr<webrtc::DesktopCapturer>(new FakeDesktopCapturer()),
scoped_ptr<DesktopShapeTracker>(new FakeDesktopShapeTracker()));
capturer.Start(this);
capturer.Capture(webrtc::DesktopRegion());
diff --git a/remoting/host/shaped_screen_capturer.cc b/remoting/host/shaped_screen_capturer.cc
deleted file mode 100644
index 00e808f..0000000
--- a/remoting/host/shaped_screen_capturer.cc
+++ /dev/null
@@ -1,67 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "remoting/host/shaped_screen_capturer.h"
-
-#include "base/logging.h"
-#include "remoting/host/desktop_shape_tracker.h"
-#include "third_party/webrtc/modules/desktop_capture/desktop_capture_options.h"
-#include "third_party/webrtc/modules/desktop_capture/desktop_frame.h"
-
-namespace remoting {
-
-// static
-scoped_ptr<ShapedScreenCapturer> ShapedScreenCapturer::Create(
- webrtc::DesktopCaptureOptions options) {
- return scoped_ptr<ShapedScreenCapturer>(
- new ShapedScreenCapturer(scoped_ptr<webrtc::ScreenCapturer>(
- webrtc::ScreenCapturer::Create(options)),
- DesktopShapeTracker::Create(options)));
-}
-
-ShapedScreenCapturer::ShapedScreenCapturer(
- scoped_ptr<webrtc::ScreenCapturer> screen_capturer,
- scoped_ptr<DesktopShapeTracker> shape_tracker)
- : screen_capturer_(screen_capturer.Pass()),
- shape_tracker_(shape_tracker.Pass()),
- callback_(NULL) {
-}
-
-ShapedScreenCapturer::~ShapedScreenCapturer() {}
-
-void ShapedScreenCapturer::Start(webrtc::ScreenCapturer::Callback* callback) {
- callback_ = callback;
- screen_capturer_->Start(this);
-}
-
-void ShapedScreenCapturer::Capture(const webrtc::DesktopRegion& region) {
- screen_capturer_->Capture(region);
-}
-
-void ShapedScreenCapturer::SetMouseShapeObserver(
- MouseShapeObserver* mouse_shape_observer) {
- screen_capturer_->SetMouseShapeObserver(mouse_shape_observer);
-}
-
-bool ShapedScreenCapturer::GetScreenList(ScreenList* screens) {
- NOTIMPLEMENTED();
- return false;
-}
-
-bool ShapedScreenCapturer::SelectScreen(webrtc::ScreenId id) {
- NOTIMPLEMENTED();
- return false;
-}
-
-webrtc::SharedMemory* ShapedScreenCapturer::CreateSharedMemory(size_t size) {
- return callback_->CreateSharedMemory(size);
-}
-
-void ShapedScreenCapturer::OnCaptureCompleted(webrtc::DesktopFrame* frame) {
- shape_tracker_->RefreshDesktopShape();
- frame->set_shape(new webrtc::DesktopRegion(shape_tracker_->desktop_shape()));
- callback_->OnCaptureCompleted(frame);
-}
-
-} // namespace remoting
diff --git a/remoting/host/shaped_screen_capturer.h b/remoting/host/shaped_screen_capturer.h
deleted file mode 100644
index c343293..0000000
--- a/remoting/host/shaped_screen_capturer.h
+++ /dev/null
@@ -1,48 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef REMOTING_HOST_SHAPED_SCREEN_CAPTURER_H_
-#define REMOTING_HOST_SHAPED_SCREEN_CAPTURER_H_
-
-#include "base/memory/scoped_ptr.h"
-#include "third_party/webrtc/modules/desktop_capture/screen_capturer.h"
-
-namespace remoting {
-
-class DesktopShapeTracker;
-
-// Screen capturer that also captures desktop shape.
-class ShapedScreenCapturer : public webrtc::ScreenCapturer,
- public webrtc::DesktopCapturer::Callback {
- public:
- static scoped_ptr<ShapedScreenCapturer> Create(
- webrtc::DesktopCaptureOptions options);
-
- ShapedScreenCapturer(scoped_ptr<webrtc::ScreenCapturer> screen_capturer,
- scoped_ptr<DesktopShapeTracker> shape_tracker);
- virtual ~ShapedScreenCapturer();
-
- // webrtc::ScreenCapturer interface.
- virtual void Start(webrtc::ScreenCapturer::Callback* callback) OVERRIDE;
- virtual void Capture(const webrtc::DesktopRegion& region) OVERRIDE;
- virtual void SetMouseShapeObserver(
- MouseShapeObserver* mouse_shape_observer) OVERRIDE;
- virtual bool GetScreenList(ScreenList* screens) OVERRIDE;
- virtual bool SelectScreen(webrtc::ScreenId id) OVERRIDE;
-
- private:
- // webrtc::ScreenCapturer::Callback interface.
- virtual webrtc::SharedMemory* CreateSharedMemory(size_t size) OVERRIDE;
- virtual void OnCaptureCompleted(webrtc::DesktopFrame* frame) OVERRIDE;
-
- scoped_ptr<webrtc::ScreenCapturer> screen_capturer_;
- scoped_ptr<DesktopShapeTracker> shape_tracker_;
- webrtc::ScreenCapturer::Callback* callback_;
-
- DISALLOW_COPY_AND_ASSIGN(ShapedScreenCapturer);
-};
-
-} // namespace remoting
-
-#endif // REMOTING_HOST_SHAPED_SCREEN_CAPTURER_H_
diff --git a/remoting/host/video_scheduler.cc b/remoting/host/video_scheduler.cc
index 7da9adf..7dc7f8a 100644
--- a/remoting/host/video_scheduler.cc
+++ b/remoting/host/video_scheduler.cc
@@ -20,10 +20,10 @@
#include "remoting/protocol/cursor_shape_stub.h"
#include "remoting/protocol/message_decoder.h"
#include "remoting/protocol/video_stub.h"
+#include "third_party/webrtc/modules/desktop_capture/desktop_capturer.h"
#include "third_party/webrtc/modules/desktop_capture/desktop_frame.h"
#include "third_party/webrtc/modules/desktop_capture/mouse_cursor.h"
#include "third_party/webrtc/modules/desktop_capture/mouse_cursor_shape.h"
-#include "third_party/webrtc/modules/desktop_capture/screen_capturer.h"
namespace remoting {
@@ -48,7 +48,7 @@ VideoScheduler::VideoScheduler(
scoped_refptr<base::SingleThreadTaskRunner> capture_task_runner,
scoped_refptr<base::SingleThreadTaskRunner> encode_task_runner,
scoped_refptr<base::SingleThreadTaskRunner> network_task_runner,
- scoped_ptr<webrtc::ScreenCapturer> capturer,
+ scoped_ptr<webrtc::DesktopCapturer> capturer,
scoped_ptr<webrtc::MouseCursorMonitor> mouse_cursor_monitor,
scoped_ptr<VideoEncoder> encoder,
protocol::CursorShapeStub* cursor_stub,
diff --git a/remoting/host/video_scheduler.h b/remoting/host/video_scheduler.h
index 21b1007..13ef218 100644
--- a/remoting/host/video_scheduler.h
+++ b/remoting/host/video_scheduler.h
@@ -15,15 +15,15 @@
#include "remoting/codec/video_encoder.h"
#include "remoting/host/capture_scheduler.h"
#include "remoting/proto/video.pb.h"
+#include "third_party/webrtc/modules/desktop_capture/desktop_capturer.h"
#include "third_party/webrtc/modules/desktop_capture/mouse_cursor_monitor.h"
-#include "third_party/webrtc/modules/desktop_capture/screen_capturer.h"
namespace base {
class SingleThreadTaskRunner;
} // namespace base
namespace media {
-class ScreenCapturer;
+class DesktopCapturer;
} // namespace media
namespace remoting {
@@ -37,7 +37,7 @@ class VideoStub;
} // namespace protocol
// Class responsible for scheduling frame captures from a
-// webrtc::ScreenCapturer, delivering them to a VideoEncoder to encode, and
+// webrtc::DesktopCapturer, delivering them to a VideoEncoder to encode, and
// finally passing the encoded video packets to the specified VideoStub to send
// on the network.
//
@@ -88,7 +88,7 @@ class VideoScheduler : public base::RefCountedThreadSafe<VideoScheduler>,
scoped_refptr<base::SingleThreadTaskRunner> capture_task_runner,
scoped_refptr<base::SingleThreadTaskRunner> encode_task_runner,
scoped_refptr<base::SingleThreadTaskRunner> network_task_runner,
- scoped_ptr<webrtc::ScreenCapturer> capturer,
+ scoped_ptr<webrtc::DesktopCapturer> capturer,
scoped_ptr<webrtc::MouseCursorMonitor> mouse_cursor_monitor,
scoped_ptr<VideoEncoder> encoder,
protocol::CursorShapeStub* cursor_stub,
@@ -180,7 +180,7 @@ class VideoScheduler : public base::RefCountedThreadSafe<VideoScheduler>,
scoped_refptr<base::SingleThreadTaskRunner> network_task_runner_;
// Used to capture frames. Always accessed on the capture thread.
- scoped_ptr<webrtc::ScreenCapturer> capturer_;
+ scoped_ptr<webrtc::DesktopCapturer> capturer_;
// Used to capture mouse cursor shapes. Always accessed on the capture thread.
scoped_ptr<webrtc::MouseCursorMonitor> mouse_cursor_monitor_;
diff --git a/remoting/host/video_scheduler_unittest.cc b/remoting/host/video_scheduler_unittest.cc
index adf1923..1d76d58 100644
--- a/remoting/host/video_scheduler_unittest.cc
+++ b/remoting/host/video_scheduler_unittest.cc
@@ -12,8 +12,8 @@
#include "remoting/base/auto_thread_task_runner.h"
#include "remoting/codec/video_encoder.h"
#include "remoting/codec/video_encoder_verbatim.h"
+#include "remoting/host/fake_desktop_capturer.h"
#include "remoting/host/fake_mouse_cursor_monitor.h"
-#include "remoting/host/fake_screen_capturer.h"
#include "remoting/host/host_mock_objects.h"
#include "remoting/proto/control.pb.h"
#include "remoting/proto/video.pb.h"
@@ -92,20 +92,20 @@ class ThreadCheckVideoEncoder : public VideoEncoderVerbatim {
DISALLOW_COPY_AND_ASSIGN(ThreadCheckVideoEncoder);
};
-class ThreadCheckScreenCapturer : public FakeScreenCapturer {
+class ThreadCheckDesktopCapturer : public FakeDesktopCapturer {
public:
- ThreadCheckScreenCapturer(
+ ThreadCheckDesktopCapturer(
scoped_refptr<base::SingleThreadTaskRunner> task_runner)
: task_runner_(task_runner) {
}
- virtual ~ThreadCheckScreenCapturer() {
+ virtual ~ThreadCheckDesktopCapturer() {
EXPECT_TRUE(task_runner_->BelongsToCurrentThread());
}
private:
scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
- DISALLOW_COPY_AND_ASSIGN(ThreadCheckScreenCapturer);
+ DISALLOW_COPY_AND_ASSIGN(ThreadCheckDesktopCapturer);
};
class ThreadCheckMouseCursorMonitor : public FakeMouseCursorMonitor {
@@ -132,14 +132,16 @@ class VideoSchedulerTest : public testing::Test {
virtual void TearDown() OVERRIDE;
void StartVideoScheduler(
- scoped_ptr<webrtc::ScreenCapturer> capturer,
+ scoped_ptr<webrtc::DesktopCapturer> capturer,
scoped_ptr<VideoEncoder> encoder,
scoped_ptr<webrtc::MouseCursorMonitor> mouse_monitor);
void StopVideoScheduler();
- // webrtc::ScreenCapturer mocks.
- void OnCapturerStart(webrtc::ScreenCapturer::Callback* callback);
+ // webrtc::DesktopCapturer mocks.
+ void OnCapturerStart(webrtc::DesktopCapturer::Callback* callback);
void OnCaptureFrame(const webrtc::DesktopRegion& region);
+
+ // webrtc::MouseCursorMonitor mocks.
void OnMouseCursorMonitorInit(
webrtc::MouseCursorMonitor::Callback* callback,
webrtc::MouseCursorMonitor::Mode mode);
@@ -157,8 +159,8 @@ class VideoSchedulerTest : public testing::Test {
MockClientStub client_stub_;
MockVideoStub video_stub_;
- // Points to the callback passed to webrtc::ScreenCapturer::Start().
- webrtc::ScreenCapturer::Callback* capturer_callback_;
+ // Points to the callback passed to webrtc::DesktopCapturer::Start().
+ webrtc::DesktopCapturer::Callback* capturer_callback_;
// Points to the callback passed to webrtc::MouseCursor::Init().
webrtc::MouseCursorMonitor::Callback* mouse_monitor_callback_;
@@ -190,7 +192,7 @@ void VideoSchedulerTest::TearDown() {
}
void VideoSchedulerTest::StartVideoScheduler(
- scoped_ptr<webrtc::ScreenCapturer> capturer,
+ scoped_ptr<webrtc::DesktopCapturer> capturer,
scoped_ptr<VideoEncoder> encoder,
scoped_ptr<webrtc::MouseCursorMonitor> mouse_monitor) {
scheduler_ = new VideoScheduler(
@@ -211,7 +213,7 @@ void VideoSchedulerTest::StopVideoScheduler() {
}
void VideoSchedulerTest::OnCapturerStart(
- webrtc::ScreenCapturer::Callback* callback) {
+ webrtc::DesktopCapturer::Callback* callback) {
EXPECT_FALSE(capturer_callback_);
EXPECT_TRUE(callback);
@@ -315,7 +317,7 @@ TEST_F(VideoSchedulerTest, StartAndStop) {
// Start video frame capture.
scoped_ptr<webrtc::MouseCursorMonitor> mouse_cursor_monitor(
new FakeMouseCursorMonitor());
- StartVideoScheduler(capturer.PassAs<webrtc::ScreenCapturer>(),
+ StartVideoScheduler(capturer.PassAs<webrtc::DesktopCapturer>(),
encoder.PassAs<VideoEncoder>(),
cursor_monitor.PassAs<webrtc::MouseCursorMonitor>());
@@ -331,8 +333,8 @@ TEST_F(VideoSchedulerTest, DeleteOnThreads) {
capture_task_runner_ = AutoThread::Create("capture", main_task_runner_);
encode_task_runner_ = AutoThread::Create("encode", main_task_runner_);
- scoped_ptr<webrtc::ScreenCapturer> capturer(
- new ThreadCheckScreenCapturer(capture_task_runner_));
+ scoped_ptr<webrtc::DesktopCapturer> capturer(
+ new ThreadCheckDesktopCapturer(capture_task_runner_));
scoped_ptr<VideoEncoder> encoder(
new ThreadCheckVideoEncoder(encode_task_runner_));
scoped_ptr<webrtc::MouseCursorMonitor> mouse_cursor_monitor(
diff --git a/remoting/remoting_host.gypi b/remoting/remoting_host.gypi
index 015f7aa..e966596 100644
--- a/remoting/remoting_host.gypi
+++ b/remoting/remoting_host.gypi
@@ -236,8 +236,8 @@
'host/server_log_entry_host.h',
'host/session_manager_factory.cc',
'host/session_manager_factory.h',
- 'host/shaped_screen_capturer.cc',
- 'host/shaped_screen_capturer.h',
+ 'host/shaped_desktop_capturer.cc',
+ 'host/shaped_desktop_capturer.h',
'host/signaling_connector.cc',
'host/signaling_connector.h',
'host/token_validator_base.cc',
diff --git a/remoting/remoting_test.gypi b/remoting/remoting_test.gypi
index 656de77..70d5f9f 100644
--- a/remoting/remoting_test.gypi
+++ b/remoting/remoting_test.gypi
@@ -19,11 +19,11 @@
'remoting_resources',
],
'sources': [
+ 'host/fake_desktop_capturer.cc',
+ 'host/fake_desktop_capturer.h',
'host/fake_desktop_environment.cc',
'host/fake_desktop_environment.h',
'host/fake_host_status_monitor.h',
- 'host/fake_screen_capturer.cc',
- 'host/fake_screen_capturer.h',
'host/fake_mouse_cursor_monitor.cc',
'host/fake_mouse_cursor_monitor.h',
'host/policy_hack/fake_policy_watcher.cc',
@@ -127,11 +127,11 @@
'host/daemon_process_unittest.cc',
'host/desktop_process_unittest.cc',
'host/desktop_shape_tracker_unittest.cc',
+ 'host/fake_desktop_capturer.cc',
+ 'host/fake_desktop_capturer.h',
'host/fake_host_extension.cc',
'host/fake_host_extension.h',
'host/fake_host_status_monitor.h',
- 'host/fake_screen_capturer.cc',
- 'host/fake_screen_capturer.h',
'host/gnubby_auth_handler_posix_unittest.cc',
'host/heartbeat_sender_unittest.cc',
'host/host_change_notification_listener_unittest.cc',
@@ -162,7 +162,7 @@
'host/setup/me2me_native_messaging_host_unittest.cc',
'host/setup/oauth_helper_unittest.cc',
'host/setup/pin_validator_unittest.cc',
- 'host/shaped_screen_capturer_unittest.cc',
+ 'host/shaped_desktop_capturer_unittest.cc',
'host/token_validator_factory_impl_unittest.cc',
'host/video_frame_recorder_unittest.cc',
'host/video_scheduler_unittest.cc',
diff --git a/remoting/test/protocol_perftest.cc b/remoting/test/protocol_perftest.cc
index 1e1c14a..438cbb8 100644
--- a/remoting/test/protocol_perftest.cc
+++ b/remoting/test/protocol_perftest.cc
@@ -348,7 +348,7 @@ class IntermittentChangeFrameGenerator
: frame_index_(0) {}
scoped_ptr<webrtc::DesktopFrame> GenerateFrame(
- webrtc::ScreenCapturer::Callback* callback) {
+ webrtc::DesktopCapturer::Callback* callback) {
const int kWidth = 800;
const int kHeight = 600;