Bug 1669406 - add pref to blocklist codecs for WebRTC testing;r=dminor

Differential Revision: https://phabricator.services.mozilla.com/D92540
This commit is contained in:
Nico Grunbaum 2020-10-07 14:26:37 +00:00
Родитель fbc063e58d
Коммит 2248f8b080
1 изменённых файлов: 18 добавлений и 0 удалений

Просмотреть файл

@ -2096,6 +2096,24 @@ void JsepSessionImpl::SetupDefaultCodecs() {
// codecs. Note: only uses the video codecs.
red->UpdateRedundantEncodings(mSupportedCodecs);
mSupportedCodecs.push_back(std::move(red));
// Filter out codecs using pref (case sensitive), useful for testing.
nsCString filteredCodecsPref;
if (NS_OK ==
Preferences::GetCString("media.peerconnection.default_codecs.blocklist",
filteredCodecsPref)) {
for (const auto& codecName : filteredCodecsPref.Split(',')) {
nsCString blocked(codecName.BeginReading(), codecName.Length());
blocked.StripWhitespace();
// Remove blocked codecs
mSupportedCodecs.erase(
std::remove_if(mSupportedCodecs.begin(), mSupportedCodecs.end(),
[&](const UniquePtr<JsepCodecDescription>& codec) {
return blocked.EqualsASCII(codec->mName.c_str());
}),
mSupportedCodecs.end());
}
}
}
void JsepSessionImpl::SetupDefaultRtpExtensions() {