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

Side by Side Diff: talk/session/media/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: Rebased Created 4 years, 10 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 * libjingle 2 * libjingle
3 * Copyright 2004 Google Inc. 3 * Copyright 2004 Google Inc.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met: 6 * modification, are permitted provided that the following conditions are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright notice, 8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer. 9 * this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright notice, 10 * 2. Redistributions in binary form must reproduce the above copyright notice,
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 // app. 135 // app.
136 if (!initialized_) { 136 if (!initialized_) {
137 enable_rtx_ = enable; 137 enable_rtx_ = enable;
138 return true; 138 return true;
139 } else { 139 } else {
140 LOG(LS_WARNING) << "Cannot toggle rtx after initialization!"; 140 LOG(LS_WARNING) << "Cannot toggle rtx after initialization!";
141 return false; 141 return false;
142 } 142 }
143 } 143 }
144 144
145 bool ChannelManager::SetCryptoOptions(
146 const rtc::CryptoOptions& crypto_options) {
147 crypto_options_ = crypto_options;
148 return true;
149 }
150
145 void ChannelManager::GetSupportedAudioCodecs( 151 void ChannelManager::GetSupportedAudioCodecs(
146 std::vector<AudioCodec>* codecs) const { 152 std::vector<AudioCodec>* codecs) const {
147 codecs->clear(); 153 codecs->clear();
148 154
149 for (std::vector<AudioCodec>::const_iterator it = 155 for (std::vector<AudioCodec>::const_iterator it =
150 media_engine_->audio_codecs().begin(); 156 media_engine_->audio_codecs().begin();
151 it != media_engine_->audio_codecs().end(); ++it) { 157 it != media_engine_->audio_codecs().end(); ++it) {
152 codecs->push_back(*it); 158 codecs->push_back(*it);
153 } 159 }
154 } 160 }
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 ASSERT(worker_thread_ == rtc::Thread::Current()); 274 ASSERT(worker_thread_ == rtc::Thread::Current());
269 ASSERT(nullptr != media_controller); 275 ASSERT(nullptr != media_controller);
270 VoiceMediaChannel* media_channel = 276 VoiceMediaChannel* media_channel =
271 media_engine_->CreateChannel(media_controller->call_w(), options); 277 media_engine_->CreateChannel(media_controller->call_w(), options);
272 if (!media_channel) 278 if (!media_channel)
273 return nullptr; 279 return nullptr;
274 280
275 VoiceChannel* voice_channel = 281 VoiceChannel* voice_channel =
276 new VoiceChannel(worker_thread_, media_engine_.get(), media_channel, 282 new VoiceChannel(worker_thread_, media_engine_.get(), media_channel,
277 transport_controller, content_name, rtcp); 283 transport_controller, content_name, rtcp);
284 voice_channel->SetCryptoOptions(crypto_options_);
278 if (!voice_channel->Init()) { 285 if (!voice_channel->Init()) {
279 delete voice_channel; 286 delete voice_channel;
280 return nullptr; 287 return nullptr;
281 } 288 }
282 voice_channels_.push_back(voice_channel); 289 voice_channels_.push_back(voice_channel);
283 return voice_channel; 290 return voice_channel;
284 } 291 }
285 292
286 void ChannelManager::DestroyVoiceChannel(VoiceChannel* voice_channel) { 293 void ChannelManager::DestroyVoiceChannel(VoiceChannel* voice_channel) {
287 TRACE_EVENT0("webrtc", "ChannelManager::DestroyVoiceChannel"); 294 TRACE_EVENT0("webrtc", "ChannelManager::DestroyVoiceChannel");
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 ASSERT(worker_thread_ == rtc::Thread::Current()); 333 ASSERT(worker_thread_ == rtc::Thread::Current());
327 ASSERT(nullptr != media_controller); 334 ASSERT(nullptr != media_controller);
328 VideoMediaChannel* media_channel = 335 VideoMediaChannel* media_channel =
329 media_engine_->CreateVideoChannel(media_controller->call_w(), options); 336 media_engine_->CreateVideoChannel(media_controller->call_w(), options);
330 if (media_channel == NULL) { 337 if (media_channel == NULL) {
331 return NULL; 338 return NULL;
332 } 339 }
333 340
334 VideoChannel* video_channel = new VideoChannel( 341 VideoChannel* video_channel = new VideoChannel(
335 worker_thread_, media_channel, transport_controller, content_name, rtcp); 342 worker_thread_, media_channel, transport_controller, content_name, rtcp);
343 video_channel->SetCryptoOptions(crypto_options_);
336 if (!video_channel->Init()) { 344 if (!video_channel->Init()) {
337 delete video_channel; 345 delete video_channel;
338 return NULL; 346 return NULL;
339 } 347 }
340 video_channels_.push_back(video_channel); 348 video_channels_.push_back(video_channel);
341 return video_channel; 349 return video_channel;
342 } 350 }
343 351
344 void ChannelManager::DestroyVideoChannel(VideoChannel* video_channel) { 352 void ChannelManager::DestroyVideoChannel(VideoChannel* video_channel) {
345 TRACE_EVENT0("webrtc", "ChannelManager::DestroyVideoChannel"); 353 TRACE_EVENT0("webrtc", "ChannelManager::DestroyVideoChannel");
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 DataMediaChannel* media_channel = data_media_engine_->CreateChannel( 392 DataMediaChannel* media_channel = data_media_engine_->CreateChannel(
385 data_channel_type); 393 data_channel_type);
386 if (!media_channel) { 394 if (!media_channel) {
387 LOG(LS_WARNING) << "Failed to create data channel of type " 395 LOG(LS_WARNING) << "Failed to create data channel of type "
388 << data_channel_type; 396 << data_channel_type;
389 return NULL; 397 return NULL;
390 } 398 }
391 399
392 DataChannel* data_channel = new DataChannel( 400 DataChannel* data_channel = new DataChannel(
393 worker_thread_, media_channel, transport_controller, content_name, rtcp); 401 worker_thread_, media_channel, transport_controller, content_name, rtcp);
402 data_channel->SetCryptoOptions(crypto_options_);
394 if (!data_channel->Init()) { 403 if (!data_channel->Init()) {
395 LOG(LS_WARNING) << "Failed to init data channel."; 404 LOG(LS_WARNING) << "Failed to init data channel.";
396 delete data_channel; 405 delete data_channel;
397 return NULL; 406 return NULL;
398 } 407 }
399 data_channels_.push_back(data_channel); 408 data_channels_.push_back(data_channel);
400 return data_channel; 409 return data_channel;
401 } 410 }
402 411
403 void ChannelManager::DestroyDataChannel(DataChannel* data_channel) { 412 void ChannelManager::DestroyDataChannel(DataChannel* data_channel) {
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
566 return worker_thread_->Invoke<bool>( 575 return worker_thread_->Invoke<bool>(
567 Bind(&MediaEngineInterface::StartRtcEventLog, media_engine_.get(), file)); 576 Bind(&MediaEngineInterface::StartRtcEventLog, media_engine_.get(), file));
568 } 577 }
569 578
570 void ChannelManager::StopRtcEventLog() { 579 void ChannelManager::StopRtcEventLog() {
571 worker_thread_->Invoke<void>( 580 worker_thread_->Invoke<void>(
572 Bind(&MediaEngineInterface::StopRtcEventLog, media_engine_.get())); 581 Bind(&MediaEngineInterface::StopRtcEventLog, media_engine_.get()));
573 } 582 }
574 583
575 } // namespace cricket 584 } // namespace cricket
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698