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/client/chromoting_client.h" | 5 #include "remoting/client/chromoting_client.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "remoting/client/audio_decode_scheduler.h" | 8 #include "remoting/client/audio_decode_scheduler.h" |
9 #include "remoting/client/audio_player.h" | 9 #include "remoting/client/audio_player.h" |
10 #include "remoting/client/client_context.h" | 10 #include "remoting/client/client_context.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 connection_->Connect(xmpp_proxy, config_.local_jid, config_.host_jid, | 60 connection_->Connect(xmpp_proxy, config_.local_jid, config_.host_jid, |
61 config_.host_public_key, transport_factory.Pass(), | 61 config_.host_public_key, transport_factory.Pass(), |
62 authenticator.Pass(), this, this, this, | 62 authenticator.Pass(), this, this, this, |
63 rectangle_decoder_, | 63 rectangle_decoder_, |
64 audio_decode_scheduler_.get()); | 64 audio_decode_scheduler_.get()); |
65 } | 65 } |
66 | 66 |
67 void ChromotingClient::Stop(const base::Closure& shutdown_task) { | 67 void ChromotingClient::Stop(const base::Closure& shutdown_task) { |
68 DCHECK(task_runner_->BelongsToCurrentThread()); | 68 DCHECK(task_runner_->BelongsToCurrentThread()); |
69 | 69 |
70 // Drop all pending packets. | 70 // Stop decoder so we don't waste CPU cycles decoding video packets we will |
71 rectangle_decoder_->DropAllPackets(); | 71 // never show. |
| 72 rectangle_decoder_->Stop(); |
72 | 73 |
73 connection_->Disconnect(base::Bind(&ChromotingClient::OnDisconnected, | 74 connection_->Disconnect(base::Bind(&ChromotingClient::OnDisconnected, |
74 weak_ptr_, shutdown_task)); | 75 weak_ptr_, shutdown_task)); |
75 } | 76 } |
76 | 77 |
77 void ChromotingClient::OnDisconnected(const base::Closure& shutdown_task) { | 78 void ChromotingClient::OnDisconnected(const base::Closure& shutdown_task) { |
78 shutdown_task.Run(); | 79 shutdown_task.Run(); |
79 } | 80 } |
80 | 81 |
81 ChromotingStats* ChromotingClient::GetStats() { | 82 ChromotingStats* ChromotingClient::GetStats() { |
(...skipping 30 matching lines...) Expand all Loading... |
112 void ChromotingClient::Initialize() { | 113 void ChromotingClient::Initialize() { |
113 DCHECK(task_runner_->BelongsToCurrentThread()); | 114 DCHECK(task_runner_->BelongsToCurrentThread()); |
114 | 115 |
115 // Initialize the decoder. | 116 // Initialize the decoder. |
116 rectangle_decoder_->Initialize(connection_->config()); | 117 rectangle_decoder_->Initialize(connection_->config()); |
117 if (connection_->config().is_audio_enabled()) | 118 if (connection_->config().is_audio_enabled()) |
118 audio_decode_scheduler_->Initialize(connection_->config()); | 119 audio_decode_scheduler_->Initialize(connection_->config()); |
119 } | 120 } |
120 | 121 |
121 } // namespace remoting | 122 } // namespace remoting |
OLD | NEW |