Commit d1dca9e2 authored by alwu's avatar alwu
Browse files

Bug 1853057 - use the cached remote result to anwser the support information. r=jolin

When asking config in the content process, we should return result based
on the cached result in the remote decoder because we don't want
to run Windows Media Foundation (WMF) in the content process, which
should be better to run only in the higher security sandboxed process.

We use that function in [1] in the content process to indentify what
types the media engine supports.

[1] https://searchfox.org/mozilla-central/rev/b6cd901cf074c5e75e3902d660bafa3cf3967c40/dom/media/ExternalEngineStateMachine.cpp#332-337

Differential Revision: https://phabricator.services.mozilla.com/D187522
parent 5eff4e2d
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -8,6 +8,8 @@
#include "VideoUtils.h"
#include "mozilla/MFMediaEngineParent.h"
#include "mozilla/MFMediaEngineUtils.h"
#include "mozilla/RemoteDecoderManagerChild.h"
#include "mozilla/RemoteDecoderModule.h"
#include "mozilla/StaticPrefs_media.h"
#include "mozilla/WindowsVersion.h"
#include "mozilla/mscom/EnsureMTA.h"
@@ -31,9 +33,9 @@ already_AddRefed<PlatformDecoderModule> MFMediaEngineDecoderModule::Create() {

/* static */
bool MFMediaEngineDecoderModule::SupportsConfig(const TrackInfo& aConfig) {
  RefPtr<MFMediaEngineDecoderModule> module = new MFMediaEngineDecoderModule();
  return !module->SupportInternal(SupportDecoderParams(aConfig), nullptr)
              .isEmpty();
  RefPtr<PlatformDecoderModule> module = RemoteDecoderModule::Create(
      RemoteDecodeIn::UtilityProcess_MFMediaEngineCDM);
  return !module->Supports(SupportDecoderParams(aConfig), nullptr).isEmpty();
}

already_AddRefed<MediaDataDecoder>
+2 −0
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@ class MFMediaEngineDecoderModule final : public PlatformDecoderModule {

  static already_AddRefed<PlatformDecoderModule> Create();

  // Used in the content process to query if the config is supported or not.
  // If in the MFCDM process, should use SupportsMimeType or Supports instead.
  static bool SupportsConfig(const TrackInfo& aConfig);

  already_AddRefed<MediaDataDecoder> CreateVideoDecoder(