Bug 1240630: [ffvpx] P2. Hook up FFVPX PDM to PDMFactory. r=kentuckyfriedtakahe

Add new preference media.ffvpx.enabled to control FFVPX PDM being enabled.
This commit is contained in:
Jean-Yves Avenard 2016-01-19 17:31:25 +11:00
parent 583e06278a
commit 5e509628ae
3 changed files with 26 additions and 0 deletions

View File

@ -9,6 +9,9 @@
#ifdef XP_WIN
#include "WMFDecoderModule.h"
#endif
#ifdef MOZ_FFVPX
#include "FFVPXRuntimeLinker.h"
#endif
#ifdef MOZ_FFMPEG
#include "FFmpegRuntimeLinker.h"
#endif
@ -53,6 +56,10 @@ bool PDMFactory::sAndroidMCDecoderEnabled = false;
bool PDMFactory::sAndroidMCDecoderPreferred = false;
#endif
bool PDMFactory::sGMPDecoderEnabled = false;
#ifdef MOZ_FFVPX
bool PDMFactory::sFFVPXDecoderEnabled = false;
using namespace ffvpx;
#endif
#ifdef MOZ_FFMPEG
bool PDMFactory::sFFmpegDecoderEnabled = false;
#endif
@ -94,6 +101,10 @@ PDMFactory::Init()
Preferences::AddBoolVarCache(&sFFmpegDecoderEnabled,
"media.ffmpeg.enabled", false);
#endif
#ifdef MOZ_FFVPX
Preferences::AddBoolVarCache(&sFFVPXDecoderEnabled,
"media.ffvpx.enabled", false);
#endif
#ifdef XP_WIN
Preferences::AddBoolVarCache(&sWMFDecoderEnabled,
"media.wmf.enabled", false);
@ -112,6 +123,9 @@ PDMFactory::Init()
#ifdef MOZ_APPLEMEDIA
AppleDecoderModule::Init();
#endif
#ifdef MOZ_FFVPX
FFVPXRuntimeLinker::Link();
#endif
#ifdef MOZ_FFMPEG
FFmpegRuntimeLinker::Link();
#endif
@ -262,6 +276,12 @@ PDMFactory::CreatePDMs()
StartupPDM(m);
}
#endif
#ifdef MOZ_FFVPX
if (sFFVPXDecoderEnabled) {
m = FFVPXRuntimeLinker::CreateDecoderModule();
StartupPDM(m);
}
#endif
#ifdef MOZ_FFMPEG
if (sFFmpegDecoderEnabled) {
m = FFmpegRuntimeLinker::CreateDecoderModule();

View File

@ -73,6 +73,9 @@ private:
static bool sAndroidMCDecoderEnabled;
#endif
static bool sGMPDecoderEnabled;
#ifdef MOZ_FFVPX
static bool sFFVPXDecoderEnabled;
#endif
#ifdef MOZ_FFMPEG
static bool sFFmpegDecoderEnabled;
#endif

View File

@ -329,6 +329,9 @@ pref("media.wmf.skip-blacklist", false);
#if defined(MOZ_FFMPEG)
pref("media.ffmpeg.enabled", true);
#endif
#if defined(MOZ_FFVPX)
pref("media.ffvpx.enabled", true);
#endif
pref("media.gmp.decoder.enabled", false);
pref("media.gmp.decoder.aac", 0);
pref("media.gmp.decoder.h264", 0);