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..b1f748e10d0f7346a176c087ec2479e1363d5f23 100644 |
| --- a/talk/app/webrtc/webrtcsession.cc |
| +++ b/talk/app/webrtc/webrtcsession.cc |
| @@ -45,12 +45,14 @@ |
| #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" |
| #include "webrtc/base/stringencode.h" |
| #include "webrtc/base/stringutils.h" |
| #include "webrtc/p2p/base/portallocator.h" |
| +#include "webrtc/p2p/base/transportchannel.h" |
| using cricket::ContentInfo; |
| using cricket::ContentInfos; |
| @@ -63,6 +65,8 @@ using cricket::STUN_PORT_TYPE; |
| using cricket::RELAY_PORT_TYPE; |
| using cricket::PRFLX_PORT_TYPE; |
| +using rtc::Bind; |
| + |
| namespace webrtc { |
| // Error messages |
| @@ -536,12 +540,12 @@ class IceRestartAnswerLatch { |
| bool ice_restart_; |
| }; |
| -WebRtcSession::WebRtcSession( |
| - cricket::ChannelManager* channel_manager, |
| - rtc::Thread* signaling_thread, |
| - rtc::Thread* worker_thread, |
| - cricket::PortAllocator* port_allocator, |
| - MediaStreamSignaling* mediastream_signaling) |
| +WebRtcSession::WebRtcSession(cricket::ChannelManager* channel_manager, |
| + rtc::Thread* signaling_thread, |
| + rtc::Thread* worker_thread, |
| + cricket::PortAllocator* port_allocator, |
| + MediaStreamSignaling* mediastream_signaling, |
| + webrtc::CallFactory* call_factory) |
| : cricket::BaseSession(signaling_thread, |
| worker_thread, |
| port_allocator, |
| @@ -552,6 +556,7 @@ WebRtcSession::WebRtcSession( |
| // Due to this constraint session id |sid_| is max limited to LLONG_MAX. |
| channel_manager_(channel_manager), |
| mediastream_signaling_(mediastream_signaling), |
| + call_factory_(call_factory), |
| ice_observer_(NULL), |
| ice_connection_state_(PeerConnectionInterface::kIceConnectionNew), |
| ice_connection_receiving_(true), |
| @@ -777,7 +782,8 @@ bool WebRtcSession::Initialize( |
| } |
| media_controller_.reset(MediaControllerInterface::Create( |
| - worker_thread(), channel_manager_->media_engine()->GetVoE())); |
| + call_factory_, worker_thread(), |
| + channel_manager_->media_engine()->GetVoE())); |
|
pthatcher1
2015/10/09 20:57:48
The addition of the CallFactory is really just so
stefan-webrtc
2015/10/10 15:32:51
That might be an option, but after a quick look it
stefan-webrtc
2015/10/12 10:11:44
I checked this again today and it turned out not t
|
| return true; |
| } |
| @@ -1159,6 +1165,8 @@ bool WebRtcSession::EnableBundle(const cricket::ContentGroup& bundle) { |
| LOG(LS_WARNING) << "Failed to enable BUNDLE for " << ch->content_name(); |
| return false; |
| } |
| + ch->transport_channel()->SignalSentPacket.connect( |
| + this, &WebRtcSession::OnSentPacket); |
|
pthatcher1
2015/10/09 20:57:48
Actually, if you listen to all of the BaseChannels
stefan-webrtc
2015/10/10 15:32:51
Ah ok. I misunderstood you and thought that for in
|
| LOG(LS_INFO) << "Enabled BUNDLE for " << ch->content_name() << " on " |
| << transport_name << "."; |
| return true; |
| @@ -1827,6 +1835,8 @@ bool WebRtcSession::CreateVoiceChannel(const cricket::ContentInfo* content) { |
| voice_channel_->SignalDtlsSetupFailure.connect( |
| this, &WebRtcSession::OnDtlsSetupFailure); |
| + voice_channel_->transport_channel()->SignalSentPacket.connect( |
| + this, &WebRtcSession::OnSentPacket); |
| return true; |
| } |
| @@ -1840,6 +1850,8 @@ bool WebRtcSession::CreateVideoChannel(const cricket::ContentInfo* content) { |
| video_channel_->SignalDtlsSetupFailure.connect( |
| this, &WebRtcSession::OnDtlsSetupFailure); |
| + video_channel_->transport_channel()->SignalSentPacket.connect( |
| + this, &WebRtcSession::OnSentPacket); |
| return true; |
| } |
| @@ -1862,6 +1874,8 @@ bool WebRtcSession::CreateDataChannel(const cricket::ContentInfo* content) { |
| data_channel_->SignalDtlsSetupFailure.connect( |
| this, &WebRtcSession::OnDtlsSetupFailure); |
| + data_channel_->transport_channel()->SignalSentPacket.connect( |
| + this, &WebRtcSession::OnSentPacket); |
| return true; |
| } |
| @@ -2185,4 +2199,9 @@ void WebRtcSession::ReportNegotiatedCiphers( |
| } |
| } |
| +void WebRtcSession::OnSentPacket(cricket::TransportChannel* channel, |
| + const rtc::SentPacket& sent_packet) { |
| + media_controller_->call_w()->OnSentPacket(sent_packet); |
| +} |
| + |
| } // namespace webrtc |