Bug 1836021 [Linux] Probe VA-API devices if HW acceleration is force enabled r=emilio

Differential Revision: https://phabricator.services.mozilla.com/D180177
This commit is contained in:
stransky 2023-06-19 12:57:02 +00:00
Родитель 26b2f34d13
Коммит 90ebdbf5c4
2 изменённых файлов: 21 добавлений и 6 удалений

Просмотреть файл

@ -154,9 +154,13 @@ async function run_test() {
failureId
);
if (OS == "Linux" && status != Ci.nsIGfxInfo.FEATURE_STATUS_OK) {
// Disabled on testsuite due to old Mesa version there.
Assert.equal(status, Ci.nsIGfxInfo.FEATURE_BLOCKED_DRIVER_VERSION);
Assert.equal(failureId.value, "FEATURE_HARDWARE_VIDEO_DECODING_MESA");
// Linux test suite is running on SW OpenGL backend and we disable
// HW video decoding there.
Assert.equal(status, Ci.nsIGfxInfo.FEATURE_BLOCKED_PLATFORM_TEST);
Assert.equal(
failureId.value,
"FEATURE_FAILURE_VIDEO_DECODING_TEST_FAILED"
);
} else {
Assert.equal(status, Ci.nsIGfxInfo.FEATURE_STATUS_OK);
}

Просмотреть файл

@ -24,6 +24,7 @@
#include "mozilla/XREAppData.h"
#include "mozilla/ScopeExit.h"
#include "mozilla/GUniquePtr.h"
#include "mozilla/StaticPrefs_media.h"
#include "nsCRTGlue.h"
#include "nsExceptionHandler.h"
#include "nsPrintfCString.h"
@ -1282,9 +1283,19 @@ nsresult GfxInfo::GetFeatureStatusImpl(
aFeature, aStatus, aSuggestedDriverVersion, aDriverInfo, aFailureId, &os);
// Probe VA-API/V4L2 on supported devices only
if (aFeature == nsIGfxInfo::FEATURE_HARDWARE_VIDEO_DECODING &&
*aStatus == nsIGfxInfo::FEATURE_STATUS_OK) {
if (mIsAccelerated) {
if (aFeature == nsIGfxInfo::FEATURE_HARDWARE_VIDEO_DECODING) {
if (!StaticPrefs::media_hardware_video_decoding_enabled_AtStartup()) {
return ret;
}
bool probeHWDecode = false;
#ifdef MOZ_WAYLAND
probeHWDecode =
mIsAccelerated &&
(*aStatus == nsIGfxInfo::FEATURE_STATUS_OK ||
StaticPrefs::media_hardware_video_decoding_force_enabled_AtStartup() ||
StaticPrefs::media_ffmpeg_vaapi_enabled_AtStartup());
#endif
if (probeHWDecode) {
GetDataVAAPI();
GetDataV4L2();
} else {