diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:43:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:43:14 +0000 |
commit | 8dd16259287f58f9273002717ec4d27e97127719 (patch) | |
tree | 3863e62a53829a84037444beab3abd4ed9dfc7d0 /dom/media/platforms/wmf/WMFDecoderModule.h | |
parent | Releasing progress-linux version 126.0.1-1~progress7.99u1. (diff) | |
download | firefox-8dd16259287f58f9273002717ec4d27e97127719.tar.xz firefox-8dd16259287f58f9273002717ec4d27e97127719.zip |
Merging upstream version 127.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/media/platforms/wmf/WMFDecoderModule.h')
-rw-r--r-- | dom/media/platforms/wmf/WMFDecoderModule.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/dom/media/platforms/wmf/WMFDecoderModule.h b/dom/media/platforms/wmf/WMFDecoderModule.h index 3b130fd657..6debdc5836 100644 --- a/dom/media/platforms/wmf/WMFDecoderModule.h +++ b/dom/media/platforms/wmf/WMFDecoderModule.h @@ -10,6 +10,7 @@ # include "PlatformDecoderModule.h" # include "WMF.h" # include "WMFUtils.h" +# include "mozilla/Atomics.h" namespace mozilla { @@ -43,7 +44,9 @@ class WMFDecoderModule : public PlatformDecoderModule { ForceEnableHEVC, }; - // Called on main thread. + // Can be called on any thread, but avoid calling this on the main thread + // because the initialization takes long time and we don't want to block the + // main thread. static void Init(Config aConfig = Config::None); // Called from any thread, must call init first @@ -53,16 +56,24 @@ class WMFDecoderModule : public PlatformDecoderModule { RefPtr<MFTDecoder>& aDecoder); static bool CanCreateMFTDecoder(const WMFStreamType& aType); + static void DisableForceEnableHEVC(); + private: // This is used for GPU process only, where we can't set the preference // directly (it can only set in the parent process) So we need a way to force // enable the HEVC in order to report the support information via telemetry. - static inline bool sForceEnableHEVC = false; + static inline Atomic<bool> sForceEnableHEVC{false}; static bool IsHEVCSupported(); WMFDecoderModule() = default; virtual ~WMFDecoderModule() = default; + + static inline StaticMutex sMutex; + static inline bool sSupportedTypesInitialized MOZ_GUARDED_BY(sMutex) = false; + static inline EnumSet<WMFStreamType> sSupportedTypes MOZ_GUARDED_BY(sMutex); + static inline EnumSet<WMFStreamType> sLackOfExtensionTypes + MOZ_GUARDED_BY(sMutex); }; } // namespace mozilla |