summaryrefslogtreecommitdiffstats
path: root/remoting/host/desktop_session_proxy.cc
diff options
context:
space:
mode:
authorsergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-28 23:54:03 +0000
committersergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-28 23:54:03 +0000
commit497d8a9857e7383f979b89694aff8dd403c176fe (patch)
tree2f07bb42d4a7a8e94e959c90dacbfa62eed1debd /remoting/host/desktop_session_proxy.cc
parentbac4ae80a786d68bfc18ca46f0adfcc4a1c43b0f (diff)
downloadchromium_src-497d8a9857e7383f979b89694aff8dd403c176fe.zip
chromium_src-497d8a9857e7383f979b89694aff8dd403c176fe.tar.gz
chromium_src-497d8a9857e7383f979b89694aff8dd403c176fe.tar.bz2
Move screen capturers from remoting/capturer to media/video/capturer/screen
Screen capturers will be used in content, and so they have to be moved to avoid dependency on remoting/capturer in content. Beside moving the files this CL also renames classes as follows: remoting::VideoFrameCapturer -> media::ScreenCapturer remoting::VideoFrame -> media::ScreenCaptureFrame remoting::CaptureData -> media::ScreenCaptureData BUG=134249 Review URL: https://codereview.chromium.org/12047101 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@179218 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/host/desktop_session_proxy.cc')
-rw-r--r--remoting/host/desktop_session_proxy.cc40
1 files changed, 21 insertions, 19 deletions
diff --git a/remoting/host/desktop_session_proxy.cc b/remoting/host/desktop_session_proxy.cc
index 48e1547..c557853 100644
--- a/remoting/host/desktop_session_proxy.cc
+++ b/remoting/host/desktop_session_proxy.cc
@@ -10,7 +10,7 @@
#include "base/single_thread_task_runner.h"
#include "ipc/ipc_channel_proxy.h"
#include "ipc/ipc_message_macros.h"
-#include "remoting/capturer/capture_data.h"
+#include "media/video/capture/screen/screen_capture_data.h"
#include "remoting/host/audio_capturer.h"
#include "remoting/host/chromoting_messages.h"
#include "remoting/host/client_session.h"
@@ -59,14 +59,14 @@ scoped_ptr<EventExecutor> DesktopSessionProxy::CreateEventExecutor(
return scoped_ptr<EventExecutor>(new IpcEventExecutor(this));
}
-scoped_ptr<VideoFrameCapturer> DesktopSessionProxy::CreateVideoCapturer(
+scoped_ptr<media::ScreenCapturer> DesktopSessionProxy::CreateVideoCapturer(
scoped_refptr<base::SingleThreadTaskRunner> capture_task_runner,
scoped_refptr<base::SingleThreadTaskRunner> encode_task_runner) {
DCHECK(caller_task_runner_->BelongsToCurrentThread());
DCHECK(!video_capture_task_runner_.get());
video_capture_task_runner_ = capture_task_runner;
- return scoped_ptr<VideoFrameCapturer>(new IpcVideoFrameCapturer(this));
+ return scoped_ptr<media::ScreenCapturer>(new IpcVideoFrameCapturer(this));
}
bool DesktopSessionProxy::OnMessageReceived(const IPC::Message& message) {
@@ -169,7 +169,7 @@ void DesktopSessionProxy::DetachFromDesktop() {
// Generate fake responses to keep the video capturer in sync.
while (pending_capture_frame_requests_) {
--pending_capture_frame_requests_;
- PostCaptureCompleted(scoped_refptr<CaptureData>());
+ PostCaptureCompleted(scoped_refptr<media::ScreenCaptureData>());
}
}
@@ -284,7 +284,8 @@ void DesktopSessionProxy::StartEventExecutor(
DesktopSessionProxy::~DesktopSessionProxy() {
}
-scoped_refptr<SharedBuffer> DesktopSessionProxy::GetSharedBuffer(int id) {
+scoped_refptr<media::SharedBuffer> DesktopSessionProxy::GetSharedBuffer(
+ int id) {
DCHECK(caller_task_runner_->BelongsToCurrentThread());
SharedBuffers::const_iterator i = shared_buffers_.find(id);
@@ -292,7 +293,7 @@ scoped_refptr<SharedBuffer> DesktopSessionProxy::GetSharedBuffer(int id) {
return i->second;
} else {
LOG(ERROR) << "Failed to find the shared buffer " << id;
- return scoped_refptr<SharedBuffer>();
+ return scoped_refptr<media::SharedBuffer>();
}
}
@@ -316,12 +317,12 @@ void DesktopSessionProxy::OnCreateSharedBuffer(
uint32 size) {
DCHECK(caller_task_runner_->BelongsToCurrentThread());
- scoped_refptr<SharedBuffer> shared_buffer;
+ scoped_refptr<media::SharedBuffer> shared_buffer;
#if defined(OS_WIN)
- shared_buffer = new SharedBuffer(id, handle, desktop_process_, size);
+ shared_buffer = new media::SharedBuffer(id, handle, desktop_process_, size);
#elif defined(OS_POSIX)
- shared_buffer = new SharedBuffer(id, handle, size);
+ shared_buffer = new media::SharedBuffer(id, handle, size);
#else
#error Unsupported platform.
#endif
@@ -363,14 +364,15 @@ void DesktopSessionProxy::OnCaptureCompleted(
// Assume that |serialized_data| is well formed because it was received from
// a more privileged process.
- scoped_refptr<CaptureData> capture_data;
- scoped_refptr<SharedBuffer> shared_buffer =
+ scoped_refptr<media::ScreenCaptureData> capture_data;
+ scoped_refptr<media::SharedBuffer> shared_buffer =
GetSharedBuffer(serialized_data.shared_buffer_id);
CHECK(shared_buffer);
- capture_data = new CaptureData(reinterpret_cast<uint8*>(shared_buffer->ptr()),
- serialized_data.bytes_per_row,
- serialized_data.dimensions);
+ capture_data = new media::ScreenCaptureData(
+ reinterpret_cast<uint8*>(shared_buffer->ptr()),
+ serialized_data.bytes_per_row,
+ serialized_data.dimensions);
capture_data->set_capture_time_ms(serialized_data.capture_time_ms);
capture_data->set_client_sequence_number(
serialized_data.client_sequence_number);
@@ -388,10 +390,10 @@ void DesktopSessionProxy::OnCaptureCompleted(
}
void DesktopSessionProxy::OnCursorShapeChanged(
- const MouseCursorShape& cursor_shape) {
+ const media::MouseCursorShape& cursor_shape) {
DCHECK(caller_task_runner_->BelongsToCurrentThread());
- PostCursorShape(
- scoped_ptr<MouseCursorShape>(new MouseCursorShape(cursor_shape)));
+ PostCursorShape(scoped_ptr<media::MouseCursorShape>(
+ new media::MouseCursorShape(cursor_shape)));
}
void DesktopSessionProxy::OnInjectClipboardEvent(
@@ -422,7 +424,7 @@ void DesktopSessionProxy::PostAudioPacket(scoped_ptr<AudioPacket> packet) {
}
void DesktopSessionProxy::PostCaptureCompleted(
- scoped_refptr<CaptureData> capture_data) {
+ scoped_refptr<media::ScreenCaptureData> capture_data) {
if (!video_capture_task_runner_->BelongsToCurrentThread()) {
video_capture_task_runner_->PostTask(
FROM_HERE, base::Bind(&DesktopSessionProxy::PostCaptureCompleted,
@@ -435,7 +437,7 @@ void DesktopSessionProxy::PostCaptureCompleted(
}
void DesktopSessionProxy::PostCursorShape(
- scoped_ptr<MouseCursorShape> cursor_shape) {
+ scoped_ptr<media::MouseCursorShape> cursor_shape) {
if (!video_capture_task_runner_->BelongsToCurrentThread()) {
video_capture_task_runner_->PostTask(
FROM_HERE, base::Bind(&DesktopSessionProxy::PostCursorShape,