Take out some superfluous webrtc:: prefixes
Bug: webrtc:42232595
Change-Id: Ib91efb4d7cc952dc5863ac5ebbb485f14920ee6a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/390420
Reviewed-by: Evan Shrubsole <eshr@webrtc.org>
Auto-Submit: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#44550}
diff --git a/pc/used_ids_unittest.cc b/pc/used_ids_unittest.cc
index fd73501..4b2b3c2 100644
--- a/pc/used_ids_unittest.cc
+++ b/pc/used_ids_unittest.cc
@@ -15,15 +15,15 @@
#include "rtc_base/checks.h"
#include "test/gtest.h"
-using ::webrtc::UsedIds;
-using ::webrtc::UsedRtpHeaderExtensionIds;
+namespace webrtc {
+namespace {
struct Foo {
int id;
};
TEST(UsedIdsTest, UniqueIdsAreUnchanged) {
- webrtc::UsedIds<Foo> used_ids(1, 5);
+ UsedIds<Foo> used_ids(1, 5);
for (int i = 1; i <= 5; ++i) {
Foo id = {i};
used_ids.FindAndSetIdUsed(&id);
@@ -32,7 +32,7 @@
}
TEST(UsedIdsTest, IdsOutsideRangeAreUnchanged) {
- webrtc::UsedIds<Foo> used_ids(1, 5);
+ UsedIds<Foo> used_ids(1, 5);
Foo id_11 = {11};
Foo id_12 = {12};
@@ -53,7 +53,7 @@
}
TEST(UsedIdsTest, CollisionsAreReassignedIdsInReverseOrder) {
- webrtc::UsedIds<Foo> used_ids(1, 10);
+ UsedIds<Foo> used_ids(1, 10);
Foo id_1 = {1};
Foo id_2 = {2};
Foo id_2_collision = {2};
@@ -92,7 +92,7 @@
// Fill all IDs.
for (int j = 1; j <= GetParam().max_id; ++j) {
- webrtc::RtpExtension extension("", j);
+ RtpExtension extension("", j);
used_ids.FindAndSetIdUsed(&extension);
EXPECT_EQ(extension.id, j);
}
@@ -100,11 +100,11 @@
TEST_P(UsedRtpHeaderExtensionIdsTest, PrioritizeReassignmentToOneByteIds) {
UsedRtpHeaderExtensionIds used_ids(GetParam().id_domain);
- webrtc::RtpExtension id_1("", 1);
- webrtc::RtpExtension id_2("", 2);
- webrtc::RtpExtension id_2_collision("", 2);
- webrtc::RtpExtension id_3("", 3);
- webrtc::RtpExtension id_3_collision("", 3);
+ RtpExtension id_1("", 1);
+ RtpExtension id_2("", 2);
+ RtpExtension id_2_collision("", 2);
+ RtpExtension id_3("", 3);
+ RtpExtension id_3_collision("", 3);
// Expect that colliding IDs are reassigned to one-byte IDs.
used_ids.FindAndSetIdUsed(&id_1);
@@ -121,16 +121,15 @@
UsedRtpHeaderExtensionIds::IdDomain::kTwoByteAllowed);
// Fill all one byte IDs.
- for (int i = 1; i <= webrtc::RtpExtension::kOneByteHeaderExtensionMaxId;
- ++i) {
- webrtc::RtpExtension id("", i);
+ for (int i = 1; i <= RtpExtension::kOneByteHeaderExtensionMaxId; ++i) {
+ RtpExtension id("", i);
used_ids.FindAndSetIdUsed(&id);
}
// Add new extensions with colliding IDs.
- webrtc::RtpExtension id1_collision("", 1);
- webrtc::RtpExtension id2_collision("", 2);
- webrtc::RtpExtension id3_collision("", 3);
+ RtpExtension id1_collision("", 1);
+ RtpExtension id2_collision("", 2);
+ RtpExtension id3_collision("", 3);
// Expect to reassign to two-byte header extension IDs.
used_ids.FindAndSetIdUsed(&id1_collision);
@@ -166,16 +165,19 @@
// Fill all IDs.
for (int j = 1; j <= GetParam().max_id; ++j) {
- webrtc::RtpExtension id("", j);
+ RtpExtension id("", j);
used_ids.FindAndSetIdUsed(&id);
}
- webrtc::RtpExtension id1_collision("", 1);
- webrtc::RtpExtension id2_collision("", 2);
- webrtc::RtpExtension id3_collision("", GetParam().max_id);
+ RtpExtension id1_collision("", 1);
+ RtpExtension id2_collision("", 2);
+ RtpExtension id3_collision("", GetParam().max_id);
EXPECT_DEATH(used_ids.FindAndSetIdUsed(&id1_collision), "");
EXPECT_DEATH(used_ids.FindAndSetIdUsed(&id2_collision), "");
EXPECT_DEATH(used_ids.FindAndSetIdUsed(&id3_collision), "");
}
#endif // RTC_DCHECK_IS_ON && GTEST_HAS_DEATH_TEST && !defined(WEBRTC_ANDROID)
+
+} // namespace
+} // namespace webrtc
diff --git a/pc/video_rtp_receiver.h b/pc/video_rtp_receiver.h
index 5bd2e6a..04a1aac 100644
--- a/pc/video_rtp_receiver.h
+++ b/pc/video_rtp_receiver.h
@@ -29,7 +29,6 @@
#include "api/transport/rtp/rtp_source.h"
#include "api/video/video_frame.h"
#include "api/video/video_sink_interface.h"
-#include "api/video/video_source_interface.h"
#include "media/base/media_channel.h"
#include "pc/jitter_buffer_delay.h"
#include "pc/media_stream_track_proxy.h"
@@ -67,9 +66,7 @@
scoped_refptr<DtlsTransportInterface> dtls_transport() const override;
std::vector<std::string> stream_ids() const override;
std::vector<scoped_refptr<MediaStreamInterface>> streams() const override;
- webrtc::MediaType media_type() const override {
- return webrtc::MediaType::VIDEO;
- }
+ MediaType media_type() const override { return MediaType::VIDEO; }
std::string id() const override { return id_; }
diff --git a/pc/video_track_unittest.cc b/pc/video_track_unittest.cc
index c003a51..bdf8f72 100644
--- a/pc/video_track_unittest.cc
+++ b/pc/video_track_unittest.cc
@@ -18,34 +18,28 @@
#include "media/base/fake_frame_source.h"
#include "pc/test/fake_video_track_renderer.h"
#include "pc/test/fake_video_track_source.h"
-#include "pc/video_track_source.h"
#include "rtc_base/thread.h"
#include "rtc_base/time_utils.h"
#include "test/gtest.h"
-using webrtc::FakeVideoTrackRenderer;
-using webrtc::FakeVideoTrackSource;
-using webrtc::MediaSourceInterface;
-using webrtc::MediaStreamTrackInterface;
-using webrtc::VideoTrack;
-using webrtc::VideoTrackInterface;
-using webrtc::VideoTrackSource;
+namespace webrtc {
+namespace {
class VideoTrackTest : public ::testing::Test {
public:
- VideoTrackTest() : frame_source_(640, 480, webrtc::kNumMicrosecsPerSec / 30) {
+ VideoTrackTest() : frame_source_(640, 480, kNumMicrosecsPerSec / 30) {
static const char kVideoTrackId[] = "track_id";
- video_track_source_ = webrtc::make_ref_counted<FakeVideoTrackSource>(
+ video_track_source_ = make_ref_counted<FakeVideoTrackSource>(
/*is_screencast=*/false);
video_track_ = VideoTrack::Create(kVideoTrackId, video_track_source_,
- webrtc::Thread::Current());
+ Thread::Current());
}
protected:
- webrtc::AutoThread main_thread_;
- webrtc::scoped_refptr<FakeVideoTrackSource> video_track_source_;
- webrtc::scoped_refptr<VideoTrack> video_track_;
- webrtc::FakeFrameSource frame_source_;
+ AutoThread main_thread_;
+ scoped_refptr<FakeVideoTrackSource> video_track_source_;
+ scoped_refptr<VideoTrack> video_track_;
+ FakeFrameSource frame_source_;
};
// VideoTrack::Create will create an API proxy around the source object.
@@ -105,3 +99,6 @@
EXPECT_EQ(3, renderer->num_rendered_frames());
EXPECT_FALSE(renderer->black_frame());
}
+
+} // namespace
+} // namespace webrtc
diff --git a/pc/webrtc_sdp.cc b/pc/webrtc_sdp.cc
index a87a82c..eb6a07d 100644
--- a/pc/webrtc_sdp.cc
+++ b/pc/webrtc_sdp.cc
@@ -68,34 +68,6 @@
#include "rtc_base/string_encode.h"
#include "rtc_base/strings/string_builder.h"
-using ::webrtc::AudioContentDescription;
-using webrtc::Candidate;
-using ::webrtc::Candidates;
-using ::webrtc::ContentInfo;
-using ::webrtc::ICE_CANDIDATE_COMPONENT_RTCP;
-using ::webrtc::ICE_CANDIDATE_COMPONENT_RTP;
-using ::webrtc::kApplicationSpecificBandwidth;
-using ::webrtc::kCodecParamMaxPTime;
-using ::webrtc::kCodecParamMinPTime;
-using ::webrtc::kCodecParamPTime;
-using ::webrtc::kTransportSpecificBandwidth;
-using ::webrtc::MediaContentDescription;
-using ::webrtc::MediaProtocolType;
-using ::webrtc::RidDescription;
-using ::webrtc::RtpHeaderExtensions;
-using ::webrtc::SctpDataContentDescription;
-using ::webrtc::SimulcastDescription;
-using ::webrtc::SimulcastLayer;
-using ::webrtc::SimulcastLayerList;
-using ::webrtc::SocketAddress;
-using ::webrtc::SsrcGroup;
-using ::webrtc::StreamParams;
-using ::webrtc::StreamParamsVec;
-using ::webrtc::TransportDescription;
-using ::webrtc::TransportInfo;
-using ::webrtc::UnsupportedContentDescription;
-using ::webrtc::VideoContentDescription;
-
// TODO(deadbeef): Switch to using anonymous namespace rather than declaring
// everything "static".
namespace webrtc {
@@ -203,8 +175,8 @@
static const char kCandidateRelay[] = "relay";
static const char kTcpCandidateType[] = "tcptype";
-// webrtc::StringBuilder doesn't have a << overload for chars, while
-// webrtc::split and webrtc::tokenize_first both take a char delimiter. To
+// StringBuilder doesn't have a << overload for chars, while
+// split and tokenize_first both take a char delimiter. To
// handle both cases these constants come in pairs of a chars and length-one
// strings.
static const char kSdpDelimiterEqual[] = "=";
@@ -268,22 +240,22 @@
static void BuildMediaDescription(const ContentInfo* content_info,
const TransportInfo* transport_info,
- const webrtc::MediaType media_type,
+ const MediaType media_type,
const std::vector<Candidate>& candidates,
int msid_signaling,
std::string* message);
-static void BuildMediaLine(const webrtc::MediaType media_type,
+static void BuildMediaLine(const MediaType media_type,
const ContentInfo* content_info,
const MediaContentDescription* media_desc,
std::string* message);
static void BuildRtpContentAttributes(const MediaContentDescription* media_desc,
- const webrtc::MediaType media_type,
+ const MediaType media_type,
int msid_signaling,
std::string* message);
static void BuildRtpHeaderExtensions(const RtpHeaderExtensions& extensions,
std::string* message);
static void BuildRtpmap(const MediaContentDescription* media_desc,
- const webrtc::MediaType media_type,
+ const MediaType media_type,
std::string* message);
static void BuildCandidate(const std::vector<Candidate>& candidates,
bool include_ufrag,
@@ -314,7 +286,7 @@
SdpParseError* error);
static bool ParseContent(
absl::string_view message,
- const webrtc::MediaType media_type,
+ const MediaType media_type,
int mline_index,
absl::string_view protocol,
const std::vector<int>& payload_types,
@@ -337,12 +309,12 @@
SsrcGroupVec* ssrc_groups,
SdpParseError* error);
static bool ParseRtpmapAttribute(absl::string_view line,
- const webrtc::MediaType media_type,
+ const MediaType media_type,
const std::vector<int>& payload_types,
MediaContentDescription* media_desc,
SdpParseError* error);
static bool ParseFmtpAttributes(absl::string_view line,
- const webrtc::MediaType media_type,
+ const MediaType media_type,
MediaContentDescription* media_desc,
SdpParseError* error);
static bool ParseFmtpParam(absl::string_view line,
@@ -350,11 +322,11 @@
std::string* value,
SdpParseError* error);
static bool ParsePacketizationAttribute(absl::string_view line,
- const webrtc::MediaType media_type,
+ const MediaType media_type,
MediaContentDescription* media_desc,
SdpParseError* error);
static bool ParseRtcpFbAttribute(absl::string_view line,
- const webrtc::MediaType media_type,
+ const MediaType media_type,
MediaContentDescription* media_desc,
SdpParseError* error);
static bool ParseIceOptions(absl::string_view line,
@@ -891,7 +863,7 @@
}
// MediaStream semantics.
- // TODO(bugs.webrtc.org/10421): Change to & webrtc::kMsidSignalingSemantic
+ // TODO(bugs.webrtc.org/10421): Change to & kMsidSignalingSemantic
// when we think it's safe to do so, so that we gradually fade out this old
// line that was removed from the specification.
if (desc->msid_signaling() != kMsidSignalingNotUsed) {
@@ -1398,7 +1370,7 @@
}
}
-void BuildMediaLine(const webrtc::MediaType media_type,
+void BuildMediaLine(const MediaType media_type,
const ContentInfo* content_info,
const MediaContentDescription* media_desc,
std::string* message) {
@@ -1409,15 +1381,14 @@
// fmt is a list of payload type numbers that MAY be used in the session.
std::string type;
std::string fmt;
- if (media_type == webrtc::MediaType::AUDIO ||
- media_type == webrtc::MediaType::VIDEO) {
- type = media_type == webrtc::MediaType::AUDIO ? kSdpMediaTypeAudio
- : kSdpMediaTypeVideo;
+ if (media_type == MediaType::AUDIO || media_type == MediaType::VIDEO) {
+ type = media_type == MediaType::AUDIO ? kSdpMediaTypeAudio
+ : kSdpMediaTypeVideo;
for (const Codec& codec : media_desc->codecs()) {
fmt.append(" ");
fmt.append(absl::StrCat(codec.id));
}
- } else if (media_type == webrtc::MediaType::DATA) {
+ } else if (media_type == MediaType::DATA) {
type = kSdpMediaTypeData;
const SctpDataContentDescription* sctp_data_desc = media_desc->as_sctp();
if (sctp_data_desc) {
@@ -1431,7 +1402,7 @@
} else {
RTC_DCHECK_NOTREACHED() << "Data description without SCTP";
}
- } else if (media_type == webrtc::MediaType::UNSUPPORTED) {
+ } else if (media_type == MediaType::UNSUPPORTED) {
const UnsupportedContentDescription* unsupported_desc =
media_desc->as_unsupported();
type = unsupported_desc->media_type();
@@ -1469,7 +1440,7 @@
void BuildMediaDescription(const ContentInfo* content_info,
const TransportInfo* transport_info,
- const webrtc::MediaType media_type,
+ const MediaType media_type,
const std::vector<Candidate>& candidates,
int msid_signaling,
std::string* message) {
@@ -1561,7 +1532,7 @@
}
void BuildRtpContentAttributes(const MediaContentDescription* media_desc,
- const webrtc::MediaType media_type,
+ const MediaType media_type,
int msid_signaling,
std::string* message) {
SimulcastSdpSerializer serializer;
@@ -1798,7 +1769,7 @@
return name != kCodecParamPTime && name != kCodecParamMaxPTime;
}
-bool WriteFmtpParameters(const webrtc::CodecParameterMap& parameters,
+bool WriteFmtpParameters(const CodecParameterMap& parameters,
StringBuilder* os) {
bool empty = true;
const char* delimiter = ""; // No delimiter before first parameter.
@@ -1861,7 +1832,7 @@
}
bool GetParameter(const std::string& name,
- const webrtc::CodecParameterMap& params,
+ const CodecParameterMap& params,
int* value) {
std::map<std::string, std::string>::const_iterator found = params.find(name);
if (found == params.end()) {
@@ -1874,12 +1845,12 @@
}
void BuildRtpmap(const MediaContentDescription* media_desc,
- const webrtc::MediaType media_type,
+ const MediaType media_type,
std::string* message) {
RTC_DCHECK(message != NULL);
RTC_DCHECK(media_desc != NULL);
StringBuilder os;
- if (media_type == webrtc::MediaType::VIDEO) {
+ if (media_type == MediaType::VIDEO) {
for (const Codec& codec : media_desc->codecs()) {
// RFC 4566
// a=rtpmap:<payload type> <encoding name>/<clock rate>
@@ -1894,7 +1865,7 @@
AddRtcpFbLines(codec, message);
AddFmtpLine(codec, message);
}
- } else if (media_type == webrtc::MediaType::AUDIO) {
+ } else if (media_type == MediaType::AUDIO) {
std::vector<int> ptimes;
std::vector<int> maxptimes;
int max_minptime = 0;
@@ -2580,7 +2551,7 @@
static std::unique_ptr<MediaContentDescription> ParseContentDescription(
absl::string_view message,
- const webrtc::MediaType media_type,
+ const MediaType media_type,
int mline_index,
absl::string_view protocol,
const std::vector<int>& payload_types,
@@ -2592,9 +2563,9 @@
std::vector<std::unique_ptr<JsepIceCandidate>>* candidates,
SdpParseError* error) {
std::unique_ptr<MediaContentDescription> media_desc;
- if (media_type == webrtc::MediaType::AUDIO) {
+ if (media_type == MediaType::AUDIO) {
media_desc = std::make_unique<AudioContentDescription>();
- } else if (media_type == webrtc::MediaType::VIDEO) {
+ } else if (media_type == MediaType::VIDEO) {
media_desc = std::make_unique<VideoContentDescription>();
} else {
RTC_DCHECK_NOTREACHED();
@@ -2714,14 +2685,14 @@
}
if (media_type == kSdpMediaTypeVideo) {
content = ParseContentDescription(
- message, webrtc::MediaType::VIDEO, mline_index, protocol,
- payload_types, pos, &content_name, &bundle_only,
- §ion_msid_signaling, &transport, candidates, error);
+ message, MediaType::VIDEO, mline_index, protocol, payload_types, pos,
+ &content_name, &bundle_only, §ion_msid_signaling, &transport,
+ candidates, error);
} else if (media_type == kSdpMediaTypeAudio) {
content = ParseContentDescription(
- message, webrtc::MediaType::AUDIO, mline_index, protocol,
- payload_types, pos, &content_name, &bundle_only,
- §ion_msid_signaling, &transport, candidates, error);
+ message, MediaType::AUDIO, mline_index, protocol, payload_types, pos,
+ &content_name, &bundle_only, §ion_msid_signaling, &transport,
+ candidates, error);
} else if (media_type == kSdpMediaTypeData && IsDtlsSctp(protocol)) {
// The draft-03 format is:
// m=application <port> DTLS/SCTP <sctp-port>...
@@ -2739,7 +2710,7 @@
} else if (fields[3] == kDefaultSctpmapProtocol) {
data_desc->set_use_sctpmap(false);
}
- if (!ParseContent(message, webrtc::MediaType::DATA, mline_index, protocol,
+ if (!ParseContent(message, MediaType::DATA, mline_index, protocol,
payload_types, pos, &content_name, &bundle_only,
§ion_msid_signaling, data_desc.get(), &transport,
candidates, error)) {
@@ -2751,11 +2722,10 @@
RTC_LOG(LS_WARNING) << "Unsupported media type: " << *mline;
auto unsupported_desc =
std::make_unique<UnsupportedContentDescription>(media_type);
- if (!ParseContent(message, webrtc::MediaType::UNSUPPORTED, mline_index,
- protocol, payload_types, pos, &content_name,
- &bundle_only, §ion_msid_signaling,
- unsupported_desc.get(), &transport, candidates,
- error)) {
+ if (!ParseContent(message, MediaType::UNSUPPORTED, mline_index, protocol,
+ payload_types, pos, &content_name, &bundle_only,
+ §ion_msid_signaling, unsupported_desc.get(),
+ &transport, candidates, error)) {
return false;
}
unsupported_desc->set_protocol(protocol);
@@ -2841,7 +2811,7 @@
return true;
}
-void AddParameters(const webrtc::CodecParameterMap& parameters, Codec* codec) {
+void AddParameters(const CodecParameterMap& parameters, Codec* codec) {
for (const auto& entry : parameters) {
const std::string& key = entry.first;
const std::string& value = entry.second;
@@ -2863,14 +2833,14 @@
// Gets the current codec setting associated with `payload_type`. If there
// is no Codec associated with that payload type it returns an empty codec
// with that payload type.
-Codec GetCodecWithPayloadType(webrtc::MediaType type,
+Codec GetCodecWithPayloadType(MediaType type,
const std::vector<Codec>& codecs,
int payload_type) {
const Codec* codec = FindCodecById(codecs, payload_type);
if (codec)
return *codec;
// Return empty codec with `payload_type`.
- if (type == webrtc::MediaType::AUDIO) {
+ if (type == MediaType::AUDIO) {
return CreateAudioCodec(payload_type, "", 0, 0);
} else {
return CreateVideoCodec(payload_type, "");
@@ -2901,7 +2871,7 @@
// to `parameters`.
void UpdateCodec(MediaContentDescription* content_desc,
int payload_type,
- const webrtc::CodecParameterMap& parameters) {
+ const CodecParameterMap& parameters) {
// Codec might already have been populated (from rtpmap).
Codec new_codec = GetCodecWithPayloadType(
content_desc->type(), content_desc->codecs(), payload_type);
@@ -2982,7 +2952,7 @@
}
bool ParseContent(absl::string_view message,
- const webrtc::MediaType media_type,
+ const MediaType media_type,
int mline_index,
absl::string_view protocol,
const std::vector<int>& payload_types,
@@ -2998,7 +2968,7 @@
RTC_DCHECK(content_name != NULL);
RTC_DCHECK(transport != NULL);
- if (media_type == webrtc::MediaType::AUDIO) {
+ if (media_type == MediaType::AUDIO) {
MaybeCreateStaticPayloadAudioCodecs(payload_types, media_desc);
}
@@ -3142,7 +3112,7 @@
if (!ParseDtlsSetup(*line, &(transport->connection_role), error)) {
return false;
}
- } else if (IsDtlsSctp(protocol) && media_type == webrtc::MediaType::DATA) {
+ } else if (IsDtlsSctp(protocol) && media_type == MediaType::DATA) {
//
// SCTP specific attributes
//
@@ -3344,7 +3314,7 @@
if (!ssrc_infos.empty()) {
CreateTracksFromSsrcInfos(ssrc_infos, stream_ids, track_id, &tracks,
*msid_signaling);
- } else if (media_type != webrtc::MediaType::DATA &&
+ } else if (media_type != MediaType::DATA &&
(*msid_signaling & kMsidSignalingMediaSection)) {
// If the stream_ids/track_id was signaled but SSRCs were unsignaled we
// still create a track. This isn't done for data media types because
@@ -3383,7 +3353,7 @@
[](const Codec codec) { return !codec.name.empty(); })) {
return ParseFailed("Failed to parse codecs correctly.", error);
}
- if (media_type == webrtc::MediaType::AUDIO) {
+ if (media_type == MediaType::AUDIO) {
AddAudioAttribute(kCodecParamMaxPTime, maxptime_as_string, media_desc);
AddAudioAttribute(kCodecParamPTime, ptime_as_string, media_desc);
}
@@ -3542,7 +3512,7 @@
}
bool ParseRtpmapAttribute(absl::string_view line,
- const webrtc::MediaType media_type,
+ const MediaType media_type,
const std::vector<int>& payload_types,
MediaContentDescription* media_desc,
SdpParseError* error) {
@@ -3586,7 +3556,7 @@
return false;
}
- if (media_type == webrtc::MediaType::VIDEO) {
+ if (media_type == MediaType::VIDEO) {
for (const Codec& existing_codec : media_desc->codecs()) {
if (!existing_codec.name.empty() && payload_type == existing_codec.id &&
(!absl::EqualsIgnoreCase(encoding_name, existing_codec.name) ||
@@ -3602,7 +3572,7 @@
}
}
UpdateCodec(payload_type, encoding_name, media_desc);
- } else if (media_type == webrtc::MediaType::AUDIO) {
+ } else if (media_type == MediaType::AUDIO) {
// RFC 4566
// For audio streams, <encoding parameters> indicates the number
// of audio channels. This parameter is OPTIONAL and may be
@@ -3654,7 +3624,7 @@
}
bool ParseFmtpParameterSet(absl::string_view line_params,
- webrtc::CodecParameterMap& codec_params,
+ CodecParameterMap& codec_params,
SdpParseError* error) {
// Parse out format specific parameters.
for (absl::string_view param :
@@ -3675,11 +3645,10 @@
}
bool ParseFmtpAttributes(absl::string_view line,
- const webrtc::MediaType media_type,
+ const MediaType media_type,
MediaContentDescription* media_desc,
SdpParseError* error) {
- if (media_type != webrtc::MediaType::AUDIO &&
- media_type != webrtc::MediaType::VIDEO) {
+ if (media_type != MediaType::AUDIO && media_type != MediaType::VIDEO) {
return true;
}
@@ -3709,23 +3678,22 @@
}
// Parse out format specific parameters.
- webrtc::CodecParameterMap codec_params;
+ CodecParameterMap codec_params;
if (!ParseFmtpParameterSet(line_params, codec_params, error)) {
return false;
}
- if (media_type == webrtc::MediaType::AUDIO ||
- media_type == webrtc::MediaType::VIDEO) {
+ if (media_type == MediaType::AUDIO || media_type == MediaType::VIDEO) {
UpdateCodec(media_desc, payload_type, codec_params);
}
return true;
}
bool ParsePacketizationAttribute(absl::string_view line,
- const webrtc::MediaType media_type,
+ const MediaType media_type,
MediaContentDescription* media_desc,
SdpParseError* error) {
- if (media_type != webrtc::MediaType::VIDEO) {
+ if (media_type != MediaType::VIDEO) {
return true;
}
std::vector<absl::string_view> packetization_fields =
@@ -3749,11 +3717,10 @@
}
bool ParseRtcpFbAttribute(absl::string_view line,
- const webrtc::MediaType media_type,
+ const MediaType media_type,
MediaContentDescription* media_desc,
SdpParseError* error) {
- if (media_type != webrtc::MediaType::AUDIO &&
- media_type != webrtc::MediaType::VIDEO) {
+ if (media_type != MediaType::AUDIO && media_type != MediaType::VIDEO) {
return true;
}
std::vector<absl::string_view> rtcp_fb_fields =
@@ -3781,8 +3748,7 @@
}
const FeedbackParam feedback_param(id, param);
- if (media_type == webrtc::MediaType::AUDIO ||
- media_type == webrtc::MediaType::VIDEO) {
+ if (media_type == MediaType::AUDIO || media_type == MediaType::VIDEO) {
UpdateCodec(media_desc, payload_type, feedback_param);
}
return true;
diff --git a/pc/webrtc_sdp.h b/pc/webrtc_sdp.h
index 884b454..f44df2a 100644
--- a/pc/webrtc_sdp.h
+++ b/pc/webrtc_sdp.h
@@ -27,7 +27,7 @@
#include "api/jsep.h"
#include "api/jsep_ice_candidate.h"
#include "api/jsep_session_description.h"
-#include "media/base/codec.h"
+#include "api/rtp_parameters.h"
#include "rtc_base/strings/string_builder.h"
#include "rtc_base/system/rtc_export.h"
@@ -100,12 +100,12 @@
// parameters are not considered to be part of the FMTP line, see the function
// IsFmtpParam(). Returns true if the set of FMTP parameters is nonempty, false
// otherwise.
-bool WriteFmtpParameters(const webrtc::CodecParameterMap& parameters,
+bool WriteFmtpParameters(const CodecParameterMap& parameters,
StringBuilder* os);
// Parses a string into an FMTP parameter set, in key-value format.
bool ParseFmtpParameterSet(absl::string_view line_params,
- webrtc::CodecParameterMap& codec_params,
+ CodecParameterMap& codec_params,
SdpParseError* error);
} // namespace webrtc
diff --git a/pc/webrtc_sdp_unittest.cc b/pc/webrtc_sdp_unittest.cc
index ba696d4..2ce4765 100644
--- a/pc/webrtc_sdp_unittest.cc
+++ b/pc/webrtc_sdp_unittest.cc
@@ -56,37 +56,13 @@
#endif
#include "pc/webrtc_sdp.h"
+namespace webrtc {
+
+namespace {
+
using ::testing::ElementsAre;
using ::testing::Field;
using ::testing::Property;
-using ::webrtc::AudioContentDescription;
-using webrtc::Candidate;
-using ::webrtc::ContentGroup;
-using ::webrtc::ContentInfo;
-using ::webrtc::ICE_CANDIDATE_COMPONENT_RTCP;
-using ::webrtc::ICE_CANDIDATE_COMPONENT_RTP;
-using webrtc::IceCandidateCollection;
-using webrtc::IceCandidateInterface;
-using webrtc::IceCandidateType;
-using webrtc::JsepIceCandidate;
-using webrtc::JsepSessionDescription;
-using ::webrtc::kFecSsrcGroupSemantics;
-using ::webrtc::MediaProtocolType;
-using ::webrtc::RidDescription;
-using ::webrtc::RidDirection;
-using webrtc::RtpExtension;
-using webrtc::RtpTransceiverDirection;
-using ::webrtc::SctpDataContentDescription;
-using webrtc::SdpParseError;
-using webrtc::SdpType;
-using ::webrtc::SessionDescription;
-using webrtc::SessionDescriptionInterface;
-using ::webrtc::SimulcastDescription;
-using ::webrtc::SimulcastLayer;
-using ::webrtc::StreamParams;
-using ::webrtc::TransportDescription;
-using ::webrtc::TransportInfo;
-using ::webrtc::VideoContentDescription;
static const uint32_t kDefaultSctpPort = 5000;
static const uint16_t kUnusualSctpPort = 9556;
@@ -860,12 +836,12 @@
static bool SdpDeserialize(const std::string& message,
JsepSessionDescription* jdesc) {
- return webrtc::SdpDeserialize(message, jdesc, NULL);
+ return SdpDeserialize(message, jdesc, NULL);
}
static bool SdpDeserializeCandidate(const std::string& message,
JsepIceCandidate* candidate) {
- return webrtc::SdpDeserializeCandidate(message, candidate, NULL);
+ return SdpDeserializeCandidate(message, candidate, NULL);
}
// Add some extra `newlines` to the `message` after `line`.
@@ -887,7 +863,7 @@
const std::string& bad_part) {
JsepSessionDescription desc(kDummyType);
SdpParseError error;
- bool ret = webrtc::SdpDeserialize(bad_sdp, &desc, &error);
+ bool ret = SdpDeserialize(bad_sdp, &desc, &error);
ASSERT_FALSE(ret);
EXPECT_NE(std::string::npos, error.line.find(bad_part.c_str()))
<< "Did not find " << bad_part << " in " << error.line;
@@ -951,10 +927,9 @@
static TransportDescription MakeTransportDescription(std::string ufrag,
std::string pwd) {
- webrtc::SSLFingerprint fingerprint(webrtc::DIGEST_SHA_1, kIdentityDigest);
+ SSLFingerprint fingerprint(DIGEST_SHA_1, kIdentityDigest);
return TransportDescription(std::vector<std::string>(), ufrag, pwd,
- webrtc::ICEMODE_FULL, webrtc::CONNECTIONROLE_NONE,
- &fingerprint);
+ ICEMODE_FULL, CONNECTIONROLE_NONE, &fingerprint);
}
// WebRtcSdpTest
@@ -963,7 +938,7 @@
public:
WebRtcSdpTest() : jdesc_(kDummyType) {
#ifdef WEBRTC_ANDROID
- webrtc::InitializeAndroidObjects();
+ InitializeAndroidObjects();
#endif
// AudioContentDescription
audio_desc_ = CreateAudioContentDescription();
@@ -973,7 +948,7 @@
audio_stream.set_stream_ids({kStreamId1});
audio_stream.ssrcs.push_back(kAudioTrack1Ssrc);
audio_desc_->AddStream(audio_stream);
- webrtc::SocketAddress audio_addr("74.125.127.126", 2345);
+ SocketAddress audio_addr("74.125.127.126", 2345);
audio_desc_->set_connection_address(audio_addr);
desc_.AddContent(kAudioContentName, MediaProtocolType::kRtp,
absl::WrapUnique(audio_desc_));
@@ -986,17 +961,16 @@
video_stream.set_stream_ids({kStreamId1});
video_stream.ssrcs.push_back(kVideoTrack1Ssrc1);
video_stream.ssrcs.push_back(kVideoTrack1Ssrc2);
- webrtc::SsrcGroup ssrc_group(webrtc::kFecSsrcGroupSemantics,
- video_stream.ssrcs);
+ SsrcGroup ssrc_group(kFecSsrcGroupSemantics, video_stream.ssrcs);
video_stream.ssrc_groups.push_back(ssrc_group);
video_desc_->AddStream(video_stream);
- webrtc::SocketAddress video_addr("74.125.224.39", 3457);
+ SocketAddress video_addr("74.125.224.39", 3457);
video_desc_->set_connection_address(video_addr);
desc_.AddContent(kVideoContentName, MediaProtocolType::kRtp,
absl::WrapUnique(video_desc_));
// TransportInfo, with fingerprint
- webrtc::SSLFingerprint fingerprint(webrtc::DIGEST_SHA_1, kIdentityDigest);
+ SSLFingerprint fingerprint(DIGEST_SHA_1, kIdentityDigest);
desc_.AddTransportInfo(TransportInfo(
kAudioContentName, MakeTransportDescription(kUfragVoice, kPwdVoice)));
desc_.AddTransportInfo(TransportInfo(
@@ -1004,75 +978,67 @@
// v4 host
int port = 1234;
- webrtc::SocketAddress address("192.168.1.5", port++);
- Candidate candidate1(webrtc::ICE_CANDIDATE_COMPONENT_RTP, "udp", address,
+ SocketAddress address("192.168.1.5", port++);
+ Candidate candidate1(ICE_CANDIDATE_COMPONENT_RTP, "udp", address,
kCandidatePriority, "", "", IceCandidateType::kHost,
kCandidateGeneration, kCandidateFoundation1);
address.SetPort(port++);
- Candidate candidate2(webrtc::ICE_CANDIDATE_COMPONENT_RTCP, "udp", address,
+ Candidate candidate2(ICE_CANDIDATE_COMPONENT_RTCP, "udp", address,
kCandidatePriority, "", "", IceCandidateType::kHost,
kCandidateGeneration, kCandidateFoundation1);
address.SetPort(port++);
- Candidate candidate3(webrtc::ICE_CANDIDATE_COMPONENT_RTCP, "udp", address,
+ Candidate candidate3(ICE_CANDIDATE_COMPONENT_RTCP, "udp", address,
kCandidatePriority, "", "", IceCandidateType::kHost,
kCandidateGeneration, kCandidateFoundation1);
address.SetPort(port++);
- Candidate candidate4(webrtc::ICE_CANDIDATE_COMPONENT_RTP, "udp", address,
+ Candidate candidate4(ICE_CANDIDATE_COMPONENT_RTP, "udp", address,
kCandidatePriority, "", "", IceCandidateType::kHost,
kCandidateGeneration, kCandidateFoundation1);
// v6 host
- webrtc::SocketAddress v6_address("::1", port++);
- webrtc::Candidate candidate5(webrtc::ICE_CANDIDATE_COMPONENT_RTP, "udp",
- v6_address, kCandidatePriority, "", "",
- IceCandidateType::kHost, kCandidateGeneration,
- kCandidateFoundation2);
+ SocketAddress v6_address("::1", port++);
+ Candidate candidate5(ICE_CANDIDATE_COMPONENT_RTP, "udp", v6_address,
+ kCandidatePriority, "", "", IceCandidateType::kHost,
+ kCandidateGeneration, kCandidateFoundation2);
v6_address.SetPort(port++);
- webrtc::Candidate candidate6(webrtc::ICE_CANDIDATE_COMPONENT_RTCP, "udp",
- v6_address, kCandidatePriority, "", "",
- IceCandidateType::kHost, kCandidateGeneration,
- kCandidateFoundation2);
+ Candidate candidate6(ICE_CANDIDATE_COMPONENT_RTCP, "udp", v6_address,
+ kCandidatePriority, "", "", IceCandidateType::kHost,
+ kCandidateGeneration, kCandidateFoundation2);
v6_address.SetPort(port++);
- webrtc::Candidate candidate7(webrtc::ICE_CANDIDATE_COMPONENT_RTCP, "udp",
- v6_address, kCandidatePriority, "", "",
- IceCandidateType::kHost, kCandidateGeneration,
- kCandidateFoundation2);
+ Candidate candidate7(ICE_CANDIDATE_COMPONENT_RTCP, "udp", v6_address,
+ kCandidatePriority, "", "", IceCandidateType::kHost,
+ kCandidateGeneration, kCandidateFoundation2);
v6_address.SetPort(port++);
- webrtc::Candidate candidate8(webrtc::ICE_CANDIDATE_COMPONENT_RTP, "udp",
- v6_address, kCandidatePriority, "", "",
- IceCandidateType::kHost, kCandidateGeneration,
- kCandidateFoundation2);
+ Candidate candidate8(ICE_CANDIDATE_COMPONENT_RTP, "udp", v6_address,
+ kCandidatePriority, "", "", IceCandidateType::kHost,
+ kCandidateGeneration, kCandidateFoundation2);
// stun
int port_stun = 2345;
- webrtc::SocketAddress address_stun("74.125.127.126", port_stun++);
- webrtc::SocketAddress rel_address_stun("192.168.1.5", port_stun++);
- webrtc::Candidate candidate9(webrtc::ICE_CANDIDATE_COMPONENT_RTP, "udp",
- address_stun, kCandidatePriority, "", "",
- IceCandidateType::kSrflx, kCandidateGeneration,
- kCandidateFoundation3);
+ SocketAddress address_stun("74.125.127.126", port_stun++);
+ SocketAddress rel_address_stun("192.168.1.5", port_stun++);
+ Candidate candidate9(ICE_CANDIDATE_COMPONENT_RTP, "udp", address_stun,
+ kCandidatePriority, "", "", IceCandidateType::kSrflx,
+ kCandidateGeneration, kCandidateFoundation3);
candidate9.set_related_address(rel_address_stun);
address_stun.SetPort(port_stun++);
rel_address_stun.SetPort(port_stun++);
- webrtc::Candidate candidate10(webrtc::ICE_CANDIDATE_COMPONENT_RTCP, "udp",
- address_stun, kCandidatePriority, "", "",
- IceCandidateType::kSrflx,
- kCandidateGeneration, kCandidateFoundation3);
+ Candidate candidate10(ICE_CANDIDATE_COMPONENT_RTCP, "udp", address_stun,
+ kCandidatePriority, "", "", IceCandidateType::kSrflx,
+ kCandidateGeneration, kCandidateFoundation3);
candidate10.set_related_address(rel_address_stun);
// relay
int port_relay = 3456;
- webrtc::SocketAddress address_relay("74.125.224.39", port_relay++);
- webrtc::Candidate candidate11(webrtc::ICE_CANDIDATE_COMPONENT_RTCP, "udp",
- address_relay, kCandidatePriority, "", "",
- IceCandidateType::kRelay,
- kCandidateGeneration, kCandidateFoundation4);
+ SocketAddress address_relay("74.125.224.39", port_relay++);
+ Candidate candidate11(ICE_CANDIDATE_COMPONENT_RTCP, "udp", address_relay,
+ kCandidatePriority, "", "", IceCandidateType::kRelay,
+ kCandidateGeneration, kCandidateFoundation4);
address_relay.SetPort(port_relay++);
- webrtc::Candidate candidate12(webrtc::ICE_CANDIDATE_COMPONENT_RTP, "udp",
- address_relay, kCandidatePriority, "", "",
- IceCandidateType::kRelay,
- kCandidateGeneration, kCandidateFoundation4);
+ Candidate candidate12(ICE_CANDIDATE_COMPONENT_RTP, "udp", address_relay,
+ kCandidatePriority, "", "", IceCandidateType::kRelay,
+ kCandidateGeneration, kCandidateFoundation4);
// voice
candidates_.push_back(candidate1);
@@ -1112,9 +1078,9 @@
const IceCandidateCollection* video_candidates_collection =
jdesc_.candidates(1);
ASSERT_NE(nullptr, video_candidates_collection);
- std::vector<webrtc::Candidate> video_candidates;
+ std::vector<Candidate> video_candidates;
for (size_t i = 0; i < video_candidates_collection->count(); ++i) {
- webrtc::Candidate c = video_candidates_collection->at(i)->candidate();
+ Candidate c = video_candidates_collection->at(i)->candidate();
c.set_transport_name("video_content_name");
video_candidates.push_back(c);
}
@@ -1131,13 +1097,13 @@
desc_.transport_infos()[1].description.ice_ufrag.clear();
desc_.transport_infos()[1].description.ice_pwd.clear();
desc_.transport_infos()[1].description.connection_role =
- webrtc::CONNECTIONROLE_NONE;
+ CONNECTIONROLE_NONE;
// Set bundle-only flag.
desc_.contents()[1].bundle_only = true;
// Add BUNDLE group.
- ContentGroup group(webrtc::GROUP_TYPE_BUNDLE);
+ ContentGroup group(GROUP_TYPE_BUNDLE);
group.AddContentName(kAudioContentName);
group.AddContentName(kVideoContentName);
desc_.AddGroup(group);
@@ -1179,8 +1145,8 @@
absl::WrapUnique(audio_desc_));
desc_.AddContent(kVideoContentName, MediaProtocolType::kRtp,
absl::WrapUnique(video_desc_));
- desc_.set_msid_signaling(webrtc::kMsidSignalingSsrcAttribute |
- webrtc::kMsidSignalingSemantic);
+ desc_.set_msid_signaling(kMsidSignalingSsrcAttribute |
+ kMsidSignalingSemantic);
ASSERT_TRUE(jdesc_.Initialize(desc_.Clone(), jdesc_.session_id(),
jdesc_.session_version()));
}
@@ -1234,8 +1200,8 @@
desc_.AddTransportInfo(
TransportInfo(kVideoContentName3,
MakeTransportDescription(kUfragVideo3, kPwdVideo3)));
- desc_.set_msid_signaling(webrtc::kMsidSignalingMediaSection |
- webrtc::kMsidSignalingSemantic);
+ desc_.set_msid_signaling(kMsidSignalingMediaSection |
+ kMsidSignalingSemantic);
ASSERT_TRUE(jdesc_.Initialize(desc_.Clone(), jdesc_.session_id(),
jdesc_.session_version()));
@@ -1247,10 +1213,10 @@
AudioContentDescription* audio = new AudioContentDescription();
audio->set_rtcp_mux(true);
audio->set_rtcp_reduced_size(true);
- audio->set_protocol(webrtc::kMediaProtocolSavpf);
- audio->AddCodec(webrtc::CreateAudioCodec(111, "opus", 48000, 2));
- audio->AddCodec(webrtc::CreateAudioCodec(103, "ISAC", 16000, 1));
- audio->AddCodec(webrtc::CreateAudioCodec(104, "ISAC", 32000, 1));
+ audio->set_protocol(kMediaProtocolSavpf);
+ audio->AddCodec(CreateAudioCodec(111, "opus", 48000, 2));
+ audio->AddCodec(CreateAudioCodec(103, "ISAC", 16000, 1));
+ audio->AddCodec(CreateAudioCodec(104, "ISAC", 32000, 1));
return audio;
}
@@ -1313,8 +1279,8 @@
absl::WrapUnique(audio_desc));
// Enable signaling a=msid lines.
- desc_.set_msid_signaling(webrtc::kMsidSignalingMediaSection |
- webrtc::kMsidSignalingSemantic);
+ desc_.set_msid_signaling(kMsidSignalingMediaSection |
+ kMsidSignalingSemantic);
ASSERT_TRUE(jdesc_.Initialize(desc_.Clone(), jdesc_.session_id(),
jdesc_.session_version()));
}
@@ -1323,14 +1289,13 @@
// configuration.
VideoContentDescription* CreateVideoContentDescription() {
VideoContentDescription* video = new VideoContentDescription();
- video->set_protocol(webrtc::kMediaProtocolSavpf);
- video->AddCodec(webrtc::CreateVideoCodec(120, "VP8"));
+ video->set_protocol(kMediaProtocolSavpf);
+ video->AddCodec(CreateVideoCodec(120, "VP8"));
return video;
}
- void CompareMediaContentDescription(
- const webrtc::MediaContentDescription* cd1,
- const webrtc::MediaContentDescription* cd2) {
+ void CompareMediaContentDescription(const MediaContentDescription* cd1,
+ const MediaContentDescription* cd2) {
// type
EXPECT_EQ(cd1->type(), cd2->type());
@@ -1346,13 +1311,13 @@
// protocol
// Use an equivalence class here, for old and new versions of the
// protocol description.
- if (cd1->protocol() == webrtc::kMediaProtocolDtlsSctp ||
- cd1->protocol() == webrtc::kMediaProtocolUdpDtlsSctp ||
- cd1->protocol() == webrtc::kMediaProtocolTcpDtlsSctp) {
+ if (cd1->protocol() == kMediaProtocolDtlsSctp ||
+ cd1->protocol() == kMediaProtocolUdpDtlsSctp ||
+ cd1->protocol() == kMediaProtocolTcpDtlsSctp) {
const bool cd2_is_also_dtls_sctp =
- cd2->protocol() == webrtc::kMediaProtocolDtlsSctp ||
- cd2->protocol() == webrtc::kMediaProtocolUdpDtlsSctp ||
- cd2->protocol() == webrtc::kMediaProtocolTcpDtlsSctp;
+ cd2->protocol() == kMediaProtocolDtlsSctp ||
+ cd2->protocol() == kMediaProtocolUdpDtlsSctp ||
+ cd2->protocol() == kMediaProtocolTcpDtlsSctp;
EXPECT_TRUE(cd2_is_also_dtls_sctp);
} else {
EXPECT_EQ(cd1->protocol(), cd2->protocol());
@@ -1416,27 +1381,27 @@
return;
}
for (size_t i = 0; i < desc1.contents().size(); ++i) {
- const webrtc::ContentInfo& c1 = desc1.contents().at(i);
- const webrtc::ContentInfo& c2 = desc2.contents().at(i);
+ const ContentInfo& c1 = desc1.contents().at(i);
+ const ContentInfo& c2 = desc2.contents().at(i);
// ContentInfo properties.
EXPECT_EQ(c1.mid(), c2.mid());
EXPECT_EQ(c1.type, c2.type);
EXPECT_EQ(c1.rejected, c2.rejected);
EXPECT_EQ(c1.bundle_only, c2.bundle_only);
- ASSERT_EQ(webrtc::IsAudioContent(&c1), webrtc::IsAudioContent(&c2));
- if (webrtc::IsAudioContent(&c1)) {
+ ASSERT_EQ(IsAudioContent(&c1), IsAudioContent(&c2));
+ if (IsAudioContent(&c1)) {
CompareMediaContentDescription(c1.media_description(),
c2.media_description());
}
- ASSERT_EQ(webrtc::IsVideoContent(&c1), webrtc::IsVideoContent(&c2));
- if (webrtc::IsVideoContent(&c1)) {
+ ASSERT_EQ(IsVideoContent(&c1), IsVideoContent(&c2));
+ if (IsVideoContent(&c1)) {
CompareMediaContentDescription(c1.media_description(),
c2.media_description());
}
- ASSERT_EQ(webrtc::IsDataContent(&c1), webrtc::IsDataContent(&c2));
+ ASSERT_EQ(IsDataContent(&c1), IsDataContent(&c2));
if (c1.media_description()->as_sctp()) {
ASSERT_TRUE(c2.media_description()->as_sctp());
const SctpDataContentDescription* scd1 =
@@ -1452,42 +1417,42 @@
}
// group
- const webrtc::ContentGroups groups1 = desc1.groups();
- const webrtc::ContentGroups groups2 = desc2.groups();
+ const ContentGroups groups1 = desc1.groups();
+ const ContentGroups groups2 = desc2.groups();
EXPECT_EQ(groups1.size(), groups1.size());
if (groups1.size() != groups2.size()) {
ADD_FAILURE();
return;
}
for (size_t i = 0; i < groups1.size(); ++i) {
- const webrtc::ContentGroup group1 = groups1.at(i);
- const webrtc::ContentGroup group2 = groups2.at(i);
+ const ContentGroup group1 = groups1.at(i);
+ const ContentGroup group2 = groups2.at(i);
EXPECT_EQ(group1.semantics(), group2.semantics());
- const webrtc::ContentNames names1 = group1.content_names();
- const webrtc::ContentNames names2 = group2.content_names();
+ const ContentNames names1 = group1.content_names();
+ const ContentNames names2 = group2.content_names();
EXPECT_EQ(names1.size(), names2.size());
if (names1.size() != names2.size()) {
ADD_FAILURE();
return;
}
- webrtc::ContentNames::const_iterator iter1 = names1.begin();
- webrtc::ContentNames::const_iterator iter2 = names2.begin();
+ ContentNames::const_iterator iter1 = names1.begin();
+ ContentNames::const_iterator iter2 = names2.begin();
while (iter1 != names1.end()) {
EXPECT_EQ(*iter1++, *iter2++);
}
}
// transport info
- const webrtc::TransportInfos transports1 = desc1.transport_infos();
- const webrtc::TransportInfos transports2 = desc2.transport_infos();
+ const TransportInfos transports1 = desc1.transport_infos();
+ const TransportInfos transports2 = desc2.transport_infos();
EXPECT_EQ(transports1.size(), transports2.size());
if (transports1.size() != transports2.size()) {
ADD_FAILURE();
return;
}
for (size_t i = 0; i < transports1.size(); ++i) {
- const webrtc::TransportInfo transport1 = transports1.at(i);
- const webrtc::TransportInfo transport2 = transports2.at(i);
+ const TransportInfo transport1 = transports1.at(i);
+ const TransportInfo transport2 = transports2.at(i);
EXPECT_EQ(transport1.content_name, transport2.content_name);
EXPECT_EQ(transport1.description.ice_ufrag,
transport2.description.ice_ufrag);
@@ -1583,7 +1548,7 @@
void AddIceOptions(const std::string& content_name,
const std::vector<std::string>& transport_options) {
ASSERT_TRUE(desc_.GetTransportInfoByName(content_name) != NULL);
- webrtc::TransportInfo transport_info =
+ TransportInfo transport_info =
*(desc_.GetTransportInfoByName(content_name));
desc_.RemoveTransportInfoByName(content_name);
transport_info.description.transport_options = transport_options;
@@ -1594,7 +1559,7 @@
const std::string& ice_ufrag,
const std::string& ice_pwd) {
ASSERT_TRUE(desc_.GetTransportInfoByName(content_name) != NULL);
- webrtc::TransportInfo transport_info =
+ TransportInfo transport_info =
*(desc_.GetTransportInfoByName(content_name));
desc_.RemoveTransportInfoByName(content_name);
transport_info.description.ice_ufrag = ice_ufrag;
@@ -1620,7 +1585,7 @@
// Removes everything in StreamParams from the session description that is
// used for a=ssrc lines.
void RemoveSsrcSignalingFromStreamParams() {
- for (webrtc::ContentInfo& content_info : jdesc_.description()->contents()) {
+ for (ContentInfo& content_info : jdesc_.description()->contents()) {
// With Unified Plan there should be one StreamParams per m= section.
StreamParams& stream =
content_info.media_description()->mutable_streams()[0];
@@ -1672,7 +1637,7 @@
jdesc_.session_version())) {
return false;
}
- std::string message = webrtc::SdpSerialize(jdesc_);
+ std::string message = SdpSerialize(jdesc_);
EXPECT_EQ(new_sdp, message);
return true;
}
@@ -1697,7 +1662,7 @@
JsepSessionDescription jdesc_no_candidates(kDummyType);
MakeDescriptionWithoutCandidates(&jdesc_no_candidates);
- std::string message = webrtc::SdpSerialize(jdesc_no_candidates);
+ std::string message = SdpSerialize(jdesc_no_candidates);
EXPECT_EQ(new_sdp, message);
return true;
}
@@ -1707,7 +1672,7 @@
new SctpDataContentDescription());
sctp_desc_ = data.get();
sctp_desc_->set_use_sctpmap(use_sctpmap);
- sctp_desc_->set_protocol(webrtc::kMediaProtocolUdpDtlsSctp);
+ sctp_desc_->set_protocol(kMediaProtocolUdpDtlsSctp);
sctp_desc_->set_port(kDefaultSctpPort);
desc_.AddContent(kDataContentName, MediaProtocolType::kSctp,
std::move(data));
@@ -1788,8 +1753,7 @@
// media level.
if (session_level && media_level) {
SdpParseError error;
- EXPECT_FALSE(
- webrtc::SdpDeserialize(sdp_with_extmap, &jdesc_with_extmap, &error));
+ EXPECT_FALSE(SdpDeserialize(sdp_with_extmap, &jdesc_with_extmap, &error));
EXPECT_NE(std::string::npos, error.description.find("a=extmap"));
} else {
EXPECT_TRUE(SdpDeserialize(sdp_with_extmap, &jdesc_with_extmap));
@@ -1797,10 +1761,10 @@
}
}
- void VerifyCodecParameter(const webrtc::CodecParameterMap& params,
+ void VerifyCodecParameter(const CodecParameterMap& params,
const std::string& name,
int expected_value) {
- webrtc::CodecParameterMap::const_iterator found = params.find(name);
+ CodecParameterMap::const_iterator found = params.find(name);
ASSERT_TRUE(found != params.end());
EXPECT_EQ(found->second, absl::StrCat(expected_value));
}
@@ -1851,13 +1815,13 @@
// Deserialize
SdpParseError error;
- EXPECT_TRUE(webrtc::SdpDeserialize(sdp, jdesc_output, &error));
+ EXPECT_TRUE(SdpDeserialize(sdp, jdesc_output, &error));
const AudioContentDescription* acd =
- webrtc::GetFirstAudioContentDescription(jdesc_output->description());
+ GetFirstAudioContentDescription(jdesc_output->description());
ASSERT_TRUE(acd);
ASSERT_FALSE(acd->codecs().empty());
- webrtc::Codec opus = acd->codecs()[0];
+ Codec opus = acd->codecs()[0];
EXPECT_EQ("opus", opus.name);
EXPECT_EQ(111, opus.id);
VerifyCodecParameter(opus.params, "minptime", params.min_ptime);
@@ -1871,7 +1835,7 @@
VerifyCodecParameter(codec.params, "maxptime", params.max_ptime);
}
- webrtc::Codec dtmf = acd->codecs()[3];
+ Codec dtmf = acd->codecs()[3];
EXPECT_EQ("telephone-event", dtmf.name);
EXPECT_EQ(105, dtmf.id);
EXPECT_EQ(3u,
@@ -1880,18 +1844,18 @@
EXPECT_EQ(dtmf.params.begin()->second, "0-15,66,70");
const VideoContentDescription* vcd =
- webrtc::GetFirstVideoContentDescription(jdesc_output->description());
+ GetFirstVideoContentDescription(jdesc_output->description());
ASSERT_TRUE(vcd);
ASSERT_FALSE(vcd->codecs().empty());
- webrtc::Codec vp8 = vcd->codecs()[0];
+ Codec vp8 = vcd->codecs()[0];
EXPECT_EQ("VP8", vp8.name);
EXPECT_EQ(99, vp8.id);
- webrtc::Codec rtx = vcd->codecs()[1];
+ Codec rtx = vcd->codecs()[1];
EXPECT_EQ("RTX", rtx.name);
EXPECT_EQ(95, rtx.id);
VerifyCodecParameter(rtx.params, "apt", vp8.id);
// VP9 is listed last in the m= line so should come after VP8 and RTX.
- webrtc::Codec vp9 = vcd->codecs()[2];
+ Codec vp9 = vcd->codecs()[2];
EXPECT_EQ("VP9", vp9.name);
EXPECT_EQ(96, vp9.id);
}
@@ -1924,33 +1888,33 @@
std::string sdp = os.str();
// Deserialize
SdpParseError error;
- EXPECT_TRUE(webrtc::SdpDeserialize(sdp, jdesc_output, &error));
+ EXPECT_TRUE(SdpDeserialize(sdp, jdesc_output, &error));
const AudioContentDescription* acd =
- webrtc::GetFirstAudioContentDescription(jdesc_output->description());
+ GetFirstAudioContentDescription(jdesc_output->description());
ASSERT_TRUE(acd);
ASSERT_FALSE(acd->codecs().empty());
- webrtc::Codec opus = acd->codecs()[0];
+ Codec opus = acd->codecs()[0];
EXPECT_EQ(111, opus.id);
- EXPECT_TRUE(opus.HasFeedbackParam(webrtc::FeedbackParam(
- webrtc::kRtcpFbParamNack, webrtc::kParamValueEmpty)));
+ EXPECT_TRUE(opus.HasFeedbackParam(
+ FeedbackParam(kRtcpFbParamNack, kParamValueEmpty)));
const VideoContentDescription* vcd =
- webrtc::GetFirstVideoContentDescription(jdesc_output->description());
+ GetFirstVideoContentDescription(jdesc_output->description());
ASSERT_TRUE(vcd);
ASSERT_FALSE(vcd->codecs().empty());
- webrtc::Codec vp8 = vcd->codecs()[0];
+ Codec vp8 = vcd->codecs()[0];
EXPECT_EQ(vp8.name, "VP8");
EXPECT_EQ(101, vp8.id);
- EXPECT_TRUE(vp8.HasFeedbackParam(webrtc::FeedbackParam(
- webrtc::kRtcpFbParamLntf, webrtc::kParamValueEmpty)));
- EXPECT_TRUE(vp8.HasFeedbackParam(webrtc::FeedbackParam(
- webrtc::kRtcpFbParamNack, webrtc::kParamValueEmpty)));
- EXPECT_TRUE(vp8.HasFeedbackParam(webrtc::FeedbackParam(
- webrtc::kRtcpFbParamNack, webrtc::kRtcpFbNackParamPli)));
- EXPECT_TRUE(vp8.HasFeedbackParam(webrtc::FeedbackParam(
- webrtc::kRtcpFbParamRemb, webrtc::kParamValueEmpty)));
- EXPECT_TRUE(vp8.HasFeedbackParam(webrtc::FeedbackParam(
- webrtc::kRtcpFbParamCcm, webrtc::kRtcpFbCcmParamFir)));
+ EXPECT_TRUE(vp8.HasFeedbackParam(
+ FeedbackParam(kRtcpFbParamLntf, kParamValueEmpty)));
+ EXPECT_TRUE(vp8.HasFeedbackParam(
+ FeedbackParam(kRtcpFbParamNack, kParamValueEmpty)));
+ EXPECT_TRUE(vp8.HasFeedbackParam(
+ FeedbackParam(kRtcpFbParamNack, kRtcpFbNackParamPli)));
+ EXPECT_TRUE(vp8.HasFeedbackParam(
+ FeedbackParam(kRtcpFbParamRemb, kParamValueEmpty)));
+ EXPECT_TRUE(vp8.HasFeedbackParam(
+ FeedbackParam(kRtcpFbParamCcm, kRtcpFbCcmParamFir)));
}
// Two SDP messages can mean the same thing but be different strings, e.g.
@@ -1960,10 +1924,10 @@
// deserializing and comparing JsepSessionDescription will test
// the serializer sufficiently.
void TestSerialize(const JsepSessionDescription& jdesc) {
- std::string message = webrtc::SdpSerialize(jdesc);
+ std::string message = SdpSerialize(jdesc);
JsepSessionDescription jdesc_output_des(kDummyType);
SdpParseError error;
- EXPECT_TRUE(webrtc::SdpDeserialize(message, &jdesc_output_des, &error));
+ EXPECT_TRUE(SdpDeserialize(message, &jdesc_output_des, &error));
EXPECT_TRUE(CompareSessionDescription(jdesc, jdesc_output_des));
}
@@ -1972,8 +1936,8 @@
// 'connection address' field, previously set from the candidates, must also
// be reset.
void MakeDescriptionWithoutCandidates(JsepSessionDescription* jdesc) {
- webrtc::SocketAddress audio_addr("0.0.0.0", 9);
- webrtc::SocketAddress video_addr("0.0.0.0", 9);
+ SocketAddress audio_addr("0.0.0.0", 9);
+ SocketAddress video_addr("0.0.0.0", 9);
audio_desc_->set_connection_address(audio_addr);
video_desc_->set_connection_address(video_addr);
ASSERT_TRUE(jdesc->Initialize(desc_.Clone(), kSessionId, kSessionVersion));
@@ -2008,34 +1972,34 @@
TEST_F(WebRtcSdpTest, SerializeSessionDescription) {
// SessionDescription with desc and candidates.
- std::string message = webrtc::SdpSerialize(jdesc_);
+ std::string message = SdpSerialize(jdesc_);
TestMismatch(std::string(kSdpFullString), message);
}
TEST_F(WebRtcSdpTest, SerializeSessionDescriptionEmpty) {
JsepSessionDescription jdesc_empty(kDummyType);
- EXPECT_EQ("", webrtc::SdpSerialize(jdesc_empty));
+ EXPECT_EQ("", SdpSerialize(jdesc_empty));
}
TEST_F(WebRtcSdpTest, SerializeSessionDescriptionWithoutCandidates) {
// JsepSessionDescription with desc but without candidates.
JsepSessionDescription jdesc_no_candidates(kDummyType);
MakeDescriptionWithoutCandidates(&jdesc_no_candidates);
- std::string message = webrtc::SdpSerialize(jdesc_no_candidates);
+ std::string message = SdpSerialize(jdesc_no_candidates);
EXPECT_EQ(std::string(kSdpString), message);
}
TEST_F(WebRtcSdpTest, SerializeSessionDescriptionWithBundles) {
- ContentGroup group1(webrtc::GROUP_TYPE_BUNDLE);
+ ContentGroup group1(GROUP_TYPE_BUNDLE);
group1.AddContentName(kAudioContentName);
group1.AddContentName(kVideoContentName);
desc_.AddGroup(group1);
- ContentGroup group2(webrtc::GROUP_TYPE_BUNDLE);
+ ContentGroup group2(GROUP_TYPE_BUNDLE);
group2.AddContentName(kAudioContentName2);
desc_.AddGroup(group2);
ASSERT_TRUE(jdesc_.Initialize(desc_.Clone(), jdesc_.session_id(),
jdesc_.session_version()));
- std::string message = webrtc::SdpSerialize(jdesc_);
+ std::string message = SdpSerialize(jdesc_);
std::string sdp_with_bundle = kSdpFullString;
InjectAfter(kSessionTime,
"a=group:BUNDLE audio_content_name video_content_name\r\n"
@@ -2045,17 +2009,15 @@
}
TEST_F(WebRtcSdpTest, SerializeSessionDescriptionWithBandwidth) {
- VideoContentDescription* vcd =
- webrtc::GetFirstVideoContentDescription(&desc_);
+ VideoContentDescription* vcd = GetFirstVideoContentDescription(&desc_);
vcd->set_bandwidth(100 * 1000 + 755); // Integer division will drop the 755.
vcd->set_bandwidth_type("AS");
- AudioContentDescription* acd =
- webrtc::GetFirstAudioContentDescription(&desc_);
+ AudioContentDescription* acd = GetFirstAudioContentDescription(&desc_);
acd->set_bandwidth(555);
acd->set_bandwidth_type("TIAS");
ASSERT_TRUE(jdesc_.Initialize(desc_.Clone(), jdesc_.session_id(),
jdesc_.session_version()));
- std::string message = webrtc::SdpSerialize(jdesc_);
+ std::string message = SdpSerialize(jdesc_);
std::string sdp_with_bandwidth = kSdpFullString;
InjectAfter("c=IN IP4 74.125.224.39\r\n", "b=AS:100\r\n",
&sdp_with_bandwidth);
@@ -2066,12 +2028,11 @@
// Should default to b=AS if bandwidth_type isn't set.
TEST_F(WebRtcSdpTest, SerializeSessionDescriptionWithMissingBandwidthType) {
- VideoContentDescription* vcd =
- webrtc::GetFirstVideoContentDescription(&desc_);
+ VideoContentDescription* vcd = GetFirstVideoContentDescription(&desc_);
vcd->set_bandwidth(100 * 1000);
ASSERT_TRUE(jdesc_.Initialize(desc_.Clone(), jdesc_.session_id(),
jdesc_.session_version()));
- std::string message = webrtc::SdpSerialize(jdesc_);
+ std::string message = SdpSerialize(jdesc_);
std::string sdp_with_bandwidth = kSdpFullString;
InjectAfter("c=IN IP4 74.125.224.39\r\n", "b=AS:100\r\n",
&sdp_with_bandwidth);
@@ -2089,7 +2050,7 @@
AddIceOptions(kVideoContentName, transport_options);
ASSERT_TRUE(jdesc_.Initialize(desc_.Clone(), jdesc_.session_id(),
jdesc_.session_version()));
- std::string message = webrtc::SdpSerialize(jdesc_);
+ std::string message = SdpSerialize(jdesc_);
std::string sdp_with_ice_options = kSdpFullString;
InjectAfter(kAttributeIcePwdVoice, "a=ice-options:iceoption1 iceoption3\r\n",
&sdp_with_ice_options);
@@ -2128,7 +2089,7 @@
JsepSessionDescription jsep_desc(kDummyType);
MakeDescriptionWithoutCandidates(&jsep_desc);
- std::string message = webrtc::SdpSerialize(jsep_desc);
+ std::string message = SdpSerialize(jsep_desc);
std::string expected_sdp = kSdpString;
expected_sdp.append(kSdpSctpDataChannelString);
@@ -2139,7 +2100,7 @@
const SessionDescription& desc,
int port) {
// Take our pre-built session description and change the SCTP port.
- std::unique_ptr<webrtc::SessionDescription> mutant = desc.Clone();
+ std::unique_ptr<SessionDescription> mutant = desc.Clone();
SctpDataContentDescription* dcdesc =
mutant->GetContentDescriptionByName(kDataContentName)->as_sctp();
dcdesc->set_port(port);
@@ -2156,7 +2117,7 @@
const int kNewPort = 1234;
MutateJsepSctpPort(&jsep_desc, desc_, kNewPort);
- std::string message = webrtc::SdpSerialize(jsep_desc);
+ std::string message = SdpSerialize(jsep_desc);
std::string expected_sdp = kSdpString;
expected_sdp.append(kSdpSctpDataChannelString);
@@ -2174,16 +2135,14 @@
}
TEST_F(WebRtcSdpTest, SerializeMediaContentDescriptionWithExtmapAllowMixed) {
- webrtc::MediaContentDescription* video_desc =
+ MediaContentDescription* video_desc =
jdesc_.description()->GetContentDescriptionByName(kVideoContentName);
ASSERT_TRUE(video_desc);
- webrtc::MediaContentDescription* audio_desc =
+ MediaContentDescription* audio_desc =
jdesc_.description()->GetContentDescriptionByName(kAudioContentName);
ASSERT_TRUE(audio_desc);
- video_desc->set_extmap_allow_mixed_enum(
- webrtc::MediaContentDescription::kMedia);
- audio_desc->set_extmap_allow_mixed_enum(
- webrtc::MediaContentDescription::kMedia);
+ video_desc->set_extmap_allow_mixed_enum(MediaContentDescription::kMedia);
+ audio_desc->set_extmap_allow_mixed_enum(MediaContentDescription::kMedia);
TestSerialize(jdesc_);
}
@@ -2192,7 +2151,7 @@
AddExtmap(encrypted);
JsepSessionDescription desc_with_extmap(kDummyType);
MakeDescriptionWithoutCandidates(&desc_with_extmap);
- std::string message = webrtc::SdpSerialize(desc_with_extmap);
+ std::string message = SdpSerialize(desc_with_extmap);
std::string sdp_with_extmap = kSdpString;
InjectAfter("a=mid:audio_content_name\r\n", kExtmap, &sdp_with_extmap);
@@ -2211,51 +2170,50 @@
}
TEST_F(WebRtcSdpTest, SerializeCandidates) {
- std::string message = webrtc::SdpSerializeCandidate(*jcandidate_);
+ std::string message = SdpSerializeCandidate(*jcandidate_);
EXPECT_EQ(std::string(kRawCandidate), message);
Candidate candidate_with_ufrag(candidates_.front());
candidate_with_ufrag.set_username("ABC");
jcandidate_.reset(new JsepIceCandidate(std::string("audio_content_name"), 0,
candidate_with_ufrag));
- message = webrtc::SdpSerializeCandidate(*jcandidate_);
+ message = SdpSerializeCandidate(*jcandidate_);
EXPECT_EQ(std::string(kRawCandidate) + " ufrag ABC", message);
Candidate candidate_with_network_info(candidates_.front());
candidate_with_network_info.set_network_id(1);
jcandidate_.reset(new JsepIceCandidate(std::string("audio"), 0,
candidate_with_network_info));
- message = webrtc::SdpSerializeCandidate(*jcandidate_);
+ message = SdpSerializeCandidate(*jcandidate_);
EXPECT_EQ(std::string(kRawCandidate) + " network-id 1", message);
candidate_with_network_info.set_network_cost(999);
jcandidate_.reset(new JsepIceCandidate(std::string("audio"), 0,
candidate_with_network_info));
- message = webrtc::SdpSerializeCandidate(*jcandidate_);
+ message = SdpSerializeCandidate(*jcandidate_);
EXPECT_EQ(std::string(kRawCandidate) + " network-id 1 network-cost 999",
message);
}
TEST_F(WebRtcSdpTest, SerializeHostnameCandidate) {
- webrtc::SocketAddress address("a.test", 1234);
- webrtc::Candidate candidate(webrtc::ICE_CANDIDATE_COMPONENT_RTP, "udp",
- address, kCandidatePriority, "", "",
- IceCandidateType::kHost, kCandidateGeneration,
- kCandidateFoundation1);
+ SocketAddress address("a.test", 1234);
+ Candidate candidate(ICE_CANDIDATE_COMPONENT_RTP, "udp", address,
+ kCandidatePriority, "", "", IceCandidateType::kHost,
+ kCandidateGeneration, kCandidateFoundation1);
JsepIceCandidate jcandidate(std::string("audio_content_name"), 0, candidate);
- std::string message = webrtc::SdpSerializeCandidate(jcandidate);
+ std::string message = SdpSerializeCandidate(jcandidate);
EXPECT_EQ(std::string(kRawHostnameCandidate), message);
}
TEST_F(WebRtcSdpTest, SerializeTcpCandidates) {
- Candidate candidate(webrtc::ICE_CANDIDATE_COMPONENT_RTP, "tcp",
- webrtc::SocketAddress("192.168.1.5", 9),
- kCandidatePriority, "", "", IceCandidateType::kHost,
- kCandidateGeneration, kCandidateFoundation1);
- candidate.set_tcptype(webrtc::TCPTYPE_ACTIVE_STR);
+ Candidate candidate(ICE_CANDIDATE_COMPONENT_RTP, "tcp",
+ SocketAddress("192.168.1.5", 9), kCandidatePriority, "",
+ "", IceCandidateType::kHost, kCandidateGeneration,
+ kCandidateFoundation1);
+ candidate.set_tcptype(TCPTYPE_ACTIVE_STR);
std::unique_ptr<IceCandidateInterface> jcandidate(
new JsepIceCandidate(std::string("audio_content_name"), 0, candidate));
- std::string message = webrtc::SdpSerializeCandidate(*jcandidate);
+ std::string message = SdpSerializeCandidate(*jcandidate);
EXPECT_EQ(std::string(kSdpTcpActiveCandidate), message);
}
@@ -2271,8 +2229,7 @@
JsepIceCandidate jcandidate(kDummyMid, kDummyIndex);
EXPECT_TRUE(SdpDeserializeCandidate(missing_tcptype, &jcandidate));
- EXPECT_EQ(std::string(webrtc::TCPTYPE_PASSIVE_STR),
- jcandidate.candidate().tcptype());
+ EXPECT_EQ(std::string(TCPTYPE_PASSIVE_STR), jcandidate.candidate().tcptype());
}
TEST_F(WebRtcSdpTest, ParseSslTcpCandidate) {
@@ -2286,7 +2243,7 @@
}
TEST_F(WebRtcSdpTest, SerializeSessionDescriptionWithH264) {
- webrtc::Codec h264_codec = webrtc::CreateVideoCodec("H264");
+ Codec h264_codec = CreateVideoCodec("H264");
// Id must be valid, but value doesn't matter.
h264_codec.id = 123;
h264_codec.SetParam("profile-level-id", "42e01f");
@@ -2296,7 +2253,7 @@
jdesc_.Initialize(desc_.Clone(), kSessionId, kSessionVersion);
- std::string message = webrtc::SdpSerialize(jdesc_);
+ std::string message = SdpSerialize(jdesc_);
size_t after_pt = message.find(" H264/90000");
ASSERT_NE(after_pt, std::string::npos);
size_t before_pt = message.rfind("a=rtpmap:", after_pt);
@@ -2374,14 +2331,14 @@
JsepSessionDescription jdesc(kDummyType);
EXPECT_TRUE(SdpDeserialize(kSdpNoRtpmapString, &jdesc));
- webrtc::AudioContentDescription* audio =
- webrtc::GetFirstAudioContentDescription(jdesc.description());
- webrtc::Codecs ref_codecs;
+ AudioContentDescription* audio =
+ GetFirstAudioContentDescription(jdesc.description());
+ Codecs ref_codecs;
// The codecs in the AudioContentDescription should be in the same order as
// the payload types (<fmt>s) on the m= line.
- ref_codecs.push_back(webrtc::CreateAudioCodec(0, "PCMU", 8000, 1));
- ref_codecs.push_back(webrtc::CreateAudioCodec(18, "G729", 8000, 1));
- ref_codecs.push_back(webrtc::CreateAudioCodec(103, "ISAC", 16000, 1));
+ ref_codecs.push_back(CreateAudioCodec(0, "PCMU", 8000, 1));
+ ref_codecs.push_back(CreateAudioCodec(18, "G729", 8000, 1));
+ ref_codecs.push_back(CreateAudioCodec(103, "ISAC", 16000, 1));
EXPECT_EQ(ref_codecs, audio->codecs());
}
@@ -2397,18 +2354,18 @@
JsepSessionDescription jdesc(kDummyType);
EXPECT_TRUE(SdpDeserialize(kSdpNoRtpmapString, &jdesc));
- webrtc::AudioContentDescription* audio =
- webrtc::GetFirstAudioContentDescription(jdesc.description());
+ AudioContentDescription* audio =
+ GetFirstAudioContentDescription(jdesc.description());
- webrtc::Codec g729 = audio->codecs()[0];
+ Codec g729 = audio->codecs()[0];
EXPECT_EQ("G729", g729.name);
EXPECT_EQ(8000, g729.clockrate);
EXPECT_EQ(18, g729.id);
- webrtc::CodecParameterMap::iterator found = g729.params.find("annexb");
+ CodecParameterMap::iterator found = g729.params.find("annexb");
ASSERT_TRUE(found != g729.params.end());
EXPECT_EQ(found->second, "yes");
- webrtc::Codec isac = audio->codecs()[1];
+ Codec isac = audio->codecs()[1];
EXPECT_EQ("ISAC", isac.name);
EXPECT_EQ(103, isac.id);
EXPECT_EQ(16000, isac.clockrate);
@@ -2435,7 +2392,7 @@
"a=group:BUNDLE audio_content_name video_content_name\r\n",
&sdp_with_bundle);
EXPECT_TRUE(SdpDeserialize(sdp_with_bundle, &jdesc_with_bundle));
- ContentGroup group(webrtc::GROUP_TYPE_BUNDLE);
+ ContentGroup group(GROUP_TYPE_BUNDLE);
group.AddContentName(kAudioContentName);
group.AddContentName(kVideoContentName);
desc_.AddGroup(group);
@@ -2452,11 +2409,9 @@
InjectAfter("a=mid:audio_content_name\r\na=sendrecv\r\n", "b=AS:50\r\n",
&sdp_with_bandwidth);
EXPECT_TRUE(SdpDeserialize(sdp_with_bandwidth, &jdesc_with_bandwidth));
- VideoContentDescription* vcd =
- webrtc::GetFirstVideoContentDescription(&desc_);
+ VideoContentDescription* vcd = GetFirstVideoContentDescription(&desc_);
vcd->set_bandwidth(100 * 1000);
- AudioContentDescription* acd =
- webrtc::GetFirstAudioContentDescription(&desc_);
+ AudioContentDescription* acd = GetFirstAudioContentDescription(&desc_);
acd->set_bandwidth(50 * 1000);
ASSERT_TRUE(jdesc_.Initialize(desc_.Clone(), jdesc_.session_id(),
jdesc_.session_version()));
@@ -2471,11 +2426,9 @@
InjectAfter("a=mid:audio_content_name\r\na=sendrecv\r\n", "b=TIAS:50000\r\n",
&sdp_with_bandwidth);
EXPECT_TRUE(SdpDeserialize(sdp_with_bandwidth, &jdesc_with_bandwidth));
- VideoContentDescription* vcd =
- webrtc::GetFirstVideoContentDescription(&desc_);
+ VideoContentDescription* vcd = GetFirstVideoContentDescription(&desc_);
vcd->set_bandwidth(100 * 1000);
- AudioContentDescription* acd =
- webrtc::GetFirstAudioContentDescription(&desc_);
+ AudioContentDescription* acd = GetFirstAudioContentDescription(&desc_);
acd->set_bandwidth(50 * 1000);
ASSERT_TRUE(jdesc_.Initialize(desc_.Clone(), jdesc_.session_id(),
jdesc_.session_version()));
@@ -2491,11 +2444,9 @@
InjectAfter("a=mid:audio_content_name\r\na=sendrecv\r\n",
"b=unknown:50000\r\n", &sdp_with_bandwidth);
EXPECT_TRUE(SdpDeserialize(sdp_with_bandwidth, &jdesc_with_bandwidth));
- VideoContentDescription* vcd =
- webrtc::GetFirstVideoContentDescription(&desc_);
+ VideoContentDescription* vcd = GetFirstVideoContentDescription(&desc_);
vcd->set_bandwidth(-1);
- AudioContentDescription* acd =
- webrtc::GetFirstAudioContentDescription(&desc_);
+ AudioContentDescription* acd = GetFirstAudioContentDescription(&desc_);
acd->set_bandwidth(-1);
ASSERT_TRUE(jdesc_.Initialize(desc_.Clone(), jdesc_.session_id(),
jdesc_.session_version()));
@@ -2596,16 +2547,14 @@
}
TEST_F(WebRtcSdpTest, DeserializeMediaContentDescriptionWithExtmapAllowMixed) {
- webrtc::MediaContentDescription* video_desc =
+ MediaContentDescription* video_desc =
jdesc_.description()->GetContentDescriptionByName(kVideoContentName);
ASSERT_TRUE(video_desc);
- webrtc::MediaContentDescription* audio_desc =
+ MediaContentDescription* audio_desc =
jdesc_.description()->GetContentDescriptionByName(kAudioContentName);
ASSERT_TRUE(audio_desc);
- video_desc->set_extmap_allow_mixed_enum(
- webrtc::MediaContentDescription::kMedia);
- audio_desc->set_extmap_allow_mixed_enum(
- webrtc::MediaContentDescription::kMedia);
+ video_desc->set_extmap_allow_mixed_enum(MediaContentDescription::kMedia);
+ audio_desc->set_extmap_allow_mixed_enum(MediaContentDescription::kMedia);
std::string sdp_with_extmap_allow_mixed = kSdpFullString;
InjectAfter("a=mid:audio_content_name\r\n", kExtmapAllowMixed,
@@ -2658,11 +2607,11 @@
sdp = kSdpTcpActiveCandidate;
EXPECT_TRUE(SdpDeserializeCandidate(sdp, &jcandidate));
- // Make a webrtc::Candidate equivalent to kSdpTcpCandidate string.
- Candidate candidate(webrtc::ICE_CANDIDATE_COMPONENT_RTP, "tcp",
- webrtc::SocketAddress("192.168.1.5", 9),
- kCandidatePriority, "", "", IceCandidateType::kHost,
- kCandidateGeneration, kCandidateFoundation1);
+ // Make a Candidate equivalent to kSdpTcpCandidate string.
+ Candidate candidate(ICE_CANDIDATE_COMPONENT_RTP, "tcp",
+ SocketAddress("192.168.1.5", 9), kCandidatePriority, "",
+ "", IceCandidateType::kHost, kCandidateGeneration,
+ kCandidateFoundation1);
std::unique_ptr<IceCandidateInterface> jcandidate_template(
new JsepIceCandidate(std::string("audio_content_name"), 0, candidate));
EXPECT_TRUE(
@@ -2809,7 +2758,7 @@
void MutateJsepSctpMaxMessageSize(const SessionDescription& desc,
int new_value,
JsepSessionDescription* jdesc) {
- std::unique_ptr<webrtc::SessionDescription> mutant = desc.Clone();
+ std::unique_ptr<SessionDescription> mutant = desc.Clone();
SctpDataContentDescription* dcdesc =
mutant->GetContentDescriptionByName(kDataContentName)->as_sctp();
dcdesc->set_max_message_size(new_value);
@@ -2836,7 +2785,7 @@
AddSctpDataChannel(use_sctpmap);
JsepSessionDescription jdesc(kDummyType);
MutateJsepSctpMaxMessageSize(desc_, 12345, &jdesc);
- std::string message = webrtc::SdpSerialize(jdesc);
+ std::string message = SdpSerialize(jdesc);
EXPECT_NE(std::string::npos,
message.find("\r\na=max-message-size:12345\r\n"));
JsepSessionDescription jdesc_output(kDummyType);
@@ -2852,7 +2801,7 @@
AddSctpDataChannel(use_sctpmap);
JsepSessionDescription jdesc(kDummyType);
MutateJsepSctpMaxMessageSize(desc_, 65536, &jdesc);
- std::string message = webrtc::SdpSerialize(jdesc);
+ std::string message = SdpSerialize(jdesc);
EXPECT_EQ(std::string::npos, message.find("\r\na=max-message-size:"));
JsepSessionDescription jdesc_output(kDummyType);
EXPECT_TRUE(SdpDeserialize(message, &jdesc_output));
@@ -2948,8 +2897,7 @@
bool use_sctpmap = true;
AddSctpDataChannel(use_sctpmap);
JsepSessionDescription jdesc(kDummyType);
- SctpDataContentDescription* dcd =
- webrtc::GetFirstSctpDataContentDescription(&desc_);
+ SctpDataContentDescription* dcd = GetFirstSctpDataContentDescription(&desc_);
dcd->set_bandwidth(100 * 1000);
ASSERT_TRUE(jdesc.Initialize(desc_.Clone(), kSessionId, kSessionVersion));
@@ -2994,7 +2942,7 @@
sdp = sdp.substr(0, sdp.size() - 2); // Remove \r\n at the end.
// Deserialize
SdpParseError error;
- EXPECT_FALSE(webrtc::SdpDeserialize(sdp, &jdesc, &error));
+ EXPECT_FALSE(SdpDeserialize(sdp, &jdesc, &error));
const std::string lastline = "a=ssrc:3 cname:stream_1_cname";
EXPECT_EQ(lastline, error.line);
EXPECT_EQ("Invalid SDP line.", error.description);
@@ -3032,12 +2980,12 @@
EXPECT_TRUE(SdpDeserialize(kSdpConferenceString, &jdesc));
// Verify
- webrtc::AudioContentDescription* audio =
- webrtc::GetFirstAudioContentDescription(jdesc.description());
+ AudioContentDescription* audio =
+ GetFirstAudioContentDescription(jdesc.description());
EXPECT_TRUE(audio->conference_mode());
- webrtc::VideoContentDescription* video =
- webrtc::GetFirstVideoContentDescription(jdesc.description());
+ VideoContentDescription* video =
+ GetFirstVideoContentDescription(jdesc.description());
EXPECT_TRUE(video->conference_mode());
}
@@ -3047,16 +2995,16 @@
// We tested deserialization already above, so just test that if we serialize
// and deserialize the flag doesn't disappear.
EXPECT_TRUE(SdpDeserialize(kSdpConferenceString, &jdesc));
- std::string reserialized = webrtc::SdpSerialize(jdesc);
+ std::string reserialized = SdpSerialize(jdesc);
EXPECT_TRUE(SdpDeserialize(reserialized, &jdesc));
// Verify.
- webrtc::AudioContentDescription* audio =
- webrtc::GetFirstAudioContentDescription(jdesc.description());
+ AudioContentDescription* audio =
+ GetFirstAudioContentDescription(jdesc.description());
EXPECT_TRUE(audio->conference_mode());
- webrtc::VideoContentDescription* video =
- webrtc::GetFirstVideoContentDescription(jdesc.description());
+ VideoContentDescription* video =
+ GetFirstVideoContentDescription(jdesc.description());
EXPECT_TRUE(video->conference_mode());
}
@@ -3064,18 +3012,18 @@
{
// By default remote estimates are disabled.
JsepSessionDescription dst(kDummyType);
- SdpDeserialize(webrtc::SdpSerialize(jdesc_), &dst);
- EXPECT_FALSE(webrtc::GetFirstVideoContentDescription(dst.description())
- ->remote_estimate());
+ SdpDeserialize(SdpSerialize(jdesc_), &dst);
+ EXPECT_FALSE(
+ GetFirstVideoContentDescription(dst.description())->remote_estimate());
}
{
// When remote estimate is enabled, the setting is propagated via SDP.
- webrtc::GetFirstVideoContentDescription(jdesc_.description())
+ GetFirstVideoContentDescription(jdesc_.description())
->set_remote_estimate(true);
JsepSessionDescription dst(kDummyType);
- SdpDeserialize(webrtc::SdpSerialize(jdesc_), &dst);
- EXPECT_TRUE(webrtc::GetFirstVideoContentDescription(dst.description())
- ->remote_estimate());
+ SdpDeserialize(SdpSerialize(jdesc_), &dst);
+ EXPECT_TRUE(
+ GetFirstVideoContentDescription(dst.description())->remote_estimate());
}
}
@@ -3190,7 +3138,7 @@
EXPECT_TRUE(SdpDeserialize(kSdpWithReorderedPlTypesString, &jdesc_output));
const AudioContentDescription* acd =
- webrtc::GetFirstAudioContentDescription(jdesc_output.description());
+ GetFirstAudioContentDescription(jdesc_output.description());
ASSERT_TRUE(acd);
ASSERT_FALSE(acd->codecs().empty());
EXPECT_EQ("ISAC", acd->codecs()[0].name);
@@ -3240,18 +3188,16 @@
// Deserialize
SdpParseError error;
- EXPECT_TRUE(
- webrtc::SdpDeserialize(kSdpWithFmtpString, &jdesc_output, &error));
+ EXPECT_TRUE(SdpDeserialize(kSdpWithFmtpString, &jdesc_output, &error));
const VideoContentDescription* vcd =
- webrtc::GetFirstVideoContentDescription(jdesc_output.description());
+ GetFirstVideoContentDescription(jdesc_output.description());
ASSERT_TRUE(vcd);
ASSERT_FALSE(vcd->codecs().empty());
- webrtc::Codec vp8 = vcd->codecs()[0];
+ Codec vp8 = vcd->codecs()[0];
EXPECT_EQ("VP8", vp8.name);
EXPECT_EQ(120, vp8.id);
- webrtc::CodecParameterMap::iterator found =
- vp8.params.find("x-google-min-bitrate");
+ CodecParameterMap::iterator found = vp8.params.find("x-google-min-bitrate");
ASSERT_TRUE(found != vp8.params.end());
EXPECT_EQ(found->second, "10");
found = vp8.params.find("x-google-max-quantization");
@@ -3274,17 +3220,16 @@
// Deserialize.
SdpParseError error;
- EXPECT_TRUE(
- webrtc::SdpDeserialize(kSdpWithFmtpString, &jdesc_output, &error));
+ EXPECT_TRUE(SdpDeserialize(kSdpWithFmtpString, &jdesc_output, &error));
const VideoContentDescription* vcd =
- webrtc::GetFirstVideoContentDescription(jdesc_output.description());
+ GetFirstVideoContentDescription(jdesc_output.description());
ASSERT_TRUE(vcd);
ASSERT_FALSE(vcd->codecs().empty());
- webrtc::Codec h264 = vcd->codecs()[0];
+ Codec h264 = vcd->codecs()[0];
EXPECT_EQ("H264", h264.name);
EXPECT_EQ(98, h264.id);
- webrtc::CodecParameterMap::const_iterator found =
+ CodecParameterMap::const_iterator found =
h264.params.find("profile-level-id");
ASSERT_TRUE(found != h264.params.end());
EXPECT_EQ(found->second, "42A01E");
@@ -3307,18 +3252,16 @@
// Deserialize
SdpParseError error;
- EXPECT_TRUE(
- webrtc::SdpDeserialize(kSdpWithFmtpString, &jdesc_output, &error));
+ EXPECT_TRUE(SdpDeserialize(kSdpWithFmtpString, &jdesc_output, &error));
const VideoContentDescription* vcd =
- webrtc::GetFirstVideoContentDescription(jdesc_output.description());
+ GetFirstVideoContentDescription(jdesc_output.description());
ASSERT_TRUE(vcd);
ASSERT_FALSE(vcd->codecs().empty());
- webrtc::Codec vp8 = vcd->codecs()[0];
+ Codec vp8 = vcd->codecs()[0];
EXPECT_EQ("VP8", vp8.name);
EXPECT_EQ(120, vp8.id);
- webrtc::CodecParameterMap::iterator found =
- vp8.params.find("x-google-min-bitrate");
+ CodecParameterMap::iterator found = vp8.params.find("x-google-min-bitrate");
ASSERT_TRUE(found != vp8.params.end());
EXPECT_EQ(found->second, "10");
found = vp8.params.find("x-google-max-quantization");
@@ -3345,46 +3288,45 @@
"a=packetization:122 unknownpacketizationattributevalue\r\n";
SdpParseError error;
- EXPECT_TRUE(webrtc::SdpDeserialize(kSdpWithPacketizationString, &jdesc_output,
- &error));
+ EXPECT_TRUE(
+ SdpDeserialize(kSdpWithPacketizationString, &jdesc_output, &error));
AudioContentDescription* acd =
- webrtc::GetFirstAudioContentDescription(jdesc_output.description());
+ GetFirstAudioContentDescription(jdesc_output.description());
ASSERT_TRUE(acd);
ASSERT_THAT(acd->codecs(), testing::SizeIs(1));
- webrtc::Codec opus = acd->codecs()[0];
+ Codec opus = acd->codecs()[0];
EXPECT_EQ(opus.name, "opus");
EXPECT_EQ(opus.id, 111);
const VideoContentDescription* vcd =
- webrtc::GetFirstVideoContentDescription(jdesc_output.description());
+ GetFirstVideoContentDescription(jdesc_output.description());
ASSERT_TRUE(vcd);
ASSERT_THAT(vcd->codecs(), testing::SizeIs(3));
- webrtc::Codec vp8 = vcd->codecs()[0];
+ Codec vp8 = vcd->codecs()[0];
EXPECT_EQ(vp8.name, "VP8");
EXPECT_EQ(vp8.id, 120);
EXPECT_EQ(vp8.packetization, "raw");
- webrtc::Codec vp9 = vcd->codecs()[1];
+ Codec vp9 = vcd->codecs()[1];
EXPECT_EQ(vp9.name, "VP9");
EXPECT_EQ(vp9.id, 121);
EXPECT_EQ(vp9.packetization, std::nullopt);
- webrtc::Codec h264 = vcd->codecs()[2];
+ Codec h264 = vcd->codecs()[2];
EXPECT_EQ(h264.name, "H264");
EXPECT_EQ(h264.id, 122);
EXPECT_EQ(h264.packetization, std::nullopt);
}
TEST_F(WebRtcSdpTest, SerializeAudioFmtpWithUnknownParameter) {
- AudioContentDescription* acd =
- webrtc::GetFirstAudioContentDescription(&desc_);
+ AudioContentDescription* acd = GetFirstAudioContentDescription(&desc_);
- webrtc::Codecs codecs = acd->codecs();
+ Codecs codecs = acd->codecs();
codecs[0].params["unknown-future-parameter"] = "SomeFutureValue";
acd->set_codecs(codecs);
ASSERT_TRUE(jdesc_.Initialize(desc_.Clone(), jdesc_.session_id(),
jdesc_.session_version()));
- std::string message = webrtc::SdpSerialize(jdesc_);
+ std::string message = SdpSerialize(jdesc_);
std::string sdp_with_fmtp = kSdpFullString;
InjectAfter("a=rtpmap:111 opus/48000/2\r\n",
"a=fmtp:111 unknown-future-parameter=SomeFutureValue\r\n",
@@ -3393,16 +3335,15 @@
}
TEST_F(WebRtcSdpTest, SerializeAudioFmtpWithKnownFmtpParameter) {
- AudioContentDescription* acd =
- webrtc::GetFirstAudioContentDescription(&desc_);
+ AudioContentDescription* acd = GetFirstAudioContentDescription(&desc_);
- webrtc::Codecs codecs = acd->codecs();
+ Codecs codecs = acd->codecs();
codecs[0].params["stereo"] = "1";
acd->set_codecs(codecs);
ASSERT_TRUE(jdesc_.Initialize(desc_.Clone(), jdesc_.session_id(),
jdesc_.session_version()));
- std::string message = webrtc::SdpSerialize(jdesc_);
+ std::string message = SdpSerialize(jdesc_);
std::string sdp_with_fmtp = kSdpFullString;
InjectAfter("a=rtpmap:111 opus/48000/2\r\n", "a=fmtp:111 stereo=1\r\n",
&sdp_with_fmtp);
@@ -3410,17 +3351,16 @@
}
TEST_F(WebRtcSdpTest, SerializeAudioFmtpWithPTimeAndMaxPTime) {
- AudioContentDescription* acd =
- webrtc::GetFirstAudioContentDescription(&desc_);
+ AudioContentDescription* acd = GetFirstAudioContentDescription(&desc_);
- webrtc::Codecs codecs = acd->codecs();
+ Codecs codecs = acd->codecs();
codecs[0].params["ptime"] = "20";
codecs[0].params["maxptime"] = "120";
acd->set_codecs(codecs);
ASSERT_TRUE(jdesc_.Initialize(desc_.Clone(), jdesc_.session_id(),
jdesc_.session_version()));
- std::string message = webrtc::SdpSerialize(jdesc_);
+ std::string message = SdpSerialize(jdesc_);
std::string sdp_with_fmtp = kSdpFullString;
InjectAfter("a=rtpmap:104 ISAC/32000\r\n",
"a=maxptime:120\r\n" // No comma here. String merging!
@@ -3430,19 +3370,17 @@
}
TEST_F(WebRtcSdpTest, SerializeAudioFmtpWithTelephoneEvent) {
- AudioContentDescription* acd =
- webrtc::GetFirstAudioContentDescription(&desc_);
+ AudioContentDescription* acd = GetFirstAudioContentDescription(&desc_);
- webrtc::Codecs codecs = acd->codecs();
- webrtc::Codec dtmf =
- webrtc::CreateAudioCodec(105, "telephone-event", 8000, 1);
+ Codecs codecs = acd->codecs();
+ Codec dtmf = CreateAudioCodec(105, "telephone-event", 8000, 1);
dtmf.params[""] = "0-15";
codecs.push_back(dtmf);
acd->set_codecs(codecs);
ASSERT_TRUE(jdesc_.Initialize(desc_.Clone(), jdesc_.session_id(),
jdesc_.session_version()));
- std::string message = webrtc::SdpSerialize(jdesc_);
+ std::string message = SdpSerialize(jdesc_);
std::string sdp_with_fmtp = kSdpFullString;
InjectAfter("m=audio 2345 RTP/SAVPF 111 103 104", " 105", &sdp_with_fmtp);
InjectAfter(
@@ -3454,16 +3392,15 @@
}
TEST_F(WebRtcSdpTest, SerializeVideoFmtp) {
- VideoContentDescription* vcd =
- webrtc::GetFirstVideoContentDescription(&desc_);
+ VideoContentDescription* vcd = GetFirstVideoContentDescription(&desc_);
- webrtc::Codecs codecs = vcd->codecs();
+ Codecs codecs = vcd->codecs();
codecs[0].params["x-google-min-bitrate"] = "10";
vcd->set_codecs(codecs);
ASSERT_TRUE(jdesc_.Initialize(desc_.Clone(), jdesc_.session_id(),
jdesc_.session_version()));
- std::string message = webrtc::SdpSerialize(jdesc_);
+ std::string message = SdpSerialize(jdesc_);
std::string sdp_with_fmtp = kSdpFullString;
InjectAfter("a=rtpmap:120 VP8/90000\r\n",
"a=fmtp:120 x-google-min-bitrate=10\r\n", &sdp_with_fmtp);
@@ -3471,16 +3408,15 @@
}
TEST_F(WebRtcSdpTest, SerializeVideoPacketizationAttribute) {
- VideoContentDescription* vcd =
- webrtc::GetFirstVideoContentDescription(&desc_);
+ VideoContentDescription* vcd = GetFirstVideoContentDescription(&desc_);
- webrtc::Codecs codecs = vcd->codecs();
+ Codecs codecs = vcd->codecs();
codecs[0].packetization = "raw";
vcd->set_codecs(codecs);
ASSERT_TRUE(jdesc_.Initialize(desc_.Clone(), jdesc_.session_id(),
jdesc_.session_version()));
- std::string message = webrtc::SdpSerialize(jdesc_);
+ std::string message = SdpSerialize(jdesc_);
std::string sdp_with_packetization = kSdpFullString;
InjectAfter("a=rtpmap:120 VP8/90000\r\n", "a=packetization:120 raw\r\n",
&sdp_with_packetization);
@@ -3492,24 +3428,24 @@
JsepSessionDescription jdesc_with_icelite(kDummyType);
std::string sdp_with_icelite = kSdpFullString;
EXPECT_TRUE(SdpDeserialize(sdp_with_icelite, &jdesc_with_icelite));
- webrtc::SessionDescription* desc = jdesc_with_icelite.description();
- const webrtc::TransportInfo* tinfo1 =
+ SessionDescription* desc = jdesc_with_icelite.description();
+ const TransportInfo* tinfo1 =
desc->GetTransportInfoByName("audio_content_name");
- EXPECT_EQ(webrtc::ICEMODE_FULL, tinfo1->description.ice_mode);
- const webrtc::TransportInfo* tinfo2 =
+ EXPECT_EQ(ICEMODE_FULL, tinfo1->description.ice_mode);
+ const TransportInfo* tinfo2 =
desc->GetTransportInfoByName("video_content_name");
- EXPECT_EQ(webrtc::ICEMODE_FULL, tinfo2->description.ice_mode);
+ EXPECT_EQ(ICEMODE_FULL, tinfo2->description.ice_mode);
// Add "a=ice-lite" and deserialize, making sure it's ICE lite.
InjectAfter(kSessionTime, "a=ice-lite\r\n", &sdp_with_icelite);
EXPECT_TRUE(SdpDeserialize(sdp_with_icelite, &jdesc_with_icelite));
desc = jdesc_with_icelite.description();
- const webrtc::TransportInfo* atinfo =
+ const TransportInfo* atinfo =
desc->GetTransportInfoByName("audio_content_name");
- EXPECT_EQ(webrtc::ICEMODE_LITE, atinfo->description.ice_mode);
- const webrtc::TransportInfo* vtinfo =
+ EXPECT_EQ(ICEMODE_LITE, atinfo->description.ice_mode);
+ const TransportInfo* vtinfo =
desc->GetTransportInfoByName("video_content_name");
- EXPECT_EQ(webrtc::ICEMODE_LITE, vtinfo->description.ice_mode);
+ EXPECT_EQ(ICEMODE_LITE, vtinfo->description.ice_mode);
// Now that we know deserialization works, we can use TestSerialize to test
// serialization.
@@ -3524,23 +3460,21 @@
JsepSessionDescription jdesc_output(kDummyType);
EXPECT_TRUE(SdpDeserialize(sdp_with_data, &jdesc_output));
- EXPECT_EQ(sdp_with_data, webrtc::SdpSerialize(jdesc_output));
+ EXPECT_EQ(sdp_with_data, SdpSerialize(jdesc_output));
}
TEST_F(WebRtcSdpTest, SerializeDtlsSetupAttribute) {
TransportInfo audio_transport_info =
*(desc_.GetTransportInfoByName(kAudioContentName));
- EXPECT_EQ(webrtc::CONNECTIONROLE_NONE,
+ EXPECT_EQ(CONNECTIONROLE_NONE,
audio_transport_info.description.connection_role);
- audio_transport_info.description.connection_role =
- webrtc::CONNECTIONROLE_ACTIVE;
+ audio_transport_info.description.connection_role = CONNECTIONROLE_ACTIVE;
TransportInfo video_transport_info =
*(desc_.GetTransportInfoByName(kVideoContentName));
- EXPECT_EQ(webrtc::CONNECTIONROLE_NONE,
+ EXPECT_EQ(CONNECTIONROLE_NONE,
video_transport_info.description.connection_role);
- video_transport_info.description.connection_role =
- webrtc::CONNECTIONROLE_ACTIVE;
+ video_transport_info.description.connection_role = CONNECTIONROLE_ACTIVE;
desc_.RemoveTransportInfoByName(kAudioContentName);
desc_.RemoveTransportInfoByName(kVideoContentName);
@@ -3550,7 +3484,7 @@
ASSERT_TRUE(jdesc_.Initialize(desc_.Clone(), jdesc_.session_id(),
jdesc_.session_version()));
- std::string message = webrtc::SdpSerialize(jdesc_);
+ std::string message = SdpSerialize(jdesc_);
std::string sdp_with_dtlssetup = kSdpFullString;
// Now adding `setup` attribute.
@@ -3563,15 +3497,13 @@
std::string sdp_with_dtlssetup = kSdpFullString;
InjectAfter(kSessionTime, "a=setup:actpass\r\n", &sdp_with_dtlssetup);
EXPECT_TRUE(SdpDeserialize(sdp_with_dtlssetup, &jdesc_with_dtlssetup));
- webrtc::SessionDescription* desc = jdesc_with_dtlssetup.description();
- const webrtc::TransportInfo* atinfo =
+ SessionDescription* desc = jdesc_with_dtlssetup.description();
+ const TransportInfo* atinfo =
desc->GetTransportInfoByName("audio_content_name");
- EXPECT_EQ(webrtc::CONNECTIONROLE_ACTPASS,
- atinfo->description.connection_role);
- const webrtc::TransportInfo* vtinfo =
+ EXPECT_EQ(CONNECTIONROLE_ACTPASS, atinfo->description.connection_role);
+ const TransportInfo* vtinfo =
desc->GetTransportInfoByName("video_content_name");
- EXPECT_EQ(webrtc::CONNECTIONROLE_ACTPASS,
- vtinfo->description.connection_role);
+ EXPECT_EQ(CONNECTIONROLE_ACTPASS, vtinfo->description.connection_role);
}
TEST_F(WebRtcSdpTest, DeserializeDtlsSetupAttributeActive) {
@@ -3579,28 +3511,26 @@
std::string sdp_with_dtlssetup = kSdpFullString;
InjectAfter(kSessionTime, "a=setup:active\r\n", &sdp_with_dtlssetup);
EXPECT_TRUE(SdpDeserialize(sdp_with_dtlssetup, &jdesc_with_dtlssetup));
- webrtc::SessionDescription* desc = jdesc_with_dtlssetup.description();
- const webrtc::TransportInfo* atinfo =
+ SessionDescription* desc = jdesc_with_dtlssetup.description();
+ const TransportInfo* atinfo =
desc->GetTransportInfoByName("audio_content_name");
- EXPECT_EQ(webrtc::CONNECTIONROLE_ACTIVE, atinfo->description.connection_role);
- const webrtc::TransportInfo* vtinfo =
+ EXPECT_EQ(CONNECTIONROLE_ACTIVE, atinfo->description.connection_role);
+ const TransportInfo* vtinfo =
desc->GetTransportInfoByName("video_content_name");
- EXPECT_EQ(webrtc::CONNECTIONROLE_ACTIVE, vtinfo->description.connection_role);
+ EXPECT_EQ(CONNECTIONROLE_ACTIVE, vtinfo->description.connection_role);
}
TEST_F(WebRtcSdpTest, DeserializeDtlsSetupAttributePassive) {
JsepSessionDescription jdesc_with_dtlssetup(kDummyType);
std::string sdp_with_dtlssetup = kSdpFullString;
InjectAfter(kSessionTime, "a=setup:passive\r\n", &sdp_with_dtlssetup);
EXPECT_TRUE(SdpDeserialize(sdp_with_dtlssetup, &jdesc_with_dtlssetup));
- webrtc::SessionDescription* desc = jdesc_with_dtlssetup.description();
- const webrtc::TransportInfo* atinfo =
+ SessionDescription* desc = jdesc_with_dtlssetup.description();
+ const TransportInfo* atinfo =
desc->GetTransportInfoByName("audio_content_name");
- EXPECT_EQ(webrtc::CONNECTIONROLE_PASSIVE,
- atinfo->description.connection_role);
- const webrtc::TransportInfo* vtinfo =
+ EXPECT_EQ(CONNECTIONROLE_PASSIVE, atinfo->description.connection_role);
+ const TransportInfo* vtinfo =
desc->GetTransportInfoByName("video_content_name");
- EXPECT_EQ(webrtc::CONNECTIONROLE_PASSIVE,
- vtinfo->description.connection_role);
+ EXPECT_EQ(CONNECTIONROLE_PASSIVE, vtinfo->description.connection_role);
}
// Verifies that the order of the serialized m-lines follows the order of the
@@ -3609,9 +3539,8 @@
JsepSessionDescription jdesc(kDummyType);
const std::string media_content_sdps[3] = {kSdpAudioString, kSdpVideoString,
kSdpSctpDataChannelString};
- const webrtc::MediaType media_types[3] = {webrtc::MediaType::AUDIO,
- webrtc::MediaType::VIDEO,
- webrtc::MediaType::DATA};
+ const MediaType media_types[3] = {MediaType::AUDIO, MediaType::VIDEO,
+ MediaType::DATA};
// Verifies all 6 permutations.
for (size_t i = 0; i < 6; ++i) {
@@ -3628,16 +3557,16 @@
sdp_string += media_content_sdps[media_content_in_sdp[j]];
EXPECT_TRUE(SdpDeserialize(sdp_string, &jdesc));
- webrtc::SessionDescription* desc = jdesc.description();
+ SessionDescription* desc = jdesc.description();
EXPECT_EQ(3u, desc->contents().size());
for (size_t j = 0; j < 3; ++j) {
- const webrtc::MediaContentDescription* mdesc =
+ const MediaContentDescription* mdesc =
desc->contents()[j].media_description();
EXPECT_EQ(media_types[media_content_in_sdp[j]], mdesc->type());
}
- std::string serialized_sdp = webrtc::SdpSerialize(jdesc);
+ std::string serialized_sdp = SdpSerialize(jdesc);
EXPECT_EQ(sdp_string, serialized_sdp);
}
}
@@ -3707,18 +3636,17 @@
// lines do not support multiple stream ids and no stream ids.
TEST_F(WebRtcSdpTest, DeserializeSessionDescriptionSpecialMsid) {
// Create both msid lines for Plan B and Unified Plan support.
- MakeUnifiedPlanDescriptionMultipleStreamIds(
- webrtc::kMsidSignalingMediaSection | webrtc::kMsidSignalingSsrcAttribute |
- webrtc::kMsidSignalingSemantic);
+ MakeUnifiedPlanDescriptionMultipleStreamIds(kMsidSignalingMediaSection |
+ kMsidSignalingSsrcAttribute |
+ kMsidSignalingSemantic);
JsepSessionDescription deserialized_description(kDummyType);
EXPECT_TRUE(SdpDeserialize(kUnifiedPlanSdpFullStringWithSpecialMsid,
&deserialized_description));
EXPECT_TRUE(CompareSessionDescription(jdesc_, deserialized_description));
- EXPECT_EQ(webrtc::kMsidSignalingMediaSection |
- webrtc::kMsidSignalingSsrcAttribute |
- webrtc::kMsidSignalingSemantic,
+ EXPECT_EQ(kMsidSignalingMediaSection | kMsidSignalingSsrcAttribute |
+ kMsidSignalingSemantic,
deserialized_description.description()->msid_signaling());
}
@@ -3728,10 +3656,10 @@
// multiple stream ids.
TEST_F(WebRtcSdpTest, SerializeSessionDescriptionSpecialMsid) {
// Create both msid lines for Plan B and Unified Plan support.
- MakeUnifiedPlanDescriptionMultipleStreamIds(
- webrtc::kMsidSignalingMediaSection | webrtc::kMsidSignalingSsrcAttribute |
- webrtc::kMsidSignalingSemantic);
- std::string serialized_sdp = webrtc::SdpSerialize(jdesc_);
+ MakeUnifiedPlanDescriptionMultipleStreamIds(kMsidSignalingMediaSection |
+ kMsidSignalingSsrcAttribute |
+ kMsidSignalingSemantic);
+ std::string serialized_sdp = SdpSerialize(jdesc_);
// We explicitly test that the serialized SDP string is equal to the hard
// coded SDP string. This is necessary, because in the parser "a=msid" lines
// take priority over "a=ssrc msid" lines. This means if we just used
@@ -3745,8 +3673,8 @@
// no stream ids and multiple stream ids.
TEST_F(WebRtcSdpTest, UnifiedPlanDeserializeSessionDescriptionSpecialMsid) {
// Only create a=msid lines for strictly Unified Plan stream ID support.
- MakeUnifiedPlanDescriptionMultipleStreamIds(
- webrtc::kMsidSignalingMediaSection | webrtc::kMsidSignalingSemantic);
+ MakeUnifiedPlanDescriptionMultipleStreamIds(kMsidSignalingMediaSection |
+ kMsidSignalingSemantic);
JsepSessionDescription deserialized_description(kDummyType);
std::string unified_plan_sdp_string =
@@ -3763,8 +3691,8 @@
// stream ids and multiple stream ids.
TEST_F(WebRtcSdpTest, UnifiedPlanSerializeSessionDescriptionSpecialMsid) {
// Only create a=msid lines for strictly Unified Plan stream ID support.
- MakeUnifiedPlanDescriptionMultipleStreamIds(
- webrtc::kMsidSignalingMediaSection | webrtc::kMsidSignalingSemantic);
+ MakeUnifiedPlanDescriptionMultipleStreamIds(kMsidSignalingMediaSection |
+ kMsidSignalingSemantic);
TestSerialize(jdesc_);
}
@@ -3796,8 +3724,7 @@
TEST_F(WebRtcSdpTest, EmptyDescriptionHasNoMsidSignaling) {
JsepSessionDescription jsep_desc(kDummyType);
ASSERT_TRUE(SdpDeserialize(kSdpSessionString, &jsep_desc));
- EXPECT_EQ(webrtc::kMsidSignalingSemantic,
- jsep_desc.description()->msid_signaling());
+ EXPECT_EQ(kMsidSignalingSemantic, jsep_desc.description()->msid_signaling());
}
TEST_F(WebRtcSdpTest, DataChannelOnlyHasNoMsidSignaling) {
@@ -3805,22 +3732,20 @@
std::string sdp = kSdpSessionString;
sdp += kSdpSctpDataChannelString;
ASSERT_TRUE(SdpDeserialize(sdp, &jsep_desc));
- EXPECT_EQ(webrtc::kMsidSignalingSemantic,
- jsep_desc.description()->msid_signaling());
+ EXPECT_EQ(kMsidSignalingSemantic, jsep_desc.description()->msid_signaling());
}
TEST_F(WebRtcSdpTest, PlanBHasSsrcAttributeMsidSignaling) {
JsepSessionDescription jsep_desc(kDummyType);
ASSERT_TRUE(SdpDeserialize(kPlanBSdpFullString, &jsep_desc));
- EXPECT_EQ(
- webrtc::kMsidSignalingSsrcAttribute | webrtc::kMsidSignalingSemantic,
- jsep_desc.description()->msid_signaling());
+ EXPECT_EQ(kMsidSignalingSsrcAttribute | kMsidSignalingSemantic,
+ jsep_desc.description()->msid_signaling());
}
TEST_F(WebRtcSdpTest, UnifiedPlanHasMediaSectionMsidSignaling) {
JsepSessionDescription jsep_desc(kDummyType);
ASSERT_TRUE(SdpDeserialize(kUnifiedPlanSdpFullString, &jsep_desc));
- EXPECT_EQ(webrtc::kMsidSignalingMediaSection | webrtc::kMsidSignalingSemantic,
+ EXPECT_EQ(kMsidSignalingMediaSection | kMsidSignalingSemantic,
jsep_desc.description()->msid_signaling());
}
@@ -3829,33 +3754,33 @@
"a=ssrc:1 msid:local_stream_1 audio_track_id_1";
TEST_F(WebRtcSdpTest, SerializeOnlyMediaSectionMsid) {
- jdesc_.description()->set_msid_signaling(webrtc::kMsidSignalingMediaSection);
- std::string sdp = webrtc::SdpSerialize(jdesc_);
+ jdesc_.description()->set_msid_signaling(kMsidSignalingMediaSection);
+ std::string sdp = SdpSerialize(jdesc_);
EXPECT_NE(std::string::npos, sdp.find(kMediaSectionMsidLine));
EXPECT_EQ(std::string::npos, sdp.find(kSsrcAttributeMsidLine));
}
TEST_F(WebRtcSdpTest, SerializeOnlySsrcAttributeMsid) {
- jdesc_.description()->set_msid_signaling(webrtc::kMsidSignalingSsrcAttribute);
- std::string sdp = webrtc::SdpSerialize(jdesc_);
+ jdesc_.description()->set_msid_signaling(kMsidSignalingSsrcAttribute);
+ std::string sdp = SdpSerialize(jdesc_);
EXPECT_EQ(std::string::npos, sdp.find(kMediaSectionMsidLine));
EXPECT_NE(std::string::npos, sdp.find(kSsrcAttributeMsidLine));
}
TEST_F(WebRtcSdpTest, SerializeBothMediaSectionAndSsrcAttributeMsid) {
- jdesc_.description()->set_msid_signaling(webrtc::kMsidSignalingMediaSection |
- webrtc::kMsidSignalingSsrcAttribute);
- std::string sdp = webrtc::SdpSerialize(jdesc_);
+ jdesc_.description()->set_msid_signaling(kMsidSignalingMediaSection |
+ kMsidSignalingSsrcAttribute);
+ std::string sdp = SdpSerialize(jdesc_);
EXPECT_NE(std::string::npos, sdp.find(kMediaSectionMsidLine));
EXPECT_NE(std::string::npos, sdp.find(kSsrcAttributeMsidLine));
}
TEST_F(WebRtcSdpTest, SerializeWithoutMsidSemantics) {
- jdesc_.description()->set_msid_signaling(webrtc::kMsidSignalingNotUsed);
- std::string sdp = webrtc::SdpSerialize(jdesc_);
+ jdesc_.description()->set_msid_signaling(kMsidSignalingNotUsed);
+ std::string sdp = SdpSerialize(jdesc_);
EXPECT_EQ(std::string::npos, sdp.find("a=msid-semantic:"));
}
@@ -3909,9 +3834,9 @@
JsepSessionDescription jdesc_output(kDummyType);
EXPECT_TRUE(SdpDeserialize(kSdpWithBandwidthOfNegativeOne, &jdesc_output));
const VideoContentDescription* vcd =
- webrtc::GetFirstVideoContentDescription(jdesc_output.description());
+ GetFirstVideoContentDescription(jdesc_output.description());
ASSERT_TRUE(vcd);
- EXPECT_EQ(webrtc::kAutoBandwidth, vcd->bandwidth());
+ EXPECT_EQ(kAutoBandwidth, vcd->bandwidth());
}
// Test that "ufrag"/"pwd" in the candidate line itself are ignored, and only
@@ -3939,7 +3864,7 @@
const IceCandidateCollection* candidates = jdesc_output.candidates(0);
ASSERT_NE(nullptr, candidates);
ASSERT_EQ(1U, candidates->count());
- webrtc::Candidate c = candidates->at(0)->candidate();
+ Candidate c = candidates->at(0)->candidate();
EXPECT_EQ("ufrag_voice", c.username());
EXPECT_EQ("pwd_voice", c.password());
}
@@ -3968,7 +3893,7 @@
const IceCandidateCollection* candidates = jdesc_output.candidates(0);
ASSERT_NE(nullptr, candidates);
ASSERT_EQ(1U, candidates->count());
- webrtc::Candidate c = candidates->at(0)->candidate();
+ Candidate c = candidates->at(0)->candidate();
EXPECT_EQ("ufrag_voice", c.username());
EXPECT_EQ("pwd_voice", c.password());
}
@@ -4420,7 +4345,7 @@
JsepSessionDescription expected_jsep(kDummyType);
MakeDescriptionWithoutCandidates(&expected_jsep);
// Serialization.
- std::string message = webrtc::SdpSerialize(expected_jsep);
+ std::string message = SdpSerialize(expected_jsep);
// Deserialization.
JsepSessionDescription jdesc(kDummyType);
EXPECT_TRUE(SdpDeserialize(message, &jdesc));
@@ -4470,10 +4395,9 @@
sdp += "a=simulcast:send 1,2;3 recv 4;5;6\r\n";
JsepSessionDescription output(kDummyType);
SdpParseError error;
- EXPECT_TRUE(webrtc::SdpDeserialize(sdp, &output, &error));
- const webrtc::ContentInfos& contents = output.description()->contents();
- const webrtc::MediaContentDescription* media =
- contents.back().media_description();
+ EXPECT_TRUE(SdpDeserialize(sdp, &output, &error));
+ const ContentInfos& contents = output.description()->contents();
+ const MediaContentDescription* media = contents.back().media_description();
EXPECT_TRUE(media->HasSimulcast());
EXPECT_EQ(2ul, media->simulcast_description().send_layers().size());
EXPECT_EQ(3ul, media->simulcast_description().receive_layers().size());
@@ -4491,10 +4415,9 @@
sdp += "a=simulcast:send 1,2;3 recv 4;5,6\r\n";
JsepSessionDescription output(kDummyType);
SdpParseError error;
- EXPECT_TRUE(webrtc::SdpDeserialize(sdp, &output, &error));
- const webrtc::ContentInfos& contents = output.description()->contents();
- const webrtc::MediaContentDescription* media =
- contents.back().media_description();
+ EXPECT_TRUE(SdpDeserialize(sdp, &output, &error));
+ const ContentInfos& contents = output.description()->contents();
+ const MediaContentDescription* media = contents.back().media_description();
EXPECT_TRUE(media->HasSimulcast());
const SimulcastDescription& simulcast = media->simulcast_description();
EXPECT_EQ(2ul, simulcast.send_layers().size());
@@ -4529,10 +4452,9 @@
sdp += "a=simulcast:send 1;2;3 recv 2;4\r\n";
JsepSessionDescription output(kDummyType);
SdpParseError error;
- EXPECT_TRUE(webrtc::SdpDeserialize(sdp, &output, &error));
- const webrtc::ContentInfos& contents = output.description()->contents();
- const webrtc::MediaContentDescription* media =
- contents.back().media_description();
+ EXPECT_TRUE(SdpDeserialize(sdp, &output, &error));
+ const ContentInfos& contents = output.description()->contents();
+ const MediaContentDescription* media = contents.back().media_description();
EXPECT_TRUE(media->HasSimulcast());
const SimulcastDescription& simulcast = media->simulcast_description();
EXPECT_EQ(2ul, simulcast.send_layers().size());
@@ -4555,10 +4477,9 @@
sdp += "a=simulcast:send 1;2\r\n";
JsepSessionDescription output(kDummyType);
SdpParseError error;
- EXPECT_TRUE(webrtc::SdpDeserialize(sdp, &output, &error));
- const webrtc::ContentInfos& contents = output.description()->contents();
- const webrtc::MediaContentDescription* media =
- contents.back().media_description();
+ EXPECT_TRUE(SdpDeserialize(sdp, &output, &error));
+ const ContentInfos& contents = output.description()->contents();
+ const MediaContentDescription* media = contents.back().media_description();
EXPECT_TRUE(media->HasSimulcast());
const SimulcastDescription& simulcast = media->simulcast_description();
EXPECT_TRUE(simulcast.receive_layers().empty());
@@ -4581,10 +4502,9 @@
sdp += "a=simulcast:send 1,2,3;4,5\r\n";
JsepSessionDescription output(kDummyType);
SdpParseError error;
- EXPECT_TRUE(webrtc::SdpDeserialize(sdp, &output, &error));
- const webrtc::ContentInfos& contents = output.description()->contents();
- const webrtc::MediaContentDescription* media =
- contents.back().media_description();
+ EXPECT_TRUE(SdpDeserialize(sdp, &output, &error));
+ const ContentInfos& contents = output.description()->contents();
+ const MediaContentDescription* media = contents.back().media_description();
EXPECT_TRUE(media->HasSimulcast());
const SimulcastDescription& simulcast = media->simulcast_description();
EXPECT_TRUE(simulcast.receive_layers().empty());
@@ -4604,10 +4524,9 @@
sdp += "a=simulcast:send 1;2\r\n";
JsepSessionDescription output(kDummyType);
SdpParseError error;
- EXPECT_TRUE(webrtc::SdpDeserialize(sdp, &output, &error));
- const webrtc::ContentInfos& contents = output.description()->contents();
- const webrtc::MediaContentDescription* media =
- contents.back().media_description();
+ EXPECT_TRUE(SdpDeserialize(sdp, &output, &error));
+ const ContentInfos& contents = output.description()->contents();
+ const MediaContentDescription* media = contents.back().media_description();
EXPECT_TRUE(media->HasSimulcast());
const SimulcastDescription& simulcast = media->simulcast_description();
EXPECT_TRUE(simulcast.receive_layers().empty());
@@ -4635,10 +4554,9 @@
sdp += "a=simulcast:send 1,2;3 recv 4\r\n";
JsepSessionDescription output(kDummyType);
SdpParseError error;
- EXPECT_TRUE(webrtc::SdpDeserialize(sdp, &output, &error));
- const webrtc::ContentInfos& contents = output.description()->contents();
- const webrtc::MediaContentDescription* media =
- contents.back().media_description();
+ EXPECT_TRUE(SdpDeserialize(sdp, &output, &error));
+ const ContentInfos& contents = output.description()->contents();
+ const MediaContentDescription* media = contents.back().media_description();
EXPECT_TRUE(media->HasSimulcast());
const SimulcastDescription& simulcast = media->simulcast_description();
EXPECT_EQ(2ul, simulcast.send_layers().size());
@@ -4658,10 +4576,9 @@
sdp += "a=simulcast:send 1;2\r\n";
JsepSessionDescription output(kDummyType);
SdpParseError error;
- EXPECT_TRUE(webrtc::SdpDeserialize(sdp, &output, &error));
- const webrtc::ContentInfos& contents = output.description()->contents();
- const webrtc::MediaContentDescription* media =
- contents.back().media_description();
+ EXPECT_TRUE(SdpDeserialize(sdp, &output, &error));
+ const ContentInfos& contents = output.description()->contents();
+ const MediaContentDescription* media = contents.back().media_description();
EXPECT_FALSE(media->HasSimulcast());
}
@@ -4672,10 +4589,9 @@
sdp += "a=simulcast:recv 1;2\r\n";
JsepSessionDescription output(kDummyType);
SdpParseError error;
- EXPECT_TRUE(webrtc::SdpDeserialize(sdp, &output, &error));
- const webrtc::ContentInfos& contents = output.description()->contents();
- const webrtc::MediaContentDescription* media =
- contents.back().media_description();
+ EXPECT_TRUE(SdpDeserialize(sdp, &output, &error));
+ const ContentInfos& contents = output.description()->contents();
+ const MediaContentDescription* media = contents.back().media_description();
EXPECT_FALSE(media->HasSimulcast());
}
@@ -4690,10 +4606,9 @@
sdp += "a=simulcast:send 1;5;3 recv 4;2;6\r\n";
JsepSessionDescription output(kDummyType);
SdpParseError error;
- EXPECT_TRUE(webrtc::SdpDeserialize(sdp, &output, &error));
- const webrtc::ContentInfos& contents = output.description()->contents();
- const webrtc::MediaContentDescription* media =
- contents.back().media_description();
+ EXPECT_TRUE(SdpDeserialize(sdp, &output, &error));
+ const ContentInfos& contents = output.description()->contents();
+ const MediaContentDescription* media = contents.back().media_description();
EXPECT_TRUE(media->HasSimulcast());
const SimulcastDescription& simulcast = media->simulcast_description();
EXPECT_EQ(2ul, simulcast.send_layers().size());
@@ -4749,35 +4664,34 @@
JsepSessionDescription output(kDummyType);
SdpParseError error;
- ASSERT_TRUE(webrtc::SdpDeserialize(sdp, &output, &error));
+ ASSERT_TRUE(SdpDeserialize(sdp, &output, &error));
EXPECT_THAT(output.description()->contents(),
- ElementsAre(Property("name", &webrtc::ContentInfo::mid, ""),
- Property("name", &webrtc::ContentInfo::mid, "")));
+ ElementsAre(Property("name", &ContentInfo::mid, ""),
+ Property("name", &ContentInfo::mid, "")));
}
TEST_F(WebRtcSdpTest, SerializeWithDefaultSctpProtocol) {
AddSctpDataChannel(false); // Don't use sctpmap
JsepSessionDescription jsep_desc(kDummyType);
MakeDescriptionWithoutCandidates(&jsep_desc);
- std::string message = webrtc::SdpSerialize(jsep_desc);
- EXPECT_NE(std::string::npos, message.find(webrtc::kMediaProtocolUdpDtlsSctp));
+ std::string message = SdpSerialize(jsep_desc);
+ EXPECT_NE(std::string::npos, message.find(kMediaProtocolUdpDtlsSctp));
}
TEST_F(WebRtcSdpTest, DeserializeWithAllSctpProtocols) {
AddSctpDataChannel(false);
- std::string protocols[] = {webrtc::kMediaProtocolDtlsSctp,
- webrtc::kMediaProtocolUdpDtlsSctp,
- webrtc::kMediaProtocolTcpDtlsSctp};
+ std::string protocols[] = {kMediaProtocolDtlsSctp, kMediaProtocolUdpDtlsSctp,
+ kMediaProtocolTcpDtlsSctp};
for (const auto& protocol : protocols) {
sctp_desc_->set_protocol(protocol);
JsepSessionDescription jsep_desc(kDummyType);
MakeDescriptionWithoutCandidates(&jsep_desc);
- std::string message = webrtc::SdpSerialize(jsep_desc);
+ std::string message = SdpSerialize(jsep_desc);
EXPECT_NE(std::string::npos, message.find(protocol));
JsepSessionDescription jsep_output(kDummyType);
SdpParseError error;
- EXPECT_TRUE(webrtc::SdpDeserialize(message, &jsep_output, &error));
+ EXPECT_TRUE(SdpDeserialize(message, &jsep_output, &error));
}
}
@@ -4971,7 +4885,7 @@
JsepSessionDescription output(kDummyType);
SdpParseError error;
- ASSERT_TRUE(webrtc::SdpDeserialize(sdp, &output, &error));
+ ASSERT_TRUE(SdpDeserialize(sdp, &output, &error));
}
TEST_F(WebRtcSdpTest, ParseSessionLevelExtmapAttributes) {
@@ -5114,7 +5028,7 @@
const auto content = jdesc.description()->contents()[0];
const auto* description = content.media_description();
ASSERT_NE(description, nullptr);
- const std::vector<webrtc::Codec> codecs = description->codecs();
+ const std::vector<Codec> codecs = description->codecs();
ASSERT_EQ(codecs.size(), 4u);
std::string value;
@@ -5143,10 +5057,10 @@
TEST_F(WebRtcSdpTest, ParsesKeyValueFmtpParameterSet) {
std::string params = "key1=value1;key2=value2";
- webrtc::CodecParameterMap codec_params;
+ CodecParameterMap codec_params;
SdpParseError error;
- ASSERT_TRUE(webrtc::ParseFmtpParameterSet(params, codec_params, &error));
+ ASSERT_TRUE(ParseFmtpParameterSet(params, codec_params, &error));
EXPECT_EQ(2U, codec_params.size());
EXPECT_EQ(codec_params["key1"], "value1");
EXPECT_EQ(codec_params["key2"], "value2");
@@ -5154,10 +5068,13 @@
TEST_F(WebRtcSdpTest, ParsesNonKeyValueFmtpParameterSet) {
std::string params = "not-in-key-value-format";
- webrtc::CodecParameterMap codec_params;
+ CodecParameterMap codec_params;
SdpParseError error;
- ASSERT_TRUE(webrtc::ParseFmtpParameterSet(params, codec_params, &error));
+ ASSERT_TRUE(ParseFmtpParameterSet(params, codec_params, &error));
EXPECT_EQ(1U, codec_params.size());
EXPECT_EQ(codec_params[""], "not-in-key-value-format");
}
+
+} // namespace
+} // namespace webrtc
diff --git a/pc/webrtc_session_description_factory.cc b/pc/webrtc_session_description_factory.cc
index 0ca42e4..5c90efd 100644
--- a/pc/webrtc_session_description_factory.cc
+++ b/pc/webrtc_session_description_factory.cc
@@ -43,10 +43,6 @@
#include "rtc_base/rtc_certificate_generator.h"
#include "rtc_base/ssl_identity.h"
#include "rtc_base/ssl_stream_adapter.h"
-#include "rtc_base/unique_id_generator.h"
-
-using ::webrtc::MediaSessionOptions;
-using webrtc::UniqueRandomIdGenerator;
namespace webrtc {
namespace {
@@ -116,7 +112,7 @@
bool dtls_enabled,
std::unique_ptr<RTCCertificateGeneratorInterface> cert_generator,
scoped_refptr<RTCCertificate> certificate,
- std::function<void(const webrtc::scoped_refptr<webrtc::RTCCertificate>&)>
+ std::function<void(const scoped_refptr<RTCCertificate>&)>
on_certificate_ready,
CodecLookupHelper* codec_lookup_helper,
const FieldTrialsView& field_trials)
diff --git a/pc/webrtc_session_description_factory.h b/pc/webrtc_session_description_factory.h
index 3f3e6b6..c897a81 100644
--- a/pc/webrtc_session_description_factory.h
+++ b/pc/webrtc_session_description_factory.h
@@ -53,7 +53,7 @@
bool dtls_enabled,
std::unique_ptr<RTCCertificateGeneratorInterface> cert_generator,
scoped_refptr<RTCCertificate> certificate,
- std::function<void(const webrtc::scoped_refptr<webrtc::RTCCertificate>&)>
+ std::function<void(const scoped_refptr<RTCCertificate>&)>
on_certificate_ready,
CodecLookupHelper* codec_lookup_helper,
const FieldTrialsView& field_trials);
@@ -145,7 +145,7 @@
CertificateRequestState certificate_request_state_;
std::queue<absl::AnyInvocable<void() &&>> callbacks_;
- std::function<void(const webrtc::scoped_refptr<webrtc::RTCCertificate>&)>
+ std::function<void(const scoped_refptr<RTCCertificate>&)>
on_certificate_ready_;
WeakPtrFactory<WebRtcSessionDescriptionFactory> weak_factory_{this};