From 4df8d0280b7361447b6dd4c68c5e4f3d34cad4d4 Mon Sep 17 00:00:00 2001 From: alwu Date: Wed, 27 Sep 2023 19:03:17 +0000 Subject: [PATCH] Bug 1853448 - part4 : modify pref to allow more flexible strategy for enabling HEVC. r=media-playback-reviewers,padenot For now, I'd like to only enable HEVC for the media engine playback, but keep the HEVC default off on the MFT. Because the media engine is an experimental feature, which is off by default, it's fine to enable HEVC for that. Differential Revision: https://phabricator.services.mozilla.com/D188540 --- dom/media/platforms/wmf/WMFDecoderModule.cpp | 4 ++-- modules/libpref/init/StaticPrefList.yaml | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/dom/media/platforms/wmf/WMFDecoderModule.cpp b/dom/media/platforms/wmf/WMFDecoderModule.cpp index b77550370c61..c43708a82533 100644 --- a/dom/media/platforms/wmf/WMFDecoderModule.cpp +++ b/dom/media/platforms/wmf/WMFDecoderModule.cpp @@ -237,7 +237,7 @@ HRESULT WMFDecoderModule::CreateMFTDecoder(const WMFStreamType& aType, MFVideoFormat_NV12); #endif case WMFStreamType::HEVC: - if (!StaticPrefs::media_wmf_hevc_enabled() || !sDXVAEnabled) { + if (StaticPrefs::media_wmf_hevc_enabled() != 1 || !sDXVAEnabled) { return E_FAIL; } return SUCCEEDED(aDecoder->Create( @@ -283,7 +283,7 @@ bool WMFDecoderModule::CanCreateMFTDecoder(const WMFStreamType& aType) { break; #endif case WMFStreamType::HEVC: - if (!StaticPrefs::media_wmf_hevc_enabled()) { + if (StaticPrefs::media_wmf_hevc_enabled() != 1) { return false; } break; diff --git a/modules/libpref/init/StaticPrefList.yaml b/modules/libpref/init/StaticPrefList.yaml index 572dbfdc0cda..4a832f3b2a97 100644 --- a/modules/libpref/init/StaticPrefList.yaml +++ b/modules/libpref/init/StaticPrefList.yaml @@ -10119,9 +10119,11 @@ mirror: always # Enable HEVC support via the windows media foundation +# 0 : disable, 1 : enable for media engine and MFT, +# 2 : enable for media engine only - name: media.wmf.hevc.enabled - type: RelaxedAtomicBool - value: false + type: RelaxedAtomicUint32 + value: 2 mirror: always #endif # MOZ_WMF