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

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..3fb06acd5dfd45196f057ca5a74722ee20d9f2e5 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,25 @@ void VideoFrameCapturerLinux::CaptureCursor() {
return;
}
- int width = img->width;
- int height = img->height;
- int total_bytes = width * height * kBytesPerPixel;
+ MouseCursorShape cursor;
+ cursor.width = img->width;
+ cursor.height = img->height;
+ cursor.hotspot_x = img->xhot;
+ cursor.hotspot_y = 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.width * cursor.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);
Wez 2012/12/11 05:23:18 We deliberately had the recipient own the cursor,
Sergey Ulanov 2012/12/12 18:31:12 Changed it to passing pointers, though I don't thi
}
CaptureData* VideoFrameCapturerLinux::CaptureScreen() {

Powered by Google App Engine
This is Rietveld 408576698