Bug 1300678 - Use gfxPrefs for media vars that get accessed from the GPU process. r=jya

This commit is contained in:
Matt Woodrow 2016-11-03 09:57:18 +13:00
Родитель b087b32f08
Коммит 552d016944
4 изменённых файлов: 14 добавлений и 24 удалений

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

@ -124,11 +124,7 @@ private:
DECL_MEDIA_PREF("media.wmf.enabled", PDMWMFEnabled, bool, true);
DECL_MEDIA_PREF("media.decoder-doctor.wmf-disabled-is-failure", DecoderDoctorWMFDisabledIsFailure, bool, false);
DECL_MEDIA_PREF("media.wmf.vp9.enabled", PDMWMFVP9DecoderEnabled, bool, true);
DECL_MEDIA_PREF("media.wmf.low-latency.enabled", PDMWMFLowLatencyEnabled, bool, false);
DECL_MEDIA_PREF("media.wmf.decoder.thread-count", PDMWMFThreadCount, int32_t, -1);
DECL_MEDIA_PREF("media.wmf.skip-blacklist", PDMWMFSkipBlacklist, bool, false);
DECL_MEDIA_PREF("media.windows-media-foundation.max-dxva-videos", PDMWMFMaxDXVAVideos, uint32_t, 8);
DECL_MEDIA_PREF("media.windows-media-foundation.allow-d3d11-dxva", PDMWMFAllowD3D11, bool, true);
#endif
DECL_MEDIA_PREF("media.decoder.fuzzing.enabled", PDMFuzzingEnabled, bool, false);
DECL_MEDIA_PREF("media.decoder.fuzzing.video-output-minimum-interval-ms", PDMFuzzingInterval, uint32_t, 0);

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

