Index: webrtc/pc/channel.h |
diff --git a/webrtc/pc/channel.h b/webrtc/pc/channel.h |
index c7749a97156e2165a18a22d8217d199b28d580b9..946059b2457b4860938bfaa946b24b2ee063bd0d 100644 |
--- a/webrtc/pc/channel.h |
+++ b/webrtc/pc/channel.h |
@@ -86,8 +86,8 @@ class BaseChannel |
bool rtcp_mux_required, |
bool srtp_required); |
virtual ~BaseChannel(); |
- bool Init_w(TransportChannel* rtp_transport, |
- TransportChannel* rtcp_transport); |
+ bool Init_w(DtlsTransportInternal* rtp_dtls_transport, |
+ DtlsTransportInternal* rtcp_dtls_transport); |
// Deinit may be called multiple times and is simply ignored if it's already |
// done. |
void Deinit(); |
@@ -107,8 +107,8 @@ class BaseChannel |
bool writable() const { return writable_; } |
- bool SetTransport(TransportChannel* rtp_transport, |
- TransportChannel* rtcp_transport); |
+ bool SetTransports(DtlsTransportInternal* rtp_dtls_transport, |
+ DtlsTransportInternal* rtcp_dtls_transport); |
bool PushdownLocalDescription(const SessionDescription* local_desc, |
ContentAction action, |
std::string* error_desc); |
@@ -153,7 +153,7 @@ class BaseChannel |
// Used for latency measurements. |
sigslot::signal1<BaseChannel*> SignalFirstPacketReceived; |
- // Forward TransportChannel SignalSentPacket to worker thread. |
+ // Forward SignalSentPacket to worker thread. |
sigslot::signal1<const rtc::SentPacket&> SignalSentPacket; |
// Emitted whenever rtcp-mux is fully negotiated and the rtcp-transport can |
@@ -161,8 +161,13 @@ class BaseChannel |
// Fired on the network thread. |
sigslot::signal1<const std::string&> SignalRtcpMuxFullyActive; |
- TransportChannel* rtp_transport() const { return rtp_transport_; } |
- TransportChannel* rtcp_transport() const { return rtcp_transport_; } |
+ // Only public for unit tests. Otherwise, consider private. |
+ DtlsTransportInternal* rtp_dtls_transport() const { |
+ return rtp_dtls_transport_; |
+ } |
+ DtlsTransportInternal* rtcp_dtls_transport() const { |
+ return rtcp_dtls_transport_; |
+ } |
bool NeedsRtcpTransport(); |
@@ -194,15 +199,15 @@ class BaseChannel |
protected: |
virtual MediaChannel* media_channel() const { return media_channel_; } |
- // Sets the |rtp_transport_| (and |rtcp_transport_|, if |
+ // Sets the |rtp_dtls_transport_| (and |rtcp_dtls_transport_|, if |
// |rtcp_enabled_| is true). |
// This method also updates writability and "ready-to-send" state. |
- bool SetTransport_n(TransportChannel* rtp_transport, |
- TransportChannel* rtcp_transport); |
+ bool SetTransports_n(DtlsTransportInternal* rtp_dtls_transport, |
+ DtlsTransportInternal* rtcp_dtls_transport); |
// This does not update writability or "ready-to-send" state; it just |
// disconnects from the old channel and connects to the new one. |
- void SetTransportChannel_n(bool rtcp, TransportChannel* new_transport); |
+ void SetTransport_n(bool rtcp, DtlsTransportInternal* new_transport); |
bool was_ever_writable() const { return was_ever_writable_; } |
void set_local_content_direction(MediaContentDirection direction) { |
@@ -225,8 +230,8 @@ class BaseChannel |
bool IsReadyToSendMedia_w() const; |
rtc::Thread* signaling_thread() { return signaling_thread_; } |
- void ConnectToTransportChannel(TransportChannel* tc); |
- void DisconnectFromTransportChannel(TransportChannel* tc); |
+ void ConnectToTransport(DtlsTransportInternal* transport); |
+ void DisconnectFromTransport(DtlsTransportInternal* transport); |
void FlushRtcpMessages_n(); |
@@ -245,10 +250,10 @@ class BaseChannel |
int flags); |
void OnReadyToSend(rtc::PacketTransportInterface* transport); |
- void OnDtlsState(TransportChannel* channel, DtlsTransportState state); |
+ void OnDtlsState(DtlsTransportInternal* transport, DtlsTransportState state); |
void OnSelectedCandidatePairChanged( |
- TransportChannel* channel, |
+ IceTransportInternal* ice_transport, |
CandidatePairInterface* selected_candidate_pair, |
int last_sent_packet_id, |
bool ready_to_send); |
@@ -284,10 +289,10 @@ class BaseChannel |
bool ShouldSetupDtlsSrtp_n() const; |
// Do the DTLS key expansion and impose it on the SRTP/SRTCP filters. |
// |rtcp_channel| indicates whether to set up the RTP or RTCP filter. |
- bool SetupDtlsSrtp_n(bool rtcp_channel); |
+ bool SetupDtlsSrtp_n(bool rtcp); |
void MaybeSetupDtlsSrtp_n(); |
// Set the DTLS-SRTP cipher policy on this channel as appropriate. |
- bool SetDtlsSrtpCryptoSuites_n(TransportChannel* tc, bool rtcp); |
+ bool SetDtlsSrtpCryptoSuites_n(DtlsTransportInternal* transport, bool rtcp); |
// Should be called whenever the conditions for |
// IsReadyToReceiveMedia/IsReadyToSendMedia are satisfied (or unsatisfied). |
@@ -357,8 +362,8 @@ class BaseChannel |
} |
private: |
- bool InitNetwork_n(TransportChannel* rtp_transport, |
- TransportChannel* rtcp_transport); |
+ bool InitNetwork_n(DtlsTransportInternal* rtp_dtls_transport, |
+ DtlsTransportInternal* rtcp_dtls_transport); |
void DisconnectTransportChannels_n(); |
void SignalSentPacket_n(rtc::PacketTransportInterface* transport, |
const rtc::SentPacket& sent_packet); |
@@ -380,10 +385,10 @@ class BaseChannel |
// True if RTCP-multiplexing is required. In other words, no standalone RTCP |
// transport will ever be used for this channel. |
const bool rtcp_mux_required_; |
- // TODO(johan): Replace TransportChannel* with rtc::PacketTransportInterface*. |
- TransportChannel* rtp_transport_ = nullptr; |
+ |
+ DtlsTransportInternal* rtp_dtls_transport_ = nullptr; |
std::vector<std::pair<rtc::Socket::Option, int> > socket_options_; |
- TransportChannel* rtcp_transport_ = nullptr; |
+ DtlsTransportInternal* rtcp_dtls_transport_ = nullptr; |
std::vector<std::pair<rtc::Socket::Option, int> > rtcp_socket_options_; |
SrtpFilter srtp_filter_; |
RtcpMuxFilter rtcp_mux_filter_; |
@@ -425,8 +430,8 @@ class VoiceChannel : public BaseChannel { |
bool rtcp_mux_required, |
bool srtp_required); |
~VoiceChannel(); |
- bool Init_w(TransportChannel* rtp_transport, |
- TransportChannel* rtcp_transport); |
+ bool Init_w(DtlsTransportInternal* rtp_dtls_transport, |
+ DtlsTransportInternal* rtcp_dtls_transport); |
// Configure sending media on the stream with SSRC |ssrc| |
// If there is only one sending stream SSRC 0 can be used. |
@@ -544,8 +549,8 @@ class VideoChannel : public BaseChannel { |
bool rtcp_mux_required, |
bool srtp_required); |
~VideoChannel(); |
- bool Init_w(TransportChannel* rtp_transport, |
- TransportChannel* rtcp_transport); |
+ bool Init_w(DtlsTransportInternal* rtp_dtls_transport, |
+ DtlsTransportInternal* rtcp_dtls_transport); |
// downcasts a MediaChannel |
VideoMediaChannel* media_channel() const override { |
@@ -624,8 +629,8 @@ class RtpDataChannel : public BaseChannel { |
bool rtcp_mux_required, |
bool srtp_required); |
~RtpDataChannel(); |
- bool Init_w(TransportChannel* rtp_transport, |
- TransportChannel* rtcp_transport); |
+ bool Init_w(DtlsTransportInternal* rtp_dtls_transport, |
+ DtlsTransportInternal* rtcp_dtls_transport); |
virtual bool SendData(const SendDataParams& params, |
const rtc::CopyOnWriteBuffer& payload, |