зеркало из https://github.com/mozilla/gecko-dev.git
Bug 947429: add prefs that let us disable gum video and peerconnection video r=jib
This commit is contained in:
Родитель
d356a3edeb
Коммит
734079b6b5
|
@ -1315,6 +1315,9 @@ MediaManager::GetUserMedia(JSContext* aCx, bool aPrivileged,
|
|||
if (Preferences::GetBool("media.navigator.permission.disabled", false)) {
|
||||
aPrivileged = true;
|
||||
}
|
||||
if (!Preferences::GetBool("media.navigator.video.enabled", true)) {
|
||||
c.mVideo = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Pass runnables along to GetUserMediaRunnable so it can add the
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
|
||||
#ifdef MOZILLA_INTERNAL_API
|
||||
#include "mozilla/dom/RTCPeerConnectionBinding.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
#endif
|
||||
|
||||
#include "nsIObserverService.h"
|
||||
|
@ -73,6 +74,10 @@ MediaConstraintsExternal::MediaConstraintsExternal(
|
|||
#ifdef MOZILLA_INTERNAL_API
|
||||
Apply(aSrc.mMandatory.mOfferToReceiveAudio, &c->offer_to_receive_audio, true);
|
||||
Apply(aSrc.mMandatory.mOfferToReceiveVideo, &c->offer_to_receive_video, true);
|
||||
if (!Preferences::GetBool("media.peerconnection.video.enabled", true)) {
|
||||
c->offer_to_receive_video.was_passed = true;
|
||||
c->offer_to_receive_video.value = false;
|
||||
}
|
||||
Apply(aSrc.mMandatory.mMozDontOfferDataChannel, &c->moz_dont_offer_datachannel,
|
||||
true);
|
||||
if (aSrc.mOptional.WasPassed()) {
|
||||
|
|
|
@ -245,6 +245,11 @@ PeerConnectionMedia::AddStream(nsIDOMMediaStream* aMediaStream, uint32_t *stream
|
|||
|
||||
// Adding tracks here based on nsDOMMediaStream expectation settings
|
||||
uint32_t hints = stream->GetHintContents();
|
||||
#ifdef MOZILLA_INTERNAL_API
|
||||
if (!Preferences::GetBool("media.peerconnection.video.enabled", true)) {
|
||||
hints &= ~(DOMMediaStream::HINT_CONTENTS_VIDEO);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!(hints & (DOMMediaStream::HINT_CONTENTS_AUDIO |
|
||||
DOMMediaStream::HINT_CONTENTS_VIDEO))) {
|
||||
|
|
|
@ -230,6 +230,7 @@ pref("media.apple.mp3.enabled", true);
|
|||
#endif
|
||||
#ifdef MOZ_WEBRTC
|
||||
pref("media.navigator.enabled", true);
|
||||
pref("media.navigator.video.enabled", true);
|
||||
pref("media.navigator.load_adapt", false);
|
||||
pref("media.navigator.video.default_width",640);
|
||||
pref("media.navigator.video.default_height",480);
|
||||
|
@ -237,10 +238,12 @@ pref("media.navigator.video.default_fps",30);
|
|||
pref("media.navigator.video.default_minfps",10);
|
||||
#ifdef MOZ_WIDGET_GONK
|
||||
pref("media.peerconnection.enabled", false);
|
||||
pref("media.peerconnection.video.enabled", false);
|
||||
pref("media.navigator.video.max_fs", 1200); // 640x480 == 1200mb
|
||||
pref("media.navigator.video.max_fr", 30);
|
||||
#else
|
||||
pref("media.peerconnection.enabled", true);
|
||||
pref("media.peerconnection.video.enabled", true);
|
||||
pref("media.navigator.video.max_fs", 0); // unrestricted
|
||||
pref("media.navigator.video.max_fr", 0); // unrestricted
|
||||
#endif
|
||||
|
|
Загрузка…
Ссылка в новой задаче