| OLD | NEW |
| 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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 // app. | 81 // app. |
| 82 if (!initialized_) { | 82 if (!initialized_) { |
| 83 enable_rtx_ = enable; | 83 enable_rtx_ = enable; |
| 84 return true; | 84 return true; |
| 85 } else { | 85 } else { |
| 86 LOG(LS_WARNING) << "Cannot toggle rtx after initialization!"; | 86 LOG(LS_WARNING) << "Cannot toggle rtx after initialization!"; |
| 87 return false; | 87 return false; |
| 88 } | 88 } |
| 89 } | 89 } |
| 90 | 90 |
| 91 bool ChannelManager::SetCryptoOptions( | |
| 92 const rtc::CryptoOptions& crypto_options) { | |
| 93 return worker_thread_->Invoke<bool>(RTC_FROM_HERE, Bind( | |
| 94 &ChannelManager::SetCryptoOptions_w, this, crypto_options)); | |
| 95 } | |
| 96 | |
| 97 bool ChannelManager::SetCryptoOptions_w( | |
| 98 const rtc::CryptoOptions& crypto_options) { | |
| 99 if (!video_channels_.empty() || !voice_channels_.empty() || | |
| 100 !data_channels_.empty()) { | |
| 101 LOG(LS_WARNING) << "Not changing crypto options in existing channels."; | |
| 102 } | |
| 103 crypto_options_ = crypto_options; | |
| 104 return true; | |
| 105 } | |
| 106 | |
| 107 void ChannelManager::GetSupportedAudioSendCodecs( | 91 void ChannelManager::GetSupportedAudioSendCodecs( |
| 108 std::vector<AudioCodec>* codecs) const { | 92 std::vector<AudioCodec>* codecs) const { |
| 109 *codecs = media_engine_->audio_send_codecs(); | 93 *codecs = media_engine_->audio_send_codecs(); |
| 110 } | 94 } |
| 111 | 95 |
| 112 void ChannelManager::GetSupportedAudioReceiveCodecs( | 96 void ChannelManager::GetSupportedAudioReceiveCodecs( |
| 113 std::vector<AudioCodec>* codecs) const { | 97 std::vector<AudioCodec>* codecs) const { |
| 114 *codecs = media_engine_->audio_recv_codecs(); | 98 *codecs = media_engine_->audio_recv_codecs(); |
| 115 } | 99 } |
| 116 | 100 |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 | 224 |
| 241 VoiceMediaChannel* media_channel = media_engine_->CreateChannel( | 225 VoiceMediaChannel* media_channel = media_engine_->CreateChannel( |
| 242 media_controller->call_w(), media_controller->config(), options); | 226 media_controller->call_w(), media_controller->config(), options); |
| 243 if (!media_channel) | 227 if (!media_channel) |
| 244 return nullptr; | 228 return nullptr; |
| 245 | 229 |
| 246 VoiceChannel* voice_channel = | 230 VoiceChannel* voice_channel = |
| 247 new VoiceChannel(worker_thread_, network_thread_, signaling_thread, | 231 new VoiceChannel(worker_thread_, network_thread_, signaling_thread, |
| 248 media_engine_.get(), media_channel, content_name, | 232 media_engine_.get(), media_channel, content_name, |
| 249 rtcp_packet_transport == nullptr, srtp_required); | 233 rtcp_packet_transport == nullptr, srtp_required); |
| 250 voice_channel->SetCryptoOptions(crypto_options_); | |
| 251 | 234 |
| 252 if (!voice_channel->Init_w(rtp_dtls_transport, rtcp_dtls_transport, | 235 if (!voice_channel->Init_w(rtp_dtls_transport, rtcp_dtls_transport, |
| 253 rtp_packet_transport, rtcp_packet_transport)) { | 236 rtp_packet_transport, rtcp_packet_transport)) { |
| 254 delete voice_channel; | 237 delete voice_channel; |
| 255 return nullptr; | 238 return nullptr; |
| 256 } | 239 } |
| 257 voice_channels_.push_back(voice_channel); | 240 voice_channels_.push_back(voice_channel); |
| 258 return voice_channel; | 241 return voice_channel; |
| 259 } | 242 } |
| 260 | 243 |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 RTC_DCHECK(nullptr != media_controller); | 309 RTC_DCHECK(nullptr != media_controller); |
| 327 VideoMediaChannel* media_channel = media_engine_->CreateVideoChannel( | 310 VideoMediaChannel* media_channel = media_engine_->CreateVideoChannel( |
| 328 media_controller->call_w(), media_controller->config(), options); | 311 media_controller->call_w(), media_controller->config(), options); |
| 329 if (media_channel == NULL) { | 312 if (media_channel == NULL) { |
| 330 return NULL; | 313 return NULL; |
| 331 } | 314 } |
| 332 | 315 |
| 333 VideoChannel* video_channel = new VideoChannel( | 316 VideoChannel* video_channel = new VideoChannel( |
| 334 worker_thread_, network_thread_, signaling_thread, media_channel, | 317 worker_thread_, network_thread_, signaling_thread, media_channel, |
| 335 content_name, rtcp_packet_transport == nullptr, srtp_required); | 318 content_name, rtcp_packet_transport == nullptr, srtp_required); |
| 336 video_channel->SetCryptoOptions(crypto_options_); | |
| 337 if (!video_channel->Init_w(rtp_dtls_transport, rtcp_dtls_transport, | 319 if (!video_channel->Init_w(rtp_dtls_transport, rtcp_dtls_transport, |
| 338 rtp_packet_transport, rtcp_packet_transport)) { | 320 rtp_packet_transport, rtcp_packet_transport)) { |
| 339 delete video_channel; | 321 delete video_channel; |
| 340 return NULL; | 322 return NULL; |
| 341 } | 323 } |
| 342 video_channels_.push_back(video_channel); | 324 video_channels_.push_back(video_channel); |
| 343 return video_channel; | 325 return video_channel; |
| 344 } | 326 } |
| 345 | 327 |
| 346 void ChannelManager::DestroyVideoChannel(VideoChannel* video_channel) { | 328 void ChannelManager::DestroyVideoChannel(VideoChannel* video_channel) { |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 395 } | 377 } |
| 396 DataMediaChannel* media_channel = data_media_engine_->CreateChannel(config); | 378 DataMediaChannel* media_channel = data_media_engine_->CreateChannel(config); |
| 397 if (!media_channel) { | 379 if (!media_channel) { |
| 398 LOG(LS_WARNING) << "Failed to create RTP data channel."; | 380 LOG(LS_WARNING) << "Failed to create RTP data channel."; |
| 399 return nullptr; | 381 return nullptr; |
| 400 } | 382 } |
| 401 | 383 |
| 402 RtpDataChannel* data_channel = new RtpDataChannel( | 384 RtpDataChannel* data_channel = new RtpDataChannel( |
| 403 worker_thread_, network_thread_, signaling_thread, media_channel, | 385 worker_thread_, network_thread_, signaling_thread, media_channel, |
| 404 content_name, rtcp_transport == nullptr, srtp_required); | 386 content_name, rtcp_transport == nullptr, srtp_required); |
| 405 data_channel->SetCryptoOptions(crypto_options_); | |
| 406 if (!data_channel->Init_w(rtp_transport, rtcp_transport, rtp_transport, | 387 if (!data_channel->Init_w(rtp_transport, rtcp_transport, rtp_transport, |
| 407 rtcp_transport)) { | 388 rtcp_transport)) { |
| 408 LOG(LS_WARNING) << "Failed to init data channel."; | 389 LOG(LS_WARNING) << "Failed to init data channel."; |
| 409 delete data_channel; | 390 delete data_channel; |
| 410 return nullptr; | 391 return nullptr; |
| 411 } | 392 } |
| 412 data_channels_.push_back(data_channel); | 393 data_channels_.push_back(data_channel); |
| 413 return data_channel; | 394 return data_channel; |
| 414 } | 395 } |
| 415 | 396 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 443 media_engine_.get(), file, max_size_bytes)); | 424 media_engine_.get(), file, max_size_bytes)); |
| 444 } | 425 } |
| 445 | 426 |
| 446 void ChannelManager::StopAecDump() { | 427 void ChannelManager::StopAecDump() { |
| 447 worker_thread_->Invoke<void>( | 428 worker_thread_->Invoke<void>( |
| 448 RTC_FROM_HERE, | 429 RTC_FROM_HERE, |
| 449 Bind(&MediaEngineInterface::StopAecDump, media_engine_.get())); | 430 Bind(&MediaEngineInterface::StopAecDump, media_engine_.get())); |
| 450 } | 431 } |
| 451 | 432 |
| 452 } // namespace cricket | 433 } // namespace cricket |
| OLD | NEW |