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

Side by Side Diff: remoting/host/video_scheduler.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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « remoting/host/video_scheduler.h ('k') | remoting/host/video_scheduler_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "remoting/host/video_scheduler.h" 5 #include "remoting/host/video_scheduler.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
11 #include "base/logging.h" 11 #include "base/logging.h"
12 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
13 #include "base/message_loop_proxy.h" 13 #include "base/message_loop_proxy.h"
14 #include "base/stl_util.h" 14 #include "base/stl_util.h"
15 #include "base/sys_info.h" 15 #include "base/sys_info.h"
16 #include "base/time.h" 16 #include "base/time.h"
17 #include "remoting/base/capture_data.h" 17 #include "remoting/capturer/capture_data.h"
18 #include "remoting/host/video_frame_capturer.h" 18 #include "remoting/capturer/mouse_cursor_shape.h"
19 #include "remoting/capturer/video_frame_capturer.h"
19 #include "remoting/proto/control.pb.h" 20 #include "remoting/proto/control.pb.h"
20 #include "remoting/proto/internal.pb.h" 21 #include "remoting/proto/internal.pb.h"
21 #include "remoting/proto/video.pb.h" 22 #include "remoting/proto/video.pb.h"
22 #include "remoting/protocol/client_stub.h" 23 #include "remoting/protocol/client_stub.h"
23 #include "remoting/protocol/message_decoder.h" 24 #include "remoting/protocol/message_decoder.h"
24 #include "remoting/protocol/video_stub.h" 25 #include "remoting/protocol/video_stub.h"
25 #include "remoting/protocol/util.h" 26 #include "remoting/protocol/util.h"
26 27
27 namespace remoting { 28 namespace remoting {
28 29
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 // accurate as long as capture is synchronous as the following statement 71 // accurate as long as capture is synchronous as the following statement
71 // will obtain the most recent sequence number received. 72 // will obtain the most recent sequence number received.
72 capture_data->set_client_sequence_number(sequence_number_); 73 capture_data->set_client_sequence_number(sequence_number_);
73 } 74 }
74 75
75 encode_task_runner_->PostTask( 76 encode_task_runner_->PostTask(
76 FROM_HERE, base::Bind(&VideoScheduler::EncodeFrame, this, capture_data)); 77 FROM_HERE, base::Bind(&VideoScheduler::EncodeFrame, this, capture_data));
77 } 78 }
78 79
79 void VideoScheduler::OnCursorShapeChanged( 80 void VideoScheduler::OnCursorShapeChanged(
80 scoped_ptr<protocol::CursorShapeInfo> cursor_shape) { 81 scoped_ptr<MouseCursorShape> cursor_shape) {
81 DCHECK(capture_task_runner_->BelongsToCurrentThread()); 82 DCHECK(capture_task_runner_->BelongsToCurrentThread());
82 83
84 scoped_ptr<protocol::CursorShapeInfo> cursor_proto(
85 new protocol::CursorShapeInfo());
86 cursor_proto->set_width(cursor_shape->size.width());
87 cursor_proto->set_height(cursor_shape->size.height());
88 cursor_proto->set_hotspot_x(cursor_shape->hotspot.x());
89 cursor_proto->set_hotspot_y(cursor_shape->hotspot.y());
90 cursor_proto->set_data(cursor_shape->data);
91
83 network_task_runner_->PostTask( 92 network_task_runner_->PostTask(
84 FROM_HERE, base::Bind(&VideoScheduler::SendCursorShape, this, 93 FROM_HERE, base::Bind(&VideoScheduler::SendCursorShape, this,
85 base::Passed(&cursor_shape))); 94 base::Passed(&cursor_proto)));
86 } 95 }
87 96
88 void VideoScheduler::Stop(const base::Closure& done_task) { 97 void VideoScheduler::Stop(const base::Closure& done_task) {
89 DCHECK(network_task_runner_->BelongsToCurrentThread()); 98 DCHECK(network_task_runner_->BelongsToCurrentThread());
90 DCHECK(!done_task.is_null()); 99 DCHECK(!done_task.is_null());
91 100
92 // Clear stubs to prevent further updates reaching the client. 101 // Clear stubs to prevent further updates reaching the client.
93 cursor_stub_ = NULL; 102 cursor_stub_ = NULL;
94 video_stub_ = NULL; 103 video_stub_ = NULL;
95 104
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 316
308 void VideoScheduler::StopOnEncodeThread(const base::Closure& done_task) { 317 void VideoScheduler::StopOnEncodeThread(const base::Closure& done_task) {
309 DCHECK(encode_task_runner_->BelongsToCurrentThread()); 318 DCHECK(encode_task_runner_->BelongsToCurrentThread());
310 319
311 // This is posted by StopOnCaptureThread, so we know that by the time we 320 // This is posted by StopOnCaptureThread, so we know that by the time we
312 // process it there are no more encode tasks queued. 321 // process it there are no more encode tasks queued.
313 network_task_runner_->PostTask(FROM_HERE, done_task); 322 network_task_runner_->PostTask(FROM_HERE, done_task);
314 } 323 }
315 324
316 } // namespace remoting 325 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/video_scheduler.h ('k') | remoting/host/video_scheduler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698