#include "pc/webrtc_session_description_factory.h"
#include <stddef.h>
#include <queue>
#include <string>
#include <type_traits>
#include <utility>
#include <vector>
#include "absl/algorithm/container.h"
#include "absl/types/optional.h"
#include "api/jsep.h"
#include "api/jsep_session_description.h"
#include "api/rtc_error.h"
#include "api/sequence_checker.h"
#include "pc/connection_context.h"
#include "pc/sdp_state_provider.h"
#include "pc/session_description.h"
#include "rtc_base/checks.h"
#include "rtc_base/logging.h"
#include "rtc_base/ssl_identity.h"
#include "rtc_base/ssl_stream_adapter.h"
#include "rtc_base/string_encode.h"
#include "rtc_base/unique_id_generator.h"
MediaSessionOptions;
UniqueRandomIdGenerator;
namespace webrtc {
namespace {
static const char kFailedDueToIdentityFailed[] = …;
static const char kFailedDueToSessionShutdown[] = …;
static const uint64_t kInitSessionVersion = …;
static bool ValidMediaSessionOptions(
const cricket::MediaSessionOptions& session_options) { … }
}
void WebRtcSessionDescriptionFactory::CopyCandidatesFromSessionDescription(
const SessionDescriptionInterface* source_desc,
const std::string& content_name,
SessionDescriptionInterface* dest_desc) { … }
WebRtcSessionDescriptionFactory::WebRtcSessionDescriptionFactory(
ConnectionContext* context,
const SdpStateProvider* sdp_info,
const std::string& session_id,
bool dtls_enabled,
std::unique_ptr<rtc::RTCCertificateGeneratorInterface> cert_generator,
rtc::scoped_refptr<rtc::RTCCertificate> certificate,
std::function<void(const rtc::scoped_refptr<rtc::RTCCertificate>&)>
on_certificate_ready,
const FieldTrialsView& field_trials)
: … { … }
WebRtcSessionDescriptionFactory::~WebRtcSessionDescriptionFactory() { … }
void WebRtcSessionDescriptionFactory::CreateOffer(
CreateSessionDescriptionObserver* observer,
const PeerConnectionInterface::RTCOfferAnswerOptions& options,
const cricket::MediaSessionOptions& session_options) { … }
void WebRtcSessionDescriptionFactory::CreateAnswer(
CreateSessionDescriptionObserver* observer,
const cricket::MediaSessionOptions& session_options) { … }
void WebRtcSessionDescriptionFactory::InternalCreateOffer(
CreateSessionDescriptionRequest request) { … }
void WebRtcSessionDescriptionFactory::InternalCreateAnswer(
CreateSessionDescriptionRequest request) { … }
void WebRtcSessionDescriptionFactory::FailPendingRequests(
const std::string& reason) { … }
void WebRtcSessionDescriptionFactory::PostCreateSessionDescriptionFailed(
CreateSessionDescriptionObserver* observer,
RTCError error) { … }
void WebRtcSessionDescriptionFactory::PostCreateSessionDescriptionSucceeded(
CreateSessionDescriptionObserver* observer,
std::unique_ptr<SessionDescriptionInterface> description) { … }
void WebRtcSessionDescriptionFactory::Post(
absl::AnyInvocable<void() &&> callback) { … }
void WebRtcSessionDescriptionFactory::OnCertificateRequestFailed() { … }
void WebRtcSessionDescriptionFactory::SetCertificate(
rtc::scoped_refptr<rtc::RTCCertificate> certificate) { … }
}