Chromium Code Reviews| Index: talk/app/webrtc/webrtcsession.cc |
| diff --git a/talk/app/webrtc/webrtcsession.cc b/talk/app/webrtc/webrtcsession.cc |
| index 2ab9a1e6969599983724f9ffdce7aebb91b5d418..83025b0cbd5478340f23f41eb451ed4962a00084 100644 |
| --- a/talk/app/webrtc/webrtcsession.cc |
| +++ b/talk/app/webrtc/webrtcsession.cc |
| @@ -45,6 +45,7 @@ |
| #include "talk/session/media/channelmanager.h" |
| #include "talk/session/media/mediasession.h" |
| #include "webrtc/base/basictypes.h" |
| +#include "webrtc/base/bind.h" |
| #include "webrtc/base/checks.h" |
| #include "webrtc/base/helpers.h" |
| #include "webrtc/base/logging.h" |
| @@ -63,6 +64,8 @@ using cricket::STUN_PORT_TYPE; |
| using cricket::RELAY_PORT_TYPE; |
| using cricket::PRFLX_PORT_TYPE; |
| +using rtc::Bind; |
| + |
| namespace webrtc { |
| // Error messages |
| @@ -1764,19 +1767,23 @@ void WebRtcSession::RemoveUnusedChannels(const SessionDescription* desc) { |
| bool WebRtcSession::CreateChannels(const SessionDescription* desc) { |
| // Creating the media channels and transport proxies. |
| const cricket::ContentInfo* voice = cricket::GetFirstAudioContent(desc); |
| + bool voice_channel_created = false; |
| if (voice && !voice->rejected && !voice_channel_) { |
| if (!CreateVoiceChannel(voice)) { |
| LOG(LS_ERROR) << "Failed to create voice channel."; |
| return false; |
| } |
| + voice_channel_created = true; |
| } |
| const cricket::ContentInfo* video = cricket::GetFirstVideoContent(desc); |
| + bool video_channel_created = false; |
| if (video && !video->rejected && !video_channel_) { |
| if (!CreateVideoChannel(video)) { |
| LOG(LS_ERROR) << "Failed to create video channel."; |
| return false; |
| } |
| + video_channel_created = true; |
| } |
| const cricket::ContentInfo* data = cricket::GetFirstDataContent(desc); |
| @@ -1814,6 +1821,17 @@ bool WebRtcSession::CreateChannels(const SessionDescription* desc) { |
| } |
| } |
| + if (voice_channel_created) { |
|
pthatcher1
2015/10/08 20:27:55
It's not necessary to put this after the bundle co
stefan-webrtc
2015/10/09 14:18:44
Right, makes sense.
I didn't figure out a good wa
|
| + worker_thread()->Invoke<void>( |
| + Bind(&MediaControllerInterface::ConnectToSignalSentPacket_w, |
| + media_controller_.get(), voice_channel_->transport_channel())); |
| + } |
| + if (video_channel_created) { |
| + worker_thread()->Invoke<void>( |
| + Bind(&MediaControllerInterface::ConnectToSignalSentPacket_w, |
| + media_controller_.get(), video_channel_->transport_channel())); |
| + } |
| + |
| return true; |
| } |