Bug 1205083 - Don't enable low latency WMF video decoding as it crashes sometimes. r=jya

This commit is contained in:
Chris Pearce 2015-10-21 21:17:56 +13:00
parent 82307b4b31
commit 794bc2df1e
6 changed files with 20 additions and 8 deletions

View File

@ -218,7 +218,7 @@ MFTDecoder::Output(RefPtr<IMFSample>* aOutput)
}
if (hr == MF_E_TRANSFORM_STREAM_CHANGE) {
// Type change, probably geometric aperature change.
// Type change, probably geometric aperture change.
// Reconfigure decoder output type, so that GetOutputMediaType()
// returns the new type, and return the error code to caller.
// This is an expected failure, so don't warn on encountering it.

View File

@ -28,6 +28,7 @@ namespace mozilla {
static bool sDXVAEnabled = false;
static int sNumDecoderThreads = -1;
static bool sIsIntelDecoderEnabled = false;
static bool sLowLatencyMFTEnabled = false;
WMFDecoderModule::WMFDecoderModule()
: mWMFInitialized(false)
@ -68,6 +69,7 @@ WMFDecoderModule::Init()
MOZ_ASSERT(NS_IsMainThread(), "Must be on main thread.");
sDXVAEnabled = gfxPlatform::GetPlatform()->CanUseHardwareVideoDecoding();
sIsIntelDecoderEnabled = Preferences::GetBool("media.webm.intel_decoder.enabled", false);
sLowLatencyMFTEnabled = Preferences::GetBool("media.wmf.low-latency.enabled", false);
SetNumOfDecoderThreads();
}
@ -78,6 +80,13 @@ WMFDecoderModule::GetNumDecoderThreads()
return sNumDecoderThreads;
}
/* static */
bool
WMFDecoderModule::LowLatencyMFTEnabled()
{
return sLowLatencyMFTEnabled;
}
nsresult
WMFDecoderModule::Startup()
{

View File

@ -41,6 +41,7 @@ public:
// Called from any thread, must call init first
static int GetNumDecoderThreads();
static bool LowLatencyMFTEnabled();
private:
bool mWMFInitialized;
};

View File

@ -216,12 +216,13 @@ WMFVideoMFTManager::InitInternal(bool aForceD3D9)
attr->GetUINT32(MF_SA_D3D_AWARE, &aware);
attr->SetUINT32(CODECAPI_AVDecNumWorkerThreads,
WMFDecoderModule::GetNumDecoderThreads());
hr = attr->SetUINT32(CODECAPI_AVLowLatencyMode, TRUE);
if (SUCCEEDED(hr)) {
LOG("Enabling Low Latency Mode");
}
else {
LOG("Couldn't enable Low Latency Mode");
if (WMFDecoderModule::LowLatencyMFTEnabled()) {
hr = attr->SetUINT32(CODECAPI_AVLowLatencyMode, TRUE);
if (SUCCEEDED(hr)) {
LOG("Enabling Low Latency Mode");
} else {
LOG("Couldn't enable Low Latency Mode");
}
}
}

View File

@ -323,6 +323,7 @@ pref("media.use-blank-decoder", false);
#ifdef MOZ_WMF
pref("media.wmf.enabled", true);
pref("media.wmf.decoder.thread-count", -1);
pref("media.wmf.low-latency.enabled", false);
#endif
#if defined(MOZ_FFMPEG)
pref("media.ffmpeg.enabled", true);

View File

@ -2,4 +2,4 @@
type: testharness
prefs: [media.mediasource.enabled:true]
disabled:
if (os == "linux") or ((os == "win") and (version == "6.1.7601")): https://bugzilla.mozilla.org/show_bug.cgi?id=1191138
if (os == "linux") or (os == "win"): https://bugzilla.mozilla.org/show_bug.cgi?id=1191138