OLD | NEW |
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/message_loop_proxy.h" | 13 #include "base/message_loop/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/time.h" | 16 #include "base/time/time.h" |
17 #include "remoting/proto/control.pb.h" | 17 #include "remoting/proto/control.pb.h" |
18 #include "remoting/proto/internal.pb.h" | 18 #include "remoting/proto/internal.pb.h" |
19 #include "remoting/proto/video.pb.h" | 19 #include "remoting/proto/video.pb.h" |
20 #include "remoting/protocol/cursor_shape_stub.h" | 20 #include "remoting/protocol/cursor_shape_stub.h" |
21 #include "remoting/protocol/message_decoder.h" | 21 #include "remoting/protocol/message_decoder.h" |
22 #include "remoting/protocol/util.h" | |
23 #include "remoting/protocol/video_stub.h" | 22 #include "remoting/protocol/video_stub.h" |
24 #include "third_party/webrtc/modules/desktop_capture/desktop_frame.h" | 23 #include "third_party/webrtc/modules/desktop_capture/desktop_frame.h" |
25 #include "third_party/webrtc/modules/desktop_capture/mouse_cursor_shape.h" | 24 #include "third_party/webrtc/modules/desktop_capture/mouse_cursor_shape.h" |
26 #include "third_party/webrtc/modules/desktop_capture/screen_capturer.h" | 25 #include "third_party/webrtc/modules/desktop_capture/screen_capturer.h" |
27 | 26 |
28 namespace remoting { | 27 namespace remoting { |
29 | 28 |
30 // Maximum number of frames that can be processed simultaneously. | 29 // Maximum number of frames that can be processed simultaneously. |
31 // TODO(hclam): Move this value to CaptureScheduler. | 30 // TODO(hclam): Move this value to CaptureScheduler. |
32 static const int kMaxPendingFrames = 2; | 31 static const int kMaxPendingFrames = 2; |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 frame.reset(); | 299 frame.reset(); |
301 | 300 |
302 scheduler_.RecordEncodeTime( | 301 scheduler_.RecordEncodeTime( |
303 base::TimeDelta::FromMilliseconds(packet->encode_time_ms())); | 302 base::TimeDelta::FromMilliseconds(packet->encode_time_ms())); |
304 network_task_runner_->PostTask( | 303 network_task_runner_->PostTask( |
305 FROM_HERE, base::Bind(&VideoScheduler::SendVideoPacket, this, | 304 FROM_HERE, base::Bind(&VideoScheduler::SendVideoPacket, this, |
306 base::Passed(&packet))); | 305 base::Passed(&packet))); |
307 } | 306 } |
308 | 307 |
309 } // namespace remoting | 308 } // namespace remoting |
OLD | NEW |