Index: talk/app/webrtc/webrtcsession.cc |
diff --git a/talk/app/webrtc/webrtcsession.cc b/talk/app/webrtc/webrtcsession.cc |
index 082e21437b1376d3a3ab6d0b12b5811ca0bf2df7..9bec2f72cf4171294003058baa128d7c2224fccc 100644 |
--- a/talk/app/webrtc/webrtcsession.cc |
+++ b/talk/app/webrtc/webrtcsession.cc |
@@ -570,12 +570,13 @@ WebRtcSession::~WebRtcSession() { |
} |
if (voice_channel_) { |
SignalVoiceChannelDestroyed(); |
- channel_manager_->DestroyVoiceChannel(voice_channel_.release(), nullptr); |
+ channel_manager_->DestroyVoiceChannel(voice_channel_.release()); |
} |
if (data_channel_) { |
SignalDataChannelDestroyed(); |
channel_manager_->DestroyDataChannel(data_channel_.release()); |
} |
+ media_controller_.reset(nullptr); |
for (size_t i = 0; i < saved_candidates_.size(); ++i) { |
delete saved_candidates_[i]; |
} |
@@ -783,6 +784,9 @@ bool WebRtcSession::Initialize( |
cricket::PORTALLOCATOR_ENABLE_LOCALHOST_CANDIDATE); |
} |
+ media_controller_.reset( |
+ MediaController::Create(worker_thread(), |
+ channel_manager_->media_engine()->GetVoE())); |
return true; |
} |
@@ -1704,8 +1708,7 @@ void WebRtcSession::RemoveUnusedChannelsAndTransports( |
mediastream_signaling_->OnAudioChannelClose(); |
SignalVoiceChannelDestroyed(); |
const std::string content_name = voice_channel_->content_name(); |
- channel_manager_->DestroyVoiceChannel(voice_channel_.release(), |
- video_channel_.get()); |
+ channel_manager_->DestroyVoiceChannel(voice_channel_.release()); |
DestroyTransportProxy(content_name); |
} |
@@ -1720,7 +1723,7 @@ void WebRtcSession::RemoveUnusedChannelsAndTransports( |
} |
} |
-// TODO(mallinath) - Add a correct error code if the channels are not creatued |
+// TODO(mallinath) - Add a correct error code if the channels are not created |
// due to BUNDLE is enabled but rtcp-mux is disabled. |
bool WebRtcSession::CreateChannels(const SessionDescription* desc) { |
// Creating the media channels and transport proxies. |
@@ -1779,8 +1782,8 @@ bool WebRtcSession::CreateChannels(const SessionDescription* desc) { |
} |
bool WebRtcSession::CreateVoiceChannel(const cricket::ContentInfo* content) { |
- voice_channel_.reset(channel_manager_->CreateVoiceChannel( |
- this, content->name, true, audio_options_)); |
+ voice_channel_.reset(channel_manager_->CreateVoiceChannel(this, content->name, |
+ true, media_controller_.get(), audio_options_)); |
if (!voice_channel_) { |
return false; |
} |
@@ -1791,8 +1794,8 @@ bool WebRtcSession::CreateVoiceChannel(const cricket::ContentInfo* content) { |
} |
bool WebRtcSession::CreateVideoChannel(const cricket::ContentInfo* content) { |
- video_channel_.reset(channel_manager_->CreateVideoChannel( |
- this, content->name, true, video_options_, voice_channel_.get())); |
+ video_channel_.reset(channel_manager_->CreateVideoChannel(this, content->name, |
+ true, media_controller_.get(), video_options_)); |
if (!video_channel_) { |
return false; |
} |