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 { |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 // Event channel. | 188 // Event channel. |
189 result->mutable_event_configs()->push_back( | 189 result->mutable_event_configs()->push_back( |
190 ChannelConfig(ChannelConfig::TRANSPORT_MUX_STREAM, | 190 ChannelConfig(ChannelConfig::TRANSPORT_MUX_STREAM, |
191 kDefaultStreamVersion, | 191 kDefaultStreamVersion, |
192 ChannelConfig::CODEC_UNDEFINED)); | 192 ChannelConfig::CODEC_UNDEFINED)); |
193 | 193 |
194 // Video channel. | 194 // Video channel. |
195 result->mutable_video_configs()->push_back( | 195 result->mutable_video_configs()->push_back( |
196 ChannelConfig(ChannelConfig::TRANSPORT_STREAM, | 196 ChannelConfig(ChannelConfig::TRANSPORT_STREAM, |
197 kDefaultStreamVersion, | 197 kDefaultStreamVersion, |
| 198 ChannelConfig::CODEC_VP9)); |
| 199 result->mutable_video_configs()->push_back( |
| 200 ChannelConfig(ChannelConfig::TRANSPORT_STREAM, |
| 201 kDefaultStreamVersion, |
198 ChannelConfig::CODEC_VP8)); | 202 ChannelConfig::CODEC_VP8)); |
199 | 203 |
200 // Audio channel. | 204 // Audio channel. |
201 result->mutable_audio_configs()->push_back( | 205 result->mutable_audio_configs()->push_back( |
202 ChannelConfig(ChannelConfig::TRANSPORT_MUX_STREAM, | 206 ChannelConfig(ChannelConfig::TRANSPORT_MUX_STREAM, |
203 kDefaultStreamVersion, | 207 kDefaultStreamVersion, |
204 ChannelConfig::CODEC_OPUS)); | 208 ChannelConfig::CODEC_OPUS)); |
205 result->mutable_audio_configs()->push_back(ChannelConfig::None()); | 209 result->mutable_audio_configs()->push_back(ChannelConfig::None()); |
206 | 210 |
207 return result.Pass(); | 211 return result.Pass(); |
208 } | 212 } |
209 | 213 |
210 // static | 214 // static |
211 void CandidateSessionConfig::DisableAudioChannel( | 215 void CandidateSessionConfig::DisableAudioChannel( |
212 CandidateSessionConfig* config) { | 216 CandidateSessionConfig* config) { |
213 config->mutable_audio_configs()->clear(); | 217 config->mutable_audio_configs()->clear(); |
214 config->mutable_audio_configs()->push_back(ChannelConfig()); | 218 config->mutable_audio_configs()->push_back(ChannelConfig()); |
215 } | 219 } |
216 | 220 |
| 221 // static |
| 222 void CandidateSessionConfig::DisableVideoCodec( |
| 223 CandidateSessionConfig* config, |
| 224 ChannelConfig::Codec codec) { |
| 225 std ::vector<ChannelConfig>::iterator i; |
| 226 for (i = config->mutable_video_configs()->begin(); |
| 227 i != config->mutable_video_configs()->end();) { |
| 228 if (i->codec == codec) { |
| 229 i = config->mutable_video_configs()->erase(i); |
| 230 } else { |
| 231 ++i; |
| 232 } |
| 233 } |
| 234 } |
| 235 |
217 } // namespace protocol | 236 } // namespace protocol |
218 } // namespace remoting | 237 } // namespace remoting |
OLD | NEW |