diff --git a/dom/media/platforms/ffmpeg/FFmpegLibWrapper.cpp b/dom/media/platforms/ffmpeg/FFmpegLibWrapper.cpp index cb60228340f8..4dac27ce41df 100644 --- a/dom/media/platforms/ffmpeg/FFmpegLibWrapper.cpp +++ b/dom/media/platforms/ffmpeg/FFmpegLibWrapper.cpp @@ -12,6 +12,7 @@ #include "PlatformDecoderModule.h" #include "prlink.h" #ifdef MOZ_WAYLAND +# include "mozilla/gfx/gfxVars.h" # include "mozilla/widget/DMABufLibWrapper.h" #endif @@ -284,7 +285,7 @@ void FFmpegLibWrapper::Unlink() { #ifdef MOZ_WAYLAND void FFmpegLibWrapper::LinkVAAPILibs() { - if (!widget::GetDMABufDevice()->IsDMABufVAAPIEnabled()) { + if (!gfx::gfxVars::CanUseHardwareVideoDecoding() || !XRE_IsRDDProcess()) { return; } diff --git a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp index 68a6f270584c..531af6bf2387 100644 --- a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp +++ b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp @@ -368,10 +368,9 @@ void FFmpegVideoDecoder::InitHWDecodingPrefs() { FFMPEG_LOG("Hardware WebRender is off, VAAPI is disabled"); return; } - - if (!widget::GetDMABufDevice()->IsDMABufVAAPIEnabled()) { + if (!XRE_IsRDDProcess()) { mEnableHardwareDecoding = false; - FFMPEG_LOG("VA-API is disabled by preference."); + FFMPEG_LOG("VA-API works in RDD process only"); } } #endif diff --git a/widget/gtk/DMABufLibWrapper.cpp b/widget/gtk/DMABufLibWrapper.cpp index e2edfbab91aa..c690ffa331e3 100644 --- a/widget/gtk/DMABufLibWrapper.cpp +++ b/widget/gtk/DMABufLibWrapper.cpp @@ -269,16 +269,6 @@ bool nsDMABufDevice::IsDMABufTexturesEnabled() { #else bool nsDMABufDevice::IsDMABufTexturesEnabled() { return false; } #endif -bool nsDMABufDevice::IsDMABufVAAPIEnabled() { - LOGDMABUF( - ("nsDMABufDevice::IsDMABufVAAPIEnabled: EGL %d " - "media_ffmpeg_vaapi_enabled %d CanUseHardwareVideoDecoding %d " - "XRE_IsRDDProcess %d\n", - gfx::gfxVars::UseEGL(), StaticPrefs::media_ffmpeg_vaapi_enabled(), - gfx::gfxVars::CanUseHardwareVideoDecoding(), XRE_IsRDDProcess())); - return gfx::gfxVars::UseVAAPI() && XRE_IsRDDProcess() && - gfx::gfxVars::CanUseHardwareVideoDecoding(); -} bool nsDMABufDevice::IsDMABufWebGLEnabled() { LOGDMABUF( ("nsDMABufDevice::IsDMABufWebGLEnabled: UseDMABuf %d " diff --git a/widget/gtk/DMABufLibWrapper.h b/widget/gtk/DMABufLibWrapper.h index 3d189f8a3522..57270bffc31e 100644 --- a/widget/gtk/DMABufLibWrapper.h +++ b/widget/gtk/DMABufLibWrapper.h @@ -190,8 +190,6 @@ class nsDMABufDevice { // Use dmabuf for WebRender general web content bool IsDMABufTexturesEnabled(); - // Use dmabuf for VA-API video playback - bool IsDMABufVAAPIEnabled(); // Use dmabuf for WebGL content bool IsDMABufWebGLEnabled(); void DisableDMABufWebGL();