Index: talk/session/media/channelmanager.cc |
diff --git a/talk/session/media/channelmanager.cc b/talk/session/media/channelmanager.cc |
index f39e966e5158941188e32fa21ec115cfce37f377..8e0a4d1dd00b5d74d986c57f10f502cd6a020e13 100644 |
--- a/talk/session/media/channelmanager.cc |
+++ b/talk/session/media/channelmanager.cc |
@@ -308,7 +308,7 @@ void ChannelManager::Terminate_w() { |
DestroyVideoChannel_w(video_channels_.back()); |
} |
while (!voice_channels_.empty()) { |
- DestroyVoiceChannel_w(voice_channels_.back(), nullptr); |
+ DestroyVoiceChannel_w(voice_channels_.back()); |
} |
if (!SetCaptureDevice_w(NULL)) { |
LOG(LS_WARNING) << "failed to delete video capturer"; |
@@ -320,20 +320,23 @@ VoiceChannel* ChannelManager::CreateVoiceChannel( |
BaseSession* session, |
const std::string& content_name, |
bool rtcp, |
+ webrtc::Call* call, |
const AudioOptions& options) { |
return worker_thread_->Invoke<VoiceChannel*>( |
Bind(&ChannelManager::CreateVoiceChannel_w, this, session, content_name, |
- rtcp, options)); |
+ rtcp, call, options)); |
} |
VoiceChannel* ChannelManager::CreateVoiceChannel_w( |
BaseSession* session, |
const std::string& content_name, |
bool rtcp, |
+ webrtc::Call* call, |
const AudioOptions& options) { |
ASSERT(initialized_); |
ASSERT(worker_thread_ == rtc::Thread::Current()); |
- VoiceMediaChannel* media_channel = media_engine_->CreateChannel(options); |
+ VoiceMediaChannel* media_channel = |
+ media_engine_->CreateChannel(call, options); |
if (!media_channel) |
return nullptr; |
@@ -348,17 +351,14 @@ VoiceChannel* ChannelManager::CreateVoiceChannel_w( |
return voice_channel; |
} |
-void ChannelManager::DestroyVoiceChannel(VoiceChannel* voice_channel, |
- VideoChannel* video_channel) { |
+void ChannelManager::DestroyVoiceChannel(VoiceChannel* voice_channel) { |
if (voice_channel) { |
worker_thread_->Invoke<void>( |
- Bind(&ChannelManager::DestroyVoiceChannel_w, this, voice_channel, |
- video_channel)); |
+ Bind(&ChannelManager::DestroyVoiceChannel_w, this, voice_channel)); |
} |
} |
-void ChannelManager::DestroyVoiceChannel_w(VoiceChannel* voice_channel, |
- VideoChannel* video_channel) { |
+void ChannelManager::DestroyVoiceChannel_w(VoiceChannel* voice_channel) { |
// Destroy voice channel. |
ASSERT(initialized_); |
ASSERT(worker_thread_ == rtc::Thread::Current()); |
@@ -367,10 +367,6 @@ void ChannelManager::DestroyVoiceChannel_w(VoiceChannel* voice_channel, |
ASSERT(it != voice_channels_.end()); |
if (it == voice_channels_.end()) |
return; |
- |
- if (video_channel) { |
- video_channel->media_channel()->DetachVoiceChannel(); |
- } |
voice_channels_.erase(it); |
delete voice_channel; |
} |
@@ -379,45 +375,28 @@ VideoChannel* ChannelManager::CreateVideoChannel( |
BaseSession* session, |
const std::string& content_name, |
bool rtcp, |
- VoiceChannel* voice_channel) { |
- return worker_thread_->Invoke<VideoChannel*>( |
- Bind(&ChannelManager::CreateVideoChannel_w, |
- this, |
- session, |
- content_name, |
- rtcp, |
- VideoOptions(), |
- voice_channel)); |
-} |
- |
-VideoChannel* ChannelManager::CreateVideoChannel( |
- BaseSession* session, |
- const std::string& content_name, |
- bool rtcp, |
- const VideoOptions& options, |
- VoiceChannel* voice_channel) { |
+ webrtc::Call* call, |
+ const VideoOptions& options) { |
return worker_thread_->Invoke<VideoChannel*>( |
Bind(&ChannelManager::CreateVideoChannel_w, |
this, |
session, |
content_name, |
rtcp, |
- options, |
- voice_channel)); |
+ call, |
+ options)); |
} |
VideoChannel* ChannelManager::CreateVideoChannel_w( |
BaseSession* session, |
const std::string& content_name, |
bool rtcp, |
- const VideoOptions& options, |
- VoiceChannel* voice_channel) { |
+ webrtc::Call* call, |
+ const VideoOptions& options) { |
ASSERT(initialized_); |
ASSERT(worker_thread_ == rtc::Thread::Current()); |
VideoMediaChannel* media_channel = |
- // voice_channel can be NULL in case of NullVoiceEngine. |
- media_engine_->CreateVideoChannel( |
- options, voice_channel ? voice_channel->media_channel() : NULL); |
+ media_engine_->CreateVideoChannel(call, options); |
if (media_channel == NULL) |
return NULL; |