/* static */ PlatformDecoderModule* PlatformDecoderModule::Create() { if (sUseBlankDecoder) { return CreateBlankDecoderModule(); } #ifdef XP_WIN nsAutoPtr<WMFDecoderModule> m(new WMFDecoderModule()); if (NS_SUCCEEDED(m->Startup())) { return m.forget(); } #endif #ifdef MOZ_FFMPEG if (sFFmpegDecoderEnabled) { return FFmpegRuntimeLinker::CreateDecoderModule(); } #endif #ifdef MOZ_APPLEMEDIA nsAutoPtr<AppleDecoderModule> m(new AppleDecoderModule()); if (NS_SUCCEEDED(m->Startup())) { return m.forget(); } #endif return nullptr; }
void PDMFactory::CreatePDMs() { RefPtr<PlatformDecoderModule> m; if (MediaPrefs::PDMUseBlankDecoder()) { 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; } #ifdef XP_WIN if (MediaPrefs::PDMWMFEnabled()) { m = new WMFDecoderModule(); RefPtr<PlatformDecoderModule> remote = new dom::RemoteDecoderModule(m); StartupPDM(remote); mWMFFailedToLoad = !StartupPDM(m); } else { mWMFFailedToLoad = MediaPrefs::DecoderDoctorWMFDisabledIsFailure(); } #endif #ifdef MOZ_FFVPX if (MediaPrefs::PDMFFVPXEnabled()) { m = FFVPXRuntimeLinker::CreateDecoderModule(); StartupPDM(m); } #endif #ifdef MOZ_FFMPEG if (MediaPrefs::PDMFFmpegEnabled()) { m = FFmpegRuntimeLinker::CreateDecoderModule(); mFFmpegFailedToLoad = !StartupPDM(m); } else { mFFmpegFailedToLoad = false; } #endif #ifdef MOZ_APPLEMEDIA m = new AppleDecoderModule(); StartupPDM(m); #endif #ifdef MOZ_WIDGET_ANDROID if(MediaPrefs::PDMAndroidMediaCodecEnabled()){ m = new AndroidDecoderModule(); StartupPDM(m, MediaPrefs::PDMAndroidMediaCodecPreferred()); } #endif m = new AgnosticDecoderModule(); StartupPDM(m); if (MediaPrefs::PDMGMPEnabled()) { m = new GMPDecoderModule(); mGMPPDMFailedToStartup = !StartupPDM(m); } else { mGMPPDMFailedToStartup = false; } }
void PDMFactory::CreatePDMs() { nsRefPtr<PlatformDecoderModule> m; if (sGMPDecoderEnabled) { m = new GMPDecoderModule(); StartupPDM(m); } #ifdef MOZ_WIDGET_ANDROID if(sAndroidMCDecoderPreferred && sAndroidMCDecoderEnabled) { m = new AndroidDecoderModule(); StartupPDM(m); } #endif #ifdef XP_WIN if (sWMFDecoderEnabled) { m = new WMFDecoderModule(); StartupPDM(m); } #endif #ifdef MOZ_FFMPEG if (sFFmpegDecoderEnabled) { m = FFmpegRuntimeLinker::CreateDecoderModule(); StartupPDM(m); } #endif #ifdef MOZ_APPLEMEDIA m = new AppleDecoderModule(); StartupPDM(m); #endif #ifdef MOZ_GONK_MEDIACODEC if (sGonkDecoderEnabled) { m = new GonkDecoderModule(); StartupPDM(m); } #endif #ifdef MOZ_WIDGET_ANDROID if(sAndroidMCDecoderEnabled){ m = new AndroidDecoderModule(); StartupPDM(m); } #endif m = new AgnosticDecoderModule(); StartupPDM(m); if (sUseBlankDecoder) { m = CreateBlankDecoderModule(); StartupPDM(m); } }
/* static */ PlatformDecoderModule* PlatformDecoderModule::Create() { if (Preferences::GetBool("media.fragmented-mp4.use-blank-decoder")) { return CreateBlankDecoderModule(); } #ifdef XP_WIN nsAutoPtr<WMFDecoderModule> m(new WMFDecoderModule()); if (NS_SUCCEEDED(m->Init())) { return m.forget(); } #endif return nullptr; }
/* static */ already_AddRefed<PlatformDecoderModule> PlatformDecoderModule::CreatePDM() { #ifdef MOZ_WIDGET_ANDROID if(sAndroidMCDecoderPreferred && sAndroidMCDecoderEnabled){ nsRefPtr<PlatformDecoderModule> m(new AndroidDecoderModule()); return m.forget(); } #endif if (sUseBlankDecoder) { return CreateBlankDecoderModule(); } #ifdef XP_WIN nsRefPtr<PlatformDecoderModule> m(new WMFDecoderModule()); return m.forget(); #endif #ifdef MOZ_FFMPEG if (sFFmpegDecoderEnabled) { nsRefPtr<PlatformDecoderModule> m = FFmpegRuntimeLinker::CreateDecoderModule(); if (m) { nsRefPtr<PlatformDecoderModule> m2(new AVCCDecoderModule(m)); return m2.forget(); } } #endif #ifdef MOZ_APPLEMEDIA nsRefPtr<PlatformDecoderModule> m(new AVCCDecoderModule(new AppleDecoderModule())); return m.forget(); #endif #ifdef MOZ_GONK_MEDIACODEC if (sGonkDecoderEnabled) { nsRefPtr<PlatformDecoderModule> m(new GonkDecoderModule()); return m.forget(); } #endif #ifdef MOZ_WIDGET_ANDROID if(sAndroidMCDecoderEnabled){ nsRefPtr<PlatformDecoderModule> m(new AndroidDecoderModule()); return m.forget(); } #endif if (sGMPDecoderEnabled) { nsRefPtr<PlatformDecoderModule> m(new AVCCDecoderModule(new GMPDecoderModule())); return m.forget(); } return nullptr; }
/* static */ PlatformDecoderModule* PlatformDecoderModule::Create() { // Note: This runs on the decode thread. MOZ_ASSERT(!NS_IsMainThread()); #ifdef MOZ_WIDGET_ANDROID if(sAndroidMCDecoderPreferred && sAndroidMCDecoderEnabled){ return new AndroidDecoderModule(); } #endif if (sUseBlankDecoder) { return CreateBlankDecoderModule(); } #ifdef XP_WIN nsAutoPtr<WMFDecoderModule> m(new WMFDecoderModule()); if (NS_SUCCEEDED(m->Startup())) { return m.forget(); } #endif #ifdef MOZ_FFMPEG if (sFFmpegDecoderEnabled) { nsAutoPtr<PlatformDecoderModule> m(FFmpegRuntimeLinker::CreateDecoderModule()); if (m) { return m.forget(); } } #endif #ifdef MOZ_APPLEMEDIA nsAutoPtr<AppleDecoderModule> m(new AppleDecoderModule()); if (NS_SUCCEEDED(m->Startup())) { return m.forget(); } #endif #ifdef MOZ_GONK_MEDIACODEC if (sGonkDecoderEnabled) { return new GonkDecoderModule(); } #endif #ifdef MOZ_WIDGET_ANDROID if(sAndroidMCDecoderEnabled){ return new AndroidDecoderModule(); } #endif return nullptr; }
void PDMFactory::CreatePDMs() { RefPtr<PlatformDecoderModule> m; 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; } #ifdef MOZ_WIDGET_ANDROID if(sAndroidMCDecoderPreferred && sAndroidMCDecoderEnabled) { m = new AndroidDecoderModule(); StartupPDM(m); } #endif #ifdef XP_WIN if (sWMFDecoderEnabled) { m = new WMFDecoderModule(); StartupPDM(m); } #endif #ifdef MOZ_FFVPX if (sFFVPXDecoderEnabled) { m = FFVPXRuntimeLinker::CreateDecoderModule(); StartupPDM(m); } #endif #ifdef MOZ_FFMPEG if (sFFmpegDecoderEnabled) { m = FFmpegRuntimeLinker::CreateDecoderModule(); StartupPDM(m); } #endif #ifdef MOZ_APPLEMEDIA m = new AppleDecoderModule(); StartupPDM(m); #endif #ifdef MOZ_GONK_MEDIACODEC if (sGonkDecoderEnabled) { m = new GonkDecoderModule(); StartupPDM(m); } #endif #ifdef MOZ_WIDGET_ANDROID if(sAndroidMCDecoderEnabled){ m = new AndroidDecoderModule(); StartupPDM(m); } #endif m = new AgnosticDecoderModule(); StartupPDM(m); if (sGMPDecoderEnabled) { m = new GMPDecoderModule(); StartupPDM(m); } }
void PDMFactory::CreateBlankPDM() { mBlankPDM = CreateBlankDecoderModule(); MOZ_ASSERT(mBlankPDM && NS_SUCCEEDED(mBlankPDM->Startup())); }