Bug 1723540 - Disable hardware video decoding when SW-WR is used. r=stransky
authorRobert Mader <robert.mader@posteo.de>
Mon, 02 Aug 2021 16:59:48 +0000
changeset 587520 0dd09304ca6689187fc205d0ac8617917b31f715
parent 587519 a670f5679e0be52691261833eab3fb6beac8f044
child 587521 e55093498ff90639b91e0b3ea812a22c5799f6b8
push id38666
push userdluca@mozilla.com
push dateMon, 02 Aug 2021 21:43:56 +0000
treeherdermozilla-central@3ff8ac39b364 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersstransky
bugs1723540
milestone92.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1723540 - Disable hardware video decoding when SW-WR is used. r=stransky We currently allow VAAPI/DMABUF decoding with Webrender - also Software Webrender, even though it can't handle it and fails in https://searchfox.org/mozilla-central/source/gfx/wr/webrender/src/renderer/mod.rs#4179 Differential Revision: https://phabricator.services.mozilla.com/D121536
dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
--- a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
+++ b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
@@ -300,22 +300,23 @@ void FFmpegVideoDecoder<LIBAV_VER>::PtsC
   mNumFaultyPts = 0;
   mNumFaultyDts = 0;
   mLastPts = INT64_MIN;
   mLastDts = INT64_MIN;
 }
 
 #ifdef MOZ_WAYLAND_USE_VAAPI
 void FFmpegVideoDecoder<LIBAV_VER>::InitHWDecodingPrefs() {
-  bool isWebRenderUsed =
-      mImageAllocator && (mImageAllocator->GetCompositorBackendType() ==
-                          layers::LayersBackend::LAYERS_WR);
-  if (!isWebRenderUsed) {
+  bool isHardwareWebRenderUsed = mImageAllocator &&
+                                 (mImageAllocator->GetCompositorBackendType() ==
+                                  layers::LayersBackend::LAYERS_WR) &&
+                                 !mImageAllocator->UsingSoftwareWebRender();
+  if (!isHardwareWebRenderUsed) {
     mEnableHardwareDecoding = false;
-    FFMPEG_LOG("WebRender is off, disabled DMABuf & VAAPI.");
+    FFMPEG_LOG("Hardware WebRender is off, disabled DMABuf & VAAPI.");
     return;
   }
 
   if (mEnableHardwareDecoding &&
       !widget::GetDMABufDevice()->IsDMABufVAAPIEnabled()) {
     mEnableHardwareDecoding = false;
     FFMPEG_LOG("VA-API is disabled by pref.");
   }