| Index: webrtc/api/webrtcsession.h
|
| diff --git a/webrtc/api/webrtcsession.h b/webrtc/api/webrtcsession.h
|
| index e346112cba3d9d6c2e8b7efd8c551a2b0b156d0a..ef31560509879ec3abeb4705ee1c20a0ecb1cc72 100644
|
| --- a/webrtc/api/webrtcsession.h
|
| +++ b/webrtc/api/webrtcsession.h
|
| @@ -22,7 +22,6 @@
|
| #include "webrtc/api/peerconnectioninterface.h"
|
| #include "webrtc/api/statstypes.h"
|
| #include "webrtc/base/constructormagic.h"
|
| -#include "webrtc/base/optional.h"
|
| #include "webrtc/base/sigslot.h"
|
| #include "webrtc/base/sslidentity.h"
|
| #include "webrtc/base/thread.h"
|
| @@ -38,9 +37,7 @@
|
| namespace cricket {
|
|
|
| class ChannelManager;
|
| -class RtpDataChannel;
|
| -class SctpTransportInternal;
|
| -class SctpTransportInternalFactory;
|
| +class DataChannel;
|
| class StatsReport;
|
| class VideoChannel;
|
| class VoiceChannel;
|
| @@ -70,8 +67,8 @@ extern const char kSdpWithoutIceUfragPwd[];
|
| extern const char kSdpWithoutSdesAndDtlsDisabled[];
|
| extern const char kSessionError[];
|
| extern const char kSessionErrorDesc[];
|
| -extern const char kDtlsSrtpSetupFailureRtp[];
|
| -extern const char kDtlsSrtpSetupFailureRtcp[];
|
| +extern const char kDtlsSetupFailureRtp[];
|
| +extern const char kDtlsSetupFailureRtcp[];
|
| extern const char kEnableBundleFailed[];
|
|
|
| // Maximum number of received video streams that will be processed by webrtc
|
| @@ -161,15 +158,13 @@ class WebRtcSession :
|
| ERROR_TRANSPORT = 2, // transport error of some kind
|
| };
|
|
|
| - // |sctp_factory| may be null, in which case SCTP is treated as unsupported.
|
| WebRtcSession(
|
| webrtc::MediaControllerInterface* media_controller,
|
| rtc::Thread* network_thread,
|
| rtc::Thread* worker_thread,
|
| rtc::Thread* signaling_thread,
|
| cricket::PortAllocator* port_allocator,
|
| - std::unique_ptr<cricket::TransportController> transport_controller,
|
| - std::unique_ptr<cricket::SctpTransportInternalFactory> sctp_factory);
|
| + std::unique_ptr<cricket::TransportController> transport_controller);
|
| virtual ~WebRtcSession();
|
|
|
| // These are const to allow them to be called from const methods.
|
| @@ -204,34 +199,26 @@ class WebRtcSession :
|
| ice_observer_ = observer;
|
| }
|
|
|
| - // Exposed for stats collecting.
|
| virtual cricket::VoiceChannel* voice_channel() {
|
| return voice_channel_.get();
|
| }
|
| virtual cricket::VideoChannel* video_channel() {
|
| return video_channel_.get();
|
| }
|
| - // Only valid when using deprecated RTP data channels.
|
| - virtual cricket::RtpDataChannel* rtp_data_channel() {
|
| - return rtp_data_channel_.get();
|
| - }
|
| - virtual rtc::Optional<std::string> sctp_content_name() const {
|
| - return sctp_content_name_;
|
| - }
|
| - virtual rtc::Optional<std::string> sctp_transport_name() const {
|
| - return sctp_transport_name_;
|
| + virtual cricket::DataChannel* data_channel() {
|
| + return data_channel_.get();
|
| }
|
|
|
| cricket::BaseChannel* GetChannel(const std::string& content_name);
|
|
|
| cricket::SecurePolicy SdesPolicy() const;
|
|
|
| - // Get current SSL role used by SCTP's underlying transport.
|
| - bool GetSctpSslRole(rtc::SSLRole* role);
|
| - // Get SSL role for an arbitrary m= section (handles bundling correctly).
|
| - // TODO(deadbeef): This is only used internally by the session description
|
| - // factory, it shouldn't really be public).
|
| - bool GetSslRole(const std::string& content_name, rtc::SSLRole* role);
|
| + // Get current ssl role from transport.
|
| + bool GetSslRole(const std::string& transport_name, rtc::SSLRole* role);
|
| +
|
| + // Get current SSL role for this channel's transport.
|
| + // If |transport| is null, returns false.
|
| + bool GetSslRole(const cricket::BaseChannel* channel, rtc::SSLRole* role);
|
|
|
| void CreateOffer(
|
| CreateSessionDescriptionObserver* observer,
|
| @@ -245,7 +232,6 @@ class WebRtcSession :
|
| // The ownership of |desc| will be transferred after this call.
|
| bool SetRemoteDescription(SessionDescriptionInterface* desc,
|
| std::string* err_desc);
|
| -
|
| bool ProcessIceMessage(const IceCandidateInterface* ice_candidate);
|
|
|
| bool RemoveRemoteIceCandidates(
|
| @@ -340,7 +326,7 @@ class WebRtcSession :
|
| // WebRTCSessionDescriptionFactory. Should happen before setLocalDescription.
|
| void OnCertificateReady(
|
| const rtc::scoped_refptr<rtc::RTCCertificate>& certificate);
|
| - void OnDtlsSrtpSetupFailure(cricket::BaseChannel*, bool rtcp);
|
| + void OnDtlsSetupFailure(cricket::BaseChannel*, bool rtcp);
|
|
|
| // For unit test.
|
| bool waiting_for_certificate_for_testing() const;
|
| @@ -352,9 +338,8 @@ class WebRtcSession :
|
| transport_controller_->SetMetricsObserver(metrics_observer);
|
| }
|
|
|
| - // Called when voice_channel_, video_channel_ and
|
| - // rtp_data_channel_/sctp_transport_ are created and destroyed. As a result
|
| - // of, for example, setting a new description.
|
| + // Called when voice_channel_, video_channel_ and data_channel_ are created
|
| + // and destroyed. As a result of, for example, setting a new description.
|
| sigslot::signal0<> SignalVoiceChannelCreated;
|
| sigslot::signal0<> SignalVoiceChannelDestroyed;
|
| sigslot::signal0<> SignalVideoChannelCreated;
|
| @@ -412,7 +397,6 @@ class WebRtcSession :
|
| bool PushdownMediaDescription(cricket::ContentAction action,
|
| cricket::ContentSource source,
|
| std::string* error_desc);
|
| - bool PushdownSctpParameters_n(cricket::ContentSource source);
|
|
|
| bool PushdownTransportDescription(cricket::ContentSource source,
|
| cricket::ContentAction action,
|
| @@ -477,24 +461,11 @@ class WebRtcSession :
|
| std::unique_ptr<SessionStats> GetStats_n(
|
| const ChannelNamePairs& channel_name_pairs);
|
|
|
| - bool CreateSctpTransport_n(const std::string& content_name,
|
| - const std::string& transport_name);
|
| - // For bundling.
|
| - void ChangeSctpTransport_n(const std::string& transport_name);
|
| - void DestroySctpTransport_n();
|
| - // SctpTransport signal handlers. Needed to marshal signals from the network
|
| - // to signaling thread.
|
| - void OnSctpTransportReadyToSendData_n();
|
| - // This may be called with "false" if the direction of the m= section causes
|
| - // us to tear down the SCTP connection.
|
| - void OnSctpTransportReadyToSendData_s(bool ready);
|
| - void OnSctpTransportDataReceived_n(const cricket::ReceiveDataParams& params,
|
| - const rtc::CopyOnWriteBuffer& payload);
|
| - // Beyond just firing the signal to the signaling thread, listens to SCTP
|
| - // CONTROL messages on unused SIDs and processes them as OPEN messages.
|
| - void OnSctpTransportDataReceived_s(const cricket::ReceiveDataParams& params,
|
| - const rtc::CopyOnWriteBuffer& payload);
|
| - void OnSctpStreamClosedRemotely_n(int sid);
|
| + // Listens to SCTP CONTROL messages on unused SIDs and process them as OPEN
|
| + // messages.
|
| + void OnDataChannelMessageReceived(cricket::DataChannel* channel,
|
| + const cricket::ReceiveDataParams& params,
|
| + const rtc::CopyOnWriteBuffer& payload);
|
|
|
| std::string BadStateErrMsg(State state);
|
| void SetIceConnectionState(PeerConnectionInterface::IceConnectionState state);
|
| @@ -527,7 +498,6 @@ class WebRtcSession :
|
| // this session.
|
| bool SrtpRequired() const;
|
|
|
| - // TransportController signal handlers.
|
| void OnTransportControllerConnectionState(cricket::IceConnectionState state);
|
| void OnTransportControllerReceiving(bool receiving);
|
| void OnTransportControllerGatheringState(cricket::IceGatheringState state);
|
| @@ -536,7 +506,6 @@ class WebRtcSession :
|
| const std::vector<cricket::Candidate>& candidates);
|
| void OnTransportControllerCandidatesRemoved(
|
| const std::vector<cricket::Candidate>& candidates);
|
| - void OnTransportControllerDtlsHandshakeError(rtc::SSLHandshakeError error);
|
|
|
| std::string GetSessionErrorMsg();
|
|
|
| @@ -553,6 +522,8 @@ class WebRtcSession :
|
|
|
| const std::string GetTransportName(const std::string& content_name);
|
|
|
| + void OnDtlsHandshakeError(rtc::SSLHandshakeError error);
|
| +
|
| rtc::Thread* const network_thread_;
|
| rtc::Thread* const worker_thread_;
|
| rtc::Thread* const signaling_thread_;
|
| @@ -565,39 +536,10 @@ class WebRtcSession :
|
| bool initial_offerer_ = false;
|
|
|
| const std::unique_ptr<cricket::TransportController> transport_controller_;
|
| - const std::unique_ptr<cricket::SctpTransportInternalFactory> sctp_factory_;
|
| MediaControllerInterface* media_controller_;
|
| std::unique_ptr<cricket::VoiceChannel> voice_channel_;
|
| std::unique_ptr<cricket::VideoChannel> video_channel_;
|
| - // |rtp_data_channel_| is used if in RTP data channel mode, |sctp_transport_|
|
| - // when using SCTP.
|
| - std::unique_ptr<cricket::RtpDataChannel> rtp_data_channel_;
|
| -
|
| - std::unique_ptr<cricket::SctpTransportInternal> sctp_transport_;
|
| - // |sctp_transport_name_| keeps track of what DTLS transport the SCTP
|
| - // transport is using (which can change due to bundling).
|
| - rtc::Optional<std::string> sctp_transport_name_;
|
| - // |sctp_content_name_| is the content name (MID) in SDP.
|
| - rtc::Optional<std::string> sctp_content_name_;
|
| - // Value cached on signaling thread. Only updated when SctpReadyToSendData
|
| - // fires on the signaling thread.
|
| - bool sctp_ready_to_send_data_ = false;
|
| - // Same as signals provided by SctpTransport, but these are guaranteed to
|
| - // fire on the signaling thread, whereas SctpTransport fires on the networking
|
| - // thread.
|
| - // |sctp_invoker_| is used so that any signals queued on the signaling thread
|
| - // from the network thread are immediately discarded if the SctpTransport is
|
| - // destroyed (due to m= section being rejected).
|
| - // TODO(deadbeef): Use a proxy object to ensure that method calls/signals
|
| - // are marshalled to the right thread. Could almost use proxy.h for this,
|
| - // but it doesn't have a mechanism for marshalling sigslot::signals
|
| - std::unique_ptr<rtc::AsyncInvoker> sctp_invoker_;
|
| - sigslot::signal1<bool> SignalSctpReadyToSendData;
|
| - sigslot::signal2<const cricket::ReceiveDataParams&,
|
| - const rtc::CopyOnWriteBuffer&>
|
| - SignalSctpDataReceived;
|
| - sigslot::signal1<int> SignalSctpStreamClosedRemotely;
|
| -
|
| + std::unique_ptr<cricket::DataChannel> data_channel_;
|
| cricket::ChannelManager* channel_manager_;
|
| IceObserver* ice_observer_;
|
| PeerConnectionInterface::IceConnectionState ice_connection_state_;
|
|
|