From 8dd16259287f58f9273002717ec4d27e97127719 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 12 Jun 2024 07:43:14 +0200 Subject: Merging upstream version 127.0. Signed-off-by: Daniel Baumann --- dom/media/ipc/MFCDMChild.cpp | 7 ++++--- dom/media/ipc/MFCDMChild.h | 2 +- dom/media/ipc/RDDChild.cpp | 9 +++++++++ dom/media/ipc/RDDParent.cpp | 16 ++++------------ dom/media/ipc/RemoteImageHolder.h | 12 ++++++------ 5 files changed, 24 insertions(+), 22 deletions(-) (limited to 'dom/media/ipc') diff --git a/dom/media/ipc/MFCDMChild.cpp b/dom/media/ipc/MFCDMChild.cpp index 2ba2bdaf4e..9df86b82f4 100644 --- a/dom/media/ipc/MFCDMChild.cpp +++ b/dom/media/ipc/MFCDMChild.cpp @@ -7,6 +7,7 @@ #include "mozilla/EMEUtils.h" #include "mozilla/KeySystemConfig.h" #include "mozilla/RefPtr.h" +#include "mozilla/StaticString.h" #include "mozilla/WMFCDMProxyCallback.h" #include "nsString.h" #include "RemoteDecoderManagerChild.h" @@ -44,7 +45,7 @@ namespace mozilla { #define INVOKE_ASYNC(method, promiseId, param1) \ do { \ - auto callsite = __func__; \ + StaticString callsite = __func__; \ using ParamType = std::remove_reference::type; \ mManagerThread->Dispatch(NS_NewRunnableFunction( \ callsite, [self = RefPtr{this}, callsite, promiseId, \ @@ -56,7 +57,7 @@ namespace mozilla { #define INVOKE_ASYNC2(method, promiseId, param1, param2) \ do { \ - auto callsite = __func__; \ + StaticString callsite = __func__; \ using ParamType1 = std::remove_reference::type; \ using ParamType2 = std::remove_reference::type; \ mManagerThread->Dispatch(NS_NewRunnableFunction( \ @@ -188,7 +189,7 @@ void MFCDMChild::AssertSendable() { template already_AddRefed MFCDMChild::InvokeAsync( - std::function&& aCall, const char* aCallerName, + std::function&& aCall, StaticString aCallerName, MozPromiseHolder& aPromise) { AssertSendable(); diff --git a/dom/media/ipc/MFCDMChild.h b/dom/media/ipc/MFCDMChild.h index 3396b0c790..ec766cab24 100644 --- a/dom/media/ipc/MFCDMChild.h +++ b/dom/media/ipc/MFCDMChild.h @@ -30,7 +30,7 @@ class MFCDMChild final : public PMFCDMChild { template already_AddRefed InvokeAsync( - std::function&& aCall, const char* aCallerName, + std::function&& aCall, StaticString aCallerName, MozPromiseHolder& aPromise); using InitPromise = MozPromise; diff --git a/dom/media/ipc/RDDChild.cpp b/dom/media/ipc/RDDChild.cpp index fb2e14bb4f..6180ec7391 100644 --- a/dom/media/ipc/RDDChild.cpp +++ b/dom/media/ipc/RDDChild.cpp @@ -5,6 +5,8 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "RDDChild.h" +#include "TelemetryProbesReporter.h" +#include "VideoUtils.h" #include "mozilla/FOGIPC.h" #include "mozilla/RDDProcessManager.h" #include "mozilla/dom/ContentParent.h" @@ -142,6 +144,13 @@ mozilla::ipc::IPCResult RDDChild::RecvGetModulesTrust( mozilla::ipc::IPCResult RDDChild::RecvUpdateMediaCodecsSupported( const media::MediaCodecsSupported& aSupported) { +#if defined(XP_MACOSX) || defined(XP_LINUX) + // We report this on GPUChild on Windows and Android + if (ContainHardwareCodecsSupported(aSupported)) { + mozilla::TelemetryProbesReporter::ReportDeviceMediaCodecSupported( + aSupported); + } +#endif dom::ContentParent::BroadcastMediaCodecsSupportedUpdate( RemoteDecodeIn::RddProcess, aSupported); return IPC_OK(); diff --git a/dom/media/ipc/RDDParent.cpp b/dom/media/ipc/RDDParent.cpp index 8892e8fbbe..4b6c1372ce 100644 --- a/dom/media/ipc/RDDParent.cpp +++ b/dom/media/ipc/RDDParent.cpp @@ -52,6 +52,10 @@ # include "mozilla/SandboxTestingChild.h" #endif +#if defined(XP_MACOSX) || defined(XP_LINUX) +# include "VideoUtils.h" +#endif + namespace mozilla { using namespace ipc; @@ -159,18 +163,6 @@ mozilla::ipc::IPCResult RDDParent::RecvInit( } IPCResult RDDParent::RecvUpdateVar(const GfxVarUpdate& aUpdate) { -#if defined(XP_WIN) - auto scopeExit = MakeScopeExit( - [couldUseHWDecoder = gfx::gfxVars::CanUseHardwareVideoDecoding()] { - if (couldUseHWDecoder != gfx::gfxVars::CanUseHardwareVideoDecoding()) { - // The capabilities of the system may have changed, force a refresh by - // re-initializing the WMF PDM. - WMFDecoderModule::Init(); - Unused << RDDParent::GetSingleton()->SendUpdateMediaCodecsSupported( - PDMFactory::Supported(true /* force refresh */)); - } - }); -#endif gfxVars::ApplyUpdate(aUpdate); return IPC_OK(); } diff --git a/dom/media/ipc/RemoteImageHolder.h b/dom/media/ipc/RemoteImageHolder.h index 981e24d150..36deab1ef1 100644 --- a/dom/media/ipc/RemoteImageHolder.h +++ b/dom/media/ipc/RemoteImageHolder.h @@ -58,12 +58,12 @@ class RemoteImageHolder final { gfx::ColorRange mColorRange = {}; }; - template <> - struct ipc::IPDLParamTraits { - static void Write(IPC::MessageWriter* aWriter, IProtocol* aActor, - RemoteImageHolder&& aParam); - static bool Read(IPC::MessageReader* aReader, IProtocol* aActor, - RemoteImageHolder* aResult); +template <> +struct ipc::IPDLParamTraits { + static void Write(IPC::MessageWriter* aWriter, IProtocol* aActor, + RemoteImageHolder&& aParam); + static bool Read(IPC::MessageReader* aReader, IProtocol* aActor, + RemoteImageHolder* aResult); }; } // namespace mozilla -- cgit v1.2.3