| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/session_manager.h" | 5 #include "remoting/host/session_manager.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/scoped_ptr.h" | 10 #include "base/scoped_ptr.h" |
| 11 #include "base/stl_util-inl.h" | 11 #include "base/stl_util-inl.h" |
| 12 #include "remoting/base/capture_data.h" | 12 #include "remoting/base/capture_data.h" |
| 13 #include "remoting/base/tracer.h" | 13 #include "remoting/base/tracer.h" |
| 14 #include "remoting/host/client_connection.h" | 14 #include "remoting/host/client_connection.h" |
| 15 #include "remoting/protocol/messages_decoder.h" | 15 #include "remoting/protocol/message_decoder.h" |
| 16 | 16 |
| 17 namespace remoting { | 17 namespace remoting { |
| 18 | 18 |
| 19 // By default we capture 20 times a second. This number is obtained by | 19 // By default we capture 20 times a second. This number is obtained by |
| 20 // experiment to provide good latency. | 20 // experiment to provide good latency. |
| 21 static const double kDefaultCaptureRate = 20.0; | 21 static const double kDefaultCaptureRate = 20.0; |
| 22 | 22 |
| 23 // Interval that we perform rate regulation. | 23 // Interval that we perform rate regulation. |
| 24 static const base::TimeDelta kRateControlInterval = | 24 static const base::TimeDelta kRateControlInterval = |
| 25 base::TimeDelta::FromSeconds(1); | 25 base::TimeDelta::FromSeconds(1); |
| (...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 411 FROM_HERE, | 411 FROM_HERE, |
| 412 NewTracedMethod(this, &SessionManager::DoSendUpdate, message, state)); | 412 NewTracedMethod(this, &SessionManager::DoSendUpdate, message, state)); |
| 413 | 413 |
| 414 if (state & Encoder::EncodingEnded) { | 414 if (state & Encoder::EncodingEnded) { |
| 415 capture_loop_->PostTask( | 415 capture_loop_->PostTask( |
| 416 FROM_HERE, NewTracedMethod(this, &SessionManager::DoFinishEncode)); | 416 FROM_HERE, NewTracedMethod(this, &SessionManager::DoFinishEncode)); |
| 417 } | 417 } |
| 418 } | 418 } |
| 419 | 419 |
| 420 } // namespace remoting | 420 } // namespace remoting |
| OLD | NEW |