Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(479)

Unified Diff: webrtc/api/webrtcsdp_unittest.cc

Issue 1845673002: Removing `preference` field from `cricket::Codec`. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Improve codec sorting performance. Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/api/webrtcsdp_unittest.cc
diff --git a/webrtc/api/webrtcsdp_unittest.cc b/webrtc/api/webrtcsdp_unittest.cc
index c52720453b7021042760dabc688efd5768dc94fd..39c27fde9a2e0d4c15a91499d31f9601476853c1 100644
--- a/webrtc/api/webrtcsdp_unittest.cc
+++ b/webrtc/api/webrtcsdp_unittest.cc
@@ -1028,10 +1028,10 @@ class WebRtcSdpTest : public testing::Test {
"inline:NzB4d1BINUAvLEw6UzF3WSJ+PSdFcGdUJShpX1Zj|2^20|1:32",
"dummy_session_params"));
audio->set_protocol(cricket::kMediaProtocolSavpf);
- AudioCodec opus(111, "opus", 48000, 0, 2, 3);
+ AudioCodec opus(111, "opus", 48000, 0, 2);
audio->AddCodec(opus);
- audio->AddCodec(AudioCodec(103, "ISAC", 16000, 32000, 1, 2));
- audio->AddCodec(AudioCodec(104, "ISAC", 32000, 56000, 1, 1));
+ audio->AddCodec(AudioCodec(103, "ISAC", 16000, 32000, 1));
+ audio->AddCodec(AudioCodec(104, "ISAC", 32000, 56000, 1));
return audio;
}
@@ -1047,8 +1047,7 @@ class WebRtcSdpTest : public testing::Test {
VideoCodec(120, JsepSessionDescription::kDefaultVideoCodecName,
JsepSessionDescription::kMaxVideoCodecWidth,
JsepSessionDescription::kMaxVideoCodecHeight,
- JsepSessionDescription::kDefaultVideoCodecFramerate,
- JsepSessionDescription::kDefaultVideoCodecPreference));
+ JsepSessionDescription::kDefaultVideoCodecFramerate));
return video;
}
@@ -1398,7 +1397,7 @@ class WebRtcSdpTest : public testing::Test {
data_desc_ = data.get();
data_desc_->set_protocol(cricket::kMediaProtocolDtlsSctp);
DataCodec codec(cricket::kGoogleSctpDataCodecId,
- cricket::kGoogleSctpDataCodecName, 0);
+ cricket::kGoogleSctpDataCodecName);
codec.SetParam(cricket::kCodecParamPort, kDefaultSctpPort);
data_desc_->AddCodec(codec);
desc_.AddContent(kDataContentName, NS_JINGLE_DRAFT_SCTP, data.release());
@@ -1411,7 +1410,7 @@ class WebRtcSdpTest : public testing::Test {
new DataContentDescription());
data_desc_ = data.get();
- data_desc_->AddCodec(DataCodec(101, "google-data", 1));
+ data_desc_->AddCodec(DataCodec(101, "google-data"));
StreamParams data_stream;
data_stream.id = kDataChannelMsid;
data_stream.cname = kDataChannelCname;
@@ -1993,8 +1992,8 @@ TEST_F(WebRtcSdpTest, SerializeWithSctpDataChannelAndNewPort) {
jsep_desc.description()->GetContentDescriptionByName(kDataContentName));
const int kNewPort = 1234;
- cricket::DataCodec codec(
- cricket::kGoogleSctpDataCodecId, cricket::kGoogleSctpDataCodecName, 0);
+ cricket::DataCodec codec(cricket::kGoogleSctpDataCodecId,
+ cricket::kGoogleSctpDataCodecName);
codec.SetParam(cricket::kCodecParamPort, kNewPort);
dcdesc->AddOrReplaceCodec(codec);
@@ -2148,10 +2147,11 @@ TEST_F(WebRtcSdpTest, DeserializeSessionDescriptionWithoutRtpmap) {
static_cast<AudioContentDescription*>(
jdesc.description()->GetContentDescriptionByName(cricket::CN_AUDIO));
AudioCodecs ref_codecs;
- // The codecs in the AudioContentDescription will be sorted by preference.
- ref_codecs.push_back(AudioCodec(0, "PCMU", 8000, 0, 1, 3));
- ref_codecs.push_back(AudioCodec(18, "G729", 16000, 0, 1, 2));
- ref_codecs.push_back(AudioCodec(103, "ISAC", 16000, 32000, 1, 1));
+ // 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(AudioCodec(0, "PCMU", 8000, 0, 1));
+ ref_codecs.push_back(AudioCodec(18, "G729", 16000, 0, 1));
+ ref_codecs.push_back(AudioCodec(103, "ISAC", 16000, 32000, 1));
EXPECT_EQ(ref_codecs, audio->codecs());
}

Powered by Google App Engine
This is Rietveld 408576698