Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(74)

Side by Side Diff: webrtc/pc/channelmanager.cc

Issue 1528843005: Add support for GCM cipher suites from RFC 7714. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fix failing SRTP-but-no-DTLS tests. Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright 2004 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2004 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 // app. 92 // app.
93 if (!initialized_) { 93 if (!initialized_) {
94 enable_rtx_ = enable; 94 enable_rtx_ = enable;
95 return true; 95 return true;
96 } else { 96 } else {
97 LOG(LS_WARNING) << "Cannot toggle rtx after initialization!"; 97 LOG(LS_WARNING) << "Cannot toggle rtx after initialization!";
98 return false; 98 return false;
99 } 99 }
100 } 100 }
101 101
102 bool ChannelManager::SetCryptoOptions(
103 const rtc::CryptoOptions& crypto_options) {
104 crypto_options_ = crypto_options;
mattdr 2016/05/06 22:34:14 Maybe this should fail or log if there are active
joachim 2016/05/09 23:21:40 Done (added warning log and comment in header but
105 return true;
106 }
107
102 void ChannelManager::GetSupportedAudioCodecs( 108 void ChannelManager::GetSupportedAudioCodecs(
103 std::vector<AudioCodec>* codecs) const { 109 std::vector<AudioCodec>* codecs) const {
104 codecs->clear(); 110 codecs->clear();
105 111
106 for (std::vector<AudioCodec>::const_iterator it = 112 for (std::vector<AudioCodec>::const_iterator it =
107 media_engine_->audio_codecs().begin(); 113 media_engine_->audio_codecs().begin();
108 it != media_engine_->audio_codecs().end(); ++it) { 114 it != media_engine_->audio_codecs().end(); ++it) {
109 codecs->push_back(*it); 115 codecs->push_back(*it);
110 } 116 }
111 } 117 }
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 ASSERT(worker_thread_ == rtc::Thread::Current()); 229 ASSERT(worker_thread_ == rtc::Thread::Current());
224 ASSERT(nullptr != media_controller); 230 ASSERT(nullptr != media_controller);
225 VoiceMediaChannel* media_channel = media_engine_->CreateChannel( 231 VoiceMediaChannel* media_channel = media_engine_->CreateChannel(
226 media_controller->call_w(), media_controller->config(), options); 232 media_controller->call_w(), media_controller->config(), options);
227 if (!media_channel) 233 if (!media_channel)
228 return nullptr; 234 return nullptr;
229 235
230 VoiceChannel* voice_channel = 236 VoiceChannel* voice_channel =
231 new VoiceChannel(worker_thread_, media_engine_.get(), media_channel, 237 new VoiceChannel(worker_thread_, media_engine_.get(), media_channel,
232 transport_controller, content_name, rtcp); 238 transport_controller, content_name, rtcp);
239 voice_channel->SetCryptoOptions(crypto_options_);
233 if (!voice_channel->Init()) { 240 if (!voice_channel->Init()) {
234 delete voice_channel; 241 delete voice_channel;
235 return nullptr; 242 return nullptr;
236 } 243 }
237 voice_channels_.push_back(voice_channel); 244 voice_channels_.push_back(voice_channel);
238 return voice_channel; 245 return voice_channel;
239 } 246 }
240 247
241 void ChannelManager::DestroyVoiceChannel(VoiceChannel* voice_channel) { 248 void ChannelManager::DestroyVoiceChannel(VoiceChannel* voice_channel) {
242 TRACE_EVENT0("webrtc", "ChannelManager::DestroyVoiceChannel"); 249 TRACE_EVENT0("webrtc", "ChannelManager::DestroyVoiceChannel");
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 ASSERT(worker_thread_ == rtc::Thread::Current()); 288 ASSERT(worker_thread_ == rtc::Thread::Current());
282 ASSERT(nullptr != media_controller); 289 ASSERT(nullptr != media_controller);
283 VideoMediaChannel* media_channel = media_engine_->CreateVideoChannel( 290 VideoMediaChannel* media_channel = media_engine_->CreateVideoChannel(
284 media_controller->call_w(), media_controller->config(), options); 291 media_controller->call_w(), media_controller->config(), options);
285 if (media_channel == NULL) { 292 if (media_channel == NULL) {
286 return NULL; 293 return NULL;
287 } 294 }
288 295
289 VideoChannel* video_channel = new VideoChannel( 296 VideoChannel* video_channel = new VideoChannel(
290 worker_thread_, media_channel, transport_controller, content_name, rtcp); 297 worker_thread_, media_channel, transport_controller, content_name, rtcp);
298 video_channel->SetCryptoOptions(crypto_options_);
291 if (!video_channel->Init()) { 299 if (!video_channel->Init()) {
292 delete video_channel; 300 delete video_channel;
293 return NULL; 301 return NULL;
294 } 302 }
295 video_channels_.push_back(video_channel); 303 video_channels_.push_back(video_channel);
296 return video_channel; 304 return video_channel;
297 } 305 }
298 306
299 void ChannelManager::DestroyVideoChannel(VideoChannel* video_channel) { 307 void ChannelManager::DestroyVideoChannel(VideoChannel* video_channel) {
300 TRACE_EVENT0("webrtc", "ChannelManager::DestroyVideoChannel"); 308 TRACE_EVENT0("webrtc", "ChannelManager::DestroyVideoChannel");
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 DataMediaChannel* media_channel = data_media_engine_->CreateChannel( 347 DataMediaChannel* media_channel = data_media_engine_->CreateChannel(
340 data_channel_type); 348 data_channel_type);
341 if (!media_channel) { 349 if (!media_channel) {
342 LOG(LS_WARNING) << "Failed to create data channel of type " 350 LOG(LS_WARNING) << "Failed to create data channel of type "
343 << data_channel_type; 351 << data_channel_type;
344 return NULL; 352 return NULL;
345 } 353 }
346 354
347 DataChannel* data_channel = new DataChannel( 355 DataChannel* data_channel = new DataChannel(
348 worker_thread_, media_channel, transport_controller, content_name, rtcp); 356 worker_thread_, media_channel, transport_controller, content_name, rtcp);
357 data_channel->SetCryptoOptions(crypto_options_);
349 if (!data_channel->Init()) { 358 if (!data_channel->Init()) {
350 LOG(LS_WARNING) << "Failed to init data channel."; 359 LOG(LS_WARNING) << "Failed to init data channel.";
351 delete data_channel; 360 delete data_channel;
352 return NULL; 361 return NULL;
353 } 362 }
354 data_channels_.push_back(data_channel); 363 data_channels_.push_back(data_channel);
355 return data_channel; 364 return data_channel;
356 } 365 }
357 366
358 void ChannelManager::DestroyDataChannel(DataChannel* data_channel) { 367 void ChannelManager::DestroyDataChannel(DataChannel* data_channel) {
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 return worker_thread_->Invoke<bool>( 426 return worker_thread_->Invoke<bool>(
418 Bind(&MediaEngineInterface::StartRtcEventLog, media_engine_.get(), file)); 427 Bind(&MediaEngineInterface::StartRtcEventLog, media_engine_.get(), file));
419 } 428 }
420 429
421 void ChannelManager::StopRtcEventLog() { 430 void ChannelManager::StopRtcEventLog() {
422 worker_thread_->Invoke<void>( 431 worker_thread_->Invoke<void>(
423 Bind(&MediaEngineInterface::StopRtcEventLog, media_engine_.get())); 432 Bind(&MediaEngineInterface::StopRtcEventLog, media_engine_.get()));
424 } 433 }
425 434
426 } // namespace cricket 435 } // namespace cricket
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698