mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 11:25:00 +00:00
Bug 1448222 - Remove MediaPrefs. r=jya
This patch converts all the prefs in MediaPrefs to the new StaticPrefs system. Note that the "media.wmf.skip-blacklist" pref was present in both MediaPrefs and gfxPrefs. The copy in MediaPrefs was never used; this explains why this patch does not add an entry for it to StaticPrefList.h. Note also that the patch removes themedia.rust.mp4parser pref, because it's unused. MozReview-Commit-ID: IfHP37NbIjY --HG-- extra : rebase_source : df84ea813b7c366d7be663c696891325610149c8
This commit is contained in:
parent
b4dc67d73a
commit
51f2b494ea
@ -1441,20 +1441,6 @@ pref("identity.fxaccounts.migrateToDevEdition", false);
|
||||
pref("ui.key.menuAccessKeyFocuses", true);
|
||||
#endif
|
||||
|
||||
// Encrypted media extensions.
|
||||
#ifdef XP_LINUX
|
||||
// On Linux EME is visible but disabled by default. This is so that the
|
||||
// "Play DRM content" checkbox in the Firefox UI is unchecked by default.
|
||||
// DRM requires downloading and installing proprietary binaries, which
|
||||
// users on an open source operating systems didn't opt into. The first
|
||||
// time a site using EME is encountered, the user will be prompted to
|
||||
// enable DRM, whereupon the EME plugin binaries will be downloaded if
|
||||
// permission is granted.
|
||||
pref("media.eme.enabled", false);
|
||||
#else
|
||||
pref("media.eme.enabled", true);
|
||||
#endif
|
||||
|
||||
#ifdef NIGHTLY_BUILD
|
||||
pref("media.eme.vp9-in-mp4.enabled", true);
|
||||
#else
|
||||
|
@ -12,13 +12,14 @@
|
||||
#include "mozilla/dom/ElementInlines.h"
|
||||
#include "mozilla/dom/Promise.h"
|
||||
#include "mozilla/ArrayUtils.h"
|
||||
#include "mozilla/NotNull.h"
|
||||
#include "mozilla/MathAlgorithms.h"
|
||||
#include "mozilla/AsyncEventDispatcher.h"
|
||||
#include "mozilla/dom/MediaEncryptedEvent.h"
|
||||
#include "mozilla/EMEUtils.h"
|
||||
#include "mozilla/EventDispatcher.h"
|
||||
#include "mozilla/NotNull.h"
|
||||
#include "mozilla/MathAlgorithms.h"
|
||||
#include "mozilla/Sprintf.h"
|
||||
#include "mozilla/StaticPrefs.h"
|
||||
|
||||
#include "AutoplayPolicy.h"
|
||||
#include "base/basictypes.h"
|
||||
@ -53,7 +54,6 @@
|
||||
#include "nsITimer.h"
|
||||
|
||||
#include "MediaError.h"
|
||||
#include "MediaPrefs.h"
|
||||
#include "MediaResource.h"
|
||||
|
||||
#include "nsICategoryManager.h"
|
||||
@ -4465,7 +4465,8 @@ void HTMLMediaElement::HiddenVideoStart()
|
||||
}
|
||||
NS_NewTimerWithFuncCallback(getter_AddRefs(mVideoDecodeSuspendTimer),
|
||||
VideoDecodeSuspendTimerCallback, this,
|
||||
MediaPrefs::MDSMSuspendBackgroundVideoDelay(), nsITimer::TYPE_ONE_SHOT,
|
||||
StaticPrefs::MediaSuspendBkgndVideoDelayMs(),
|
||||
nsITimer::TYPE_ONE_SHOT,
|
||||
"HTMLMediaElement::VideoDecodeSuspendTimerCallback",
|
||||
mMainThreadEventTarget);
|
||||
}
|
||||
@ -4637,7 +4638,8 @@ HTMLMediaElement::ReportTelemetry()
|
||||
// Here, we have played *some* of the video, but didn't get more than 1
|
||||
// keyframe. Report '0' if we have played for longer than the video-
|
||||
// decode-suspend delay (showing recovery would be difficult).
|
||||
uint32_t suspendDelay_ms = MediaPrefs::MDSMSuspendBackgroundVideoDelay();
|
||||
uint32_t suspendDelay_ms =
|
||||
StaticPrefs::MediaSuspendBkgndVideoDelayMs();
|
||||
if (uint32_t(playTime * 1000.0) > suspendDelay_ms) {
|
||||
Telemetry::Accumulate(Telemetry::VIDEO_INTER_KEYFRAME_MAX_MS,
|
||||
key,
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/dom/HTMLMediaElement.h"
|
||||
#include "MediaPrefs.h"
|
||||
#include "mozilla/StaticPrefs.h"
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
@ -138,7 +138,7 @@ public:
|
||||
|
||||
bool MozOrientationLockEnabled() const
|
||||
{
|
||||
return MediaPrefs::VideoOrientationLockEnabled();
|
||||
return StaticPrefs::MediaVideocontrolsLockVideoOrientation();
|
||||
}
|
||||
|
||||
bool MozIsOrientationLocked() const
|
||||
|
@ -6,8 +6,8 @@
|
||||
#include "BackgroundVideoDecodingPermissionObserver.h"
|
||||
|
||||
#include "mozilla/AsyncEventDispatcher.h"
|
||||
#include "mozilla/StaticPrefs.h"
|
||||
#include "MediaDecoder.h"
|
||||
#include "MediaPrefs.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsIDocument.h"
|
||||
|
||||
@ -26,7 +26,7 @@ BackgroundVideoDecodingPermissionObserver::Observe(nsISupports* aSubject,
|
||||
const char* aTopic,
|
||||
const char16_t* aData)
|
||||
{
|
||||
if (!MediaPrefs::ResumeVideoDecodingOnTabHover()) {
|
||||
if (!StaticPrefs::MediaResumeBkgndVideoOnTabhover()) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -8,7 +8,6 @@
|
||||
|
||||
#include "BufferMediaResource.h"
|
||||
#include "MediaData.h"
|
||||
#include "MediaPrefs.h"
|
||||
#include "PDMFactory.h"
|
||||
#include "VideoUtils.h"
|
||||
#include "WebMDemuxer.h"
|
||||
@ -152,7 +151,6 @@ Benchmark::Init()
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
gfxVars::Initialize();
|
||||
gfxPrefs::GetSingleton();
|
||||
MediaPrefs::GetSingleton();
|
||||
}
|
||||
|
||||
BenchmarkPlayback::BenchmarkPlayback(Benchmark* aMainThreadState,
|
||||
|
@ -10,6 +10,7 @@
|
||||
#include "MediaFormatReader.h"
|
||||
#include "BaseMediaResource.h"
|
||||
#include "MediaShutdownManager.h"
|
||||
#include "mozilla/StaticPrefs.h"
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
@ -533,7 +534,7 @@ ChannelMediaDecoder::ShouldThrottleDownload(const MediaStatistics& aStats)
|
||||
|
||||
int64_t length = aStats.mTotalBytes;
|
||||
if (length > 0 &&
|
||||
length <= int64_t(MediaPrefs::MediaMemoryCacheMaxSize()) * 1024) {
|
||||
length <= int64_t(StaticPrefs::MediaMemoryCacheMaxSize()) * 1024) {
|
||||
// Don't throttle the download of small resources. This is to speed
|
||||
// up seeking, as seeks into unbuffered ranges would require starting
|
||||
// up a new HTTP transaction, which adds latency.
|
||||
|
@ -38,7 +38,6 @@
|
||||
#include "FlacDemuxer.h"
|
||||
|
||||
#include "nsPluginHost.h"
|
||||
#include "MediaPrefs.h"
|
||||
|
||||
namespace mozilla
|
||||
{
|
||||
|
@ -6,13 +6,13 @@
|
||||
|
||||
#include "FileBlockCache.h"
|
||||
#include "MediaCache.h"
|
||||
#include "MediaPrefs.h"
|
||||
#include "VideoUtils.h"
|
||||
#include "prio.h"
|
||||
#include <algorithm>
|
||||
#include "nsAnonymousTemporaryFile.h"
|
||||
#include "nsIThreadManager.h"
|
||||
#include "mozilla/dom/ContentChild.h"
|
||||
#include "mozilla/StaticPrefs.h"
|
||||
#include "mozilla/SystemGroup.h"
|
||||
#include "nsXULAppAPI.h"
|
||||
|
||||
@ -140,7 +140,7 @@ FileBlockCache::GetMaxBlocks() const
|
||||
// We look up the cache size every time. This means dynamic changes
|
||||
// to the pref are applied.
|
||||
const uint32_t cacheSizeKb =
|
||||
std::min(MediaPrefs::MediaCacheSizeKb(), uint32_t(INT32_MAX) * 2);
|
||||
std::min(StaticPrefs::MediaCacheSize(), uint32_t(INT32_MAX) * 2);
|
||||
// Ensure we can divide BLOCK_SIZE by 1024.
|
||||
static_assert(MediaCacheStream::BLOCK_SIZE % 1024 == 0,
|
||||
"BLOCK_SIZE should be a multiple of 1024");
|
||||
|
@ -9,7 +9,6 @@
|
||||
#include "ChannelMediaResource.h"
|
||||
#include "FileBlockCache.h"
|
||||
#include "MediaBlockCacheBase.h"
|
||||
#include "MediaPrefs.h"
|
||||
#include "MediaResource.h"
|
||||
#include "MemoryBlockCache.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
@ -20,6 +19,7 @@
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "mozilla/Services.h"
|
||||
#include "mozilla/StaticPtr.h"
|
||||
#include "mozilla/StaticPrefs.h"
|
||||
#include "mozilla/SystemGroup.h"
|
||||
#include "mozilla/Telemetry.h"
|
||||
#include "nsContentUtils.h"
|
||||
@ -784,7 +784,7 @@ MediaCache::GetMediaCache(int64_t aContentLength)
|
||||
}
|
||||
|
||||
if (aContentLength > 0 &&
|
||||
aContentLength <= int64_t(MediaPrefs::MediaMemoryCacheMaxSize()) * 1024) {
|
||||
aContentLength <= int64_t(StaticPrefs::MediaMemoryCacheMaxSize()) * 1024) {
|
||||
// Small-enough resource, use a new memory-backed MediaCache.
|
||||
RefPtr<MediaBlockCacheBase> bc = new MemoryBlockCache(aContentLength);
|
||||
nsresult rv = bc->Init();
|
||||
@ -1376,8 +1376,8 @@ MediaCache::Update()
|
||||
}
|
||||
}
|
||||
|
||||
int32_t resumeThreshold = MediaPrefs::MediaCacheResumeThreshold();
|
||||
int32_t readaheadLimit = MediaPrefs::MediaCacheReadaheadLimit();
|
||||
int32_t resumeThreshold = StaticPrefs::MediaCacheResumeThreshold();
|
||||
int32_t readaheadLimit = StaticPrefs::MediaCacheReadaheadLimit();
|
||||
|
||||
for (uint32_t i = 0; i < mStreams.Length(); ++i) {
|
||||
actions.AppendElement(StreamAction{});
|
||||
|
@ -18,6 +18,7 @@
|
||||
#include "mozilla/NotNull.h"
|
||||
#include "mozilla/SharedThreadPool.h"
|
||||
#include "mozilla/Sprintf.h"
|
||||
#include "mozilla/StaticPrefs.h"
|
||||
#include "mozilla/Telemetry.h"
|
||||
#include "mozilla/TaskQueue.h"
|
||||
#include "mozilla/Tuple.h"
|
||||
@ -28,7 +29,6 @@
|
||||
#include "MediaDecoder.h"
|
||||
#include "MediaDecoderStateMachine.h"
|
||||
#include "MediaShutdownManager.h"
|
||||
#include "MediaPrefs.h"
|
||||
#include "MediaTimer.h"
|
||||
#include "ReaderProxy.h"
|
||||
#include "TimeUnits.h"
|
||||
@ -159,7 +159,7 @@ static TimeDuration
|
||||
SuspendBackgroundVideoDelay()
|
||||
{
|
||||
return TimeDuration::FromMilliseconds(
|
||||
MediaPrefs::MDSMSuspendBackgroundVideoDelay());
|
||||
StaticPrefs::MediaSuspendBkgndVideoDelayMs());
|
||||
}
|
||||
|
||||
class MediaDecoderStateMachine::StateObject
|
||||
@ -760,7 +760,7 @@ private:
|
||||
return;
|
||||
}
|
||||
|
||||
auto timeout = MediaPrefs::DormantOnPauseTimeout();
|
||||
auto timeout = StaticPrefs::MediaDormantOnPauseTimeoutMs();
|
||||
if (timeout < 0) {
|
||||
// Disabled when timeout is negative.
|
||||
return;
|
||||
@ -2203,7 +2203,7 @@ DecodeMetadataState::OnMetadataRead(MetadataHolder&& aMetadata)
|
||||
|
||||
// Check whether the media satisfies the requirement of seamless looing.
|
||||
// (Before checking the media is audio only, we need to get metadata first.)
|
||||
mMaster->mSeamlessLoopingAllowed = MediaPrefs::SeamlessLooping() &&
|
||||
mMaster->mSeamlessLoopingAllowed = StaticPrefs::MediaSeamlessLooping() &&
|
||||
mMaster->HasAudio() &&
|
||||
!mMaster->HasVideo();
|
||||
mMaster->LoopingChanged();
|
||||
@ -3052,7 +3052,7 @@ void MediaDecoderStateMachine::SetVideoDecodeModeInternal(VideoDecodeMode aMode)
|
||||
mVideoDecodeSuspended ? 'T' : 'F');
|
||||
|
||||
// Should not suspend decoding if we don't turn on the pref.
|
||||
if (!MediaPrefs::MDSMSuspendBackgroundVideoEnabled() &&
|
||||
if (!StaticPrefs::MediaSuspendBkgndVideoEnabled() &&
|
||||
aMode == VideoDecodeMode::Suspend) {
|
||||
LOG("SetVideoDecodeModeInternal(), early return because preference off and set to Suspend");
|
||||
return;
|
||||
|
@ -17,10 +17,14 @@
|
||||
#include "mozilla/NotNull.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "mozilla/SharedThreadPool.h"
|
||||
#include "mozilla/StaticPrefs.h"
|
||||
#include "mozilla/Telemetry.h"
|
||||
#include "mozilla/Unused.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsPrintfCString.h"
|
||||
#ifdef MOZ_WIDGET_ANDROID
|
||||
#include "mozilla/jni/Utils.h"
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <map>
|
||||
@ -1305,8 +1309,10 @@ MediaFormatReader::MediaFormatReader(MediaFormatReaderInit& aInit,
|
||||
: mTaskQueue(new TaskQueue(GetMediaThreadPool(MediaThreadType::PLAYBACK),
|
||||
"MediaFormatReader::mTaskQueue",
|
||||
/* aSupportsTailDispatch = */ true))
|
||||
, mAudio(this, MediaData::AUDIO_DATA, MediaPrefs::MaxAudioDecodeError())
|
||||
, mVideo(this, MediaData::VIDEO_DATA, MediaPrefs::MaxVideoDecodeError())
|
||||
, mAudio(this, MediaData::AUDIO_DATA,
|
||||
StaticPrefs::MediaAudioMaxDecodeError())
|
||||
, mVideo(this, MediaData::VIDEO_DATA,
|
||||
StaticPrefs::MediaVideoMaxDecodeError())
|
||||
, mDemuxer(new DemuxerProxy(aDemuxer))
|
||||
, mDemuxerInitDone(false)
|
||||
, mPendingNotifyDataArrived(false)
|
||||
@ -1582,7 +1588,7 @@ MediaFormatReader::OnDemuxerInitDone(const MediaResult& aResult)
|
||||
MOZ_ASSERT(OnTaskQueue());
|
||||
mDemuxerInitRequest.Complete();
|
||||
|
||||
if (NS_FAILED(aResult) && MediaPrefs::MediaWarningsAsErrors()) {
|
||||
if (NS_FAILED(aResult) && StaticPrefs::MediaPlaybackWarningsAsErrors()) {
|
||||
mMetadataPromise.Reject(aResult, __func__);
|
||||
return;
|
||||
}
|
||||
@ -1782,7 +1788,7 @@ MediaFormatReader::ShouldSkip(TimeUnit aTimeThreshold)
|
||||
{
|
||||
MOZ_ASSERT(HasVideo());
|
||||
|
||||
if (!MediaPrefs::MFRSkipToNextKeyFrameEnabled()) {
|
||||
if (!StaticPrefs::MediaDecoderSkipToNextKeyFrameEnabled()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -2403,7 +2409,7 @@ MediaFormatReader::HandleDemuxedSamples(
|
||||
if (info && decoder.mLastStreamSourceID != info->GetID()) {
|
||||
nsTArray<RefPtr<MediaRawData>> samples;
|
||||
if (decoder.mDecoder) {
|
||||
bool recyclable = MediaPrefs::MediaDecoderCheckRecycling() &&
|
||||
bool recyclable = StaticPrefs::MediaDecoderRecycleEnabled() &&
|
||||
decoder.mDecoder->SupportDecoderRecycling();
|
||||
if (!recyclable && decoder.mTimeThreshold.isNothing() &&
|
||||
(decoder.mNextStreamSourceID.isNothing() ||
|
||||
|
@ -9,15 +9,15 @@
|
||||
|
||||
#include "mozilla/Atomics.h"
|
||||
#include "mozilla/Maybe.h"
|
||||
#include "mozilla/StateMirroring.h"
|
||||
#include "mozilla/TaskQueue.h"
|
||||
#include "mozilla/Mutex.h"
|
||||
#include "mozilla/StateMirroring.h"
|
||||
#include "mozilla/StaticPrefs.h"
|
||||
#include "mozilla/TaskQueue.h"
|
||||
|
||||
#include "FrameStatistics.h"
|
||||
#include "MediaEventSource.h"
|
||||
#include "MediaDataDemuxer.h"
|
||||
#include "MediaMetadataManager.h"
|
||||
#include "MediaPrefs.h"
|
||||
#include "MediaPromiseDefs.h"
|
||||
#include "nsAutoPtr.h"
|
||||
#include "PDMFactory.h"
|
||||
@ -487,7 +487,7 @@ private:
|
||||
// Allow decode errors to be non-fatal, but give up
|
||||
// if we have too many, or if warnings should be treated as errors.
|
||||
return mNumOfConsecutiveError > mMaxConsecutiveError ||
|
||||
MediaPrefs::MediaWarningsAsErrors();
|
||||
StaticPrefs::MediaPlaybackWarningsAsErrors();
|
||||
} else if (mError.ref() == NS_ERROR_DOM_MEDIA_NEED_NEW_DECODER) {
|
||||
// If the caller asked for a new decoder we shouldn't treat
|
||||
// it as fatal.
|
||||
|
@ -1,93 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "MediaPrefs.h"
|
||||
|
||||
#include "mozilla/ClearOnShutdown.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "mozilla/StaticPtr.h"
|
||||
#include "MainThreadUtils.h"
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
StaticAutoPtr<MediaPrefs> MediaPrefs::sInstance;
|
||||
|
||||
MediaPrefs&
|
||||
MediaPrefs::GetSingleton()
|
||||
{
|
||||
if (!sInstance) {
|
||||
sInstance = new MediaPrefs;
|
||||
ClearOnShutdown(&sInstance);
|
||||
}
|
||||
MOZ_ASSERT(SingletonExists());
|
||||
return *sInstance;
|
||||
}
|
||||
|
||||
bool
|
||||
MediaPrefs::SingletonExists()
|
||||
{
|
||||
return sInstance != nullptr;
|
||||
}
|
||||
|
||||
MediaPrefs::MediaPrefs()
|
||||
{
|
||||
MediaPrefs::AssertMainThread();
|
||||
}
|
||||
|
||||
void MediaPrefs::AssertMainThread()
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread(), "this code must be run on the main thread");
|
||||
}
|
||||
|
||||
void MediaPrefs::PrefAddVarCache(bool* aVariable,
|
||||
const char* aPref,
|
||||
bool aDefault)
|
||||
{
|
||||
Preferences::AddBoolVarCache(aVariable, aPref, aDefault);
|
||||
}
|
||||
|
||||
void MediaPrefs::PrefAddVarCache(int32_t* aVariable,
|
||||
const char* aPref,
|
||||
int32_t aDefault)
|
||||
{
|
||||
Preferences::AddIntVarCache(aVariable, aPref, aDefault);
|
||||
}
|
||||
|
||||
void MediaPrefs::PrefAddVarCache(uint32_t* aVariable,
|
||||
const char* aPref,
|
||||
uint32_t aDefault)
|
||||
{
|
||||
Preferences::AddUintVarCache(aVariable, aPref, aDefault);
|
||||
}
|
||||
|
||||
void MediaPrefs::PrefAddVarCache(float* aVariable,
|
||||
const char* aPref,
|
||||
float aDefault)
|
||||
{
|
||||
Preferences::AddFloatVarCache(aVariable, aPref, aDefault);
|
||||
}
|
||||
|
||||
void MediaPrefs::PrefAddVarCache(AtomicBool* aVariable,
|
||||
const char* aPref,
|
||||
bool aDefault)
|
||||
{
|
||||
Preferences::AddAtomicBoolVarCache(aVariable, aPref, aDefault);
|
||||
}
|
||||
|
||||
void MediaPrefs::PrefAddVarCache(AtomicInt32* aVariable,
|
||||
const char* aPref,
|
||||
int32_t aDefault)
|
||||
{
|
||||
Preferences::AddAtomicIntVarCache(aVariable, aPref, aDefault);
|
||||
}
|
||||
|
||||
void MediaPrefs::PrefAddVarCache(AtomicUint32* aVariable,
|
||||
const char* aPref,
|
||||
uint32_t aDefault)
|
||||
{
|
||||
Preferences::AddAtomicUintVarCache(aVariable, aPref, aDefault);
|
||||
}
|
||||
|
||||
} // namespace mozilla
|
@ -1,233 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#ifndef MEDIA_PREFS_H
|
||||
#define MEDIA_PREFS_H
|
||||
|
||||
#ifdef MOZ_WIDGET_ANDROID
|
||||
#include "GeneratedJNIWrappers.h"
|
||||
#endif
|
||||
|
||||
#include "mozilla/Atomics.h"
|
||||
|
||||
// First time MediaPrefs::GetSingleton() needs to be called on the main thread,
|
||||
// before any of the methods accessing the values are used, but after
|
||||
// the Preferences system has been initialized.
|
||||
|
||||
// The static methods to access the preference value are safe to call
|
||||
// from any thread after that first call.
|
||||
|
||||
// To register a preference, you need to add a line in this file using
|
||||
// the DECL_MEDIA_PREF macro.
|
||||
//
|
||||
// For example this line in the .h:
|
||||
// DECL_MEDIA_PREF("media.resampling.enabled",AudioSinkResampling,bool,false);
|
||||
// means that you can call
|
||||
// const bool& var = MediaPrefs::AudioSinkResampling();
|
||||
// from any thread, you will get the most up to date preference value of
|
||||
// "media.resampling.enabled". If the value is not set, the default would be
|
||||
// false.
|
||||
|
||||
#define DECL_MEDIA_PREF(Pref, Name, Type, Default) \
|
||||
public: \
|
||||
static const Type& Name() { MOZ_ASSERT(SingletonExists()); return GetSingleton().mPref##Name.mValue; } \
|
||||
private: \
|
||||
static const char* Get##Name##PrefName() { return Pref; } \
|
||||
static StripAtomic<Type> Get##Name##PrefDefault() { return Default; } \
|
||||
PrefTemplate<Type, Get##Name##PrefDefault, Get##Name##PrefName> mPref##Name
|
||||
|
||||
// Custom Definitions.
|
||||
#define GMP_DEFAULT_ASYNC_SHUTDOWN_TIMEOUT 3000
|
||||
#define SUSPEND_BACKGROUND_VIDEO_DELAY_MS 10000
|
||||
#define TEST_PREFERENCE_FAKE_RECOGNITION_SERVICE "media.webspeech.test.fake_recognition_service"
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
template<class T> class StaticAutoPtr;
|
||||
|
||||
class MediaPrefs final
|
||||
{
|
||||
typedef Atomic<bool, Relaxed> AtomicBool;
|
||||
typedef Atomic<int32_t, Relaxed> AtomicInt32;
|
||||
typedef Atomic<uint32_t, Relaxed> AtomicUint32;
|
||||
|
||||
template <typename T>
|
||||
struct StripAtomicImpl {
|
||||
typedef T Type;
|
||||
};
|
||||
|
||||
template <typename T, MemoryOrdering Order>
|
||||
struct StripAtomicImpl<Atomic<T, Order>> {
|
||||
typedef T Type;
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
using StripAtomic = typename StripAtomicImpl<T>::Type;
|
||||
|
||||
private:
|
||||
// Since we cannot use const char*, use a function that returns it.
|
||||
template <class T, StripAtomic<T> Default(), const char* Pref()>
|
||||
class PrefTemplate
|
||||
{
|
||||
public:
|
||||
PrefTemplate()
|
||||
: mValue(Default())
|
||||
{
|
||||
Register(Pref());
|
||||
}
|
||||
T mValue;
|
||||
private:
|
||||
void Register(const char* aPreference)
|
||||
{
|
||||
AssertMainThread();
|
||||
PrefAddVarCache(&mValue, aPreference, mValue);
|
||||
}
|
||||
};
|
||||
|
||||
// This is where DECL_MEDIA_PREF for each of the preferences should go.
|
||||
|
||||
// Cache sizes.
|
||||
DECL_MEDIA_PREF("media.cache_size", MediaCacheSizeKb, uint32_t, 512000);
|
||||
DECL_MEDIA_PREF("media.memory_cache_max_size", MediaMemoryCacheMaxSize, uint32_t, 8192);
|
||||
DECL_MEDIA_PREF("media.memory_caches_combined_limit_kb", MediaMemoryCachesCombinedLimitKb, uint32_t, 524288);
|
||||
DECL_MEDIA_PREF("media.memory_caches_combined_limit_pc_sysmem",
|
||||
MediaMemoryCachesCombinedLimitPcSysmem, uint32_t, 5);
|
||||
|
||||
DECL_MEDIA_PREF("media.cache_resume_threshold", MediaCacheResumeThreshold, int32_t, 10);
|
||||
DECL_MEDIA_PREF("media.cache_readahead_limit", MediaCacheReadaheadLimit, int32_t, 30);
|
||||
|
||||
// AudioSink
|
||||
DECL_MEDIA_PREF("accessibility.monoaudio.enable", MonoAudio, bool, false);
|
||||
DECL_MEDIA_PREF("media.resampling.enabled", AudioSinkResampling, bool, false);
|
||||
#if defined(XP_WIN) || defined(XP_DARWIN) || defined(MOZ_PULSEAUDIO)
|
||||
DECL_MEDIA_PREF("media.forcestereo.enabled", AudioSinkForceStereo, bool, false);
|
||||
#else
|
||||
DECL_MEDIA_PREF("media.forcestereo.enabled", AudioSinkForceStereo, bool, true);
|
||||
#endif
|
||||
// VideoSink
|
||||
DECL_MEDIA_PREF("media.ruin-av-sync.enabled", RuinAvSync, bool, false);
|
||||
|
||||
// Encrypted Media Extensions
|
||||
DECL_MEDIA_PREF("media.clearkey.persistent-license.enabled", ClearKeyPersistentLicenseEnabled, bool, false);
|
||||
|
||||
// PlatformDecoderModule
|
||||
DECL_MEDIA_PREF("media.gmp.insecure.allow", GMPAllowInsecure, bool, false);
|
||||
DECL_MEDIA_PREF("media.eme.enabled", EMEEnabled, bool, false);
|
||||
DECL_MEDIA_PREF("media.use-blank-decoder", PDMUseBlankDecoder, bool, false);
|
||||
DECL_MEDIA_PREF("media.gpu-process-decoder", PDMUseGPUDecoder, bool, false);
|
||||
#ifdef MOZ_WIDGET_ANDROID
|
||||
DECL_MEDIA_PREF("media.android-media-codec.enabled", PDMAndroidMediaCodecEnabled, bool, false);
|
||||
DECL_MEDIA_PREF("media.android-media-codec.preferred", PDMAndroidMediaCodecPreferred, bool, false);
|
||||
DECL_MEDIA_PREF("media.navigator.hardware.vp8_encode.acceleration_remote_enabled", RemoteMediaCodecVP8EncoderEnabled, bool, false);
|
||||
#endif
|
||||
// WebRTC
|
||||
DECL_MEDIA_PREF("media.navigator.mediadatadecoder_enabled", MediaDataDecoderEnabled, bool, false);
|
||||
#ifdef MOZ_FFMPEG
|
||||
DECL_MEDIA_PREF("media.ffmpeg.enabled", PDMFFmpegEnabled, bool, true);
|
||||
DECL_MEDIA_PREF("media.libavcodec.allow-obsolete", LibavcodecAllowObsolete, bool, false);
|
||||
#endif
|
||||
#if defined(MOZ_FFMPEG) || defined(MOZ_FFVPX)
|
||||
DECL_MEDIA_PREF("media.ffmpeg.low-latency.enabled", PDMFFmpegLowLatencyEnabled, bool, false);
|
||||
#endif
|
||||
#ifdef MOZ_FFVPX
|
||||
DECL_MEDIA_PREF("media.ffvpx.enabled", PDMFFVPXEnabled, bool, true);
|
||||
#endif
|
||||
#ifdef MOZ_AV1
|
||||
DECL_MEDIA_PREF("media.av1.enabled", AV1Enabled, bool, false);
|
||||
#endif
|
||||
#ifdef XP_WIN
|
||||
DECL_MEDIA_PREF("media.wmf.enabled", PDMWMFEnabled, bool, true);
|
||||
DECL_MEDIA_PREF("media.wmf.skip-blacklist", PDMWMFSkipBlacklist, bool, false);
|
||||
DECL_MEDIA_PREF("media.decoder-doctor.wmf-disabled-is-failure", DecoderDoctorWMFDisabledIsFailure, bool, false);
|
||||
DECL_MEDIA_PREF("media.wmf.vp9.enabled", PDMWMFVP9DecoderEnabled, bool, true);
|
||||
#endif
|
||||
DECL_MEDIA_PREF("media.decoder.recycle.enabled", MediaDecoderCheckRecycling, bool, false);
|
||||
DECL_MEDIA_PREF("media.decoder.skip-to-next-key-frame.enabled", MFRSkipToNextKeyFrameEnabled, bool, true);
|
||||
DECL_MEDIA_PREF("media.gmp.decoder.enabled", PDMGMPEnabled, bool, true);
|
||||
DECL_MEDIA_PREF("media.eme.audio.blank", EMEBlankAudio, bool, false);
|
||||
DECL_MEDIA_PREF("media.eme.video.blank", EMEBlankVideo, bool, false);
|
||||
DECL_MEDIA_PREF("media.eme.chromium-api.video-shmems",
|
||||
EMEChromiumAPIVideoShmemCount,
|
||||
uint32_t,
|
||||
3);
|
||||
|
||||
// MediaDecoderStateMachine
|
||||
DECL_MEDIA_PREF("media.suspend-bkgnd-video.enabled", MDSMSuspendBackgroundVideoEnabled, bool, false);
|
||||
DECL_MEDIA_PREF("media.suspend-bkgnd-video.delay-ms", MDSMSuspendBackgroundVideoDelay, AtomicUint32, SUSPEND_BACKGROUND_VIDEO_DELAY_MS);
|
||||
DECL_MEDIA_PREF("media.dormant-on-pause-timeout-ms", DormantOnPauseTimeout, int32_t, 5000);
|
||||
|
||||
// WebSpeech
|
||||
DECL_MEDIA_PREF("media.webspeech.synth.force_global_queue", WebSpeechForceGlobal, bool, false);
|
||||
DECL_MEDIA_PREF("media.webspeech.test.enable", WebSpeechTestEnabled, bool, false);
|
||||
DECL_MEDIA_PREF("media.webspeech.test.fake_fsm_events", WebSpeechFakeFSMEvents, bool, false);
|
||||
DECL_MEDIA_PREF(TEST_PREFERENCE_FAKE_RECOGNITION_SERVICE, WebSpeechFakeRecognitionService, bool, false);
|
||||
DECL_MEDIA_PREF("media.webspeech.recognition.enable", WebSpeechRecognitionEnabled, bool, false);
|
||||
DECL_MEDIA_PREF("media.webspeech.recognition.force_enable", WebSpeechRecognitionForceEnabled, bool, false);
|
||||
|
||||
#if defined(RELEASE_OR_BETA)
|
||||
DECL_MEDIA_PREF("media.audio-max-decode-error", MaxAudioDecodeError, uint32_t, 3);
|
||||
DECL_MEDIA_PREF("media.video-max-decode-error", MaxVideoDecodeError, uint32_t, 2);
|
||||
#else
|
||||
// Take zero tolerance of decoding error in debug for any decoder regression.
|
||||
DECL_MEDIA_PREF("media.audio-max-decode-error", MaxAudioDecodeError, uint32_t, 0);
|
||||
DECL_MEDIA_PREF("media.video-max-decode-error", MaxVideoDecodeError, uint32_t, 0);
|
||||
#endif
|
||||
|
||||
// Ogg
|
||||
DECL_MEDIA_PREF("media.ogg.enabled", OggEnabled, bool, true);
|
||||
// Flac
|
||||
DECL_MEDIA_PREF("media.ogg.flac.enabled", FlacInOgg, bool, false);
|
||||
DECL_MEDIA_PREF("media.flac.enabled", FlacEnabled, bool, true);
|
||||
|
||||
// Hls
|
||||
DECL_MEDIA_PREF("media.hls.enabled", HLSEnabled, bool, false);
|
||||
|
||||
// True, it enables rust parser and fallback to stagefright if rust parser fails.
|
||||
// False, it uses stagefright only.
|
||||
DECL_MEDIA_PREF("media.rust.mp4parser", EnableRustMP4Parser, bool, true);
|
||||
|
||||
DECL_MEDIA_PREF("media.mp4.enabled", MP4Enabled, bool, false);
|
||||
|
||||
// Error/warning handling, Decoder Doctor
|
||||
DECL_MEDIA_PREF("media.playback.warnings-as-errors", MediaWarningsAsErrors, bool, false);
|
||||
|
||||
// resume background video decoding when the cursor is hovering over the tab.
|
||||
DECL_MEDIA_PREF("media.resume-bkgnd-video-on-tabhover", ResumeVideoDecodingOnTabHover, bool, false);
|
||||
|
||||
DECL_MEDIA_PREF("media.videocontrols.lock-video-orientation", VideoOrientationLockEnabled, bool, false);
|
||||
|
||||
// Media Seamless Looping
|
||||
DECL_MEDIA_PREF("media.seamless-looping", SeamlessLooping, bool, true);
|
||||
|
||||
public:
|
||||
// Manage the singleton:
|
||||
static MediaPrefs& GetSingleton();
|
||||
static bool SingletonExists();
|
||||
|
||||
private:
|
||||
template<class T> friend class StaticAutoPtr;
|
||||
static StaticAutoPtr<MediaPrefs> sInstance;
|
||||
|
||||
// Creating these to avoid having to include Preferences.h in the .h
|
||||
static void PrefAddVarCache(bool*, const char*, bool);
|
||||
static void PrefAddVarCache(int32_t*, const char*, int32_t);
|
||||
static void PrefAddVarCache(uint32_t*, const char*, uint32_t);
|
||||
static void PrefAddVarCache(float*, const char*, float);
|
||||
static void PrefAddVarCache(AtomicBool*, const char*, bool);
|
||||
static void PrefAddVarCache(AtomicInt32*, const char*, int32_t);
|
||||
static void PrefAddVarCache(AtomicUint32*, const char*, uint32_t);
|
||||
|
||||
static void AssertMainThread();
|
||||
|
||||
MediaPrefs();
|
||||
MediaPrefs(const MediaPrefs&) = delete;
|
||||
MediaPrefs& operator=(const MediaPrefs&) = delete;
|
||||
};
|
||||
|
||||
#undef DECL_MEDIA_PREF /* Don't need it outside of this file */
|
||||
|
||||
} // namespace mozilla
|
||||
|
||||
#endif /* MEDIA_PREFS_H */
|
@ -5,7 +5,6 @@
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "MediaResource.h"
|
||||
#include "MediaPrefs.h"
|
||||
#include "mozilla/DebugOnly.h"
|
||||
#include "mozilla/Logging.h"
|
||||
#include "mozilla/MathAlgorithms.h"
|
||||
|
@ -6,12 +6,12 @@
|
||||
|
||||
#include "MemoryBlockCache.h"
|
||||
|
||||
#include "MediaPrefs.h"
|
||||
#include "mozilla/Atomics.h"
|
||||
#include "mozilla/ClearOnShutdown.h"
|
||||
#include "mozilla/Logging.h"
|
||||
#include "mozilla/Telemetry.h"
|
||||
#include "mozilla/Services.h"
|
||||
#include "mozilla/StaticPrefs.h"
|
||||
#include "nsIObserver.h"
|
||||
#include "nsIObserverService.h"
|
||||
#include "nsWeakReference.h"
|
||||
@ -139,7 +139,7 @@ enum MemoryBlockCacheTelemetryErrors
|
||||
static int32_t
|
||||
CalculateMaxBlocks(int64_t aContentLength)
|
||||
{
|
||||
int64_t maxSize = int64_t(MediaPrefs::MediaMemoryCacheMaxSize()) * 1024;
|
||||
int64_t maxSize = int64_t(StaticPrefs::MediaMemoryCacheMaxSize()) * 1024;
|
||||
MOZ_ASSERT(aContentLength <= maxSize);
|
||||
MOZ_ASSERT(maxSize % MediaBlockCacheBase::BLOCK_SIZE == 0);
|
||||
// Note: It doesn't matter if calculations overflow, Init() would later fail.
|
||||
@ -205,8 +205,8 @@ MemoryBlockCache::EnsureBufferCanContain(size_t aContentLength)
|
||||
static const size_t sysmem =
|
||||
std::max<size_t>(PR_GetPhysicalMemorySize(), 32 * 1024 * 1024);
|
||||
const size_t limit = std::min(
|
||||
size_t(MediaPrefs::MediaMemoryCachesCombinedLimitKb()) * 1024,
|
||||
sysmem * MediaPrefs::MediaMemoryCachesCombinedLimitPcSysmem() / 100);
|
||||
size_t(StaticPrefs::MediaMemoryCachesCombinedLimitKb()) * 1024,
|
||||
sysmem * StaticPrefs::MediaMemoryCachesCombinedLimitPcSysmem() / 100);
|
||||
const size_t currentSizes = static_cast<size_t>(gCombinedSizes);
|
||||
if (currentSizes + extra > limit) {
|
||||
LOG("EnsureBufferCanContain(%zu) - buffer size %zu, wanted + %zu = %zu;"
|
||||
|
@ -10,12 +10,12 @@
|
||||
#include "CubebUtils.h"
|
||||
#include "ImageContainer.h"
|
||||
#include "MediaContainerType.h"
|
||||
#include "MediaPrefs.h"
|
||||
#include "MediaResource.h"
|
||||
#include "TimeUnits.h"
|
||||
#include "VorbisUtils.h"
|
||||
#include "mozilla/Base64.h"
|
||||
#include "mozilla/SharedThreadPool.h"
|
||||
#include "mozilla/StaticPrefs.h"
|
||||
#include "mozilla/SystemGroup.h"
|
||||
#include "mozilla/TaskCategory.h"
|
||||
#include "mozilla/TaskQueue.h"
|
||||
@ -171,11 +171,11 @@ void DownmixStereoToMono(mozilla::AudioDataValue* aBuffer,
|
||||
uint32_t
|
||||
DecideAudioPlaybackChannels(const AudioInfo& info)
|
||||
{
|
||||
if (MediaPrefs::MonoAudio()) {
|
||||
if (StaticPrefs::accessibility_monoaudio_enable()) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (MediaPrefs::AudioSinkForceStereo()) {
|
||||
if (StaticPrefs::MediaForcestereoEnabled()) {
|
||||
return 2;
|
||||
}
|
||||
|
||||
|
@ -8,8 +8,8 @@
|
||||
#include "mozilla/dom/MediaKeySystemAccessBinding.h"
|
||||
#include "mozilla/dom/MediaKeySession.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "mozilla/StaticPrefs.h"
|
||||
#include "MediaContainerType.h"
|
||||
#include "MediaPrefs.h"
|
||||
#include "nsMimeTypes.h"
|
||||
#ifdef XP_WIN
|
||||
#include "WMFDecoderModule.h"
|
||||
@ -35,6 +35,7 @@
|
||||
#include "DecoderTraits.h"
|
||||
#ifdef MOZ_WIDGET_ANDROID
|
||||
#include "FennecJNIWrappers.h"
|
||||
#include "GeneratedJNIWrappers.h"
|
||||
#endif
|
||||
#include <functional>
|
||||
|
||||
@ -133,7 +134,8 @@ MediaKeySystemStatus
|
||||
MediaKeySystemAccess::GetKeySystemStatus(const nsAString& aKeySystem,
|
||||
nsACString& aOutMessage)
|
||||
{
|
||||
MOZ_ASSERT(MediaPrefs::EMEEnabled() || IsClearkeyKeySystem(aKeySystem));
|
||||
MOZ_ASSERT(StaticPrefs::MediaEmeEnabled() ||
|
||||
IsClearkeyKeySystem(aKeySystem));
|
||||
|
||||
if (IsClearkeyKeySystem(aKeySystem)) {
|
||||
return EnsureCDMInstalled(aKeySystem, aOutMessage);
|
||||
@ -275,7 +277,7 @@ GetSupportedKeySystems()
|
||||
clearkey.mPersistentState = KeySystemFeatureSupport::Requestable;
|
||||
clearkey.mDistinctiveIdentifier = KeySystemFeatureSupport::Prohibited;
|
||||
clearkey.mSessionTypes.AppendElement(MediaKeySessionType::Temporary);
|
||||
if (MediaPrefs::ClearKeyPersistentLicenseEnabled()) {
|
||||
if (StaticPrefs::MediaClearkeyPersistentLicenseEnabled()) {
|
||||
clearkey.mSessionTypes.AppendElement(MediaKeySessionType::Persistent_license);
|
||||
}
|
||||
#if defined(XP_WIN)
|
||||
|
@ -4,12 +4,12 @@
|
||||
|
||||
#include "MediaKeySystemAccessManager.h"
|
||||
#include "DecoderDoctorDiagnostics.h"
|
||||
#include "MediaPrefs.h"
|
||||
#include "mozilla/EMEUtils.h"
|
||||
#include "nsServiceManagerUtils.h"
|
||||
#include "nsComponentManagerUtils.h"
|
||||
#include "nsIObserverService.h"
|
||||
#include "mozilla/Services.h"
|
||||
#include "mozilla/StaticPrefs.h"
|
||||
#include "mozilla/DetailedPromise.h"
|
||||
#ifdef XP_WIN
|
||||
#include "mozilla/WindowsVersion.h"
|
||||
@ -108,7 +108,7 @@ MediaKeySystemAccessManager::Request(DetailedPromise* aPromise,
|
||||
return;
|
||||
}
|
||||
|
||||
if (!MediaPrefs::EMEEnabled() && !IsClearkeyKeySystem(aKeySystem)) {
|
||||
if (!StaticPrefs::MediaEmeEnabled() && !IsClearkeyKeySystem(aKeySystem)) {
|
||||
// EME disabled by user, send notification to chrome so UI can inform user.
|
||||
// Clearkey is allowed even when EME is disabled because we want the pref
|
||||
// "media.eme.enabled" only taking effect on proprietary DRMs.
|
||||
|
@ -8,7 +8,6 @@
|
||||
#include "mozilla/EMEUtils.h"
|
||||
#include "FennecJNINatives.h"
|
||||
#include "MediaCodec.h" // For MediaDrm::KeyStatus
|
||||
#include "MediaPrefs.h"
|
||||
|
||||
using namespace mozilla::java;
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
#include "FlacDecoder.h"
|
||||
#include "MediaContainerType.h"
|
||||
#include "MediaPrefs.h"
|
||||
#include "mozilla/StaticPrefs.h"
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
@ -14,7 +14,7 @@ namespace mozilla {
|
||||
FlacDecoder::IsEnabled()
|
||||
{
|
||||
#ifdef MOZ_FFVPX
|
||||
return MediaPrefs::FlacEnabled();
|
||||
return StaticPrefs::MediaFlacEnabled();
|
||||
#else
|
||||
// Until bug 1295886 is fixed.
|
||||
return false;
|
||||
|
@ -14,9 +14,9 @@
|
||||
#include "GMPLog.h"
|
||||
#include "GMPService.h"
|
||||
#include "GMPUtils.h"
|
||||
#include "MediaPrefs.h"
|
||||
#include "mozilla/dom/MediaKeyMessageEventBinding.h"
|
||||
#include "mozilla/gmp/GMPTypes.h"
|
||||
#include "mozilla/StaticPrefs.h"
|
||||
#include "mozilla/Unused.h"
|
||||
#include "AnnexB.h"
|
||||
#include "H264.h"
|
||||
@ -32,7 +32,7 @@ ChromiumCDMParent::ChromiumCDMParent(GMPContentParent* aContentParent,
|
||||
uint32_t aPluginId)
|
||||
: mPluginId(aPluginId)
|
||||
, mContentParent(aContentParent)
|
||||
, mVideoShmemLimit(MediaPrefs::EMEChromiumAPIVideoShmemCount())
|
||||
, mVideoShmemLimit(StaticPrefs::MediaEmeChromiumApiVideoShmems())
|
||||
{
|
||||
GMP_LOG(
|
||||
"ChromiumCDMParent::ChromiumCDMParent(this=%p, contentParent=%p, id=%u)",
|
||||
|
@ -26,7 +26,6 @@
|
||||
#endif
|
||||
#include "CDMStorageIdProvider.h"
|
||||
#include "GMPContentParent.h"
|
||||
#include "MediaPrefs.h"
|
||||
#include "VideoUtils.h"
|
||||
|
||||
using mozilla::ipc::GeckoChildProcessHost;
|
||||
|
@ -9,6 +9,7 @@
|
||||
#include "base/task.h"
|
||||
#include "mozilla/AbstractThread.h"
|
||||
#include "mozilla/Logging.h"
|
||||
#include "mozilla/StaticPrefs.h"
|
||||
#include "mozilla/dom/ContentParent.h"
|
||||
#include "GMPParent.h"
|
||||
#include "GMPVideoDecoderParent.h"
|
||||
@ -38,7 +39,6 @@
|
||||
#include "nsIXULRuntime.h"
|
||||
#include "GMPDecoderModule.h"
|
||||
#include <limits>
|
||||
#include "MediaPrefs.h"
|
||||
#include "mozilla/SystemGroup.h"
|
||||
|
||||
using mozilla::ipc::Transport;
|
||||
@ -818,7 +818,7 @@ CreateGMPParent(AbstractThread* aMainThread)
|
||||
{
|
||||
#if defined(XP_LINUX) && defined(MOZ_GMP_SANDBOX)
|
||||
if (!SandboxInfo::Get().CanSandboxMedia()) {
|
||||
if (!MediaPrefs::GMPAllowInsecure()) {
|
||||
if (!StaticPrefs::MediaGmpInsecureAllow()) {
|
||||
NS_WARNING("Denying media plugin load due to lack of sandboxing.");
|
||||
return nullptr;
|
||||
}
|
||||
|
@ -12,7 +12,6 @@
|
||||
#include "GMPVideoDecoderProxy.h"
|
||||
#include "GMPVideoEncoderProxy.h"
|
||||
#include "GMPServiceParent.h"
|
||||
#include "MediaPrefs.h"
|
||||
#include "nsAppDirectoryServiceDefs.h"
|
||||
#include "mozilla/Atomics.h"
|
||||
#include "mozilla/DebugOnly.h"
|
||||
@ -27,7 +26,7 @@ struct GMPTestRunner
|
||||
{
|
||||
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(GMPTestRunner)
|
||||
|
||||
GMPTestRunner() { MediaPrefs::GetSingleton(); }
|
||||
GMPTestRunner() {}
|
||||
void DoTest(void (GMPTestRunner::*aTestMethod)(GMPTestMonitor&));
|
||||
void RunTestGMPTestCodec1(GMPTestMonitor& aMonitor);
|
||||
void RunTestGMPTestCodec2(GMPTestMonitor& aMonitor);
|
||||
|
@ -16,7 +16,6 @@
|
||||
#include "GMPService.h"
|
||||
#include "GMPUtils.h"
|
||||
#include "mozilla/StaticPtr.h"
|
||||
#include "MediaPrefs.h"
|
||||
|
||||
#define GMP_DIR_NAME NS_LITERAL_STRING("gmp-fakeopenh264")
|
||||
#define GMP_OLD_VERSION NS_LITERAL_STRING("1.0")
|
||||
@ -228,8 +227,6 @@ GMPRemoveTest::~GMPRemoveTest()
|
||||
void
|
||||
GMPRemoveTest::Setup()
|
||||
{
|
||||
// Initialize media preferences.
|
||||
MediaPrefs::GetSingleton();
|
||||
GeneratePlugin();
|
||||
GetService()->GetThread(getter_AddRefs(mGMPThread));
|
||||
|
||||
|
@ -7,7 +7,6 @@
|
||||
#include "gtest/gtest.h"
|
||||
#include "GMPUtils.h"
|
||||
#include "nsString.h"
|
||||
#include "MediaPrefs.h"
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
@ -20,8 +19,6 @@ void TestSplitAt(const char* aInput,
|
||||
size_t aNumExpectedTokens,
|
||||
const char* aExpectedTokens[])
|
||||
{
|
||||
// Initialize media preferences.
|
||||
MediaPrefs::GetSingleton();
|
||||
nsCString input(aInput);
|
||||
nsTArray<nsCString> tokens;
|
||||
SplitAt(aDelims, input, tokens);
|
||||
|
@ -5,7 +5,6 @@
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
#include "MediaData.h"
|
||||
#include "MediaPrefs.h"
|
||||
#include "mozilla/ArrayUtils.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "BufferStream.h"
|
||||
|
@ -15,11 +15,11 @@
|
||||
#include "MediaContainerType.h"
|
||||
#include "MediaDecoderStateMachine.h"
|
||||
#include "MediaFormatReader.h"
|
||||
#include "MediaPrefs.h"
|
||||
#include "MediaShutdownManager.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsNetUtil.h"
|
||||
#include "nsThreadUtils.h"
|
||||
#include "mozilla/StaticPrefs.h"
|
||||
|
||||
using namespace mozilla::java;
|
||||
|
||||
@ -127,7 +127,7 @@ HLSDecoder::CreateStateMachine()
|
||||
bool
|
||||
HLSDecoder::IsEnabled()
|
||||
{
|
||||
return MediaPrefs::HLSEnabled() && (jni::GetAPIVersion() >= 16);
|
||||
return StaticPrefs::MediaHlsEnabled() && (jni::GetAPIVersion() >= 16);
|
||||
}
|
||||
|
||||
bool
|
||||
|
@ -3,13 +3,14 @@
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "RemoteVideoDecoder.h"
|
||||
#include "VideoDecoderChild.h"
|
||||
#include "VideoDecoderManagerChild.h"
|
||||
#include "mozilla/layers/TextureClient.h"
|
||||
#include "mozilla/StaticPrefs.h"
|
||||
#include "base/thread.h"
|
||||
#include "MediaInfo.h"
|
||||
#include "MediaPrefs.h"
|
||||
#include "ImageContainer.h"
|
||||
#include "mozilla/layers/SynchronousTask.h"
|
||||
|
||||
@ -170,7 +171,7 @@ IsRemoteAcceleratedCompositor(KnowsCompositor* aKnows)
|
||||
already_AddRefed<MediaDataDecoder>
|
||||
RemoteDecoderModule::CreateVideoDecoder(const CreateDecoderParams& aParams)
|
||||
{
|
||||
if (!MediaPrefs::PDMUseGPUDecoder() ||
|
||||
if (!StaticPrefs::MediaGpuProcessDecoder() ||
|
||||
!aParams.mKnowsCompositor ||
|
||||
!IsRemoteAcceleratedCompositor(aParams.mKnowsCompositor))
|
||||
{
|
||||
|
@ -3,10 +3,10 @@
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "VideoDecoderManagerChild.h"
|
||||
#include "VideoDecoderChild.h"
|
||||
#include "mozilla/dom/ContentChild.h"
|
||||
#include "MediaPrefs.h"
|
||||
#include "nsThreadUtils.h"
|
||||
#include "mozilla/gfx/2D.h"
|
||||
#include "mozilla/ipc/ProtocolUtils.h"
|
||||
|
@ -13,7 +13,7 @@
|
||||
#include "mozilla/CheckedInt.h"
|
||||
#include "mozilla/DebugOnly.h"
|
||||
#include "mozilla/IntegerPrintfMacros.h"
|
||||
#include "MediaPrefs.h"
|
||||
#include "mozilla/StaticPrefs.h"
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
@ -48,7 +48,7 @@ AudioSink::AudioSink(AbstractThread* aThread,
|
||||
, mIsAudioDataAudible(false)
|
||||
, mAudioQueue(aAudioQueue)
|
||||
{
|
||||
bool resampling = MediaPrefs::AudioSinkResampling();
|
||||
bool resampling = StaticPrefs::MediaResamplingEnabled();
|
||||
|
||||
if (resampling) {
|
||||
mOutputRate = 48000;
|
||||
@ -195,7 +195,8 @@ AudioSink::InitializeAudioStream(const PlaybackParams& aParams)
|
||||
: AudioConfig::ChannelLayout(mOutputChannels).Map();
|
||||
// The layout map used here is already processed by mConverter with
|
||||
// mOutputChannels into SMPTE format, so there is no need to worry if
|
||||
// MediaPrefs::MonoAudio() or MediaPrefs::AudioSinkForceStereo() is applied.
|
||||
// StaticPrefs::accessibility_monoaudio_enable() or
|
||||
// StaticPrefs::MediaForcestereoEnabled() is applied.
|
||||
nsresult rv = mAudioStream->Init(mOutputChannels, channelMap, mOutputRate);
|
||||
if (NS_FAILED(rv)) {
|
||||
mAudioStream->Shutdown();
|
||||
|
@ -12,10 +12,10 @@
|
||||
|
||||
#include "MediaQueue.h"
|
||||
#include "VideoSink.h"
|
||||
#include "MediaPrefs.h"
|
||||
#include "VideoUtils.h"
|
||||
|
||||
#include "mozilla/IntegerPrintfMacros.h"
|
||||
#include "mozilla/StaticPrefs.h"
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
@ -50,7 +50,7 @@ VideoSink::VideoSink(AbstractThread* aThread,
|
||||
, mHasVideo(false)
|
||||
, mUpdateScheduler(aThread)
|
||||
, mVideoQueueSendToCompositorSize(aVQueueSentToCompositerSize)
|
||||
, mMinVideoQueueSize(MediaPrefs::RuinAvSync() ? 1 : 0)
|
||||
, mMinVideoQueueSize(StaticPrefs::MediaRuinAvSyncEnabled() ? 1 : 0)
|
||||
#ifdef XP_WIN
|
||||
, mHiResTimersRequested(false)
|
||||
#endif
|
||||
|
@ -6,11 +6,11 @@
|
||||
|
||||
#include "TrackBuffersManager.h"
|
||||
#include "ContainerParser.h"
|
||||
#include "MediaPrefs.h"
|
||||
#include "MediaSourceDemuxer.h"
|
||||
#include "MediaSourceUtils.h"
|
||||
#include "mozilla/ErrorResult.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "mozilla/StaticPrefs.h"
|
||||
#include "nsMimeTypes.h"
|
||||
#include "SourceBuffer.h"
|
||||
#include "SourceBufferResource.h"
|
||||
@ -947,7 +947,7 @@ TrackBuffersManager::OnDemuxerResetDone(const MediaResult& aResult)
|
||||
MOZ_ASSERT(OnTaskQueue());
|
||||
mDemuxerInitRequest.Complete();
|
||||
|
||||
if (NS_FAILED(aResult) && MediaPrefs::MediaWarningsAsErrors()) {
|
||||
if (NS_FAILED(aResult) && StaticPrefs::MediaPlaybackWarningsAsErrors()) {
|
||||
RejectAppend(aResult, __func__);
|
||||
return;
|
||||
}
|
||||
@ -1055,7 +1055,7 @@ TrackBuffersManager::OnDemuxerInitDone(const MediaResult& aResult)
|
||||
|
||||
mDemuxerInitRequest.Complete();
|
||||
|
||||
if (NS_FAILED(aResult) && MediaPrefs::MediaWarningsAsErrors()) {
|
||||
if (NS_FAILED(aResult) && StaticPrefs::MediaPlaybackWarningsAsErrors()) {
|
||||
RejectAppend(aResult, __func__);
|
||||
return;
|
||||
}
|
||||
|
@ -126,7 +126,6 @@ EXPORTS += [
|
||||
'MediaInfo.h',
|
||||
'MediaMetadataManager.h',
|
||||
'MediaMIMETypes.h',
|
||||
'MediaPrefs.h',
|
||||
'MediaPromiseDefs.h',
|
||||
'MediaQueue.h',
|
||||
'MediaRecorder.h',
|
||||
@ -243,7 +242,6 @@ UNIFIED_SOURCES += [
|
||||
'MediaInfo.cpp',
|
||||
'MediaManager.cpp',
|
||||
'MediaMIMETypes.cpp',
|
||||
'MediaPrefs.cpp',
|
||||
'MediaRecorder.cpp',
|
||||
'MediaResource.cpp',
|
||||
'MediaShutdownManager.cpp',
|
||||
|
@ -6,11 +6,11 @@
|
||||
|
||||
#include "MP4Decoder.h"
|
||||
#include "MediaContainerType.h"
|
||||
#include "MediaPrefs.h"
|
||||
#include "MP4Demuxer.h"
|
||||
#include "nsMimeTypes.h"
|
||||
#include "VideoUtils.h"
|
||||
#include "PDMFactory.h"
|
||||
#include "mozilla/StaticPrefs.h"
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
@ -168,7 +168,7 @@ MP4Decoder::IsAAC(const nsACString& aMimeType)
|
||||
bool
|
||||
MP4Decoder::IsEnabled()
|
||||
{
|
||||
return MediaPrefs::MP4Enabled();
|
||||
return StaticPrefs::mediaMp4Enabled();
|
||||
}
|
||||
|
||||
} // namespace mozilla
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
#include "MP4Demuxer.h"
|
||||
|
||||
#include "MediaPrefs.h"
|
||||
#include "mozilla/StaticPrefs.h"
|
||||
// Used for telemetry
|
||||
#include "mozilla/Telemetry.h"
|
||||
#include "AnnexB.h"
|
||||
@ -167,7 +167,7 @@ MP4Demuxer::Init()
|
||||
|
||||
auto audioTrackCount = metadata.GetNumberTracks(TrackInfo::kAudioTrack);
|
||||
if (audioTrackCount.Ref() == MP4Metadata::NumberTracksError()) {
|
||||
if (MediaPrefs::MediaWarningsAsErrors()) {
|
||||
if (StaticPrefs::MediaPlaybackWarningsAsErrors()) {
|
||||
return InitPromise::CreateAndReject(
|
||||
MediaResult(NS_ERROR_DOM_MEDIA_DEMUXER_ERR,
|
||||
RESULT_DETAIL("Invalid audio track (%s)",
|
||||
@ -179,7 +179,7 @@ MP4Demuxer::Init()
|
||||
|
||||
auto videoTrackCount = metadata.GetNumberTracks(TrackInfo::kVideoTrack);
|
||||
if (videoTrackCount.Ref() == MP4Metadata::NumberTracksError()) {
|
||||
if (MediaPrefs::MediaWarningsAsErrors()) {
|
||||
if (StaticPrefs::MediaPlaybackWarningsAsErrors()) {
|
||||
return InitPromise::CreateAndReject(
|
||||
MediaResult(NS_ERROR_DOM_MEDIA_DEMUXER_ERR,
|
||||
RESULT_DETAIL("Invalid video track (%s)",
|
||||
@ -210,7 +210,7 @@ MP4Demuxer::Init()
|
||||
MP4Metadata::ResultAndTrackInfo info =
|
||||
metadata.GetTrackInfo(TrackInfo::kAudioTrack, i);
|
||||
if (!info.Ref()) {
|
||||
if (MediaPrefs::MediaWarningsAsErrors()) {
|
||||
if (StaticPrefs::MediaPlaybackWarningsAsErrors()) {
|
||||
return InitPromise::CreateAndReject(
|
||||
MediaResult(NS_ERROR_DOM_MEDIA_DEMUXER_ERR,
|
||||
RESULT_DETAIL("Invalid MP4 audio track (%s)",
|
||||
@ -246,7 +246,7 @@ MP4Demuxer::Init()
|
||||
MP4Metadata::ResultAndTrackInfo info =
|
||||
metadata.GetTrackInfo(TrackInfo::kVideoTrack, i);
|
||||
if (!info.Ref()) {
|
||||
if (MediaPrefs::MediaWarningsAsErrors()) {
|
||||
if (StaticPrefs::MediaPlaybackWarningsAsErrors()) {
|
||||
return InitPromise::CreateAndReject(
|
||||
MediaResult(NS_ERROR_DOM_MEDIA_DEMUXER_ERR,
|
||||
RESULT_DETAIL("Invalid MP4 video track (%s)",
|
||||
|
@ -13,7 +13,6 @@
|
||||
#include "MoofParser.h"
|
||||
#include "MP4Metadata.h"
|
||||
#include "ByteStream.h"
|
||||
#include "MediaPrefs.h"
|
||||
#include "mp4parse.h"
|
||||
|
||||
#include <limits>
|
||||
|
@ -5,10 +5,10 @@
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "OggDecoder.h"
|
||||
#include "MediaPrefs.h"
|
||||
#include "MediaContainerType.h"
|
||||
#include "MediaDecoder.h"
|
||||
#include "nsMimeTypes.h"
|
||||
#include "mozilla/StaticPrefs.h"
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
@ -16,7 +16,7 @@ namespace mozilla {
|
||||
bool
|
||||
OggDecoder::IsSupportedType(const MediaContainerType& aContainerType)
|
||||
{
|
||||
if (!MediaPrefs::OggEnabled()) {
|
||||
if (!StaticPrefs::MediaOggEnabled()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -38,7 +38,8 @@ OggDecoder::IsSupportedType(const MediaContainerType& aContainerType)
|
||||
for (const auto& codec : codecs.Range()) {
|
||||
if ((MediaDecoder::IsOpusEnabled() && codec.EqualsLiteral("opus")) ||
|
||||
codec.EqualsLiteral("vorbis") ||
|
||||
(MediaPrefs::FlacInOgg() && codec.EqualsLiteral("flac"))) {
|
||||
(StaticPrefs::MediaOggFlacEnabled() &&
|
||||
codec.EqualsLiteral("flac"))) {
|
||||
continue;
|
||||
}
|
||||
// Note: Only accept Theora in a video container type, not in an audio
|
||||
|
@ -12,12 +12,12 @@
|
||||
#include "mozilla/Atomics.h"
|
||||
#include "mozilla/PodOperations.h"
|
||||
#include "mozilla/SharedThreadPool.h"
|
||||
#include "mozilla/StaticPrefs.h"
|
||||
#include "mozilla/Telemetry.h"
|
||||
#include "mozilla/TimeStamp.h"
|
||||
#include "MediaDataDemuxer.h"
|
||||
#include "nsAutoRef.h"
|
||||
#include "XiphExtradata.h"
|
||||
#include "MediaPrefs.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
@ -538,7 +538,7 @@ OggDemuxer::ReadMetadata()
|
||||
NS_WARNING("Opus decoding disabled."
|
||||
" See media.opus.enabled in about:config");
|
||||
}
|
||||
} else if (MediaPrefs::FlacInOgg() &&
|
||||
} else if (StaticPrefs::MediaOggFlacEnabled() &&
|
||||
s->GetType() == OggCodecState::TYPE_FLAC &&
|
||||
ReadHeaders(TrackInfo::kAudioTrack, s)) {
|
||||
if (!mFlacState) {
|
||||
|
@ -28,11 +28,11 @@
|
||||
#include "mozilla/ClearOnShutdown.h"
|
||||
#include "mozilla/SharedThreadPool.h"
|
||||
#include "mozilla/StaticPtr.h"
|
||||
#include "mozilla/StaticPrefs.h"
|
||||
#include "mozilla/SyncRunnable.h"
|
||||
#include "mozilla/TaskQueue.h"
|
||||
|
||||
#include "MediaInfo.h"
|
||||
#include "MediaPrefs.h"
|
||||
#include "H264Converter.h"
|
||||
|
||||
#include "AgnosticDecoderModule.h"
|
||||
@ -333,7 +333,7 @@ PDMFactory::CreatePDMs()
|
||||
{
|
||||
RefPtr<PlatformDecoderModule> m;
|
||||
|
||||
if (MediaPrefs::PDMUseBlankDecoder()) {
|
||||
if (StaticPrefs::MediaUseBlankDecoder()) {
|
||||
m = CreateBlankDecoderModule();
|
||||
StartupPDM(m);
|
||||
// The Blank PDM SupportsMimeType reports true for all codecs; the creation
|
||||
@ -343,23 +343,24 @@ PDMFactory::CreatePDMs()
|
||||
}
|
||||
|
||||
#ifdef XP_WIN
|
||||
if (MediaPrefs::PDMWMFEnabled() && !IsWin7AndPre2000Compatible()) {
|
||||
if (StaticPrefs::MediaWmfEnabled() && !IsWin7AndPre2000Compatible()) {
|
||||
m = new WMFDecoderModule();
|
||||
RefPtr<PlatformDecoderModule> remote = new dom::RemoteDecoderModule(m);
|
||||
StartupPDM(remote);
|
||||
mWMFFailedToLoad = !StartupPDM(m);
|
||||
} else {
|
||||
mWMFFailedToLoad = MediaPrefs::DecoderDoctorWMFDisabledIsFailure();
|
||||
mWMFFailedToLoad =
|
||||
StaticPrefs::MediaDecoderDoctorWmfDisabledIsFailure();
|
||||
}
|
||||
#endif
|
||||
#ifdef MOZ_FFVPX
|
||||
if (MediaPrefs::PDMFFVPXEnabled()) {
|
||||
if (StaticPrefs::MediaFfvpxEnabled()) {
|
||||
m = FFVPXRuntimeLinker::CreateDecoderModule();
|
||||
StartupPDM(m);
|
||||
}
|
||||
#endif
|
||||
#ifdef MOZ_FFMPEG
|
||||
if (MediaPrefs::PDMFFmpegEnabled()) {
|
||||
if (StaticPrefs::MediaFfmpegEnabled()) {
|
||||
m = FFmpegRuntimeLinker::CreateDecoderModule();
|
||||
mFFmpegFailedToLoad = !StartupPDM(m);
|
||||
} else {
|
||||
@ -371,16 +372,16 @@ PDMFactory::CreatePDMs()
|
||||
StartupPDM(m);
|
||||
#endif
|
||||
#ifdef MOZ_WIDGET_ANDROID
|
||||
if(MediaPrefs::PDMAndroidMediaCodecEnabled()){
|
||||
if (StaticPrefs::MediaAndroidMediaCodecEnabled()) {
|
||||
m = new AndroidDecoderModule();
|
||||
StartupPDM(m, MediaPrefs::PDMAndroidMediaCodecPreferred());
|
||||
StartupPDM(m, StaticPrefs::MediaAndroidMediaCodecPreferred());
|
||||
}
|
||||
#endif
|
||||
|
||||
m = new AgnosticDecoderModule();
|
||||
StartupPDM(m);
|
||||
|
||||
if (MediaPrefs::PDMGMPEnabled()) {
|
||||
if (StaticPrefs::MediaGmpDecoderEnabled()) {
|
||||
m = new GMPDecoderModule();
|
||||
mGMPPDMFailedToStartup = !StartupPDM(m);
|
||||
} else {
|
||||
|
@ -5,13 +5,13 @@
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "AgnosticDecoderModule.h"
|
||||
#include "MediaPrefs.h"
|
||||
#include "OpusDecoder.h"
|
||||
#include "TheoraDecoder.h"
|
||||
#include "VPXDecoder.h"
|
||||
#include "VorbisDecoder.h"
|
||||
#include "WAVDecoder.h"
|
||||
#include "mozilla/Logging.h"
|
||||
#include "mozilla/StaticPrefs.h"
|
||||
|
||||
#ifdef MOZ_AV1
|
||||
#include "AOMDecoder.h"
|
||||
@ -31,7 +31,7 @@ AgnosticDecoderModule::SupportsMimeType(
|
||||
WaveDataDecoder::IsWave(aMimeType) ||
|
||||
TheoraDecoder::IsTheora(aMimeType);
|
||||
#ifdef MOZ_AV1
|
||||
if (MediaPrefs::AV1Enabled()) {
|
||||
if (StaticPrefs::MediaAv1Enabled()) {
|
||||
supports |= AOMDecoder::IsAV1(aMimeType);
|
||||
}
|
||||
#endif
|
||||
@ -50,7 +50,7 @@ AgnosticDecoderModule::CreateVideoDecoder(const CreateDecoderParams& aParams)
|
||||
}
|
||||
#ifdef MOZ_AV1
|
||||
else if (AOMDecoder::IsAV1(aParams.mConfig.mMimeType) &&
|
||||
MediaPrefs::AV1Enabled()) {
|
||||
StaticPrefs::MediaAv1Enabled()) {
|
||||
m = new AOMDecoder(aParams);
|
||||
}
|
||||
#endif
|
||||
|
@ -12,11 +12,11 @@
|
||||
#include "GMPDecoderModule.h"
|
||||
#include "GMPService.h"
|
||||
#include "MediaInfo.h"
|
||||
#include "MediaPrefs.h"
|
||||
#include "PDMFactory.h"
|
||||
#include "mozIGeckoMediaPluginService.h"
|
||||
#include "mozilla/CDMProxy.h"
|
||||
#include "mozilla/EMEUtils.h"
|
||||
#include "mozilla/StaticPrefs.h"
|
||||
#include "mozilla/UniquePtr.h"
|
||||
#include "mozilla/Unused.h"
|
||||
#include "nsAutoPtr.h"
|
||||
@ -409,7 +409,7 @@ EMEDecoderModule::CreateVideoDecoder(const CreateDecoderParams& aParams)
|
||||
{
|
||||
MOZ_ASSERT(aParams.mConfig.mCrypto.mValid);
|
||||
|
||||
if (MediaPrefs::EMEBlankVideo()) {
|
||||
if (StaticPrefs::MediaEmeVideoBlank()) {
|
||||
EME_LOG("EMEDecoderModule::CreateVideoDecoder() creating a blank decoder.");
|
||||
RefPtr<PlatformDecoderModule> m(CreateBlankDecoderModule());
|
||||
return m->CreateVideoDecoder(aParams);
|
||||
@ -445,7 +445,7 @@ EMEDecoderModule::CreateAudioDecoder(const CreateDecoderParams& aParams)
|
||||
MOZ_ASSERT(!SupportsMimeType(aParams.mConfig.mMimeType, nullptr));
|
||||
MOZ_ASSERT(mPDM);
|
||||
|
||||
if (MediaPrefs::EMEBlankAudio()) {
|
||||
if (StaticPrefs::MediaEmeAudioBlank()) {
|
||||
EME_LOG("EMEDecoderModule::CreateAudioDecoder() creating a blank decoder.");
|
||||
RefPtr<PlatformDecoderModule> m(CreateBlankDecoderModule());
|
||||
return m->CreateAudioDecoder(aParams);
|
||||
|
@ -11,7 +11,6 @@
|
||||
#include "GMPVideoDecoder.h"
|
||||
#include "MP4Decoder.h"
|
||||
#include "MediaDataDecoderProxy.h"
|
||||
#include "MediaPrefs.h"
|
||||
#include "VPXDecoder.h"
|
||||
#include "VideoUtils.h"
|
||||
#include "gmp-video-decode.h"
|
||||
|
@ -4,7 +4,6 @@
|
||||
|
||||
#include "GeneratedJNIWrappers.h"
|
||||
#include "MediaInfo.h"
|
||||
#include "MediaPrefs.h"
|
||||
#include "OpusDecoder.h"
|
||||
#include "RemoteDataDecoder.h"
|
||||
#include "VPXDecoder.h"
|
||||
|
@ -10,7 +10,6 @@
|
||||
#include "AppleVTDecoder.h"
|
||||
#include "AppleVTLinker.h"
|
||||
#include "MacIOSurfaceImage.h"
|
||||
#include "MediaPrefs.h"
|
||||
#include "mozilla/DebugOnly.h"
|
||||
#include "mozilla/Logging.h"
|
||||
#include "mozilla/gfx/gfxVars.h"
|
||||
|
@ -11,7 +11,7 @@
|
||||
#include "FFmpegLibWrapper.h"
|
||||
#include "FFmpegAudioDecoder.h"
|
||||
#include "FFmpegVideoDecoder.h"
|
||||
#include "MediaPrefs.h"
|
||||
#include "mozilla/StaticPrefs.h"
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
@ -42,7 +42,7 @@ public:
|
||||
}
|
||||
if (aParams.mOptions.contains(
|
||||
CreateDecoderParams::Option::LowLatency) &&
|
||||
!MediaPrefs::PDMFFmpegLowLatencyEnabled()) {
|
||||
!StaticPrefs::MediaFfmpegLowLatencyEnabled()) {
|
||||
return nullptr;
|
||||
}
|
||||
RefPtr<MediaDataDecoder> decoder = new FFmpegVideoDecoder<V>(
|
||||
|
@ -4,8 +4,10 @@
|
||||
|
||||
#include "FFmpegLibWrapper.h"
|
||||
#include "FFmpegLog.h"
|
||||
#include "MediaPrefs.h"
|
||||
#include "mozilla/PodOperations.h"
|
||||
#ifdef MOZ_FFMPEG
|
||||
#include "mozilla/StaticPrefs.h"
|
||||
#endif
|
||||
#include "mozilla/Types.h"
|
||||
#include "PlatformDecoderModule.h"
|
||||
#include "prlink.h"
|
||||
@ -45,7 +47,7 @@ FFmpegLibWrapper::Link()
|
||||
}
|
||||
#ifdef MOZ_FFMPEG
|
||||
if (version < (54u << 16 | 35u << 8 | 1u) &&
|
||||
!MediaPrefs::LibavcodecAllowObsolete()) {
|
||||
!StaticPrefs::MediaLibavcodecAllowObsolete()) {
|
||||
// Refuse any libavcodec version prior to 54.35.1.
|
||||
// (Unless media.libavcodec.allow-obsolete==true)
|
||||
Unlink();
|
||||
|
@ -9,7 +9,6 @@
|
||||
#include "MFTDecoder.h"
|
||||
#include "MP4Decoder.h"
|
||||
#include "MediaInfo.h"
|
||||
#include "MediaPrefs.h"
|
||||
#include "VPXDecoder.h"
|
||||
#include "WMF.h"
|
||||
#include "WMFAudioMFTManager.h"
|
||||
@ -20,6 +19,7 @@
|
||||
#include "mozilla/Maybe.h"
|
||||
#include "mozilla/Services.h"
|
||||
#include "mozilla/StaticMutex.h"
|
||||
#include "mozilla/StaticPrefs.h"
|
||||
#include "mozilla/WindowsVersion.h"
|
||||
#include "mozilla/gfx/gfxVars.h"
|
||||
#include "nsAutoPtr.h"
|
||||
@ -55,7 +55,7 @@ WMFDecoderModule::Init()
|
||||
// If we're in the content process and the UseGPUDecoder pref is set, it
|
||||
// means that we've given up on the GPU process (it's been crashing) so we
|
||||
// should disable DXVA
|
||||
sDXVAEnabled = !MediaPrefs::PDMUseGPUDecoder();
|
||||
sDXVAEnabled = !StaticPrefs::MediaGpuProcessDecoder();
|
||||
} else if (XRE_IsGPUProcess()) {
|
||||
// Always allow DXVA in the GPU process.
|
||||
sDXVAEnabled = true;
|
||||
@ -213,7 +213,7 @@ WMFDecoderModule::Supports(const TrackInfo& aTrackInfo,
|
||||
CanCreateWMFDecoder<CLSID_CMP3DecMediaObject>()) {
|
||||
return true;
|
||||
}
|
||||
if (MediaPrefs::PDMWMFVP9DecoderEnabled()) {
|
||||
if (StaticPrefs::MediaWmfVp9Enabled()) {
|
||||
static const uint32_t VP8_USABLE_BUILD = 16287;
|
||||
if (VPXDecoder::IsVP8(aTrackInfo.mMimeType) &&
|
||||
IsWindowsBuildOrLater(VP8_USABLE_BUILD) &&
|
||||
|
@ -9,8 +9,8 @@
|
||||
#include "DecoderDoctorDiagnostics.h"
|
||||
#include "ImageContainer.h"
|
||||
#include "MediaInfo.h"
|
||||
#include "MediaPrefs.h"
|
||||
#include "PDMFactory.h"
|
||||
#include "mozilla/StaticPrefs.h"
|
||||
#include "mozilla/TaskQueue.h"
|
||||
#include "AnnexB.h"
|
||||
#include "H264.h"
|
||||
@ -364,7 +364,7 @@ bool
|
||||
H264Converter::CanRecycleDecoder() const
|
||||
{
|
||||
MOZ_ASSERT(mDecoder);
|
||||
return MediaPrefs::MediaDecoderCheckRecycling() &&
|
||||
return StaticPrefs::MediaDecoderRecycleEnabled() &&
|
||||
mDecoder->SupportDecoderRecycling();
|
||||
}
|
||||
|
||||
|
@ -6,11 +6,11 @@
|
||||
|
||||
#include "WebMDecoder.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "mozilla/StaticPrefs.h"
|
||||
#ifdef MOZ_AV1
|
||||
#include "AOMDecoder.h"
|
||||
#endif
|
||||
#include "MediaContainerType.h"
|
||||
#include "MediaPrefs.h"
|
||||
#include "PDMFactory.h"
|
||||
#include "VideoUtils.h"
|
||||
|
||||
@ -70,7 +70,7 @@ WebMDecoder::IsSupportedType(const MediaContainerType& aContainerType)
|
||||
}
|
||||
}
|
||||
#ifdef MOZ_AV1
|
||||
if (isVideo && MediaPrefs::AV1Enabled() &&
|
||||
if (isVideo && StaticPrefs::MediaAv1Enabled() &&
|
||||
AOMDecoder::IsSupportedCodec(codec)) {
|
||||
continue;
|
||||
}
|
||||
|
@ -16,8 +16,8 @@
|
||||
#include "mozilla/dom/MediaStreamError.h"
|
||||
#include "mozilla/MediaManager.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "MediaPrefs.h"
|
||||
#include "mozilla/Services.h"
|
||||
#include "mozilla/StaticPrefs.h"
|
||||
|
||||
#include "AudioSegment.h"
|
||||
#include "DOMMediaStream.h"
|
||||
@ -87,7 +87,7 @@ GetSpeechRecognitionService(const nsAString& aLang)
|
||||
speechRecognitionService = DEFAULT_RECOGNITION_SERVICE;
|
||||
}
|
||||
|
||||
if (MediaPrefs::WebSpeechFakeRecognitionService()) {
|
||||
if (StaticPrefs::MediaWebspeechTextFakeRecognitionService()) {
|
||||
speechRecognitionServiceCID =
|
||||
NS_SPEECH_RECOGNITION_SERVICE_CONTRACTID_PREFIX "fake";
|
||||
} else {
|
||||
@ -125,7 +125,7 @@ SpeechRecognition::SpeechRecognition(nsPIDOMWindowInner* aOwnerWindow)
|
||||
{
|
||||
SR_LOG("created SpeechRecognition");
|
||||
|
||||
if (MediaPrefs::WebSpeechTestEnabled()) {
|
||||
if (StaticPrefs::MediaWebspeechTestEnable()) {
|
||||
nsCOMPtr<nsIObserverService> obs = services::GetObserverService();
|
||||
obs->AddObserver(this, SPEECH_RECOGNITION_TEST_EVENT_REQUEST_TOPIC, false);
|
||||
obs->AddObserver(this, SPEECH_RECOGNITION_TEST_END_TOPIC, false);
|
||||
@ -181,9 +181,10 @@ SpeechRecognition::IsAuthorized(JSContext* aCx, JSObject* aGlobal)
|
||||
bool hasPermission =
|
||||
(speechRecognition == nsIPermissionManager::ALLOW_ACTION);
|
||||
|
||||
return (hasPermission || MediaPrefs::WebSpeechRecognitionForceEnabled() ||
|
||||
MediaPrefs::WebSpeechTestEnabled()) &&
|
||||
MediaPrefs::WebSpeechRecognitionEnabled();
|
||||
return (hasPermission ||
|
||||
StaticPrefs::MediaWebspeechRecognitionForceEnable() ||
|
||||
StaticPrefs::MediaWebspeechTestEnable()) &&
|
||||
StaticPrefs::MediaWebspeechRecognitionEnable();
|
||||
}
|
||||
|
||||
already_AddRefed<SpeechRecognition>
|
||||
@ -620,7 +621,7 @@ SpeechRecognition::Observe(nsISupports* aSubject, const char* aTopic,
|
||||
nsCOMPtr<nsIObserverService> obs = services::GetObserverService();
|
||||
obs->RemoveObserver(this, SPEECH_RECOGNITION_TEST_EVENT_REQUEST_TOPIC);
|
||||
obs->RemoveObserver(this, SPEECH_RECOGNITION_TEST_END_TOPIC);
|
||||
} else if (MediaPrefs::WebSpeechFakeFSMEvents() &&
|
||||
} else if (StaticPrefs::MediaWebspeechTextFakeFsmEvents() &&
|
||||
!strcmp(aTopic, SPEECH_RECOGNITION_TEST_EVENT_REQUEST_TOPIC)) {
|
||||
ProcessTestEventRequest(aSubject, nsDependentString(aData));
|
||||
}
|
||||
@ -640,9 +641,9 @@ SpeechRecognition::ProcessTestEventRequest(nsISupports* aSubject,
|
||||
SpeechRecognitionErrorCode::Audio_capture, // TODO different codes?
|
||||
NS_LITERAL_STRING("AUDIO_ERROR test event"));
|
||||
} else {
|
||||
NS_ASSERTION(MediaPrefs::WebSpeechFakeRecognitionService(),
|
||||
NS_ASSERTION(StaticPrefs::MediaWebspeechTextFakeRecognitionService(),
|
||||
"Got request for fake recognition service event, but "
|
||||
TEST_PREFERENCE_FAKE_RECOGNITION_SERVICE " is unset");
|
||||
"media.webspeech.test.fake_recognition_service is unset");
|
||||
|
||||
// let the fake recognition service handle the request
|
||||
}
|
||||
|
@ -7,7 +7,6 @@
|
||||
#include "nsThreadUtils.h"
|
||||
|
||||
#include "FakeSpeechRecognitionService.h"
|
||||
#include "MediaPrefs.h"
|
||||
|
||||
#include "SpeechRecognition.h"
|
||||
#include "SpeechRecognitionAlternative.h"
|
||||
@ -15,6 +14,7 @@
|
||||
#include "SpeechRecognitionResultList.h"
|
||||
#include "nsIObserverService.h"
|
||||
#include "mozilla/Services.h"
|
||||
#include "mozilla/StaticPrefs.h"
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
@ -67,9 +67,9 @@ FakeSpeechRecognitionService::Abort()
|
||||
NS_IMETHODIMP
|
||||
FakeSpeechRecognitionService::Observe(nsISupports* aSubject, const char* aTopic, const char16_t* aData)
|
||||
{
|
||||
MOZ_ASSERT(MediaPrefs::WebSpeechFakeRecognitionService(),
|
||||
MOZ_ASSERT(StaticPrefs::MediaWebspeechTextFakeRecognitionService(),
|
||||
"Got request to fake recognition service event, but "
|
||||
TEST_PREFERENCE_FAKE_RECOGNITION_SERVICE " is not set");
|
||||
"media.webspeech.test.fake_recognition_service is not set");
|
||||
|
||||
if (!strcmp(aTopic, SPEECH_RECOGNITION_TEST_END_TOPIC)) {
|
||||
nsCOMPtr<nsIObserverService> obs = services::GetObserverService();
|
||||
|
@ -8,7 +8,6 @@
|
||||
#include "nsServiceManagerUtils.h"
|
||||
#include "nsCategoryManagerUtils.h"
|
||||
|
||||
#include "MediaPrefs.h"
|
||||
#include "SpeechSynthesisUtterance.h"
|
||||
#include "SpeechSynthesisVoice.h"
|
||||
#include "nsSynthVoiceRegistry.h"
|
||||
@ -17,10 +16,11 @@
|
||||
|
||||
#include "nsString.h"
|
||||
#include "mozilla/ClearOnShutdown.h"
|
||||
#include "mozilla/StaticPtr.h"
|
||||
#include "mozilla/dom/ContentChild.h"
|
||||
#include "mozilla/dom/ContentParent.h"
|
||||
#include "mozilla/intl/LocaleService.h"
|
||||
#include "mozilla/StaticPrefs.h"
|
||||
#include "mozilla/StaticPtr.h"
|
||||
#include "mozilla/Unused.h"
|
||||
|
||||
#include "SpeechSynthesisChild.h"
|
||||
@ -346,7 +346,8 @@ nsSynthVoiceRegistry::RemoveVoice(nsISpeechService* aService,
|
||||
mDefaultVoices.RemoveElement(retval);
|
||||
mUriVoiceMap.Remove(aUri);
|
||||
|
||||
if (retval->mIsQueued && !MediaPrefs::WebSpeechForceGlobal()) {
|
||||
if (retval->mIsQueued &&
|
||||
!StaticPrefs::MediaWebspeechSynthForceGlobalQueue()) {
|
||||
// Check if this is the last queued voice, and disable the global queue if
|
||||
// it is.
|
||||
bool queued = false;
|
||||
@ -717,7 +718,8 @@ nsSynthVoiceRegistry::Speak(const nsAString& aText,
|
||||
|
||||
aTask->SetChosenVoiceURI(voice->mUri);
|
||||
|
||||
if (mUseGlobalQueue || MediaPrefs::WebSpeechForceGlobal()) {
|
||||
if (mUseGlobalQueue ||
|
||||
StaticPrefs::MediaWebspeechSynthForceGlobalQueue()) {
|
||||
LOG(LogLevel::Debug,
|
||||
("nsSynthVoiceRegistry::Speak queueing text='%s' lang='%s' uri='%s' rate=%f pitch=%f",
|
||||
NS_ConvertUTF16toUTF8(aText).get(), NS_ConvertUTF16toUTF8(aLang).get(),
|
||||
@ -796,7 +798,8 @@ nsSynthVoiceRegistry::SetIsSpeaking(bool aIsSpeaking)
|
||||
|
||||
// Only set to 'true' if global queue is enabled.
|
||||
mIsSpeaking =
|
||||
aIsSpeaking && (mUseGlobalQueue || MediaPrefs::WebSpeechForceGlobal());
|
||||
aIsSpeaking && (mUseGlobalQueue ||
|
||||
StaticPrefs::MediaWebspeechSynthForceGlobalQueue());
|
||||
|
||||
nsTArray<SpeechSynthesisParent*> ssplist;
|
||||
GetAllSpeechSynthActors(ssplist);
|
||||
|
@ -12,6 +12,7 @@
|
||||
#include "mozilla/MemoryReportingProcess.h"
|
||||
#include "mozilla/Sprintf.h"
|
||||
#include "mozilla/StaticPtr.h"
|
||||
#include "mozilla/StaticPrefs.h"
|
||||
#include "mozilla/dom/ContentParent.h"
|
||||
#include "mozilla/gfx/gfxVars.h"
|
||||
#include "mozilla/layers/APZCTreeManagerChild.h"
|
||||
@ -37,7 +38,6 @@
|
||||
#include "VsyncSource.h"
|
||||
#include "mozilla/dom/VideoDecoderManagerChild.h"
|
||||
#include "mozilla/dom/VideoDecoderManagerParent.h"
|
||||
#include "MediaPrefs.h"
|
||||
#include "nsExceptionHandler.h"
|
||||
#include "nsPrintfCString.h"
|
||||
|
||||
@ -981,7 +981,7 @@ GPUProcessManager::CreateContentVideoDecoderManager(base::ProcessId aOtherProces
|
||||
ipc::Endpoint<dom::PVideoDecoderManagerChild>* aOutEndpoint)
|
||||
{
|
||||
if (!EnsureGPUReady() ||
|
||||
!MediaPrefs::PDMUseGPUDecoder() ||
|
||||
!StaticPrefs::MediaGpuProcessDecoder() ||
|
||||
!mDecodeVideoOnGpuProcess) {
|
||||
return;
|
||||
}
|
||||
|
@ -31,7 +31,6 @@
|
||||
#include "gfxTextRun.h"
|
||||
#include "gfxUserFontSet.h"
|
||||
#include "gfxConfig.h"
|
||||
#include "MediaPrefs.h"
|
||||
#include "VRThread.h"
|
||||
|
||||
#ifdef XP_WIN
|
||||
@ -657,7 +656,6 @@ gfxPlatform::Init()
|
||||
|
||||
// Initialize the preferences by creating the singleton.
|
||||
gfxPrefs::GetSingleton();
|
||||
MediaPrefs::GetSingleton();
|
||||
gfxVars::Initialize();
|
||||
|
||||
gfxConfig::Init();
|
||||
|
@ -105,7 +105,6 @@
|
||||
#include "TouchManager.h"
|
||||
#include "DecoderDoctorLogger.h"
|
||||
#include "MediaDecoder.h"
|
||||
#include "MediaPrefs.h"
|
||||
#include "mozilla/ServoBindings.h"
|
||||
#include "mozilla/StaticPresData.h"
|
||||
#include "mozilla/dom/WebIDLGlobalNameHash.h"
|
||||
@ -283,11 +282,6 @@ nsLayoutStatics::Initialize()
|
||||
InitializeServo();
|
||||
}
|
||||
|
||||
#ifndef MOZ_WIDGET_ANDROID
|
||||
// On Android, we instantiate it when constructing AndroidBridge.
|
||||
MediaPrefs::GetSingleton();
|
||||
#endif
|
||||
|
||||
// This must be initialized on the main-thread.
|
||||
mozilla::dom::IPCBlobInputStreamStorage::Initialize();
|
||||
|
||||
|
@ -4,10 +4,10 @@
|
||||
|
||||
#include "CSFLog.h"
|
||||
#include "nspr.h"
|
||||
#include "mozilla/StaticPrefs.h"
|
||||
|
||||
#include "WebrtcMediaCodecVP8VideoCodec.h"
|
||||
#include "MediaCodecVideoCodec.h"
|
||||
#include "MediaPrefs.h"
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
@ -20,7 +20,7 @@ static const char* mcvcLogTag ="MediaCodecVideoCodec";
|
||||
WebrtcVideoEncoder* MediaCodecVideoCodec::CreateEncoder(CodecType aCodecType) {
|
||||
CSFLogDebug(LOGTAG, "%s ", __FUNCTION__);
|
||||
if (aCodecType == CODEC_VP8) {
|
||||
if (MediaPrefs::RemoteMediaCodecVP8EncoderEnabled()) {
|
||||
if (StaticPrefs::MediaNavigatorHardwareVp8encodeAccelerationRemoteEnabled()) {
|
||||
return new WebrtcMediaCodecVP8VideoRemoteEncoder();
|
||||
} else {
|
||||
return new WebrtcMediaCodecVP8VideoEncoder();
|
||||
|
@ -3,8 +3,8 @@
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "MediaDataDecoderCodec.h"
|
||||
#include "MediaPrefs.h"
|
||||
#include "WebrtcMediaDataDecoderCodec.h"
|
||||
#include "mozilla/StaticPrefs.h"
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
@ -19,7 +19,7 @@ MediaDataDecoderCodec::CreateEncoder(
|
||||
MediaDataDecoderCodec::CreateDecoder(
|
||||
webrtc::VideoCodecType aCodecType)
|
||||
{
|
||||
if (!MediaPrefs::MediaDataDecoderEnabled()) {
|
||||
if (!StaticPrefs::MediaNavigatorMediadatadecoderEnabled()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@ -34,4 +34,4 @@ MediaDataDecoderCodec::CreateDecoder(
|
||||
return new WebrtcMediaDataDecoder();
|
||||
}
|
||||
|
||||
} // namespace mozilla
|
||||
} // namespace mozilla
|
||||
|
@ -563,11 +563,6 @@ pref("browser.meta_refresh_when_inactive.disabled", true);
|
||||
// prevent video elements from preloading too much data
|
||||
pref("media.preload.default", 1); // default to preload none
|
||||
pref("media.preload.auto", 2); // preload metadata if preload=auto
|
||||
pref("media.cache_size", 32768); // 32MB media cache
|
||||
// Try to save battery by not resuming reading from a connection until we fall
|
||||
// below 10s of buffered data.
|
||||
pref("media.cache_resume_threshold", 10);
|
||||
pref("media.cache_readahead_limit", 30);
|
||||
// On mobile we'll throttle the download once the readahead_limit is hit,
|
||||
// even if the download is slow. This is to preserve battery and data.
|
||||
pref("media.throttle-regardless-of-download-rate", true);
|
||||
@ -584,28 +579,11 @@ pref("media.video-queue.default-size", 3);
|
||||
// (the most recent) image data.
|
||||
pref("media.video-queue.send-to-compositor-size", 1);
|
||||
|
||||
// Allow to check if the decoder supports recycling only on Fennec nightly build.
|
||||
pref("media.decoder.recycle.enabled", true);
|
||||
|
||||
// Enable the MediaCodec PlatformDecoderModule by default.
|
||||
pref("media.android-media-codec.enabled", true);
|
||||
pref("media.android-media-codec.preferred", true);
|
||||
|
||||
// Enable MSE
|
||||
pref("media.mediasource.enabled", true);
|
||||
|
||||
pref("media.mediadrm-widevinecdm.visible", true);
|
||||
|
||||
#ifdef NIGHTLY_BUILD
|
||||
// Enable EME (Encrypted Media Extensions)
|
||||
pref("media.eme.enabled", true);
|
||||
#endif
|
||||
|
||||
pref("media.hls.enabled", true);
|
||||
|
||||
// Whether to suspend decoding of videos in background tabs.
|
||||
pref("media.suspend-bkgnd-video.enabled", true);
|
||||
|
||||
// optimize images memory usage
|
||||
pref("image.downscale-during-decode.enabled", true);
|
||||
|
||||
@ -900,7 +878,5 @@ pref("javascript.options.native_regexp", false);
|
||||
// Ask for permission when enumerating WebRTC devices.
|
||||
pref("media.navigator.permission.device", true);
|
||||
|
||||
pref("media.videocontrols.lock-video-orientation", true);
|
||||
|
||||
// Allow system add-on updates
|
||||
pref("extensions.systemAddon.update.url", "https://aus5.mozilla.org/update/3/SystemAddons/%VERSION%/%BUILD_ID%/%BUILD_TARGET%/%LOCALE%/%CHANNEL%/%OS_VERSION%/%DISTRIBUTION%/%DISTRIBUTION_VERSION%/update.xml");
|
||||
|
@ -77,6 +77,16 @@
|
||||
|
||||
// clang-format off
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Accessibility prefs
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
VARCACHE_PREF(
|
||||
"accessibility.monoaudio.enable",
|
||||
accessibility_monoaudio_enable,
|
||||
bool, false
|
||||
)
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Full-screen prefs
|
||||
//---------------------------------------------------------------------------
|
||||
@ -295,6 +305,497 @@ VARCACHE_PREF(
|
||||
bool, false
|
||||
)
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Media prefs
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
// These prefs use camel case instead of snake case for the getter because one
|
||||
// reviewer had an unshakeable preference for that.
|
||||
|
||||
// File-backed MediaCache size.
|
||||
#ifdef ANDROID
|
||||
# define PREF_VALUE 32768 // Measured in KiB
|
||||
#else
|
||||
# define PREF_VALUE 512000 // Measured in KiB
|
||||
#endif
|
||||
VARCACHE_PREF(
|
||||
"media.cache_size",
|
||||
MediaCacheSize,
|
||||
uint32_t, PREF_VALUE
|
||||
)
|
||||
#undef PREF_VALUE
|
||||
|
||||
// If a resource is known to be smaller than this size (in kilobytes), a
|
||||
// memory-backed MediaCache may be used; otherwise the (single shared global)
|
||||
// file-backed MediaCache is used.
|
||||
VARCACHE_PREF(
|
||||
"media.memory_cache_max_size",
|
||||
MediaMemoryCacheMaxSize,
|
||||
uint32_t, 8192 // Measured in KiB
|
||||
)
|
||||
|
||||
// Don't create more memory-backed MediaCaches if their combined size would go
|
||||
// above this absolute size limit.
|
||||
#ifdef ANDROID
|
||||
# define PREF_VALUE 32768 // Measured in KiB
|
||||
#else
|
||||
# define PREF_VALUE 524288 // Measured in KiB
|
||||
#endif
|
||||
VARCACHE_PREF(
|
||||
"media.memory_caches_combined_limit_kb",
|
||||
MediaMemoryCachesCombinedLimitKb,
|
||||
uint32_t, PREF_VALUE
|
||||
)
|
||||
#undef PREF_VALUE
|
||||
|
||||
// Don't create more memory-backed MediaCaches if their combined size would go
|
||||
// above this relative size limit (a percentage of physical memory).
|
||||
VARCACHE_PREF(
|
||||
"media.memory_caches_combined_limit_pc_sysmem",
|
||||
MediaMemoryCachesCombinedLimitPcSysmem,
|
||||
uint32_t, 5 // A percentage
|
||||
)
|
||||
|
||||
// When a network connection is suspended, don't resume it until the amount of
|
||||
// buffered data falls below this threshold (in seconds).
|
||||
#ifdef ANDROID
|
||||
# define PREF_VALUE 10 // Use a smaller limit to save battery.
|
||||
#else
|
||||
# define PREF_VALUE 30
|
||||
#endif
|
||||
VARCACHE_PREF(
|
||||
"media.cache_resume_threshold",
|
||||
MediaCacheResumeThreshold,
|
||||
int32_t, PREF_VALUE
|
||||
)
|
||||
#undef PREF_VALUE
|
||||
|
||||
// Stop reading ahead when our buffered data is this many seconds ahead of the
|
||||
// current playback position. This limit can stop us from using arbitrary
|
||||
// amounts of network bandwidth prefetching huge videos.
|
||||
#ifdef ANDROID
|
||||
# define PREF_VALUE 30 // Use a smaller limit to save battery.
|
||||
#else
|
||||
# define PREF_VALUE 60
|
||||
#endif
|
||||
VARCACHE_PREF(
|
||||
"media.cache_readahead_limit",
|
||||
MediaCacheReadaheadLimit,
|
||||
int32_t, PREF_VALUE
|
||||
)
|
||||
#undef PREF_VALUE
|
||||
|
||||
// AudioSink
|
||||
VARCACHE_PREF(
|
||||
"media.resampling.enabled",
|
||||
MediaResamplingEnabled,
|
||||
bool, false
|
||||
)
|
||||
|
||||
#if defined(XP_WIN) || defined(XP_DARWIN) || defined(MOZ_PULSEAUDIO)
|
||||
// libcubeb backend implement .get_preferred_channel_layout
|
||||
# define PREF_VALUE false
|
||||
#else
|
||||
# define PREF_VALUE true
|
||||
#endif
|
||||
VARCACHE_PREF(
|
||||
"media.forcestereo.enabled",
|
||||
MediaForcestereoEnabled,
|
||||
bool, PREF_VALUE
|
||||
)
|
||||
#undef PREF_VALUE
|
||||
|
||||
// VideoSink
|
||||
VARCACHE_PREF(
|
||||
"media.ruin-av-sync.enabled",
|
||||
MediaRuinAvSyncEnabled,
|
||||
bool, false
|
||||
)
|
||||
|
||||
// Encrypted Media Extensions
|
||||
#if defined(ANDROID)
|
||||
# if defined(NIGHTLY_BUILD)
|
||||
# define PREF_VALUE true
|
||||
# else
|
||||
# define PREF_VALUE false
|
||||
# endif
|
||||
#elif defined(XP_LINUX)
|
||||
// On Linux EME is visible but disabled by default. This is so that the "Play
|
||||
// DRM content" checkbox in the Firefox UI is unchecked by default. DRM
|
||||
// requires downloading and installing proprietary binaries, which users on
|
||||
// an open source operating systems didn't opt into. The first time a site
|
||||
// using EME is encountered, the user will be prompted to enable DRM,
|
||||
// whereupon the EME plugin binaries will be downloaded if permission is
|
||||
// granted.
|
||||
# define PREF_VALUE false
|
||||
#else
|
||||
# define PREF_VALUE true
|
||||
#endif
|
||||
VARCACHE_PREF(
|
||||
"media.eme.enabled",
|
||||
MediaEmeEnabled,
|
||||
bool, PREF_VALUE
|
||||
)
|
||||
#undef PREF_VALUE
|
||||
|
||||
VARCACHE_PREF(
|
||||
"media.clearkey.persistent-license.enabled",
|
||||
MediaClearkeyPersistentLicenseEnabled,
|
||||
bool, false
|
||||
)
|
||||
|
||||
#if defined(XP_LINUX) && defined(MOZ_GMP_SANDBOX)
|
||||
// Whether to allow, on a Linux system that doesn't support the necessary
|
||||
// sandboxing features, loading Gecko Media Plugins unsandboxed. However, EME
|
||||
// CDMs will not be loaded without sandboxing even if this pref is changed.
|
||||
VARCACHE_PREF(
|
||||
"media.gmp.insecure.allow",
|
||||
MediaGmpInsecureAllow,
|
||||
bool, false
|
||||
)
|
||||
#endif
|
||||
|
||||
// Specifies whether the PDMFactory can create a test decoder that just outputs
|
||||
// blank frames/audio instead of actually decoding. The blank decoder works on
|
||||
// all platforms.
|
||||
VARCACHE_PREF(
|
||||
"media.use-blank-decoder",
|
||||
MediaUseBlankDecoder,
|
||||
bool, false
|
||||
)
|
||||
|
||||
#if defined(XP_WIN)
|
||||
# define PREF_VALUE true
|
||||
#else
|
||||
# define PREF_VALUE false
|
||||
#endif
|
||||
VARCACHE_PREF(
|
||||
"media.gpu-process-decoder",
|
||||
MediaGpuProcessDecoder,
|
||||
bool, PREF_VALUE
|
||||
)
|
||||
#undef PREF_VALUE
|
||||
|
||||
#ifdef ANDROID
|
||||
|
||||
// Enable the MediaCodec PlatformDecoderModule by default.
|
||||
VARCACHE_PREF(
|
||||
"media.android-media-codec.enabled",
|
||||
MediaAndroidMediaCodecEnabled,
|
||||
bool, true
|
||||
)
|
||||
|
||||
VARCACHE_PREF(
|
||||
"media.android-media-codec.preferred",
|
||||
MediaAndroidMediaCodecPreferred,
|
||||
bool, true
|
||||
)
|
||||
|
||||
#endif // ANDROID
|
||||
|
||||
// WebRTC
|
||||
#ifdef MOZ_WEBRTC
|
||||
#ifdef ANDROID
|
||||
|
||||
VARCACHE_PREF(
|
||||
"media.navigator.hardware.vp8_encode.acceleration_remote_enabled",
|
||||
MediaNavigatorHardwareVp8encodeAccelerationRemoteEnabled,
|
||||
bool, true
|
||||
)
|
||||
|
||||
PREF("media.navigator.hardware.vp8_encode.acceleration_enabled", bool, true)
|
||||
|
||||
PREF("media.navigator.hardware.vp8_decode.acceleration_enabled", bool, false)
|
||||
|
||||
#endif // ANDROID
|
||||
|
||||
// Use MediaDataDecoder API for WebRTC. This includes hardware acceleration for
|
||||
// decoding.
|
||||
VARCACHE_PREF(
|
||||
"media.navigator.mediadatadecoder_enabled",
|
||||
MediaNavigatorMediadatadecoderEnabled,
|
||||
bool, false
|
||||
)
|
||||
#endif // MOZ_WEBRTC
|
||||
|
||||
#ifdef MOZ_FFMPEG
|
||||
|
||||
# if defined(XP_MACOSX)
|
||||
# define PREF_VALUE false
|
||||
# else
|
||||
# define PREF_VALUE true
|
||||
# endif
|
||||
VARCACHE_PREF(
|
||||
"media.ffmpeg.enabled",
|
||||
MediaFfmpegEnabled,
|
||||
bool, PREF_VALUE
|
||||
)
|
||||
#undef PREF_VALUE
|
||||
|
||||
VARCACHE_PREF(
|
||||
"media.libavcodec.allow-obsolete",
|
||||
MediaLibavcodecAllowObsolete,
|
||||
bool, false
|
||||
)
|
||||
|
||||
#endif // MOZ_FFMPEG
|
||||
|
||||
#ifdef MOZ_FFVPX
|
||||
VARCACHE_PREF(
|
||||
"media.ffvpx.enabled",
|
||||
MediaFfvpxEnabled,
|
||||
bool, true
|
||||
)
|
||||
#endif
|
||||
|
||||
#if defined(MOZ_FFMPEG) || defined(MOZ_FFVPX)
|
||||
VARCACHE_PREF(
|
||||
"media.ffmpeg.low-latency.enabled",
|
||||
MediaFfmpegLowLatencyEnabled,
|
||||
bool, false
|
||||
)
|
||||
#endif
|
||||
|
||||
#ifdef MOZ_WMF
|
||||
|
||||
VARCACHE_PREF(
|
||||
"media.wmf.enabled",
|
||||
MediaWmfEnabled,
|
||||
bool, true
|
||||
)
|
||||
|
||||
// Whether DD should consider WMF-disabled a WMF failure, useful for testing.
|
||||
VARCACHE_PREF(
|
||||
"media.decoder-doctor.wmf-disabled-is-failure",
|
||||
MediaDecoderDoctorWmfDisabledIsFailure,
|
||||
bool, false
|
||||
)
|
||||
|
||||
VARCACHE_PREF(
|
||||
"media.wmf.vp9.enabled",
|
||||
MediaWmfVp9Enabled,
|
||||
bool, true
|
||||
)
|
||||
|
||||
#endif // MOZ_WMF
|
||||
|
||||
// Whether to check the decoder supports recycling.
|
||||
#ifdef ANDROID
|
||||
# define PREF_VALUE true
|
||||
#else
|
||||
# define PREF_VALUE false
|
||||
#endif
|
||||
VARCACHE_PREF(
|
||||
"media.decoder.recycle.enabled",
|
||||
MediaDecoderRecycleEnabled,
|
||||
bool, PREF_VALUE
|
||||
)
|
||||
#undef PREF_VALUE
|
||||
|
||||
// Should MFR try to skip to the next key frame?
|
||||
VARCACHE_PREF(
|
||||
"media.decoder.skip-to-next-key-frame.enabled",
|
||||
MediaDecoderSkipToNextKeyFrameEnabled,
|
||||
bool, true
|
||||
)
|
||||
|
||||
VARCACHE_PREF(
|
||||
"media.gmp.decoder.enabled",
|
||||
MediaGmpDecoderEnabled,
|
||||
bool, false
|
||||
)
|
||||
|
||||
VARCACHE_PREF(
|
||||
"media.eme.audio.blank",
|
||||
MediaEmeAudioBlank,
|
||||
bool, false
|
||||
)
|
||||
VARCACHE_PREF(
|
||||
"media.eme.video.blank",
|
||||
MediaEmeVideoBlank,
|
||||
bool, false
|
||||
)
|
||||
|
||||
VARCACHE_PREF(
|
||||
"media.eme.chromium-api.video-shmems",
|
||||
MediaEmeChromiumApiVideoShmems,
|
||||
uint32_t, 6
|
||||
)
|
||||
|
||||
// Whether to suspend decoding of videos in background tabs.
|
||||
VARCACHE_PREF(
|
||||
"media.suspend-bkgnd-video.enabled",
|
||||
MediaSuspendBkgndVideoEnabled,
|
||||
bool, true
|
||||
)
|
||||
|
||||
// Delay, in ms, from time window goes to background to suspending
|
||||
// video decoders. Defaults to 10 seconds.
|
||||
VARCACHE_PREF(
|
||||
"media.suspend-bkgnd-video.delay-ms",
|
||||
MediaSuspendBkgndVideoDelayMs,
|
||||
RelaxedAtomicUint32, 10000
|
||||
)
|
||||
|
||||
VARCACHE_PREF(
|
||||
"media.dormant-on-pause-timeout-ms",
|
||||
MediaDormantOnPauseTimeoutMs,
|
||||
int32_t, 5000
|
||||
)
|
||||
|
||||
VARCACHE_PREF(
|
||||
"media.webspeech.synth.force_global_queue",
|
||||
MediaWebspeechSynthForceGlobalQueue,
|
||||
bool, false
|
||||
)
|
||||
|
||||
VARCACHE_PREF(
|
||||
"media.webspeech.test.enable",
|
||||
MediaWebspeechTestEnable,
|
||||
bool, false
|
||||
)
|
||||
|
||||
VARCACHE_PREF(
|
||||
"media.webspeech.test.fake_fsm_events",
|
||||
MediaWebspeechTextFakeFsmEvents,
|
||||
bool, false
|
||||
)
|
||||
|
||||
VARCACHE_PREF(
|
||||
"media.webspeech.test.fake_recognition_service",
|
||||
MediaWebspeechTextFakeRecognitionService,
|
||||
bool, false
|
||||
)
|
||||
|
||||
#ifdef MOZ_WEBSPEECH
|
||||
VARCACHE_PREF(
|
||||
"media.webspeech.recognition.enable",
|
||||
MediaWebspeechRecognitionEnable,
|
||||
bool, false
|
||||
)
|
||||
#endif
|
||||
|
||||
VARCACHE_PREF(
|
||||
"media.webspeech.recognition.force_enable",
|
||||
MediaWebspeechRecognitionForceEnable,
|
||||
bool, false
|
||||
)
|
||||
|
||||
#if defined(RELEASE_OR_BETA)
|
||||
# define PREF_VALUE 3
|
||||
#else
|
||||
// Zero tolerance in pre-release builds to detect any decoder regression.
|
||||
# define PREF_VALUE 0
|
||||
#endif
|
||||
VARCACHE_PREF(
|
||||
"media.audio-max-decode-error",
|
||||
MediaAudioMaxDecodeError,
|
||||
uint32_t, PREF_VALUE
|
||||
)
|
||||
#undef PREF_VALUE
|
||||
|
||||
#if defined(RELEASE_OR_BETA)
|
||||
# define PREF_VALUE 2
|
||||
#else
|
||||
// Zero tolerance in pre-release builds to detect any decoder regression.
|
||||
# define PREF_VALUE 0
|
||||
#endif
|
||||
VARCACHE_PREF(
|
||||
"media.video-max-decode-error",
|
||||
MediaVideoMaxDecodeError,
|
||||
uint32_t, PREF_VALUE
|
||||
)
|
||||
#undef PREF_VALUE
|
||||
|
||||
// Ogg
|
||||
VARCACHE_PREF(
|
||||
"media.ogg.enabled",
|
||||
MediaOggEnabled,
|
||||
bool, true
|
||||
)
|
||||
|
||||
// AV1
|
||||
VARCACHE_PREF(
|
||||
"media.av1.enabled",
|
||||
MediaAv1Enabled,
|
||||
bool, true
|
||||
)
|
||||
|
||||
// Flac
|
||||
// Use new MediaFormatReader architecture for plain ogg.
|
||||
VARCACHE_PREF(
|
||||
"media.ogg.flac.enabled",
|
||||
MediaOggFlacEnabled,
|
||||
bool, true
|
||||
)
|
||||
|
||||
VARCACHE_PREF(
|
||||
"media.flac.enabled",
|
||||
MediaFlacEnabled,
|
||||
bool, true
|
||||
)
|
||||
|
||||
// Hls
|
||||
#ifdef ANDROID
|
||||
# define PREF_VALUE true
|
||||
#else
|
||||
# define PREF_VALUE false
|
||||
#endif
|
||||
VARCACHE_PREF(
|
||||
"media.hls.enabled",
|
||||
MediaHlsEnabled,
|
||||
bool, PREF_VALUE
|
||||
)
|
||||
#undef PREF_VALUE
|
||||
|
||||
#ifdef MOZ_FMP4
|
||||
# define PREF_VALUE true
|
||||
#else
|
||||
# define PREF_VALUE false
|
||||
#endif
|
||||
VARCACHE_PREF(
|
||||
"media.mp4.enabled",
|
||||
mediaMp4Enabled,
|
||||
bool, PREF_VALUE
|
||||
)
|
||||
#undef PREF_VALUE
|
||||
|
||||
// Error/warning handling, Decoder Doctor.
|
||||
//
|
||||
// Set to true to force demux/decode warnings to be treated as errors.
|
||||
VARCACHE_PREF(
|
||||
"media.playback.warnings-as-errors",
|
||||
MediaPlaybackWarningsAsErrors,
|
||||
bool, false
|
||||
)
|
||||
|
||||
// Resume video decoding when the cursor is hovering on a background tab to
|
||||
// reduce the resume latency and improve the user experience.
|
||||
VARCACHE_PREF(
|
||||
"media.resume-bkgnd-video-on-tabhover",
|
||||
MediaResumeBkgndVideoOnTabhover,
|
||||
bool, true
|
||||
)
|
||||
|
||||
#ifdef ANDROID
|
||||
# define PREF_VALUE true
|
||||
#else
|
||||
# define PREF_VALUE false
|
||||
#endif
|
||||
VARCACHE_PREF(
|
||||
"media.videocontrols.lock-video-orientation",
|
||||
MediaVideocontrolsLockVideoOrientation,
|
||||
bool, PREF_VALUE
|
||||
)
|
||||
#undef PREF_VALUE
|
||||
|
||||
// Media Seamless Looping
|
||||
VARCACHE_PREF(
|
||||
"media.seamless-looping",
|
||||
MediaSeamlessLooping,
|
||||
bool, true
|
||||
)
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Network prefs
|
||||
//---------------------------------------------------------------------------
|
||||
|
@ -349,30 +349,10 @@ pref("mathml.disabled", false);
|
||||
// Enable scale transform for stretchy MathML operators. See bug 414277.
|
||||
pref("mathml.scale_stretchy_operators.enabled", true);
|
||||
|
||||
pref("media.dormant-on-pause-timeout-ms", 5000);
|
||||
|
||||
// Used by ChannelMediaResource to run data callbacks from HTTP channel
|
||||
// off the main thread.
|
||||
pref("media.omt_data_delivery.enabled", true);
|
||||
|
||||
// File-backed MediaCache size in kilobytes
|
||||
pref("media.cache_size", 512000);
|
||||
// When a network connection is suspended, don't resume it until the
|
||||
// amount of buffered data falls below this threshold (in seconds).
|
||||
pref("media.cache_resume_threshold", 30);
|
||||
// Stop reading ahead when our buffered data is this many seconds ahead
|
||||
// of the current playback position. This limit can stop us from using arbitrary
|
||||
// amounts of network bandwidth prefetching huge videos.
|
||||
pref("media.cache_readahead_limit", 60);
|
||||
// If a resource is known to be smaller than this size (in kilobytes), a
|
||||
// memory-backed MediaCache may be used; otherwise the (single shared
|
||||
// global) file-backed MediaCache is used.
|
||||
pref("media.memory_cache_max_size", 8192);
|
||||
// Don't create more memory-backed MediaCaches if their combined size would go
|
||||
// above the lowest limit (in kilobytes or in percent of physical memory size).
|
||||
pref("media.memory_caches_combined_limit_kb", 524288);
|
||||
pref("media.memory_caches_combined_limit_pc_sysmem", 5);
|
||||
|
||||
// We'll throttle the download if the download rate is throttle-factor times
|
||||
// the estimated playback rate, AND we satisfy the cache readahead_limit
|
||||
// above. The estimated playback rate is time_duration/length_in_bytes.
|
||||
@ -395,21 +375,11 @@ pref("media.play-stand-alone", true);
|
||||
pref("media.hardware-video-decoding.enabled", true);
|
||||
pref("media.hardware-video-decoding.force-enabled", false);
|
||||
|
||||
#ifdef MOZ_FMP4
|
||||
pref("media.mp4.enabled", true);
|
||||
// Specifies whether the PDMFactory can create a test decoder that
|
||||
#endif
|
||||
// just outputs blank frames/audio instead of actually decoding. The blank
|
||||
// decoder works on all platforms.
|
||||
pref("media.use-blank-decoder", false);
|
||||
#ifdef MOZ_WMF
|
||||
pref("media.wmf.enabled", true);
|
||||
pref("media.wmf.dxva.enabled", true);
|
||||
pref("media.wmf.dxva.d3d11.enabled", true);
|
||||
pref("media.wmf.dxva.max-videos", 8);
|
||||
pref("media.wmf.low-latency.enabled", false);
|
||||
pref("media.wmf.skip-blacklist", false);
|
||||
pref("media.wmf.vp9.enabled", true);
|
||||
pref("media.wmf.amd.vp9.enabled", true);
|
||||
pref("media.wmf.amd.highres.enabled", true);
|
||||
pref("media.wmf.allow-unsupported-resolutions", false);
|
||||
@ -420,30 +390,12 @@ pref("media.wmf.deblacklisting-for-telemetry-in-gpu-process", true);
|
||||
pref("media.wmf.play-stand-alone", true);
|
||||
pref("media.wmf.use-sync-texture", true);
|
||||
#endif
|
||||
#if defined(MOZ_FFMPEG)
|
||||
#if defined(XP_MACOSX)
|
||||
pref("media.ffmpeg.enabled", false);
|
||||
#else
|
||||
pref("media.ffmpeg.enabled", true);
|
||||
#endif
|
||||
pref("media.libavcodec.allow-obsolete", false);
|
||||
#endif
|
||||
#if defined(MOZ_FFVPX)
|
||||
pref("media.ffvpx.enabled", true);
|
||||
#endif
|
||||
#if defined(MOZ_FFMPEG) || defined(MOZ_FFVPX)
|
||||
pref("media.ffmpeg.low-latency.enabled", false);
|
||||
#endif
|
||||
pref("media.gmp.decoder.enabled", false);
|
||||
pref("media.gmp.decoder.aac", 0);
|
||||
pref("media.gmp.decoder.h264", 0);
|
||||
pref("media.ogg.enabled", true);
|
||||
pref("media.opus.enabled", true);
|
||||
pref("media.wave.enabled", true);
|
||||
pref("media.webm.enabled", true);
|
||||
|
||||
pref("media.eme.chromium-api.video-shmems", 6);
|
||||
|
||||
// GMP storage version number. At startup we check the version against
|
||||
// media.gmp.storage.version.observed, and if the versions don't match,
|
||||
// we clear storage and set media.gmp.storage.version.observed=expected.
|
||||
@ -462,23 +414,9 @@ pref("media.decoder-doctor.decode-errors-allowed", "");
|
||||
pref("media.decoder-doctor.decode-warnings-allowed", "");
|
||||
// Whether we report partial failures.
|
||||
pref("media.decoder-doctor.verbose", false);
|
||||
// Whether DD should consider WMF-disabled a WMF failure, useful for testing.
|
||||
pref("media.decoder-doctor.wmf-disabled-is-failure", false);
|
||||
// URL to report decode issues
|
||||
pref("media.decoder-doctor.new-issue-endpoint", "https://webcompat.com/issues/new");
|
||||
|
||||
// Whether to suspend decoding of videos in background tabs.
|
||||
pref("media.suspend-bkgnd-video.enabled", true);
|
||||
// Delay, in ms, from time window goes to background to suspending
|
||||
// video decoders. Defaults to 10 seconds.
|
||||
pref("media.suspend-bkgnd-video.delay-ms", 10000);
|
||||
// Resume video decoding when the cursor is hovering on a background tab to
|
||||
// reduce the resume latency and improve the user experience.
|
||||
pref("media.resume-bkgnd-video-on-tabhover", true);
|
||||
|
||||
// Whether to enable media seamless looping.
|
||||
pref("media.seamless-looping", true);
|
||||
|
||||
#ifdef MOZ_WEBRTC
|
||||
pref("media.navigator.enabled", true);
|
||||
pref("media.navigator.video.enabled", true);
|
||||
@ -571,15 +509,9 @@ pref("media.peerconnection.capture_delay", 50);
|
||||
pref("media.peerconnection.capture_delay", 50);
|
||||
#elif defined(ANDROID)
|
||||
pref("media.peerconnection.capture_delay", 100);
|
||||
pref("media.navigator.hardware.vp8_encode.acceleration_enabled", true);
|
||||
pref("media.navigator.hardware.vp8_encode.acceleration_remote_enabled", true);
|
||||
pref("media.navigator.hardware.vp8_decode.acceleration_enabled", false);
|
||||
#else
|
||||
pref("media.peerconnection.capture_delay", 70);
|
||||
#endif
|
||||
// Use MediaDataDecoder API for WebRTC, this includes hardware acceleration for
|
||||
// decoding.
|
||||
pref("media.navigator.mediadatadecoder_enabled", false);
|
||||
#endif
|
||||
|
||||
pref("dom.webaudio.enabled", true);
|
||||
@ -614,18 +546,11 @@ pref("media.mediasource.webm.enabled", true);
|
||||
#endif
|
||||
pref("media.mediasource.webm.audio.enabled", true);
|
||||
|
||||
pref("media.av1.enabled", false);
|
||||
|
||||
// Use new MediaFormatReader architecture for plain ogg.
|
||||
pref("media.flac.enabled", true);
|
||||
pref("media.ogg.flac.enabled", true);
|
||||
|
||||
pref("media.benchmark.vp9.threshold", 150);
|
||||
pref("media.benchmark.frames", 300);
|
||||
pref("media.benchmark.timeout", 1000);
|
||||
|
||||
#ifdef MOZ_WEBSPEECH
|
||||
pref("media.webspeech.recognition.enable", false);
|
||||
pref("media.webspeech.synth.enabled", false);
|
||||
#endif
|
||||
#ifdef MOZ_WEBM_ENCODER
|
||||
@ -660,12 +585,6 @@ pref("media.video-queue.send-to-compositor-size", 9999);
|
||||
// Whether to disable the video stats to prevent fingerprinting
|
||||
pref("media.video_stats.enabled", true);
|
||||
|
||||
// Whether to check the decoder supports recycling.
|
||||
pref("media.decoder.recycle.enabled", false);
|
||||
|
||||
//Weather MFR should try to skip to next key frame or not.
|
||||
pref("media.decoder.skip-to-next-key-frame.enabled", true);
|
||||
|
||||
// Log level for cubeb, the audio input/output system. Valid values are
|
||||
// "verbose", "normal" and "" (log disabled).
|
||||
pref("media.cubeb.logging_level", "");
|
||||
@ -682,9 +601,6 @@ pref("media.cubeb.sandbox", false);
|
||||
|
||||
pref("media.webaudio.audiocontextoptions-samplerate.enabled", true);
|
||||
|
||||
// Set to true to force demux/decode warnings to be treated as errors.
|
||||
pref("media.playback.warnings-as-errors", false);
|
||||
|
||||
// Weather we allow AMD switchable graphics
|
||||
pref("layers.amd-switchable-gfx.enabled", true);
|
||||
|
||||
@ -4809,7 +4725,6 @@ pref("layers.bench.enabled", false);
|
||||
|
||||
#if defined(XP_WIN)
|
||||
pref("layers.gpu-process.enabled", true);
|
||||
pref("media.gpu-process-decoder", true);
|
||||
pref("layers.gpu-process.allow-software", true);
|
||||
#ifdef NIGHTLY_BUILD
|
||||
pref("layers.gpu-process.max_restarts", 3);
|
||||
@ -5697,13 +5612,6 @@ pref("narrate.voice", " { \"default\": \"automatic\" }");
|
||||
// Only make voices that match content language available.
|
||||
pref("narrate.filter-voices", true);
|
||||
|
||||
#if defined(XP_LINUX) && defined(MOZ_GMP_SANDBOX)
|
||||
// Whether to allow, on a Linux system that doesn't support the necessary sandboxing
|
||||
// features, loading Gecko Media Plugins unsandboxed. However, EME CDMs will not be
|
||||
// loaded without sandboxing even if this pref is changed.
|
||||
pref("media.gmp.insecure.allow", false);
|
||||
#endif
|
||||
|
||||
// HTML <dialog> element
|
||||
pref("dom.dialog_element.enabled", false);
|
||||
|
||||
|
@ -32,7 +32,6 @@
|
||||
#include "mozilla/gfx/Logging.h"
|
||||
#include "mozilla/gfx/gfxVars.h"
|
||||
#include "mozilla/layers/PaintThread.h"
|
||||
#include "MediaPrefs.h"
|
||||
#include "gfxPrefs.h"
|
||||
#include "gfxPlatform.h"
|
||||
#include "gfxConfig.h"
|
||||
@ -598,10 +597,6 @@ GfxInfoBase::Init()
|
||||
{
|
||||
InitGfxDriverInfoShutdownObserver();
|
||||
gfxPrefs::GetSingleton();
|
||||
if (!XRE_IsGPUProcess()) {
|
||||
// MediaPrefs can't run in the GPU process.
|
||||
MediaPrefs::GetSingleton();
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIObserverService> os = mozilla::services::GetObserverService();
|
||||
if (os) {
|
||||
|
@ -48,7 +48,6 @@
|
||||
#include "mozilla/dom/ContentChild.h"
|
||||
#include "nsIObserverService.h"
|
||||
#include "nsISupportsPrimitives.h"
|
||||
#include "MediaPrefs.h"
|
||||
#include "WidgetUtils.h"
|
||||
|
||||
#include "FennecJNIWrappers.h"
|
||||
@ -130,8 +129,6 @@ AndroidBridge::ConstructBridge()
|
||||
|
||||
MOZ_ASSERT(!sBridge);
|
||||
sBridge = new AndroidBridge();
|
||||
|
||||
MediaPrefs::GetSingleton();
|
||||
}
|
||||
|
||||
void
|
||||
|
Loading…
Reference in New Issue
Block a user