зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1300678 - Use gfxPrefs for media vars that get accessed from the GPU process. r=jya
This commit is contained in:
Родитель
b087b32f08
Коммит
552d016944
|
@ -124,11 +124,7 @@ private:
|
||||||
DECL_MEDIA_PREF("media.wmf.enabled", PDMWMFEnabled, bool, true);
|
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.decoder-doctor.wmf-disabled-is-failure", DecoderDoctorWMFDisabledIsFailure, bool, false);
|
||||||
DECL_MEDIA_PREF("media.wmf.vp9.enabled", PDMWMFVP9DecoderEnabled, bool, true);
|
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.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
|
#endif
|
||||||
DECL_MEDIA_PREF("media.decoder.fuzzing.enabled", PDMFuzzingEnabled, bool, false);
|
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);
|
DECL_MEDIA_PREF("media.decoder.fuzzing.video-output-minimum-interval-ms", PDMFuzzingInterval, uint32_t, 0);
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
#include "mozilla/Telemetry.h"
|
#include "mozilla/Telemetry.h"
|
||||||
#include "MediaTelemetryConstants.h"
|
#include "MediaTelemetryConstants.h"
|
||||||
#include "mfapi.h"
|
#include "mfapi.h"
|
||||||
#include "MediaPrefs.h"
|
#include "gfxPrefs.h"
|
||||||
#include "MFTDecoder.h"
|
#include "MFTDecoder.h"
|
||||||
#include "DriverCrashGuard.h"
|
#include "DriverCrashGuard.h"
|
||||||
#include "nsPrintfCString.h"
|
#include "nsPrintfCString.h"
|
||||||
|
@ -408,7 +408,7 @@ D3D9DXVA2Manager::Init(layers::KnowsCompositor* aKnowsCompositor,
|
||||||
return hr;
|
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++) {
|
for (size_t i = 0; i < MOZ_ARRAY_LENGTH(sAMDPreUVD4); i++) {
|
||||||
if (adapter.DeviceId == sAMDPreUVD4[i]) {
|
if (adapter.DeviceId == sAMDPreUVD4[i]) {
|
||||||
mIsAMDPreUVD4 = true;
|
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
|
// DXVA processing takes up a lot of GPU resources, so limit the number of
|
||||||
// videos we use DXVA with at any one time.
|
// videos we use DXVA with at any one time.
|
||||||
uint32_t dxvaLimit = 4;
|
uint32_t dxvaLimit = gfxPrefs::PDMWMFMaxDXVAVideos();
|
||||||
// TODO: Sync this value across to the GPU process.
|
|
||||||
if (XRE_GetProcessType() != GeckoProcessType_GPU) {
|
|
||||||
dxvaLimit = MediaPrefs::PDMWMFMaxDXVAVideos();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (sDXVAVideosCount == dxvaLimit) {
|
if (sDXVAVideosCount == dxvaLimit) {
|
||||||
aFailureReason.AssignLiteral("Too many DXVA videos playing");
|
aFailureReason.AssignLiteral("Too many DXVA videos playing");
|
||||||
|
@ -745,7 +741,7 @@ D3D11DXVA2Manager::Init(layers::KnowsCompositor* aKnowsCompositor,
|
||||||
return hr;
|
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++) {
|
for (size_t i = 0; i < MOZ_ARRAY_LENGTH(sAMDPreUVD4); i++) {
|
||||||
if (adapterDesc.DeviceId == sAMDPreUVD4[i]) {
|
if (adapterDesc.DeviceId == sAMDPreUVD4[i]) {
|
||||||
mIsAMDPreUVD4 = true;
|
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
|
// DXVA processing takes up a lot of GPU resources, so limit the number of
|
||||||
// videos we use DXVA with at any one time.
|
// videos we use DXVA with at any one time.
|
||||||
uint32_t dxvaLimit = 4;
|
uint32_t dxvaLimit = gfxPrefs::PDMWMFMaxDXVAVideos();
|
||||||
// TODO: Sync this value across to the GPU process.
|
|
||||||
if (XRE_GetProcessType() != GeckoProcessType_GPU) {
|
|
||||||
dxvaLimit = MediaPrefs::PDMWMFMaxDXVAVideos();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (sDXVAVideosCount == dxvaLimit) {
|
if (sDXVAVideosCount == dxvaLimit) {
|
||||||
aFailureReason.AssignLiteral("Too many DXVA videos playing");
|
aFailureReason.AssignLiteral("Too many DXVA videos playing");
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
#include <winsdkver.h>
|
#include <winsdkver.h>
|
||||||
#include "WMFVideoMFTManager.h"
|
#include "WMFVideoMFTManager.h"
|
||||||
#include "MediaDecoderReader.h"
|
#include "MediaDecoderReader.h"
|
||||||
#include "MediaPrefs.h"
|
#include "gfxPrefs.h"
|
||||||
#include "WMFUtils.h"
|
#include "WMFUtils.h"
|
||||||
#include "ImageContainer.h"
|
#include "ImageContainer.h"
|
||||||
#include "VideoUtils.h"
|
#include "VideoUtils.h"
|
||||||
|
@ -18,7 +18,6 @@
|
||||||
#include "mozilla/ClearOnShutdown.h"
|
#include "mozilla/ClearOnShutdown.h"
|
||||||
#include "mozilla/layers/LayersTypes.h"
|
#include "mozilla/layers/LayersTypes.h"
|
||||||
#include "MediaInfo.h"
|
#include "MediaInfo.h"
|
||||||
#include "MediaPrefs.h"
|
|
||||||
#include "mozilla/Logging.h"
|
#include "mozilla/Logging.h"
|
||||||
#include "mozilla/Preferences.h"
|
#include "mozilla/Preferences.h"
|
||||||
#include "nsWindowsHelpers.h"
|
#include "nsWindowsHelpers.h"
|
||||||
|
@ -316,10 +315,8 @@ public:
|
||||||
NS_ASSERTION(NS_IsMainThread(), "Must be on main thread.");
|
NS_ASSERTION(NS_IsMainThread(), "Must be on main thread.");
|
||||||
nsACString* failureReason = &mFailureReason;
|
nsACString* failureReason = &mFailureReason;
|
||||||
nsCString secondFailureReason;
|
nsCString secondFailureReason;
|
||||||
bool allowD3D11 = (XRE_GetProcessType() == GeckoProcessType_GPU) ||
|
|
||||||
MediaPrefs::PDMWMFAllowD3D11();
|
|
||||||
if (mBackend == LayersBackend::LAYERS_D3D11 &&
|
if (mBackend == LayersBackend::LAYERS_D3D11 &&
|
||||||
allowD3D11 && IsWin8OrLater()) {
|
gfxPrefs::PDMWMFAllowD3D11() && IsWin8OrLater()) {
|
||||||
const nsCString& blacklistedDLL = FindD3D11BlacklistedDLL();
|
const nsCString& blacklistedDLL = FindD3D11BlacklistedDLL();
|
||||||
if (!blacklistedDLL.IsEmpty()) {
|
if (!blacklistedDLL.IsEmpty()) {
|
||||||
failureReason->AppendPrintf("D3D11 blacklisted with DLL %s",
|
failureReason->AppendPrintf("D3D11 blacklisted with DLL %s",
|
||||||
|
@ -447,8 +444,7 @@ WMFVideoMFTManager::InitInternal(bool aForceD3D9)
|
||||||
attr->GetUINT32(MF_SA_D3D_AWARE, &aware);
|
attr->GetUINT32(MF_SA_D3D_AWARE, &aware);
|
||||||
attr->SetUINT32(CODECAPI_AVDecNumWorkerThreads,
|
attr->SetUINT32(CODECAPI_AVDecNumWorkerThreads,
|
||||||
WMFDecoderModule::GetNumDecoderThreads());
|
WMFDecoderModule::GetNumDecoderThreads());
|
||||||
if ((XRE_GetProcessType() != GeckoProcessType_GPU) &&
|
if (gfxPrefs::PDMWMFLowLatencyEnabled()) {
|
||||||
MediaPrefs::PDMWMFLowLatencyEnabled()) {
|
|
||||||
hr = attr->SetUINT32(CODECAPI_AVLowLatencyMode, TRUE);
|
hr = attr->SetUINT32(CODECAPI_AVLowLatencyMode, TRUE);
|
||||||
if (SUCCEEDED(hr)) {
|
if (SUCCEEDED(hr)) {
|
||||||
LOG("Enabling Low Latency Mode");
|
LOG("Enabling Low Latency Mode");
|
||||||
|
|
|
@ -541,6 +541,12 @@ private:
|
||||||
|
|
||||||
DECL_GFX_PREF(Once, "media.hardware-video-decoding.force-enabled",
|
DECL_GFX_PREF(Once, "media.hardware-video-decoding.force-enabled",
|
||||||
HardwareVideoDecodingForceEnabled, bool, false);
|
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.
|
// These affect how line scrolls from wheel events will be accelerated.
|
||||||
DECL_GFX_PREF(Live, "mousewheel.acceleration.factor", MouseWheelAccelerationFactor, int32_t, -1);
|
DECL_GFX_PREF(Live, "mousewheel.acceleration.factor", MouseWheelAccelerationFactor, int32_t, -1);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче