summaryrefslogtreecommitdiffstats
path: root/dom/media/ipc
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:27 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:27 +0000
commit40a355a42d4a9444dc753c04c6608dade2f06a23 (patch)
tree871fc667d2de662f171103ce5ec067014ef85e61 /dom/media/ipc
parentAdding upstream version 124.0.1. (diff)
downloadfirefox-40a355a42d4a9444dc753c04c6608dade2f06a23.tar.xz
firefox-40a355a42d4a9444dc753c04c6608dade2f06a23.zip
Adding upstream version 125.0.1.upstream/125.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/media/ipc')
-rw-r--r--dom/media/ipc/MFCDMSerializers.h16
-rw-r--r--dom/media/ipc/MFMediaEngineParent.cpp4
-rw-r--r--dom/media/ipc/RDDProcessHost.cpp4
-rw-r--r--dom/media/ipc/RDDProcessManager.cpp8
-rw-r--r--dom/media/ipc/RemoteDecoderManagerChild.cpp32
5 files changed, 38 insertions, 26 deletions
diff --git a/dom/media/ipc/MFCDMSerializers.h b/dom/media/ipc/MFCDMSerializers.h
index 587f30ae09..64867f4dbb 100644
--- a/dom/media/ipc/MFCDMSerializers.h
+++ b/dom/media/ipc/MFCDMSerializers.h
@@ -5,9 +5,9 @@
#ifndef DOM_MEDIA_IPC_MFCDMSERIALIZERS_H_
#define DOM_MEDIA_IPC_MFCDMSERIALIZERS_H_
-#include "ipc/EnumSerializer.h"
#include "MediaData.h"
#include "mozilla/KeySystemConfig.h"
+#include "mozilla/dom/BindingIPCUtils.h"
#include "mozilla/dom/MediaKeyMessageEventBinding.h"
#include "mozilla/dom/MediaKeyStatusMapBinding.h"
@@ -35,23 +35,17 @@ struct ParamTraits<mozilla::CryptoScheme>
template <>
struct ParamTraits<mozilla::dom::MediaKeyMessageType>
- : public ContiguousEnumSerializer<
- mozilla::dom::MediaKeyMessageType,
- mozilla::dom::MediaKeyMessageType::License_request,
- mozilla::dom::MediaKeyMessageType::EndGuard_> {};
+ : public mozilla::dom::WebIDLEnumSerializer<
+ mozilla::dom::MediaKeyMessageType> {};
template <>
struct ParamTraits<mozilla::dom::MediaKeyStatus>
- : public ContiguousEnumSerializer<mozilla::dom::MediaKeyStatus,
- mozilla::dom::MediaKeyStatus::Usable,
- mozilla::dom::MediaKeyStatus::EndGuard_> {
+ : public mozilla::dom::WebIDLEnumSerializer<mozilla::dom::MediaKeyStatus> {
};
template <>
struct ParamTraits<mozilla::dom::HDCPVersion>
- : public ContiguousEnumSerializer<mozilla::dom::HDCPVersion,
- mozilla::dom::HDCPVersion::_1_0,
- mozilla::dom::HDCPVersion::EndGuard_> {};
+ : public mozilla::dom::WebIDLEnumSerializer<mozilla::dom::HDCPVersion> {};
} // namespace IPC
diff --git a/dom/media/ipc/MFMediaEngineParent.cpp b/dom/media/ipc/MFMediaEngineParent.cpp
index 0238956781..5ed1b71160 100644
--- a/dom/media/ipc/MFMediaEngineParent.cpp
+++ b/dom/media/ipc/MFMediaEngineParent.cpp
@@ -113,7 +113,6 @@ void MFMediaEngineParent::DestroyEngineIfExists(
mRequestSampleListener.DisconnectIfExists();
if (mDXGIDeviceManager) {
mDXGIDeviceManager = nullptr;
- wmf::MFUnlockDXGIDeviceManager();
}
if (aError) {
Unused << SendNotifyError(*aError);
@@ -191,6 +190,9 @@ void MFMediaEngineParent::InitializeDXGIDeviceManager() {
UINT deviceResetToken;
RETURN_VOID_IF_FAILED(
wmf::MFLockDXGIDeviceManager(&deviceResetToken, &mDXGIDeviceManager));
+ if (!mDXGIDeviceManager) {
+ return;
+ }
RETURN_VOID_IF_FAILED(
mDXGIDeviceManager->ResetDevice(d3d11Device.get(), deviceResetToken));
LOG("Initialized DXGI manager");
diff --git a/dom/media/ipc/RDDProcessHost.cpp b/dom/media/ipc/RDDProcessHost.cpp
index 0c0d35e7b5..d855b7804b 100644
--- a/dom/media/ipc/RDDProcessHost.cpp
+++ b/dom/media/ipc/RDDProcessHost.cpp
@@ -53,10 +53,6 @@ bool RDDProcessHost::Launch(StringVector aExtraOpts) {
}
mPrefSerializer->AddSharedPrefCmdLineArgs(*this, aExtraOpts);
-#if defined(XP_WIN) && defined(MOZ_SANDBOX)
- mSandboxLevel = Preferences::GetInt("security.sandbox.rdd.level");
-#endif
-
mLaunchPhase = LaunchPhase::Waiting;
mLaunchTime = TimeStamp::Now();
diff --git a/dom/media/ipc/RDDProcessManager.cpp b/dom/media/ipc/RDDProcessManager.cpp
index e7da3c3569..cb51b68282 100644
--- a/dom/media/ipc/RDDProcessManager.cpp
+++ b/dom/media/ipc/RDDProcessManager.cpp
@@ -170,8 +170,8 @@ RefPtr<GenericNonExclusivePromise> RDDProcessManager::LaunchRDDProcess() {
}
mQueuedPrefs.Clear();
- CrashReporter::AnnotateCrashReport(
- CrashReporter::Annotation::RDDProcessStatus, "Running"_ns);
+ CrashReporter::RecordAnnotationCString(
+ CrashReporter::Annotation::RDDProcessStatus, "Running");
if (!CreateVideoBridge()) {
mNumProcessAttempts++;
@@ -271,8 +271,8 @@ void RDDProcessManager::DestroyProcess() {
mRDDChild = nullptr;
mQueuedPrefs.Clear();
- CrashReporter::AnnotateCrashReport(
- CrashReporter::Annotation::RDDProcessStatus, "Destroyed"_ns);
+ CrashReporter::RecordAnnotationCString(
+ CrashReporter::Annotation::RDDProcessStatus, "Destroyed");
}
bool RDDProcessManager::CreateContentBridge(
diff --git a/dom/media/ipc/RemoteDecoderManagerChild.cpp b/dom/media/ipc/RemoteDecoderManagerChild.cpp
index 48da254f39..b0b075e4d2 100644
--- a/dom/media/ipc/RemoteDecoderManagerChild.cpp
+++ b/dom/media/ipc/RemoteDecoderManagerChild.cpp
@@ -50,8 +50,8 @@ using namespace gfx;
// Used so that we only ever attempt to check if the RDD/GPU/Utility processes
// should be launched serially. Protects sLaunchPromise
StaticMutex sLaunchMutex;
-static EnumeratedArray<RemoteDecodeIn, RemoteDecodeIn::SENTINEL,
- StaticRefPtr<GenericNonExclusivePromise>>
+static EnumeratedArray<RemoteDecodeIn, StaticRefPtr<GenericNonExclusivePromise>,
+ size_t(RemoteDecodeIn::SENTINEL)>
sLaunchPromises MOZ_GUARDED_BY(sLaunchMutex);
// Only modified on the main-thread, read on any thread. While it could be read
@@ -61,8 +61,8 @@ static StaticDataMutex<StaticRefPtr<nsIThread>>
sRemoteDecoderManagerChildThread("sRemoteDecoderManagerChildThread");
// Only accessed from sRemoteDecoderManagerChildThread
-static EnumeratedArray<RemoteDecodeIn, RemoteDecodeIn::SENTINEL,
- StaticRefPtr<RemoteDecoderManagerChild>>
+static EnumeratedArray<RemoteDecodeIn, StaticRefPtr<RemoteDecoderManagerChild>,
+ size_t(RemoteDecodeIn::SENTINEL)>
sRemoteDecoderManagerChildForProcesses;
static StaticAutoPtr<nsTArray<RefPtr<Runnable>>> sRecreateTasks;
@@ -70,8 +70,8 @@ static StaticAutoPtr<nsTArray<RefPtr<Runnable>>> sRecreateTasks;
// Used for protecting codec support information collected from different remote
// processes.
StaticMutex sProcessSupportedMutex;
-static EnumeratedArray<RemoteDecodeIn, RemoteDecodeIn::SENTINEL,
- Maybe<media::MediaCodecsSupported>>
+static EnumeratedArray<RemoteDecodeIn, Maybe<media::MediaCodecsSupported>,
+ size_t(RemoteDecodeIn::SENTINEL)>
sProcessSupported MOZ_GUARDED_BY(sProcessSupportedMutex);
class ShutdownObserver final : public nsIObserver {
@@ -311,6 +311,16 @@ RemoteDecoderManagerChild::CreateAudioDecoder(
__func__);
}
+ if (!aParams.mMediaEngineId &&
+ aLocation == RemoteDecodeIn::UtilityProcess_MFMediaEngineCDM) {
+ return PlatformDecoderModule::CreateDecoderPromise::CreateAndReject(
+ MediaResult(NS_ERROR_DOM_MEDIA_NOT_SUPPORTED_ERR,
+ nsPrintfCString("%s only support for media engine playback",
+ RemoteDecodeInToStr(aLocation))
+ .get()),
+ __func__);
+ }
+
RefPtr<GenericNonExclusivePromise> launchPromise;
if (StaticPrefs::media_utility_process_enabled() &&
(aLocation == RemoteDecodeIn::UtilityProcess_Generic ||
@@ -385,6 +395,16 @@ RemoteDecoderManagerChild::CreateVideoDecoder(
__func__);
}
+ if (!aParams.mMediaEngineId &&
+ aLocation == RemoteDecodeIn::UtilityProcess_MFMediaEngineCDM) {
+ return PlatformDecoderModule::CreateDecoderPromise::CreateAndReject(
+ MediaResult(NS_ERROR_DOM_MEDIA_NOT_SUPPORTED_ERR,
+ nsPrintfCString("%s only support for media engine playback",
+ RemoteDecodeInToStr(aLocation))
+ .get()),
+ __func__);
+ }
+
MOZ_ASSERT(aLocation != RemoteDecodeIn::Unspecified);
RefPtr<GenericNonExclusivePromise> p;