| 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/protocol/session_config.h" | 5 #include "remoting/protocol/session_config.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 namespace remoting { | 9 namespace remoting { |
| 10 namespace protocol { | 10 namespace protocol { |
| 11 | 11 |
| 12 const int kDefaultStreamVersion = 2; | 12 const int kDefaultStreamVersion = 2; |
| 13 | 13 |
| 14 // The control channel version that supports the "capabilities" message. |
| 15 const int kCapabilitiesControlStreamVersion = 3; |
| 16 |
| 14 ChannelConfig ChannelConfig::None() { | 17 ChannelConfig ChannelConfig::None() { |
| 15 return ChannelConfig(); | 18 return ChannelConfig(); |
| 16 } | 19 } |
| 17 | 20 |
| 18 ChannelConfig::ChannelConfig() | 21 ChannelConfig::ChannelConfig() |
| 19 : transport(TRANSPORT_NONE), | 22 : transport(TRANSPORT_NONE), |
| 20 version(0), | 23 version(0), |
| 21 codec(CODEC_UNDEFINED) { | 24 codec(CODEC_UNDEFINED) { |
| 22 } | 25 } |
| 23 | 26 |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 return result.Pass(); | 167 return result.Pass(); |
| 165 } | 168 } |
| 166 | 169 |
| 167 // static | 170 // static |
| 168 scoped_ptr<CandidateSessionConfig> CandidateSessionConfig::CreateDefault() { | 171 scoped_ptr<CandidateSessionConfig> CandidateSessionConfig::CreateDefault() { |
| 169 scoped_ptr<CandidateSessionConfig> result = CreateEmpty(); | 172 scoped_ptr<CandidateSessionConfig> result = CreateEmpty(); |
| 170 | 173 |
| 171 // Control channel. | 174 // Control channel. |
| 172 result->mutable_control_configs()->push_back( | 175 result->mutable_control_configs()->push_back( |
| 173 ChannelConfig(ChannelConfig::TRANSPORT_MUX_STREAM, | 176 ChannelConfig(ChannelConfig::TRANSPORT_MUX_STREAM, |
| 177 kCapabilitiesControlStreamVersion, |
| 178 ChannelConfig::CODEC_UNDEFINED)); |
| 179 result->mutable_control_configs()->push_back( |
| 180 ChannelConfig(ChannelConfig::TRANSPORT_MUX_STREAM, |
| 174 kDefaultStreamVersion, | 181 kDefaultStreamVersion, |
| 175 ChannelConfig::CODEC_UNDEFINED)); | 182 ChannelConfig::CODEC_UNDEFINED)); |
| 176 result->mutable_control_configs()->push_back( | 183 result->mutable_control_configs()->push_back( |
| 177 ChannelConfig(ChannelConfig::TRANSPORT_STREAM, | 184 ChannelConfig(ChannelConfig::TRANSPORT_STREAM, |
| 178 kDefaultStreamVersion, | 185 kDefaultStreamVersion, |
| 179 ChannelConfig::CODEC_UNDEFINED)); | 186 ChannelConfig::CODEC_UNDEFINED)); |
| 180 | 187 |
| 181 // Event channel. | 188 // Event channel. |
| 182 result->mutable_event_configs()->push_back( | 189 result->mutable_event_configs()->push_back( |
| 183 ChannelConfig(ChannelConfig::TRANSPORT_MUX_STREAM, | 190 ChannelConfig(ChannelConfig::TRANSPORT_MUX_STREAM, |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 | 225 |
| 219 // static | 226 // static |
| 220 void CandidateSessionConfig::DisableAudioChannel( | 227 void CandidateSessionConfig::DisableAudioChannel( |
| 221 CandidateSessionConfig* config) { | 228 CandidateSessionConfig* config) { |
| 222 config->mutable_audio_configs()->clear(); | 229 config->mutable_audio_configs()->clear(); |
| 223 config->mutable_audio_configs()->push_back(ChannelConfig()); | 230 config->mutable_audio_configs()->push_back(ChannelConfig()); |
| 224 } | 231 } |
| 225 | 232 |
| 226 } // namespace protocol | 233 } // namespace protocol |
| 227 } // namespace remoting | 234 } // namespace remoting |
| OLD | NEW |