summaryrefslogtreecommitdiffstats
path: root/dom/media/ipc/RemoteDecoderManagerChild.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'dom/media/ipc/RemoteDecoderManagerChild.cpp')
-rw-r--r--dom/media/ipc/RemoteDecoderManagerChild.cpp32
1 files changed, 26 insertions, 6 deletions
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;