| 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 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 webrtc::MediaControllerInterface* media_controller, | 206 webrtc::MediaControllerInterface* media_controller, |
| 207 DtlsTransportInternal* rtp_transport, | 207 DtlsTransportInternal* rtp_transport, |
| 208 DtlsTransportInternal* rtcp_transport, | 208 DtlsTransportInternal* rtcp_transport, |
| 209 rtc::Thread* signaling_thread, | 209 rtc::Thread* signaling_thread, |
| 210 const std::string& content_name, | 210 const std::string& content_name, |
| 211 bool srtp_required, | 211 bool srtp_required, |
| 212 const AudioOptions& options) { | 212 const AudioOptions& options) { |
| 213 return worker_thread_->Invoke<VoiceChannel*>( | 213 return worker_thread_->Invoke<VoiceChannel*>( |
| 214 RTC_FROM_HERE, | 214 RTC_FROM_HERE, |
| 215 Bind(&ChannelManager::CreateVoiceChannel_w, this, media_controller, | 215 Bind(&ChannelManager::CreateVoiceChannel_w, this, media_controller, |
| 216 rtp_transport, rtcp_transport, signaling_thread, content_name, | 216 rtp_transport, rtcp_transport, rtp_transport, rtcp_transport, |
| 217 srtp_required, options)); | 217 signaling_thread, content_name, srtp_required, options)); |
| 218 } |
| 219 |
| 220 VoiceChannel* ChannelManager::CreateVoiceChannel( |
| 221 webrtc::MediaControllerInterface* media_controller, |
| 222 rtc::PacketTransportInternal* rtp_transport, |
| 223 rtc::PacketTransportInternal* rtcp_transport, |
| 224 rtc::Thread* signaling_thread, |
| 225 const std::string& content_name, |
| 226 bool srtp_required, |
| 227 const AudioOptions& options) { |
| 228 return worker_thread_->Invoke<VoiceChannel*>( |
| 229 RTC_FROM_HERE, |
| 230 Bind(&ChannelManager::CreateVoiceChannel_w, this, media_controller, |
| 231 nullptr, nullptr, rtp_transport, rtcp_transport, signaling_thread, |
| 232 content_name, srtp_required, options)); |
| 218 } | 233 } |
| 219 | 234 |
| 220 VoiceChannel* ChannelManager::CreateVoiceChannel_w( | 235 VoiceChannel* ChannelManager::CreateVoiceChannel_w( |
| 221 webrtc::MediaControllerInterface* media_controller, | 236 webrtc::MediaControllerInterface* media_controller, |
| 222 DtlsTransportInternal* rtp_transport, | 237 DtlsTransportInternal* rtp_dtls_transport, |
| 223 DtlsTransportInternal* rtcp_transport, | 238 DtlsTransportInternal* rtcp_dtls_transport, |
| 239 rtc::PacketTransportInternal* rtp_packet_transport, |
| 240 rtc::PacketTransportInternal* rtcp_packet_transport, |
| 224 rtc::Thread* signaling_thread, | 241 rtc::Thread* signaling_thread, |
| 225 const std::string& content_name, | 242 const std::string& content_name, |
| 226 bool srtp_required, | 243 bool srtp_required, |
| 227 const AudioOptions& options) { | 244 const AudioOptions& options) { |
| 228 RTC_DCHECK(initialized_); | 245 RTC_DCHECK(initialized_); |
| 229 RTC_DCHECK(worker_thread_ == rtc::Thread::Current()); | 246 RTC_DCHECK(worker_thread_ == rtc::Thread::Current()); |
| 230 RTC_DCHECK(nullptr != media_controller); | 247 RTC_DCHECK(nullptr != media_controller); |
| 231 | 248 |
| 232 VoiceMediaChannel* media_channel = media_engine_->CreateChannel( | 249 VoiceMediaChannel* media_channel = media_engine_->CreateChannel( |
| 233 media_controller->call_w(), media_controller->config(), options); | 250 media_controller->call_w(), media_controller->config(), options); |
| 234 if (!media_channel) | 251 if (!media_channel) |
| 235 return nullptr; | 252 return nullptr; |
| 236 | 253 |
| 237 VoiceChannel* voice_channel = new VoiceChannel( | 254 VoiceChannel* voice_channel = |
| 238 worker_thread_, network_thread_, signaling_thread, media_engine_.get(), | 255 new VoiceChannel(worker_thread_, network_thread_, signaling_thread, |
| 239 media_channel, content_name, rtcp_transport == nullptr, srtp_required); | 256 media_engine_.get(), media_channel, content_name, |
| 257 rtcp_packet_transport == nullptr, srtp_required); |
| 240 voice_channel->SetCryptoOptions(crypto_options_); | 258 voice_channel->SetCryptoOptions(crypto_options_); |
| 241 | 259 |
| 242 if (!voice_channel->Init_w(rtp_transport, rtcp_transport, rtp_transport, | 260 if (!voice_channel->Init_w(rtp_dtls_transport, rtcp_dtls_transport, |
| 243 rtcp_transport)) { | 261 rtp_packet_transport, rtcp_packet_transport)) { |
| 244 delete voice_channel; | 262 delete voice_channel; |
| 245 return nullptr; | 263 return nullptr; |
| 246 } | 264 } |
| 247 voice_channels_.push_back(voice_channel); | 265 voice_channels_.push_back(voice_channel); |
| 248 return voice_channel; | 266 return voice_channel; |
| 249 } | 267 } |
| 250 | 268 |
| 251 void ChannelManager::DestroyVoiceChannel(VoiceChannel* voice_channel) { | 269 void ChannelManager::DestroyVoiceChannel(VoiceChannel* voice_channel) { |
| 252 TRACE_EVENT0("webrtc", "ChannelManager::DestroyVoiceChannel"); | 270 TRACE_EVENT0("webrtc", "ChannelManager::DestroyVoiceChannel"); |
| 253 if (voice_channel) { | 271 if (voice_channel) { |
| (...skipping 21 matching lines...) Expand all Loading... |
| 275 webrtc::MediaControllerInterface* media_controller, | 293 webrtc::MediaControllerInterface* media_controller, |
| 276 DtlsTransportInternal* rtp_transport, | 294 DtlsTransportInternal* rtp_transport, |
| 277 DtlsTransportInternal* rtcp_transport, | 295 DtlsTransportInternal* rtcp_transport, |
| 278 rtc::Thread* signaling_thread, | 296 rtc::Thread* signaling_thread, |
| 279 const std::string& content_name, | 297 const std::string& content_name, |
| 280 bool srtp_required, | 298 bool srtp_required, |
| 281 const VideoOptions& options) { | 299 const VideoOptions& options) { |
| 282 return worker_thread_->Invoke<VideoChannel*>( | 300 return worker_thread_->Invoke<VideoChannel*>( |
| 283 RTC_FROM_HERE, | 301 RTC_FROM_HERE, |
| 284 Bind(&ChannelManager::CreateVideoChannel_w, this, media_controller, | 302 Bind(&ChannelManager::CreateVideoChannel_w, this, media_controller, |
| 285 rtp_transport, rtcp_transport, signaling_thread, content_name, | 303 rtp_transport, rtcp_transport, rtp_transport, rtcp_transport, |
| 286 srtp_required, options)); | 304 signaling_thread, content_name, srtp_required, options)); |
| 305 } |
| 306 |
| 307 VideoChannel* ChannelManager::CreateVideoChannel( |
| 308 webrtc::MediaControllerInterface* media_controller, |
| 309 rtc::PacketTransportInternal* rtp_transport, |
| 310 rtc::PacketTransportInternal* rtcp_transport, |
| 311 rtc::Thread* signaling_thread, |
| 312 const std::string& content_name, |
| 313 bool srtp_required, |
| 314 const VideoOptions& options) { |
| 315 return worker_thread_->Invoke<VideoChannel*>( |
| 316 RTC_FROM_HERE, |
| 317 Bind(&ChannelManager::CreateVideoChannel_w, this, media_controller, |
| 318 nullptr, nullptr, rtp_transport, rtcp_transport, signaling_thread, |
| 319 content_name, srtp_required, options)); |
| 287 } | 320 } |
| 288 | 321 |
| 289 VideoChannel* ChannelManager::CreateVideoChannel_w( | 322 VideoChannel* ChannelManager::CreateVideoChannel_w( |
| 290 webrtc::MediaControllerInterface* media_controller, | 323 webrtc::MediaControllerInterface* media_controller, |
| 291 DtlsTransportInternal* rtp_transport, | 324 DtlsTransportInternal* rtp_dtls_transport, |
| 292 DtlsTransportInternal* rtcp_transport, | 325 DtlsTransportInternal* rtcp_dtls_transport, |
| 326 rtc::PacketTransportInternal* rtp_packet_transport, |
| 327 rtc::PacketTransportInternal* rtcp_packet_transport, |
| 293 rtc::Thread* signaling_thread, | 328 rtc::Thread* signaling_thread, |
| 294 const std::string& content_name, | 329 const std::string& content_name, |
| 295 bool srtp_required, | 330 bool srtp_required, |
| 296 const VideoOptions& options) { | 331 const VideoOptions& options) { |
| 297 RTC_DCHECK(initialized_); | 332 RTC_DCHECK(initialized_); |
| 298 RTC_DCHECK(worker_thread_ == rtc::Thread::Current()); | 333 RTC_DCHECK(worker_thread_ == rtc::Thread::Current()); |
| 299 RTC_DCHECK(nullptr != media_controller); | 334 RTC_DCHECK(nullptr != media_controller); |
| 300 VideoMediaChannel* media_channel = media_engine_->CreateVideoChannel( | 335 VideoMediaChannel* media_channel = media_engine_->CreateVideoChannel( |
| 301 media_controller->call_w(), media_controller->config(), options); | 336 media_controller->call_w(), media_controller->config(), options); |
| 302 if (media_channel == NULL) { | 337 if (media_channel == NULL) { |
| 303 return NULL; | 338 return NULL; |
| 304 } | 339 } |
| 305 | 340 |
| 306 VideoChannel* video_channel = new VideoChannel( | 341 VideoChannel* video_channel = new VideoChannel( |
| 307 worker_thread_, network_thread_, signaling_thread, media_channel, | 342 worker_thread_, network_thread_, signaling_thread, media_channel, |
| 308 content_name, rtcp_transport == nullptr, srtp_required); | 343 content_name, rtcp_packet_transport == nullptr, srtp_required); |
| 309 video_channel->SetCryptoOptions(crypto_options_); | 344 video_channel->SetCryptoOptions(crypto_options_); |
| 310 if (!video_channel->Init_w(rtp_transport, rtcp_transport, rtp_transport, | 345 if (!video_channel->Init_w(rtp_dtls_transport, rtcp_dtls_transport, |
| 311 rtcp_transport)) { | 346 rtp_packet_transport, rtcp_packet_transport)) { |
| 312 delete video_channel; | 347 delete video_channel; |
| 313 return NULL; | 348 return NULL; |
| 314 } | 349 } |
| 315 video_channels_.push_back(video_channel); | 350 video_channels_.push_back(video_channel); |
| 316 return video_channel; | 351 return video_channel; |
| 317 } | 352 } |
| 318 | 353 |
| 319 void ChannelManager::DestroyVideoChannel(VideoChannel* video_channel) { | 354 void ChannelManager::DestroyVideoChannel(VideoChannel* video_channel) { |
| 320 TRACE_EVENT0("webrtc", "ChannelManager::DestroyVideoChannel"); | 355 TRACE_EVENT0("webrtc", "ChannelManager::DestroyVideoChannel"); |
| 321 if (video_channel) { | 356 if (video_channel) { |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 416 media_engine_.get(), file, max_size_bytes)); | 451 media_engine_.get(), file, max_size_bytes)); |
| 417 } | 452 } |
| 418 | 453 |
| 419 void ChannelManager::StopAecDump() { | 454 void ChannelManager::StopAecDump() { |
| 420 worker_thread_->Invoke<void>( | 455 worker_thread_->Invoke<void>( |
| 421 RTC_FROM_HERE, | 456 RTC_FROM_HERE, |
| 422 Bind(&MediaEngineInterface::StopAecDump, media_engine_.get())); | 457 Bind(&MediaEngineInterface::StopAecDump, media_engine_.get())); |
| 423 } | 458 } |
| 424 | 459 |
| 425 } // namespace cricket | 460 } // namespace cricket |
| OLD | NEW |