| 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 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 result->event_config_ = candidate_config->event_configs().front(); | 142 result->event_config_ = candidate_config->event_configs().front(); |
| 143 result->video_config_ = candidate_config->video_configs().front(); | 143 result->video_config_ = candidate_config->video_configs().front(); |
| 144 result->audio_config_ = candidate_config->audio_configs().front(); | 144 result->audio_config_ = candidate_config->audio_configs().front(); |
| 145 | 145 |
| 146 return result; | 146 return result; |
| 147 } | 147 } |
| 148 | 148 |
| 149 // static | 149 // static |
| 150 std::unique_ptr<SessionConfig> SessionConfig::ForTest() { | 150 std::unique_ptr<SessionConfig> SessionConfig::ForTest() { |
| 151 std::unique_ptr<SessionConfig> result(new SessionConfig(Protocol::ICE)); | 151 std::unique_ptr<SessionConfig> result(new SessionConfig(Protocol::ICE)); |
| 152 result->control_config_ = ChannelConfig(ChannelConfig::TRANSPORT_MUX_STREAM, | 152 result->control_config_ = |
| 153 kControlStreamVersion, | 153 ChannelConfig(ChannelConfig::TRANSPORT_MUX_STREAM, kControlStreamVersion, |
| 154 ChannelConfig::CODEC_UNDEFINED); | 154 ChannelConfig::CODEC_UNDEFINED); |
| 155 result->event_config_ = ChannelConfig(ChannelConfig::TRANSPORT_MUX_STREAM, | 155 result->event_config_ = |
| 156 kDefaultStreamVersion, | 156 ChannelConfig(ChannelConfig::TRANSPORT_MUX_STREAM, kDefaultStreamVersion, |
| 157 ChannelConfig::CODEC_UNDEFINED); | 157 ChannelConfig::CODEC_UNDEFINED); |
| 158 result->video_config_ = ChannelConfig(ChannelConfig::TRANSPORT_STREAM, | 158 result->video_config_ = |
| 159 kDefaultStreamVersion, | 159 ChannelConfig(ChannelConfig::TRANSPORT_STREAM, kDefaultStreamVersion, |
| 160 ChannelConfig::CODEC_VP8); | 160 ChannelConfig::CODEC_VP8); |
| 161 result->audio_config_ = ChannelConfig(ChannelConfig::TRANSPORT_NONE, | 161 result->audio_config_ = |
| 162 kDefaultStreamVersion, | 162 ChannelConfig(ChannelConfig::TRANSPORT_MUX_STREAM, kDefaultStreamVersion, |
| 163 ChannelConfig::CODEC_UNDEFINED); | 163 ChannelConfig::CODEC_OPUS); |
| 164 return result; | 164 return result; |
| 165 } | 165 } |
| 166 | 166 |
| 167 std::unique_ptr<SessionConfig> SessionConfig::ForTestWithAudio() { | 167 std::unique_ptr<SessionConfig> SessionConfig::ForTestWithAudio() { |
| 168 std::unique_ptr<SessionConfig> result(ForTest()); | 168 std::unique_ptr<SessionConfig> result(ForTest()); |
| 169 result->audio_config_ = ChannelConfig(ChannelConfig::TRANSPORT_STREAM, | 169 result->audio_config_ = ChannelConfig(ChannelConfig::TRANSPORT_STREAM, |
| 170 kDefaultStreamVersion, | 170 kDefaultStreamVersion, |
| 171 ChannelConfig::CODEC_OPUS); | 171 ChannelConfig::CODEC_OPUS); |
| 172 return result; | 172 return result; |
| 173 } | 173 } |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 void CandidateSessionConfig::PreferTransport( | 306 void CandidateSessionConfig::PreferTransport( |
| 307 ChannelConfig::TransportType transport) { | 307 ChannelConfig::TransportType transport) { |
| 308 UpdateConfigListToPreferTransport(&control_configs_, transport); | 308 UpdateConfigListToPreferTransport(&control_configs_, transport); |
| 309 UpdateConfigListToPreferTransport(&event_configs_, transport); | 309 UpdateConfigListToPreferTransport(&event_configs_, transport); |
| 310 UpdateConfigListToPreferTransport(&video_configs_, transport); | 310 UpdateConfigListToPreferTransport(&video_configs_, transport); |
| 311 UpdateConfigListToPreferTransport(&audio_configs_, transport); | 311 UpdateConfigListToPreferTransport(&audio_configs_, transport); |
| 312 } | 312 } |
| 313 | 313 |
| 314 } // namespace protocol | 314 } // namespace protocol |
| 315 } // namespace remoting | 315 } // namespace remoting |
| OLD | NEW |