| 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/client_session.h" | 5 #include "remoting/host/client_session.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/message_loop/message_loop_proxy.h" | 9 #include "base/message_loop/message_loop_proxy.h" |
| 10 #include "remoting/base/capabilities.h" | 10 #include "remoting/base/capabilities.h" |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 | 135 |
| 136 void ClientSession::ControlVideo(const protocol::VideoControl& video_control) { | 136 void ClientSession::ControlVideo(const protocol::VideoControl& video_control) { |
| 137 DCHECK(CalledOnValidThread()); | 137 DCHECK(CalledOnValidThread()); |
| 138 | 138 |
| 139 // Note that |video_scheduler_| may be NULL, depending upon whether extensions | 139 // Note that |video_scheduler_| may be NULL, depending upon whether extensions |
| 140 // choose to wrap or "steal" the video capturer or encoder. | 140 // choose to wrap or "steal" the video capturer or encoder. |
| 141 if (video_control.has_enable()) { | 141 if (video_control.has_enable()) { |
| 142 VLOG(1) << "Received VideoControl (enable=" | 142 VLOG(1) << "Received VideoControl (enable=" |
| 143 << video_control.enable() << ")"; | 143 << video_control.enable() << ")"; |
| 144 pause_video_ = !video_control.enable(); | 144 pause_video_ = !video_control.enable(); |
| 145 if (video_scheduler_) | 145 if (video_scheduler_.get()) |
| 146 video_scheduler_->Pause(pause_video_); | 146 video_scheduler_->Pause(pause_video_); |
| 147 } | 147 } |
| 148 if (video_control.has_lossless_encode()) { | 148 if (video_control.has_lossless_encode()) { |
| 149 VLOG(1) << "Received VideoControl (lossless_encode=" | 149 VLOG(1) << "Received VideoControl (lossless_encode=" |
| 150 << video_control.lossless_encode() << ")"; | 150 << video_control.lossless_encode() << ")"; |
| 151 lossless_video_encode_ = video_control.lossless_encode(); | 151 lossless_video_encode_ = video_control.lossless_encode(); |
| 152 if (video_scheduler_) | 152 if (video_scheduler_.get()) |
| 153 video_scheduler_->SetLosslessEncode(lossless_video_encode_); | 153 video_scheduler_->SetLosslessEncode(lossless_video_encode_); |
| 154 } | 154 } |
| 155 if (video_control.has_lossless_color()) { | 155 if (video_control.has_lossless_color()) { |
| 156 VLOG(1) << "Received VideoControl (lossless_color=" | 156 VLOG(1) << "Received VideoControl (lossless_color=" |
| 157 << video_control.lossless_color() << ")"; | 157 << video_control.lossless_color() << ")"; |
| 158 lossless_video_color_ = video_control.lossless_color(); | 158 lossless_video_color_ = video_control.lossless_color(); |
| 159 if (video_scheduler_) | 159 if (video_scheduler_.get()) |
| 160 video_scheduler_->SetLosslessColor(lossless_video_color_); | 160 video_scheduler_->SetLosslessColor(lossless_video_color_); |
| 161 } | 161 } |
| 162 } | 162 } |
| 163 | 163 |
| 164 void ClientSession::ControlAudio(const protocol::AudioControl& audio_control) { | 164 void ClientSession::ControlAudio(const protocol::AudioControl& audio_control) { |
| 165 DCHECK(CalledOnValidThread()); | 165 DCHECK(CalledOnValidThread()); |
| 166 | 166 |
| 167 if (audio_control.has_enable()) { | 167 if (audio_control.has_enable()) { |
| 168 VLOG(1) << "Received AudioControl (enable=" | 168 VLOG(1) << "Received AudioControl (enable=" |
| 169 << audio_control.enable() << ")"; | 169 << audio_control.enable() << ")"; |
| (...skipping 30 matching lines...) Expand all Loading... |
| 200 | 200 |
| 201 VLOG(1) << "Client capabilities: " << *client_capabilities_; | 201 VLOG(1) << "Client capabilities: " << *client_capabilities_; |
| 202 | 202 |
| 203 // Calculate the set of capabilities enabled by both client and host and | 203 // Calculate the set of capabilities enabled by both client and host and |
| 204 // pass it to the desktop environment if it is available. | 204 // pass it to the desktop environment if it is available. |
| 205 desktop_environment_->SetCapabilities(capabilities_); | 205 desktop_environment_->SetCapabilities(capabilities_); |
| 206 } | 206 } |
| 207 | 207 |
| 208 void ClientSession::RequestPairing( | 208 void ClientSession::RequestPairing( |
| 209 const protocol::PairingRequest& pairing_request) { | 209 const protocol::PairingRequest& pairing_request) { |
| 210 if (pairing_registry_ && pairing_request.has_client_name()) { | 210 if (pairing_registry_.get() && pairing_request.has_client_name()) { |
| 211 protocol::PairingRegistry::Pairing pairing = | 211 protocol::PairingRegistry::Pairing pairing = |
| 212 pairing_registry_->CreatePairing(pairing_request.client_name()); | 212 pairing_registry_->CreatePairing(pairing_request.client_name()); |
| 213 protocol::PairingResponse pairing_response; | 213 protocol::PairingResponse pairing_response; |
| 214 pairing_response.set_client_id(pairing.client_id()); | 214 pairing_response.set_client_id(pairing.client_id()); |
| 215 pairing_response.set_shared_secret(pairing.shared_secret()); | 215 pairing_response.set_shared_secret(pairing.shared_secret()); |
| 216 connection_->client_stub()->SetPairingResponse(pairing_response); | 216 connection_->client_stub()->SetPairingResponse(pairing_response); |
| 217 } | 217 } |
| 218 } | 218 } |
| 219 | 219 |
| 220 void ClientSession::DeliverClientMessage( | 220 void ClientSession::DeliverClientMessage( |
| (...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 528 return scoped_ptr<AudioEncoder>(new AudioEncoderVerbatim()); | 528 return scoped_ptr<AudioEncoder>(new AudioEncoderVerbatim()); |
| 529 } else if (audio_config.codec == protocol::ChannelConfig::CODEC_OPUS) { | 529 } else if (audio_config.codec == protocol::ChannelConfig::CODEC_OPUS) { |
| 530 return scoped_ptr<AudioEncoder>(new AudioEncoderOpus()); | 530 return scoped_ptr<AudioEncoder>(new AudioEncoderOpus()); |
| 531 } | 531 } |
| 532 | 532 |
| 533 NOTREACHED(); | 533 NOTREACHED(); |
| 534 return scoped_ptr<AudioEncoder>(); | 534 return scoped_ptr<AudioEncoder>(); |
| 535 } | 535 } |
| 536 | 536 |
| 537 } // namespace remoting | 537 } // namespace remoting |
| OLD | NEW |