2015-10-05 13:08:56 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim:set ts=2 sw=2 sts=2 et cindent: */
|
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
#include "PDMFactory.h"
|
|
|
|
|
|
|
|
#ifdef XP_WIN
|
|
|
|
#include "WMFDecoderModule.h"
|
|
|
|
#endif
|
2016-01-19 09:31:25 +03:00
|
|
|
#ifdef MOZ_FFVPX
|
|
|
|
#include "FFVPXRuntimeLinker.h"
|
|
|
|
#endif
|
2015-10-05 13:08:56 +03:00
|
|
|
#ifdef MOZ_FFMPEG
|
|
|
|
#include "FFmpegRuntimeLinker.h"
|
|
|
|
#endif
|
|
|
|
#ifdef MOZ_APPLEMEDIA
|
|
|
|
#include "AppleDecoderModule.h"
|
|
|
|
#endif
|
|
|
|
#ifdef MOZ_GONK_MEDIACODEC
|
|
|
|
#include "GonkDecoderModule.h"
|
|
|
|
#endif
|
|
|
|
#ifdef MOZ_WIDGET_ANDROID
|
|
|
|
#include "AndroidDecoderModule.h"
|
|
|
|
#endif
|
|
|
|
#include "GMPDecoderModule.h"
|
|
|
|
|
|
|
|
#include "mozilla/Preferences.h"
|
|
|
|
#include "mozilla/TaskQueue.h"
|
|
|
|
|
|
|
|
#include "mozilla/SharedThreadPool.h"
|
|
|
|
|
|
|
|
#include "MediaInfo.h"
|
|
|
|
#include "FuzzingWrapper.h"
|
|
|
|
#include "H264Converter.h"
|
|
|
|
|
2015-10-06 01:53:02 +03:00
|
|
|
#include "AgnosticDecoderModule.h"
|
2015-10-05 13:08:56 +03:00
|
|
|
|
2015-10-06 11:56:29 +03:00
|
|
|
#ifdef MOZ_EME
|
|
|
|
#include "EMEDecoderModule.h"
|
|
|
|
#include "mozilla/CDMProxy.h"
|
|
|
|
#endif
|
|
|
|
|
2016-04-19 10:36:20 +03:00
|
|
|
#include "DecoderDoctorDiagnostics.h"
|
|
|
|
|
2015-10-05 13:08:56 +03:00
|
|
|
namespace mozilla {
|
|
|
|
|
|
|
|
extern already_AddRefed<PlatformDecoderModule> CreateAgnosticDecoderModule();
|
|
|
|
extern already_AddRefed<PlatformDecoderModule> CreateBlankDecoderModule();
|
|
|
|
|
|
|
|
bool PDMFactory::sUseBlankDecoder = false;
|
2015-10-15 04:51:31 +03:00
|
|
|
#ifdef MOZ_GONK_MEDIACODEC
|
2015-10-05 13:08:56 +03:00
|
|
|
bool PDMFactory::sGonkDecoderEnabled = false;
|
2015-10-15 04:51:31 +03:00
|
|
|
#endif
|
|
|
|
#ifdef MOZ_WIDGET_ANDROID
|
2015-10-05 13:08:56 +03:00
|
|
|
bool PDMFactory::sAndroidMCDecoderEnabled = false;
|
|
|
|
bool PDMFactory::sAndroidMCDecoderPreferred = false;
|
2015-10-15 04:51:31 +03:00
|
|
|
#endif
|
2015-10-05 13:08:56 +03:00
|
|
|
bool PDMFactory::sGMPDecoderEnabled = false;
|
2016-01-19 09:31:25 +03:00
|
|
|
#ifdef MOZ_FFVPX
|
|
|
|
bool PDMFactory::sFFVPXDecoderEnabled = false;
|
|
|
|
#endif
|
2015-10-15 04:51:31 +03:00
|
|
|
#ifdef MOZ_FFMPEG
|
2015-10-12 02:00:04 +03:00
|
|
|
bool PDMFactory::sFFmpegDecoderEnabled = false;
|
2015-10-15 04:51:31 +03:00
|
|
|
#endif
|
2015-10-15 04:51:34 +03:00
|
|
|
#ifdef XP_WIN
|
|
|
|
bool PDMFactory::sWMFDecoderEnabled = false;
|
|
|
|
#endif
|
2015-10-12 02:00:04 +03:00
|
|
|
|
2015-10-05 13:08:56 +03:00
|
|
|
bool PDMFactory::sEnableFuzzingWrapper = false;
|
|
|
|
uint32_t PDMFactory::sVideoOutputMinimumInterval_ms = 0;
|
|
|
|
bool PDMFactory::sDontDelayInputExhausted = false;
|
|
|
|
|
|
|
|
/* static */
|
|
|
|
void
|
|
|
|
PDMFactory::Init()
|
|
|
|
{
|
|
|
|
MOZ_ASSERT(NS_IsMainThread());
|
|
|
|
static bool alreadyInitialized = false;
|
|
|
|
if (alreadyInitialized) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
alreadyInitialized = true;
|
|
|
|
|
|
|
|
Preferences::AddBoolVarCache(&sUseBlankDecoder,
|
2016-03-10 07:04:23 +03:00
|
|
|
"media.use-blank-decoder", false);
|
2015-10-05 13:08:56 +03:00
|
|
|
#ifdef MOZ_GONK_MEDIACODEC
|
|
|
|
Preferences::AddBoolVarCache(&sGonkDecoderEnabled,
|
2016-03-10 07:04:23 +03:00
|
|
|
"media.gonk.enabled", true);
|
2015-10-05 13:08:56 +03:00
|
|
|
#endif
|
|
|
|
#ifdef MOZ_WIDGET_ANDROID
|
|
|
|
Preferences::AddBoolVarCache(&sAndroidMCDecoderEnabled,
|
2015-10-15 04:51:28 +03:00
|
|
|
"media.android-media-codec.enabled", false);
|
2015-10-05 13:08:56 +03:00
|
|
|
Preferences::AddBoolVarCache(&sAndroidMCDecoderPreferred,
|
2015-10-15 04:51:28 +03:00
|
|
|
"media.android-media-codec.preferred", false);
|
2015-10-05 13:08:56 +03:00
|
|
|
#endif
|
|
|
|
|
|
|
|
Preferences::AddBoolVarCache(&sGMPDecoderEnabled,
|
2016-03-10 07:04:23 +03:00
|
|
|
"media.gmp.decoder.enabled", true);
|
2015-10-15 04:51:31 +03:00
|
|
|
#ifdef MOZ_FFMPEG
|
2015-10-12 02:00:04 +03:00
|
|
|
Preferences::AddBoolVarCache(&sFFmpegDecoderEnabled,
|
2016-03-10 07:04:23 +03:00
|
|
|
"media.ffmpeg.enabled", true);
|
2015-10-15 04:51:31 +03:00
|
|
|
#endif
|
2016-01-19 09:31:25 +03:00
|
|
|
#ifdef MOZ_FFVPX
|
|
|
|
Preferences::AddBoolVarCache(&sFFVPXDecoderEnabled,
|
2016-03-10 07:04:23 +03:00
|
|
|
"media.ffvpx.enabled", true);
|
2016-01-19 09:31:25 +03:00
|
|
|
#endif
|
2015-10-15 04:51:34 +03:00
|
|
|
#ifdef XP_WIN
|
|
|
|
Preferences::AddBoolVarCache(&sWMFDecoderEnabled,
|
2016-03-10 07:04:23 +03:00
|
|
|
"media.wmf.enabled", true);
|
2015-10-15 04:51:34 +03:00
|
|
|
#endif
|
2015-10-05 13:08:56 +03:00
|
|
|
|
|
|
|
Preferences::AddBoolVarCache(&sEnableFuzzingWrapper,
|
|
|
|
"media.decoder.fuzzing.enabled", false);
|
|
|
|
Preferences::AddUintVarCache(&sVideoOutputMinimumInterval_ms,
|
|
|
|
"media.decoder.fuzzing.video-output-minimum-interval-ms", 0);
|
|
|
|
Preferences::AddBoolVarCache(&sDontDelayInputExhausted,
|
|
|
|
"media.decoder.fuzzing.dont-delay-inputexhausted", false);
|
|
|
|
|
|
|
|
#ifdef XP_WIN
|
|
|
|
WMFDecoderModule::Init();
|
|
|
|
#endif
|
|
|
|
#ifdef MOZ_APPLEMEDIA
|
|
|
|
AppleDecoderModule::Init();
|
|
|
|
#endif
|
2016-01-19 09:31:25 +03:00
|
|
|
#ifdef MOZ_FFVPX
|
2016-01-20 12:22:43 +03:00
|
|
|
FFVPXRuntimeLinker::Init();
|
2016-01-19 09:31:25 +03:00
|
|
|
#endif
|
2015-10-05 13:08:56 +03:00
|
|
|
#ifdef MOZ_FFMPEG
|
2016-01-20 12:22:43 +03:00
|
|
|
FFmpegRuntimeLinker::Init();
|
2015-10-05 13:08:56 +03:00
|
|
|
#endif
|
2015-10-08 10:40:09 +03:00
|
|
|
GMPDecoderModule::Init();
|
2015-10-05 13:08:56 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
PDMFactory::PDMFactory()
|
|
|
|
{
|
2015-10-06 01:08:03 +03:00
|
|
|
CreatePDMs();
|
2015-10-05 13:08:56 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
PDMFactory::~PDMFactory()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
already_AddRefed<MediaDataDecoder>
|
|
|
|
PDMFactory::CreateDecoder(const TrackInfo& aConfig,
|
|
|
|
FlushableTaskQueue* aTaskQueue,
|
|
|
|
MediaDataDecoderCallback* aCallback,
|
2016-04-19 10:36:19 +03:00
|
|
|
DecoderDoctorDiagnostics* aDiagnostics,
|
2015-10-05 13:08:56 +03:00
|
|
|
layers::LayersBackend aLayersBackend,
|
|
|
|
layers::ImageContainer* aImageContainer)
|
|
|
|
{
|
2015-10-28 16:46:30 +03:00
|
|
|
bool isEncrypted = mEMEPDM && aConfig.mCrypto.mValid;
|
|
|
|
|
|
|
|
if (isEncrypted) {
|
|
|
|
return CreateDecoderWithPDM(mEMEPDM,
|
|
|
|
aConfig,
|
|
|
|
aTaskQueue,
|
|
|
|
aCallback,
|
2016-04-19 10:36:19 +03:00
|
|
|
aDiagnostics,
|
2015-10-28 16:46:30 +03:00
|
|
|
aLayersBackend,
|
|
|
|
aImageContainer);
|
|
|
|
}
|
2015-10-06 11:56:29 +03:00
|
|
|
|
2016-04-19 10:36:20 +03:00
|
|
|
if (aDiagnostics) {
|
|
|
|
// If libraries failed to load, the following loop over mCurrentPDMs
|
|
|
|
// will not even try to use them. So we record failures now.
|
2016-04-22 06:42:11 +03:00
|
|
|
if (mWMFFailedToLoad) {
|
|
|
|
aDiagnostics->SetWMFFailedToLoad();
|
|
|
|
}
|
2016-04-19 10:36:20 +03:00
|
|
|
if (mFFmpegFailedToLoad) {
|
|
|
|
aDiagnostics->SetFFmpegFailedToLoad();
|
|
|
|
}
|
2016-04-22 06:42:11 +03:00
|
|
|
if (mGMPPDMFailedToStartup) {
|
|
|
|
aDiagnostics->SetGMPPDMFailedToStartup();
|
|
|
|
}
|
2016-04-19 10:36:20 +03:00
|
|
|
}
|
|
|
|
|
2015-10-28 16:46:30 +03:00
|
|
|
for (auto& current : mCurrentPDMs) {
|
2016-04-19 10:36:19 +03:00
|
|
|
if (!current->SupportsMimeType(aConfig.mMimeType, aDiagnostics)) {
|
2015-10-28 16:46:30 +03:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
RefPtr<MediaDataDecoder> m =
|
|
|
|
CreateDecoderWithPDM(current,
|
|
|
|
aConfig,
|
|
|
|
aTaskQueue,
|
|
|
|
aCallback,
|
2016-04-19 10:36:19 +03:00
|
|
|
aDiagnostics,
|
2015-10-28 16:46:30 +03:00
|
|
|
aLayersBackend,
|
|
|
|
aImageContainer);
|
|
|
|
if (m) {
|
|
|
|
return m.forget();
|
|
|
|
}
|
2015-10-06 01:53:02 +03:00
|
|
|
}
|
2015-10-28 16:46:30 +03:00
|
|
|
NS_WARNING("Unable to create a decoder, no platform found.");
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
already_AddRefed<MediaDataDecoder>
|
|
|
|
PDMFactory::CreateDecoderWithPDM(PlatformDecoderModule* aPDM,
|
|
|
|
const TrackInfo& aConfig,
|
|
|
|
FlushableTaskQueue* aTaskQueue,
|
|
|
|
MediaDataDecoderCallback* aCallback,
|
2016-04-19 10:36:19 +03:00
|
|
|
DecoderDoctorDiagnostics* aDiagnostics,
|
2015-10-28 16:46:30 +03:00
|
|
|
layers::LayersBackend aLayersBackend,
|
|
|
|
layers::ImageContainer* aImageContainer)
|
|
|
|
{
|
|
|
|
MOZ_ASSERT(aPDM);
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<MediaDataDecoder> m;
|
2015-10-05 13:08:56 +03:00
|
|
|
|
|
|
|
if (aConfig.GetAsAudioInfo()) {
|
2015-10-28 16:46:30 +03:00
|
|
|
m = aPDM->CreateAudioDecoder(*aConfig.GetAsAudioInfo(),
|
|
|
|
aTaskQueue,
|
2016-04-19 10:36:19 +03:00
|
|
|
aCallback,
|
|
|
|
aDiagnostics);
|
2015-10-05 13:08:56 +03:00
|
|
|
return m.forget();
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!aConfig.GetAsVideoInfo()) {
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
MediaDataDecoderCallback* callback = aCallback;
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<DecoderCallbackFuzzingWrapper> callbackWrapper;
|
2015-10-05 13:08:56 +03:00
|
|
|
if (sEnableFuzzingWrapper) {
|
|
|
|
callbackWrapper = new DecoderCallbackFuzzingWrapper(aCallback);
|
|
|
|
callbackWrapper->SetVideoOutputMinimumInterval(
|
|
|
|
TimeDuration::FromMilliseconds(sVideoOutputMinimumInterval_ms));
|
|
|
|
callbackWrapper->SetDontDelayInputExhausted(sDontDelayInputExhausted);
|
|
|
|
callback = callbackWrapper.get();
|
|
|
|
}
|
|
|
|
|
2015-10-06 01:53:02 +03:00
|
|
|
if (H264Converter::IsH264(aConfig)) {
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<H264Converter> h
|
2015-10-28 16:46:30 +03:00
|
|
|
= new H264Converter(aPDM,
|
2015-10-06 01:53:02 +03:00
|
|
|
*aConfig.GetAsVideoInfo(),
|
|
|
|
aLayersBackend,
|
|
|
|
aImageContainer,
|
|
|
|
aTaskQueue,
|
2016-04-19 10:36:19 +03:00
|
|
|
callback,
|
|
|
|
aDiagnostics);
|
2015-10-06 01:53:02 +03:00
|
|
|
const nsresult rv = h->GetLastError();
|
|
|
|
if (NS_SUCCEEDED(rv) || rv == NS_ERROR_NOT_INITIALIZED) {
|
|
|
|
// The H264Converter either successfully created the wrapped decoder,
|
|
|
|
// or there wasn't enough AVCC data to do so. Otherwise, there was some
|
|
|
|
// problem, for example WMF DLLs were missing.
|
|
|
|
m = h.forget();
|
2015-10-06 01:08:03 +03:00
|
|
|
}
|
2015-10-06 01:53:02 +03:00
|
|
|
} else {
|
2015-10-28 16:46:30 +03:00
|
|
|
m = aPDM->CreateVideoDecoder(*aConfig.GetAsVideoInfo(),
|
|
|
|
aLayersBackend,
|
|
|
|
aImageContainer,
|
|
|
|
aTaskQueue,
|
2016-04-19 10:36:19 +03:00
|
|
|
callback,
|
|
|
|
aDiagnostics);
|
2015-10-05 13:08:56 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
if (callbackWrapper && m) {
|
|
|
|
m = new DecoderFuzzingWrapper(m.forget(), callbackWrapper.forget());
|
|
|
|
}
|
|
|
|
|
|
|
|
return m.forget();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
2016-04-19 10:36:19 +03:00
|
|
|
PDMFactory::SupportsMimeType(const nsACString& aMimeType,
|
|
|
|
DecoderDoctorDiagnostics* aDiagnostics) const
|
2015-10-05 13:08:56 +03:00
|
|
|
{
|
2015-10-06 11:56:29 +03:00
|
|
|
if (mEMEPDM) {
|
2016-04-19 10:36:19 +03:00
|
|
|
return mEMEPDM->SupportsMimeType(aMimeType, aDiagnostics);
|
2015-10-06 11:56:29 +03:00
|
|
|
}
|
2016-04-19 10:36:19 +03:00
|
|
|
RefPtr<PlatformDecoderModule> current = GetDecoder(aMimeType, aDiagnostics);
|
2015-10-06 01:53:02 +03:00
|
|
|
return !!current;
|
2015-10-05 13:08:56 +03:00
|
|
|
}
|
|
|
|
|
2015-10-06 01:08:03 +03:00
|
|
|
void
|
|
|
|
PDMFactory::CreatePDMs()
|
2015-10-05 13:08:56 +03:00
|
|
|
{
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<PlatformDecoderModule> m;
|
2015-10-06 01:08:03 +03:00
|
|
|
|
2015-10-27 00:49:03 +03:00
|
|
|
if (sUseBlankDecoder) {
|
|
|
|
m = CreateBlankDecoderModule();
|
|
|
|
StartupPDM(m);
|
|
|
|
// The Blank PDM SupportsMimeType reports true for all codecs; the creation
|
|
|
|
// of its decoder is infallible. As such it will be used for all media, we
|
|
|
|
// can stop creating more PDM from this point.
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2015-10-05 13:08:56 +03:00
|
|
|
#ifdef MOZ_WIDGET_ANDROID
|
2015-10-06 01:08:03 +03:00
|
|
|
if(sAndroidMCDecoderPreferred && sAndroidMCDecoderEnabled) {
|
|
|
|
m = new AndroidDecoderModule();
|
|
|
|
StartupPDM(m);
|
2015-10-05 13:08:56 +03:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#ifdef XP_WIN
|
2015-10-15 04:51:34 +03:00
|
|
|
if (sWMFDecoderEnabled) {
|
|
|
|
m = new WMFDecoderModule();
|
2016-04-22 06:42:11 +03:00
|
|
|
if (!StartupPDM(m)) {
|
|
|
|
mWMFFailedToLoad = true;
|
|
|
|
}
|
2015-10-15 04:51:34 +03:00
|
|
|
}
|
2015-10-05 13:08:56 +03:00
|
|
|
#endif
|
2016-01-19 09:31:25 +03:00
|
|
|
#ifdef MOZ_FFVPX
|
|
|
|
if (sFFVPXDecoderEnabled) {
|
|
|
|
m = FFVPXRuntimeLinker::CreateDecoderModule();
|
|
|
|
StartupPDM(m);
|
|
|
|
}
|
|
|
|
#endif
|
2015-10-05 13:08:56 +03:00
|
|
|
#ifdef MOZ_FFMPEG
|
2015-10-12 02:00:04 +03:00
|
|
|
if (sFFmpegDecoderEnabled) {
|
|
|
|
m = FFmpegRuntimeLinker::CreateDecoderModule();
|
2016-04-19 10:36:20 +03:00
|
|
|
if (!StartupPDM(m)) {
|
|
|
|
mFFmpegFailedToLoad = true;
|
|
|
|
}
|
2015-10-12 02:00:04 +03:00
|
|
|
}
|
2015-10-05 13:08:56 +03:00
|
|
|
#endif
|
|
|
|
#ifdef MOZ_APPLEMEDIA
|
2015-10-06 01:08:03 +03:00
|
|
|
m = new AppleDecoderModule();
|
|
|
|
StartupPDM(m);
|
2015-10-05 13:08:56 +03:00
|
|
|
#endif
|
|
|
|
#ifdef MOZ_GONK_MEDIACODEC
|
|
|
|
if (sGonkDecoderEnabled) {
|
2015-10-06 01:08:03 +03:00
|
|
|
m = new GonkDecoderModule();
|
|
|
|
StartupPDM(m);
|
2015-10-05 13:08:56 +03:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#ifdef MOZ_WIDGET_ANDROID
|
|
|
|
if(sAndroidMCDecoderEnabled){
|
2015-10-06 01:08:03 +03:00
|
|
|
m = new AndroidDecoderModule();
|
|
|
|
StartupPDM(m);
|
2015-10-05 13:08:56 +03:00
|
|
|
}
|
|
|
|
#endif
|
2015-10-06 01:53:02 +03:00
|
|
|
|
|
|
|
m = new AgnosticDecoderModule();
|
|
|
|
StartupPDM(m);
|
2015-10-29 11:54:38 +03:00
|
|
|
|
|
|
|
if (sGMPDecoderEnabled) {
|
|
|
|
m = new GMPDecoderModule();
|
2016-04-22 06:42:11 +03:00
|
|
|
if (!StartupPDM(m)) {
|
|
|
|
mGMPPDMFailedToStartup = true;
|
|
|
|
}
|
|
|
|
}
|
2015-10-06 01:08:03 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
PDMFactory::StartupPDM(PlatformDecoderModule* aPDM)
|
|
|
|
{
|
|
|
|
if (aPDM && NS_SUCCEEDED(aPDM->Startup())) {
|
|
|
|
mCurrentPDMs.AppendElement(aPDM);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
already_AddRefed<PlatformDecoderModule>
|
2016-04-19 10:36:19 +03:00
|
|
|
PDMFactory::GetDecoder(const nsACString& aMimeType,
|
|
|
|
DecoderDoctorDiagnostics* aDiagnostics) const
|
2015-10-06 01:08:03 +03:00
|
|
|
{
|
2016-04-19 10:36:20 +03:00
|
|
|
if (aDiagnostics) {
|
|
|
|
// If libraries failed to load, the following loop over mCurrentPDMs
|
|
|
|
// will not even try to use them. So we record failures now.
|
2016-04-22 06:42:11 +03:00
|
|
|
if (mWMFFailedToLoad) {
|
|
|
|
aDiagnostics->SetWMFFailedToLoad();
|
|
|
|
}
|
2016-04-19 10:36:20 +03:00
|
|
|
if (mFFmpegFailedToLoad) {
|
|
|
|
aDiagnostics->SetFFmpegFailedToLoad();
|
|
|
|
}
|
2016-04-22 06:42:11 +03:00
|
|
|
if (mGMPPDMFailedToStartup) {
|
|
|
|
aDiagnostics->SetGMPPDMFailedToStartup();
|
|
|
|
}
|
2016-04-19 10:36:20 +03:00
|
|
|
}
|
|
|
|
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<PlatformDecoderModule> pdm;
|
2015-10-06 01:08:03 +03:00
|
|
|
for (auto& current : mCurrentPDMs) {
|
2016-04-19 10:36:19 +03:00
|
|
|
if (current->SupportsMimeType(aMimeType, aDiagnostics)) {
|
2015-10-06 01:08:03 +03:00
|
|
|
pdm = current;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return pdm.forget();
|
2015-10-05 13:08:56 +03:00
|
|
|
}
|
|
|
|
|
2015-10-06 11:56:29 +03:00
|
|
|
#ifdef MOZ_EME
|
|
|
|
void
|
|
|
|
PDMFactory::SetCDMProxy(CDMProxy* aProxy)
|
|
|
|
{
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<PDMFactory> m = new PDMFactory();
|
2016-05-10 01:28:38 +03:00
|
|
|
mEMEPDM = new EMEDecoderModule(aProxy, m);
|
2015-10-06 11:56:29 +03:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2015-10-05 13:08:56 +03:00
|
|
|
} // namespace mozilla
|