summaryrefslogtreecommitdiffstats
path: root/ipc/glue/UtilityAudioDecoderParent.cpp
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:14:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:14:29 +0000
commitfbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8 (patch)
tree4c1ccaf5486d4f2009f9a338a98a83e886e29c97 /ipc/glue/UtilityAudioDecoderParent.cpp
parentReleasing progress-linux version 124.0.1-1~progress7.99u1. (diff)
downloadfirefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.tar.xz
firefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.zip
Merging upstream version 125.0.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'ipc/glue/UtilityAudioDecoderParent.cpp')
-rw-r--r--ipc/glue/UtilityAudioDecoderParent.cpp26
1 files changed, 18 insertions, 8 deletions
diff --git a/ipc/glue/UtilityAudioDecoderParent.cpp b/ipc/glue/UtilityAudioDecoderParent.cpp
index 2eb0936a38..ed6327061b 100644
--- a/ipc/glue/UtilityAudioDecoderParent.cpp
+++ b/ipc/glue/UtilityAudioDecoderParent.cpp
@@ -42,7 +42,8 @@
namespace mozilla::ipc {
-UtilityAudioDecoderParent::UtilityAudioDecoderParent()
+UtilityAudioDecoderParent::UtilityAudioDecoderParent(
+ nsTArray<gfx::GfxVarUpdate>&& aUpdates)
: mKind(GetCurrentSandboxingKind()),
mAudioDecoderParentStart(TimeStamp::Now()) {
#ifdef MOZ_WMF_MEDIA_ENGINE
@@ -51,6 +52,9 @@ UtilityAudioDecoderParent::UtilityAudioDecoderParent()
profiler_set_process_name(nsCString("MF Media Engine CDM"));
gfx::gfxConfig::Init();
gfx::gfxVars::Initialize();
+ for (auto& update : aUpdates) {
+ gfx::gfxVars::ApplyUpdate(update);
+ }
gfx::DeviceManagerDx::Init();
return;
}
@@ -78,12 +82,12 @@ UtilityAudioDecoderParent::~UtilityAudioDecoderParent() {
/* static */
void UtilityAudioDecoderParent::GenericPreloadForSandbox() {
-#if defined(MOZ_SANDBOX) && defined(XP_WIN) && defined(MOZ_FFVPX)
+#if defined(MOZ_SANDBOX) && defined(XP_WIN)
// Preload AV dlls so we can enable Binary Signature Policy
// to restrict further dll loads.
UtilityProcessImpl::LoadLibraryOrCrash(L"mozavcodec.dll");
UtilityProcessImpl::LoadLibraryOrCrash(L"mozavutil.dll");
-#endif // defined(MOZ_SANDBOX) && defined(XP_WIN) && defined(MOZ_FFVPX)
+#endif // defined(MOZ_SANDBOX) && defined(XP_WIN)
}
/* static */
@@ -141,7 +145,6 @@ UtilityAudioDecoderParent::RecvNewContentRemoteDecoderManager(
#ifdef MOZ_WMF_MEDIA_ENGINE
mozilla::ipc::IPCResult UtilityAudioDecoderParent::RecvInitVideoBridge(
Endpoint<PVideoBridgeChild>&& aEndpoint,
- nsTArray<gfx::GfxVarUpdate>&& aUpdates,
const ContentDeviceData& aContentDeviceData) {
MOZ_ASSERT(mKind == SandboxingKind::MF_MEDIA_ENGINE_CDM);
if (!RemoteDecoderManagerParent::CreateVideoBridgeToOtherProcess(
@@ -149,10 +152,6 @@ mozilla::ipc::IPCResult UtilityAudioDecoderParent::RecvInitVideoBridge(
return IPC_FAIL_NO_REASON(this);
}
- for (const auto& update : aUpdates) {
- gfx::gfxVars::ApplyUpdate(update);
- }
-
gfx::gfxConfig::Inherit(
{
gfx::Feature::HW_COMPOSITING,
@@ -175,6 +174,17 @@ mozilla::ipc::IPCResult UtilityAudioDecoderParent::RecvInitVideoBridge(
IPCResult UtilityAudioDecoderParent::RecvUpdateVar(
const GfxVarUpdate& aUpdate) {
MOZ_ASSERT(mKind == SandboxingKind::MF_MEDIA_ENGINE_CDM);
+ auto scopeExit = MakeScopeExit(
+ [self = RefPtr<UtilityAudioDecoderParent>{this},
+ location = GetRemoteDecodeInFromKind(mKind),
+ couldUseHWDecoder = gfx::gfxVars::CanUseHardwareVideoDecoding()] {
+ if (couldUseHWDecoder != gfx::gfxVars::CanUseHardwareVideoDecoding()) {
+ // The capabilities of the system may have changed, force a refresh by
+ // re-initializing the PDM.
+ Unused << self->SendUpdateMediaCodecsSupported(
+ location, PDMFactory::Supported(true /* force refresh */));
+ }
+ });
gfx::gfxVars::ApplyUpdate(aUpdate);
return IPC_OK();
}