Bug 1392961 - Add preference to make VP9 the preferred video codec. r=jesup

Behaviour is controlled through the media.navigator.video.vp9_preferred preference.

MozReview-Commit-ID: J06ArFYNmTk

--HG--
extra : rebase_source : a25bd4783fde0acf8291ee440745a619d3fa7db8
This commit is contained in:
Jean-Yves Avenard 2017-10-19 15:18:51 +02:00
Родитель 4039779167
Коммит 96d64e1c44
2 изменённых файлов: 15 добавлений и 4 удалений

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

@ -833,7 +833,8 @@ class ConfigureCodec {
mHardwareH264Supported(false),
mSoftwareH264Enabled(false),
mH264Enabled(false),
mVP9Enabled(false),
mVP9Enabled(true),
mVP9Preferred(false),
mH264Level(13), // minimum suggested for WebRTC spec
mH264MaxBr(0), // Unlimited
mH264MaxMbps(0), // Unlimited
@ -859,6 +860,9 @@ class ConfigureCodec {
branch->GetBoolPref("media.peerconnection.video.vp9_enabled",
&mVP9Enabled);
branch->GetBoolPref("media.peerconnection.video.vp9_preferred",
&mVP9Preferred);
branch->GetIntPref("media.navigator.video.max_fs", &mVP8MaxFs);
if (mVP8MaxFs <= 0) {
mVP8MaxFs = 12288; // We must specify something other than 0
@ -930,9 +934,14 @@ class ConfigureCodec {
} else if (videoCodec.mName == "ulpfec") {
videoCodec.mEnabled = mRedUlpfecEnabled;
} else if (videoCodec.mName == "VP8" || videoCodec.mName == "VP9") {
if (videoCodec.mName == "VP9" && !mVP9Enabled) {
videoCodec.mEnabled = false;
break;
if (videoCodec.mName == "VP9") {
if (!mVP9Enabled) {
videoCodec.mEnabled = false;
break;
}
if (mVP9Preferred) {
videoCodec.mStronglyPreferred = true;
}
}
videoCodec.mConstraints.maxFs = mVP8MaxFs;
videoCodec.mConstraints.maxFps = mVP8MaxFr;
@ -959,6 +968,7 @@ class ConfigureCodec {
bool mSoftwareH264Enabled;
bool mH264Enabled;
bool mVP9Enabled;
bool mVP9Preferred;
int32_t mH264Level;
int32_t mH264MaxBr;
int32_t mH264MaxMbps;

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

@ -485,6 +485,7 @@ pref("media.navigator.video.h264.max_br", 0);
pref("media.navigator.video.h264.max_mbps", 0);
pref("media.peerconnection.video.h264_enabled", false);
pref("media.peerconnection.video.vp9_enabled", true);
pref("media.peerconnection.video.vp9_preferred", false);
pref("media.getusermedia.aec", 1);
pref("media.getusermedia.browser.enabled", false);
pref("media.getusermedia.channels", 0);