Index: webrtc/pc/channel.cc |
diff --git a/webrtc/pc/channel.cc b/webrtc/pc/channel.cc |
index 8e916f12793802f245313b3c088050b128961cdc..5c85ed4e26196ee06f87fb5b295588d102850a25 100644 |
--- a/webrtc/pc/channel.cc |
+++ b/webrtc/pc/channel.cc |
@@ -19,6 +19,7 @@ |
#include "webrtc/base/copyonwritebuffer.h" |
#include "webrtc/base/dscp.h" |
#include "webrtc/base/logging.h" |
+#include "webrtc/base/networkroute.h" |
#include "webrtc/base/trace_event.h" |
#include "webrtc/media/base/mediaconstants.h" |
#include "webrtc/media/base/rtputils.h" |
@@ -346,6 +347,8 @@ void BaseChannel::ConnectToTransportChannel(TransportChannel* tc) { |
tc->SignalReadPacket.connect(this, &BaseChannel::OnChannelRead); |
tc->SignalReadyToSend.connect(this, &BaseChannel::OnReadyToSend); |
tc->SignalDtlsState.connect(this, &BaseChannel::OnDtlsState); |
+ tc->SignalSelectedConnectionChanged.connect( |
+ this, &BaseChannel::OnSelectedConnectionChanged); |
} |
void BaseChannel::DisconnectFromTransportChannel(TransportChannel* tc) { |
@@ -504,6 +507,19 @@ void BaseChannel::OnDtlsState(TransportChannel* channel, |
} |
} |
+void BaseChannel::OnSelectedConnectionChanged(TransportChannel* channel, |
+ Connection* selected_connection) { |
+ ASSERT(channel == transport_channel_ || channel == rtcp_transport_channel_); |
+ NetworkRoute network_route; |
+ if (selected_connection) { |
+ network_route = |
+ NetworkRoute(selected_connection->local_candidate().network_id(), |
+ selected_connection->remote_candidate().network_id()); |
+ } |
+ media_channel()->OnNetworkRouteChanged(channel->transport_name(), |
+ network_route); |
pthatcher1
2016/03/28 16:18:48
Should we have a unit test for this part also?
honghaiz3
2016/03/29 01:03:03
Done.
|
+} |
+ |
void BaseChannel::SetReadyToSend(bool rtcp, bool ready) { |
if (rtcp) { |
rtcp_ready_to_send_ = ready; |