summaryrefslogtreecommitdiffstats
path: root/dom/media/platforms/wmf/WMFDecoderModule.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:35:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:35:29 +0000
commit59203c63bb777a3bacec32fb8830fba33540e809 (patch)
tree58298e711c0ff0575818c30485b44a2f21bf28a0 /dom/media/platforms/wmf/WMFDecoderModule.h
parentAdding upstream version 126.0.1. (diff)
downloadfirefox-59203c63bb777a3bacec32fb8830fba33540e809.tar.xz
firefox-59203c63bb777a3bacec32fb8830fba33540e809.zip
Adding upstream version 127.0.upstream/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.h15
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