Chromium Code Reviews| Index: talk/app/webrtc/webrtcsession.cc |
| diff --git a/talk/app/webrtc/webrtcsession.cc b/talk/app/webrtc/webrtcsession.cc |
| index f73cf39806fc6f424ddb9f7ef47f53e3ce670330..c5fcc12d634a6823d5c7ba691562e18f9b9dec58 100644 |
| --- a/talk/app/webrtc/webrtcsession.cc |
| +++ b/talk/app/webrtc/webrtcsession.cc |
| @@ -551,16 +551,18 @@ WebRtcSession::~WebRtcSession() { |
| // voice_channel_. |
| if (video_channel_) { |
| SignalVideoChannelDestroyed(); |
| + media_controller_->set_video_channel(nullptr); |
|
pthatcher1
2015/09/02 21:24:22
Why is this necessary if media_controller_ is abou
the sun
2015/09/03 15:00:46
Part of LoadObserver discussion. Not strictly nece
|
| channel_manager_->DestroyVideoChannel(video_channel_.release()); |
| } |
| 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]; |
| } |
| @@ -765,6 +767,9 @@ bool WebRtcSession::Initialize( |
| cricket::PORTALLOCATOR_ENABLE_LOCALHOST_CANDIDATE); |
| } |
| + media_controller_.reset( |
| + new MediaController(worker_thread(), channel_manager_->media_engine())); |
| + |
| return true; |
| } |
| @@ -1675,6 +1680,7 @@ void WebRtcSession::RemoveUnusedChannelsAndTransports( |
| mediastream_signaling_->OnVideoChannelClose(); |
| SignalVideoChannelDestroyed(); |
| const std::string content_name = video_channel_->content_name(); |
| + media_controller_->set_video_channel(nullptr); |
| channel_manager_->DestroyVideoChannel(video_channel_.release()); |
| DestroyTransportProxy(content_name); |
| } |
| @@ -1685,8 +1691,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); |
| } |
| @@ -1701,7 +1706,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. |
| @@ -1760,8 +1765,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_->call(), audio_options_)); |
| if (!voice_channel_) { |
| return false; |
| } |
| @@ -1772,11 +1777,12 @@ 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_->call(), video_options_)); |
| if (!video_channel_) { |
| return false; |
| } |
| + media_controller_->set_video_channel(video_channel_.get()); |
| video_channel_->SignalDtlsSetupFailure.connect( |
| this, &WebRtcSession::OnDtlsSetupFailure); |