commit f92988332aa62047936106bc39f3066a922211d9
parent b0f0f1c9d2f3abb1769f0216c145757818b47b65
Author: John Lin <jolin@mozilla.com>
Date: Tue, 28 Oct 2025 22:20:26 +0000
Bug 1905878 - initialize WMF video manager on MTA thread. r=media-playback-reviewers,alwu
Current media playbck pipeline setup satisfies the condition
but it's not so when running gtest.
Differential Revision: https://phabricator.services.mozilla.com/D270361
Diffstat:
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/dom/media/platforms/wmf/WMFVideoMFTManager.cpp b/dom/media/platforms/wmf/WMFVideoMFTManager.cpp
@@ -34,6 +34,7 @@
#include "mozilla/glean/DomMediaPlatformsWmfMetrics.h"
#include "mozilla/layers/FenceD3D11.h"
#include "mozilla/layers/LayersTypes.h"
+#include "mozilla/mscom/EnsureMTA.h"
#include "nsPrintfCString.h"
#include "nsThreadUtils.h"
#include "nsWindowsHelpers.h"
@@ -200,7 +201,10 @@ MediaResult WMFVideoMFTManager::Init() {
return result;
}
- result = InitInternal();
+ // InitInternal() indirectly calls IMFTransform interface and should run on
+ // MTA thread.
+ // https://msdn.microsoft.com/en-us/library/windows/desktop/ee892371(v=vs.85).aspx#components
+ mozilla::mscom::EnsureMTA([&]() { result = InitInternal(); });
if (NS_SUCCEEDED(result) && mDXVA2Manager) {
// If we had some failures but eventually made it work,
// make sure we preserve the messages.