Bug 1322739: P4. Never use WMF decoders when low latency is required. r=gerald
authorJean-Yves Avenard <jyavenard@mozilla.com>
Tue, 21 Feb 2017 17:07:28 +0100
changeset 373313 323f69eeab41fbe7c485f7b9eca1dd7be07e48e9
parent 373312 cdff3a6b58716c5377b2b32dd968e9f8bf727d2b
child 373314 b974e52e577dca4fb3cd570898e34cb8d68a512b
push id10863
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 23:02:23 +0000
treeherdermozilla-aurora@0931190cd725 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgerald
bugs1322739
milestone54.0a1
Bug 1322739: P4. Never use WMF decoders when low latency is required. r=gerald We will revisit once VP9 hardware decoders on Windows can be assessed. MozReview-Commit-ID: CXL2M45D2x7
dom/media/platforms/wmf/WMFDecoderModule.cpp
--- a/dom/media/platforms/wmf/WMFDecoderModule.cpp
+++ b/dom/media/platforms/wmf/WMFDecoderModule.cpp
@@ -74,16 +74,22 @@ WMFDecoderModule::Startup()
 {
   mWMFInitialized = SUCCEEDED(wmf::MFStartup());
   return mWMFInitialized ? NS_OK : NS_ERROR_FAILURE;
 }
 
 already_AddRefed<MediaDataDecoder>
 WMFDecoderModule::CreateVideoDecoder(const CreateDecoderParams& aParams)
 {
+  if (aParams.mOptions.contains(CreateDecoderParams::Option::LowLatency)) {
+    // Latency on Windows is bad. Let's not attempt to decode with WMF decoders
+    // when low latency is required.
+    return nullptr;
+  }
+
   nsAutoPtr<WMFVideoMFTManager> manager(
     new WMFVideoMFTManager(aParams.VideoConfig(),
                            aParams.mKnowsCompositor,
                            aParams.mImageContainer,
                            sDXVAEnabled));
 
   if (!manager->Init()) {
     return nullptr;