summaryrefslogtreecommitdiffstats
path: root/third_party/libwebrtc/pc/jsep_transport_controller.h
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/libwebrtc/pc/jsep_transport_controller.h')
-rw-r--r--third_party/libwebrtc/pc/jsep_transport_controller.h52
1 files changed, 36 insertions, 16 deletions
diff --git a/third_party/libwebrtc/pc/jsep_transport_controller.h b/third_party/libwebrtc/pc/jsep_transport_controller.h
index 5880e346cd..448844ac79 100644
--- a/third_party/libwebrtc/pc/jsep_transport_controller.h
+++ b/third_party/libwebrtc/pc/jsep_transport_controller.h
@@ -112,7 +112,7 @@ class JsepTransportController : public sigslot::has_slots<> {
rtc::SSLProtocolVersion ssl_max_version = rtc::SSL_PROTOCOL_DTLS_12;
// `crypto_options` is used to determine if created DTLS transports
// negotiate GCM crypto suites or not.
- webrtc::CryptoOptions crypto_options;
+ CryptoOptions crypto_options;
PeerConnectionInterface::BundlePolicy bundle_policy =
PeerConnectionInterface::kBundlePolicyBalanced;
PeerConnectionInterface::RtcpMuxPolicy rtcp_mux_policy =
@@ -120,7 +120,7 @@ class JsepTransportController : public sigslot::has_slots<> {
bool disable_encryption = false;
bool enable_external_auth = false;
// Used to inject the ICE/DTLS transports created externally.
- webrtc::IceTransportFactory* ice_transport_factory = nullptr;
+ IceTransportFactory* ice_transport_factory = nullptr;
cricket::DtlsTransportFactory* dtls_transport_factory = nullptr;
Observer* transport_observer = nullptr;
// Must be provided and valid for the lifetime of the
@@ -140,7 +140,7 @@ class JsepTransportController : public sigslot::has_slots<> {
std::function<void(rtc::SSLHandshakeError)> on_dtls_handshake_error_;
// Field trials.
- const webrtc::FieldTrialsView* field_trials;
+ const FieldTrialsView* field_trials;
};
// The ICE related events are fired on the `network_thread`.
@@ -161,11 +161,24 @@ class JsepTransportController : public sigslot::has_slots<> {
// level, creating/destroying transport objects as needed and updating their
// properties. This includes RTP, DTLS, and ICE (but not SCTP). At least not
// yet? May make sense to in the future.
+ //
+ // `local_desc` must always be valid. If a remote description has previously
+ // been set via a call to `SetRemoteDescription()` then `remote_desc` should
+ // point to that description object in order to keep the current local and
+ // remote session descriptions in sync.
RTCError SetLocalDescription(SdpType type,
- const cricket::SessionDescription* description);
-
+ const cricket::SessionDescription* local_desc,
+ const cricket::SessionDescription* remote_desc);
+
+ // Call to apply a remote description (See `SetLocalDescription()` for local).
+ //
+ // `remote_desc` must always be valid. If a local description has previously
+ // been set via a call to `SetLocalDescription()` then `local_desc` should
+ // point to that description object in order to keep the current local and
+ // remote session descriptions in sync.
RTCError SetRemoteDescription(SdpType type,
- const cricket::SessionDescription* description);
+ const cricket::SessionDescription* local_desc,
+ const cricket::SessionDescription* remote_desc);
// Get transports to be used for the provided `mid`. If bundling is enabled,
// calling GetRtpTransport for multiple MIDs may yield the same object.
@@ -174,7 +187,7 @@ class JsepTransportController : public sigslot::has_slots<> {
const cricket::DtlsTransportInternal* GetRtcpDtlsTransport(
const std::string& mid) const;
// Gets the externally sharable version of the DtlsTransport.
- rtc::scoped_refptr<webrtc::DtlsTransport> LookupDtlsTransportByMid(
+ rtc::scoped_refptr<DtlsTransport> LookupDtlsTransportByMid(
const std::string& mid);
rtc::scoped_refptr<SctpTransport> GetSctpTransport(
const std::string& mid) const;
@@ -325,14 +338,23 @@ class JsepTransportController : public sigslot::has_slots<> {
CallbackList<const cricket::CandidatePairChangeEvent&>
signal_ice_candidate_pair_changed_ RTC_GUARDED_BY(network_thread_);
+ // Called from SetLocalDescription and SetRemoteDescription.
+ // When `local` is true, local_desc must be valid. Similarly when
+ // `local` is false, remote_desc must be valid. The description counterpart
+ // to the one that's being applied, may be nullptr but when it's supplied
+ // the counterpart description's content groups will be kept up to date for
+ // `type == SdpType::kAnswer`.
RTCError ApplyDescription_n(bool local,
SdpType type,
- const cricket::SessionDescription* description)
+ const cricket::SessionDescription* local_desc,
+ const cricket::SessionDescription* remote_desc)
RTC_RUN_ON(network_thread_);
RTCError ValidateAndMaybeUpdateBundleGroups(
bool local,
SdpType type,
- const cricket::SessionDescription* description);
+ const cricket::SessionDescription* local_desc,
+ const cricket::SessionDescription* remote_desc)
+ RTC_RUN_ON(network_thread_);
RTCError ValidateContent(const cricket::ContentInfo& content_info);
void HandleRejectedContent(const cricket::ContentInfo& content_info)
@@ -399,19 +421,19 @@ class JsepTransportController : public sigslot::has_slots<> {
std::unique_ptr<cricket::DtlsTransportInternal> CreateDtlsTransport(
const cricket::ContentInfo& content_info,
cricket::IceTransportInternal* ice);
- rtc::scoped_refptr<webrtc::IceTransportInterface> CreateIceTransport(
+ rtc::scoped_refptr<IceTransportInterface> CreateIceTransport(
const std::string& transport_name,
bool rtcp);
- std::unique_ptr<webrtc::RtpTransport> CreateUnencryptedRtpTransport(
+ std::unique_ptr<RtpTransport> CreateUnencryptedRtpTransport(
const std::string& transport_name,
rtc::PacketTransportInternal* rtp_packet_transport,
rtc::PacketTransportInternal* rtcp_packet_transport);
- std::unique_ptr<webrtc::SrtpTransport> CreateSdesTransport(
+ std::unique_ptr<SrtpTransport> CreateSdesTransport(
const std::string& transport_name,
cricket::DtlsTransportInternal* rtp_dtls_transport,
cricket::DtlsTransportInternal* rtcp_dtls_transport);
- std::unique_ptr<webrtc::DtlsSrtpTransport> CreateDtlsSrtpTransport(
+ std::unique_ptr<DtlsSrtpTransport> CreateDtlsSrtpTransport(
const std::string& transport_name,
cricket::DtlsTransportInternal* rtp_dtls_transport,
cricket::DtlsTransportInternal* rtcp_dtls_transport);
@@ -453,7 +475,7 @@ class JsepTransportController : public sigslot::has_slots<> {
void OnRtcpPacketReceived_n(rtc::CopyOnWriteBuffer* packet,
int64_t packet_time_us)
RTC_RUN_ON(network_thread_);
- void OnUnDemuxableRtpPacketReceived_n(const webrtc::RtpPacketReceived& packet)
+ void OnUnDemuxableRtpPacketReceived_n(const RtpPacketReceived& packet)
RTC_RUN_ON(network_thread_);
void OnDtlsHandshakeError(rtc::SSLHandshakeError error);
@@ -481,8 +503,6 @@ class JsepTransportController : public sigslot::has_slots<> {
const Config config_;
bool active_reset_srtp_params_ RTC_GUARDED_BY(network_thread_);
- const cricket::SessionDescription* local_desc_ = nullptr;
- const cricket::SessionDescription* remote_desc_ = nullptr;
absl::optional<bool> initial_offerer_;
cricket::IceConfig ice_config_;