Remove WebRTC-SetCodecPreferences-ReceiveOnlyFilterInsteadOfThrow killswitch

which launched a while back.

BUG=webrtc:40644399,webrtc:364825888

Change-Id: Ied1d76d8ab2cbb395e09c08f6354d99b4e082cef
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/367840
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@meta.com>
Cr-Commit-Position: refs/heads/main@{#43383}
This commit is contained in:
Philipp Hancke 2024-11-06 14:09:41 -08:00 committed by WebRTC LUCI CQ
parent 3c18829356
commit 7a79d68645
3 changed files with 0 additions and 56 deletions

View File

@ -146,9 +146,6 @@ ACTIVE_FIELD_TRIALS: FrozenSet[FieldTrial] = frozenset([
FieldTrial('WebRTC-SetReadyToSendFalseIfSendFail', FieldTrial('WebRTC-SetReadyToSendFalseIfSendFail',
361124449, 361124449,
date(2024, 12, 1)), date(2024, 12, 1)),
FieldTrial('WebRTC-SetCodecPreferences-ReceiveOnlyFilterInsteadOfThrow',
40644399,
date(2024, 12, 1)),
FieldTrial('WebRTC-SrtpRemoveReceiveStream', FieldTrial('WebRTC-SrtpRemoveReceiveStream',
42225949, 42225949,
date(2024, 10, 1)), date(2024, 10, 1)),

View File

@ -1640,25 +1640,6 @@ TEST_F(PeerConnectionMediaTestUnifiedPlan,
EXPECT_TRUE(CompareCodecs(sender_audio_codecs, codecs)); EXPECT_TRUE(CompareCodecs(sender_audio_codecs, codecs));
} }
TEST_F(PeerConnectionMediaTestUnifiedPlan,
SetCodecPreferencesAudioSendOnlyKillswitch) {
field_trials_ = std::make_unique<test::ScopedKeyValueConfig>(
"WebRTC-SetCodecPreferences-ReceiveOnlyFilterInsteadOfThrow/Disabled/");
auto fake_engine = std::make_unique<FakeMediaEngine>();
auto send_codecs = fake_engine->voice().send_codecs();
send_codecs.push_back(cricket::CreateAudioCodec(send_codecs.back().id + 1,
"send_only_codec", 0, 1));
fake_engine->SetAudioSendCodecs(send_codecs);
auto caller = CreatePeerConnectionWithAudio(std::move(fake_engine));
auto transceiver = caller->pc()->GetTransceivers().front();
auto send_capabilities = caller->pc_factory()->GetRtpSenderCapabilities(
cricket::MediaType::MEDIA_TYPE_AUDIO);
EXPECT_TRUE(transceiver->SetCodecPreferences(send_capabilities.codecs).ok());
}
TEST_F(PeerConnectionMediaTestUnifiedPlan, TEST_F(PeerConnectionMediaTestUnifiedPlan,
SetCodecPreferencesVideoRejectsAudioCodec) { SetCodecPreferencesVideoRejectsAudioCodec) {
auto caller = CreatePeerConnectionWithVideo(); auto caller = CreatePeerConnectionWithVideo();
@ -1753,25 +1734,6 @@ TEST_F(PeerConnectionMediaTestUnifiedPlan,
EXPECT_TRUE(CompareCodecs(sender_video_codecs, codecs)); EXPECT_TRUE(CompareCodecs(sender_video_codecs, codecs));
} }
TEST_F(PeerConnectionMediaTestUnifiedPlan,
SetCodecPreferencesVideoSendOnlyKillswitch) {
field_trials_ = std::make_unique<test::ScopedKeyValueConfig>(
"WebRTC-SetCodecPreferences-ReceiveOnlyFilterInsteadOfThrow/Disabled/");
auto fake_engine = std::make_unique<FakeMediaEngine>();
auto send_codecs = fake_engine->voice().send_codecs();
send_codecs.push_back(
cricket::CreateVideoCodec(send_codecs.back().id + 1, "send_only_codec"));
fake_engine->SetAudioSendCodecs(send_codecs);
auto caller = CreatePeerConnectionWithAudio(std::move(fake_engine));
auto transceiver = caller->pc()->GetTransceivers().front();
auto send_capabilities = caller->pc_factory()->GetRtpSenderCapabilities(
cricket::MediaType::MEDIA_TYPE_AUDIO);
EXPECT_TRUE(transceiver->SetCodecPreferences(send_capabilities.codecs).ok());
}
TEST_F(PeerConnectionMediaTestUnifiedPlan, TEST_F(PeerConnectionMediaTestUnifiedPlan,
SetCodecPreferencesVideoCodecDuplicatesRemoved) { SetCodecPreferencesVideoCodecDuplicatesRemoved) {
auto caller = CreatePeerConnectionWithVideo(); auto caller = CreatePeerConnectionWithVideo();

View File

@ -97,26 +97,11 @@ RTCError VerifyCodecPreferences(
return codec.MatchesRtpCodec(codec_preference); return codec.MatchesRtpCodec(codec_preference);
}); });
if (!is_recv_codec) { if (!is_recv_codec) {
if (!field_trials.IsDisabled(
"WebRTC-SetCodecPreferences-ReceiveOnlyFilterInsteadOfThrow")) {
LOG_AND_RETURN_ERROR( LOG_AND_RETURN_ERROR(
RTCErrorType::INVALID_MODIFICATION, RTCErrorType::INVALID_MODIFICATION,
std::string( std::string(
"Invalid codec preferences: invalid codec with name \"") + "Invalid codec preferences: invalid codec with name \"") +
codec_preference.name + "\"."); codec_preference.name + "\".");
} else {
// Killswitch behavior: filter out any codec not in receive codecs.
codecs.erase(std::remove_if(
codecs.begin(), codecs.end(),
[&recv_codecs](const RtpCodecCapability& codec) {
return codec.IsMediaCodec() &&
!absl::c_any_of(
recv_codecs,
[&codec](const cricket::Codec& recv_codec) {
return recv_codec.MatchesRtpCodec(codec);
});
}));
}
} }
} }