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

Unified Diff: remoting/capturer/video_frame_capturer_linux.cc

Issue 11470028: Move screen capturers to remoting/capturer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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/capturer/video_frame_capturer_linux.cc
diff --git a/remoting/host/video_frame_capturer_linux.cc b/remoting/capturer/video_frame_capturer_linux.cc
similarity index 95%
rename from remoting/host/video_frame_capturer_linux.cc
rename to remoting/capturer/video_frame_capturer_linux.cc
index 0ebbc6928fd42203b24bea5bc403760bb3753931..8ca9e211464b5886085700abdbff7db7d02d4271 100644
--- a/remoting/host/video_frame_capturer_linux.cc
+++ b/remoting/capturer/video_frame_capturer_linux.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "remoting/host/video_frame_capturer.h"
+#include "remoting/capturer/video_frame_capturer.h"
#include <X11/Xlib.h>
#include <X11/Xutil.h>
@@ -14,14 +14,15 @@
#include "base/basictypes.h"
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
+#include "base/stl_util.h"
#include "base/time.h"
-#include "remoting/base/capture_data.h"
-#include "remoting/host/differ.h"
-#include "remoting/host/linux/x_server_pixel_buffer.h"
-#include "remoting/host/video_frame.h"
-#include "remoting/host/video_frame_capturer_helper.h"
-#include "remoting/host/video_frame_queue.h"
-#include "remoting/proto/control.pb.h"
+#include "remoting/capturer/capture_data.h"
+#include "remoting/capturer/differ.h"
+#include "remoting/capturer/linux/x_server_pixel_buffer.h"
+#include "remoting/capturer/mouse_cursor_shape.h"
+#include "remoting/capturer/video_frame.h"
+#include "remoting/capturer/video_frame_capturer_helper.h"
+#include "remoting/capturer/video_frame_queue.h"
namespace remoting {
@@ -374,31 +375,24 @@ void VideoFrameCapturerLinux::CaptureCursor() {
return;
}
- int width = img->width;
- int height = img->height;
- int total_bytes = width * height * kBytesPerPixel;
+ scoped_ptr<MouseCursorShape> cursor(new MouseCursorShape());
+ cursor->size.set(img->width, img->height);
+ cursor->hotspot.set(img->xhot, img->yhot);
- scoped_ptr<protocol::CursorShapeInfo> cursor_proto(
- new protocol::CursorShapeInfo());
- cursor_proto->set_width(width);
- cursor_proto->set_height(height);
- cursor_proto->set_hotspot_x(img->xhot);
- cursor_proto->set_hotspot_y(img->yhot);
-
- cursor_proto->mutable_data()->resize(total_bytes);
- uint8* proto_data = const_cast<uint8*>(reinterpret_cast<const uint8*>(
- cursor_proto->mutable_data()->data()));
+ int total_bytes =
+ cursor->size.width() * cursor->size.height() * kBytesPerPixel;
+ cursor->data.resize(total_bytes);
// Xlib stores 32-bit data in longs, even if longs are 64-bits long.
unsigned long* src = img->pixels;
- uint32* dst = reinterpret_cast<uint32*>(proto_data);
- uint32* dst_end = dst + (width * height);
+ uint32* dst = reinterpret_cast<uint32*>(string_as_array(&cursor->data));
+ uint32* dst_end = dst + (img->width * img->height);
while (dst < dst_end) {
*dst++ = static_cast<uint32>(*src++);
}
XFree(img);
- delegate_->OnCursorShapeChanged(cursor_proto.Pass());
+ delegate_->OnCursorShapeChanged(cursor.Pass());
}
CaptureData* VideoFrameCapturerLinux::CaptureScreen() {
« no previous file with comments | « remoting/capturer/video_frame_capturer_helper_unittest.cc ('k') | remoting/capturer/video_frame_capturer_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698