@ -17,7 +17,7 @@
#include "mozilla/Telemetry.h"
#include "MediaTelemetryConstants.h"
#include "mfapi.h"
#include "MediaPrefs.h"
#include "gfxPrefs.h"
#include "MFTDecoder.h"
#include "DriverCrashGuard.h"
#include "nsPrintfCString.h"
@ -408,7 +408,7 @@ D3D9DXVA2Manager::Init(layers::KnowsCompositor* aKnowsCompositor,
return hr;
}
if (adapter.VendorId == 0x1022 && !MediaPrefs::PDMWMFSkipBlacklist()) {
if (adapter.VendorId == 0x1022 && !gfxPrefs::PDMWMFSkipBlacklist()) {
for (size_t i = 0; i < MOZ_ARRAY_LENGTH(sAMDPreUVD4); i++) {
if (adapter.DeviceId == sAMDPreUVD4[i]) {
mIsAMDPreUVD4 = true;
@ -503,11 +503,7 @@ DXVA2Manager::CreateD3D9DXVA(layers::KnowsCompositor* aKnowsCompositor,
// DXVA processing takes up a lot of GPU resources, so limit the number of
// videos we use DXVA with at any one time.
uint32_t dxvaLimit = 4;
// TODO: Sync this value across to the GPU process.
if (XRE_GetProcessType() != GeckoProcessType_GPU) {
dxvaLimit = MediaPrefs::PDMWMFMaxDXVAVideos();
}
uint32_t dxvaLimit = gfxPrefs::PDMWMFMaxDXVAVideos();
if (sDXVAVideosCount == dxvaLimit) {
aFailureReason.AssignLiteral("Too many DXVA videos playing");
@ -745,7 +741,7 @@ D3D11DXVA2Manager::Init(layers::KnowsCompositor* aKnowsCompositor,
return hr;
}
if (adapterDesc.VendorId == 0x1022 && !MediaPrefs::PDMWMFSkipBlacklist()) {
if (adapterDesc.VendorId == 0x1022 && !gfxPrefs::PDMWMFSkipBlacklist()) {
for (size_t i = 0; i < MOZ_ARRAY_LENGTH(sAMDPreUVD4); i++) {
if (adapterDesc.DeviceId == sAMDPreUVD4[i]) {
mIsAMDPreUVD4 = true;
@ -924,11 +920,7 @@ DXVA2Manager::CreateD3D11DXVA(layers::KnowsCompositor* aKnowsCompositor,
{
// DXVA processing takes up a lot of GPU resources, so limit the number of
// videos we use DXVA with at any one time.
uint32_t dxvaLimit = 4;
// TODO: Sync this value across to the GPU process.
if (XRE_GetProcessType() != GeckoProcessType_GPU) {
dxvaLimit = MediaPrefs::PDMWMFMaxDXVAVideos();
}
uint32_t dxvaLimit = gfxPrefs::PDMWMFMaxDXVAVideos();
if (sDXVAVideosCount == dxvaLimit) {
aFailureReason.AssignLiteral("Too many DXVA videos playing");

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

@ -8,7 +8,7 @@
#include <winsdkver.h>
#include "WMFVideoMFTManager.h"
#include "MediaDecoderReader.h"
#include "MediaPrefs.h"
#include "gfxPrefs.h"
#include "WMFUtils.h"
#include "ImageContainer.h"
#include "VideoUtils.h"
@ -18,7 +18,6 @@
#include "mozilla/ClearOnShutdown.h"
#include "mozilla/layers/LayersTypes.h"
#include "MediaInfo.h"
#include "MediaPrefs.h"
#include "mozilla/Logging.h"
#include "mozilla/Preferences.h"
#include "nsWindowsHelpers.h"
@ -316,10 +315,8 @@ public:
NS_ASSERTION(NS_IsMainThread(), "Must be on main thread.");
nsACString* failureReason = &mFailureReason;
nsCString secondFailureReason;
bool allowD3D11 = (XRE_GetProcessType() == GeckoProcessType_GPU) ||
MediaPrefs::PDMWMFAllowD3D11();
if (mBackend == LayersBackend::LAYERS_D3D11 &&
allowD3D11 && IsWin8OrLater()) {
gfxPrefs::PDMWMFAllowD3D11() && IsWin8OrLater()) {
const nsCString& blacklistedDLL = FindD3D11BlacklistedDLL();
if (!blacklistedDLL.IsEmpty()) {
failureReason->AppendPrintf("D3D11 blacklisted with DLL %s",
@ -447,8 +444,7 @@ WMFVideoMFTManager::InitInternal(bool aForceD3D9)
attr->GetUINT32(MF_SA_D3D_AWARE, &aware);
attr->SetUINT32(CODECAPI_AVDecNumWorkerThreads,
WMFDecoderModule::GetNumDecoderThreads());
if ((XRE_GetProcessType() != GeckoProcessType_GPU) &&
MediaPrefs::PDMWMFLowLatencyEnabled()) {
if (gfxPrefs::PDMWMFLowLatencyEnabled()) {
hr = attr->SetUINT32(CODECAPI_AVLowLatencyMode, TRUE);
if (SUCCEEDED(hr)) {
LOG("Enabling Low Latency Mode");

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

@ -541,6 +541,12 @@ private:
DECL_GFX_PREF(Once, "media.hardware-video-decoding.force-enabled",
HardwareVideoDecodingForceEnabled, bool, false);
#ifdef XP_WIN
DECL_GFX_PREF(Live, "media.windows-media-foundation.allow-d3d11-dxva", PDMWMFAllowD3D11, bool, true);
DECL_GFX_PREF(Live, "media.windows-media-foundation.max-dxva-videos", PDMWMFMaxDXVAVideos, uint32_t, 8);
DECL_GFX_PREF(Live, "media.wmf.low-latency.enabled", PDMWMFLowLatencyEnabled, bool, false);
DECL_GFX_PREF(Live, "media.wmf.skip-blacklist", PDMWMFSkipBlacklist, bool, false);
#endif
// These affect how line scrolls from wheel events will be accelerated.
DECL_GFX_PREF(Live, "mousewheel.acceleration.factor", MouseWheelAccelerationFactor, int32_t, -1);