зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
fbc063e58d
Коммит
2248f8b080
|
@ -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() {
|
||||
|
|
Загрузка…
Ссылка в новой задаче