| 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 <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "remoting/base/capabilities.h" | 10 #include "remoting/base/capabilities.h" |
| 11 #include "remoting/base/constants.h" | 11 #include "remoting/base/constants.h" |
| 12 #include "remoting/client/audio_consumer.h" |
| 12 #include "remoting/client/audio_decode_scheduler.h" | 13 #include "remoting/client/audio_decode_scheduler.h" |
| 13 #include "remoting/client/audio_player.h" | |
| 14 #include "remoting/client/client_context.h" | 14 #include "remoting/client/client_context.h" |
| 15 #include "remoting/client/client_user_interface.h" | 15 #include "remoting/client/client_user_interface.h" |
| 16 #include "remoting/protocol/authenticator.h" | 16 #include "remoting/protocol/authenticator.h" |
| 17 #include "remoting/protocol/connection_to_host.h" | 17 #include "remoting/protocol/connection_to_host.h" |
| 18 #include "remoting/protocol/host_stub.h" | 18 #include "remoting/protocol/host_stub.h" |
| 19 #include "remoting/protocol/ice_connection_to_host.h" | 19 #include "remoting/protocol/ice_connection_to_host.h" |
| 20 #include "remoting/protocol/jingle_session_manager.h" | 20 #include "remoting/protocol/jingle_session_manager.h" |
| 21 #include "remoting/protocol/negotiating_client_authenticator.h" | 21 #include "remoting/protocol/negotiating_client_authenticator.h" |
| 22 #include "remoting/protocol/session_config.h" | 22 #include "remoting/protocol/session_config.h" |
| 23 #include "remoting/protocol/transport_context.h" | 23 #include "remoting/protocol/transport_context.h" |
| 24 #include "remoting/protocol/video_renderer.h" | 24 #include "remoting/protocol/video_renderer.h" |
| 25 #include "remoting/protocol/webrtc_connection_to_host.h" | 25 #include "remoting/protocol/webrtc_connection_to_host.h" |
| 26 #include "remoting/signaling/jid_util.h" | 26 #include "remoting/signaling/jid_util.h" |
| 27 #include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h" | 27 #include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h" |
| 28 | 28 |
| 29 namespace remoting { | 29 namespace remoting { |
| 30 | 30 |
| 31 ChromotingClient::ChromotingClient(ClientContext* client_context, | 31 ChromotingClient::ChromotingClient(ClientContext* client_context, |
| 32 ClientUserInterface* user_interface, | 32 ClientUserInterface* user_interface, |
| 33 protocol::VideoRenderer* video_renderer, | 33 protocol::VideoRenderer* video_renderer, |
| 34 std::unique_ptr<AudioPlayer> audio_player) | 34 base::WeakPtr<AudioConsumer> audio_consumer) |
| 35 : user_interface_(user_interface), video_renderer_(video_renderer) { | 35 : user_interface_(user_interface), video_renderer_(video_renderer) { |
| 36 DCHECK(client_context->main_task_runner()->BelongsToCurrentThread()); | 36 DCHECK(client_context->main_task_runner()->BelongsToCurrentThread()); |
| 37 if (audio_player) { | 37 if (audio_consumer) { |
| 38 audio_decode_scheduler_.reset(new AudioDecodeScheduler( | 38 audio_decode_scheduler_.reset(new AudioDecodeScheduler( |
| 39 client_context->main_task_runner(), | 39 client_context->main_task_runner(), |
| 40 client_context->audio_decode_task_runner(), std::move(audio_player))); | 40 client_context->audio_decode_task_runner(), audio_consumer)); |
| 41 } | 41 } |
| 42 } | 42 } |
| 43 | 43 |
| 44 ChromotingClient::~ChromotingClient() { | 44 ChromotingClient::~ChromotingClient() { |
| 45 if (signal_strategy_) | 45 if (signal_strategy_) |
| 46 signal_strategy_->RemoveListener(this); | 46 signal_strategy_->RemoveListener(this); |
| 47 } | 47 } |
| 48 | 48 |
| 49 void ChromotingClient::set_protocol_config( | 49 void ChromotingClient::set_protocol_config( |
| 50 std::unique_ptr<protocol::CandidateSessionConfig> config) { | 50 std::unique_ptr<protocol::CandidateSessionConfig> config) { |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 VLOG(1) << "Client capabilities: " << local_capabilities_; | 269 VLOG(1) << "Client capabilities: " << local_capabilities_; |
| 270 | 270 |
| 271 protocol::Capabilities capabilities; | 271 protocol::Capabilities capabilities; |
| 272 capabilities.set_capabilities(local_capabilities_); | 272 capabilities.set_capabilities(local_capabilities_); |
| 273 connection_->host_stub()->SetCapabilities(capabilities); | 273 connection_->host_stub()->SetCapabilities(capabilities); |
| 274 | 274 |
| 275 mouse_input_scaler_.set_input_stub(connection_->input_stub()); | 275 mouse_input_scaler_.set_input_stub(connection_->input_stub()); |
| 276 } | 276 } |
| 277 | 277 |
| 278 } // namespace remoting | 278 } // namespace remoting |
| OLD | NEW |