1*d9f75844SAndroid Build Coastguard Worker /* 2*d9f75844SAndroid Build Coastguard Worker * Copyright 2020 The WebRTC project authors. All Rights Reserved. 3*d9f75844SAndroid Build Coastguard Worker * 4*d9f75844SAndroid Build Coastguard Worker * Use of this source code is governed by a BSD-style license 5*d9f75844SAndroid Build Coastguard Worker * that can be found in the LICENSE file in the root of the source 6*d9f75844SAndroid Build Coastguard Worker * tree. An additional intellectual property rights grant can be found 7*d9f75844SAndroid Build Coastguard Worker * in the file PATENTS. All contributing project authors may 8*d9f75844SAndroid Build Coastguard Worker * be found in the AUTHORS file in the root of the source tree. 9*d9f75844SAndroid Build Coastguard Worker */ 10*d9f75844SAndroid Build Coastguard Worker 11*d9f75844SAndroid Build Coastguard Worker #ifndef PC_SDP_STATE_PROVIDER_H_ 12*d9f75844SAndroid Build Coastguard Worker #define PC_SDP_STATE_PROVIDER_H_ 13*d9f75844SAndroid Build Coastguard Worker 14*d9f75844SAndroid Build Coastguard Worker #include <string> 15*d9f75844SAndroid Build Coastguard Worker 16*d9f75844SAndroid Build Coastguard Worker #include "api/jsep.h" 17*d9f75844SAndroid Build Coastguard Worker #include "api/peer_connection_interface.h" 18*d9f75844SAndroid Build Coastguard Worker 19*d9f75844SAndroid Build Coastguard Worker namespace webrtc { 20*d9f75844SAndroid Build Coastguard Worker 21*d9f75844SAndroid Build Coastguard Worker // This interface provides access to the state of an SDP offer/answer 22*d9f75844SAndroid Build Coastguard Worker // negotiation. 23*d9f75844SAndroid Build Coastguard Worker // 24*d9f75844SAndroid Build Coastguard Worker // All the functions are const, so using this interface serves as 25*d9f75844SAndroid Build Coastguard Worker // assurance that the user is not modifying the state. 26*d9f75844SAndroid Build Coastguard Worker class SdpStateProvider { 27*d9f75844SAndroid Build Coastguard Worker public: ~SdpStateProvider()28*d9f75844SAndroid Build Coastguard Worker virtual ~SdpStateProvider() {} 29*d9f75844SAndroid Build Coastguard Worker 30*d9f75844SAndroid Build Coastguard Worker virtual PeerConnectionInterface::SignalingState signaling_state() const = 0; 31*d9f75844SAndroid Build Coastguard Worker 32*d9f75844SAndroid Build Coastguard Worker virtual const SessionDescriptionInterface* local_description() const = 0; 33*d9f75844SAndroid Build Coastguard Worker virtual const SessionDescriptionInterface* remote_description() const = 0; 34*d9f75844SAndroid Build Coastguard Worker virtual const SessionDescriptionInterface* current_local_description() 35*d9f75844SAndroid Build Coastguard Worker const = 0; 36*d9f75844SAndroid Build Coastguard Worker virtual const SessionDescriptionInterface* current_remote_description() 37*d9f75844SAndroid Build Coastguard Worker const = 0; 38*d9f75844SAndroid Build Coastguard Worker virtual const SessionDescriptionInterface* pending_local_description() 39*d9f75844SAndroid Build Coastguard Worker const = 0; 40*d9f75844SAndroid Build Coastguard Worker virtual const SessionDescriptionInterface* pending_remote_description() 41*d9f75844SAndroid Build Coastguard Worker const = 0; 42*d9f75844SAndroid Build Coastguard Worker 43*d9f75844SAndroid Build Coastguard Worker // Whether an ICE restart has been asked for. Used in CreateOffer. 44*d9f75844SAndroid Build Coastguard Worker virtual bool NeedsIceRestart(const std::string& content_name) const = 0; 45*d9f75844SAndroid Build Coastguard Worker // Whether an ICE restart was indicated in the remote offer. 46*d9f75844SAndroid Build Coastguard Worker // Used in CreateAnswer. 47*d9f75844SAndroid Build Coastguard Worker virtual bool IceRestartPending(const std::string& content_name) const = 0; 48*d9f75844SAndroid Build Coastguard Worker virtual absl::optional<rtc::SSLRole> GetDtlsRole( 49*d9f75844SAndroid Build Coastguard Worker const std::string& mid) const = 0; 50*d9f75844SAndroid Build Coastguard Worker }; 51*d9f75844SAndroid Build Coastguard Worker 52*d9f75844SAndroid Build Coastguard Worker } // namespace webrtc 53*d9f75844SAndroid Build Coastguard Worker 54*d9f75844SAndroid Build Coastguard Worker #endif // PC_SDP_STATE_PROVIDER_H_ 55