Issue #2301 - Make Gecko Media Plugins optional when not building EME or WebRTC

Co-authored-by: Moonchild <moonchild@palemoon.org>
This commit is contained in:
Matheus Marinho 2023-08-31 12:07:34 -03:00 committed by roytam1
commit 9e7d1492e6
54 changed files with 314 additions and 30 deletions

View file

@ -18,7 +18,9 @@
#ifdef MOZ_APPLEMEDIA
#include "AppleDecoderModule.h"
#endif
#ifdef MOZ_GMP
#include "GMPDecoderModule.h"
#endif
#include "mozilla/ClearOnShutdown.h"
#include "mozilla/SharedThreadPool.h"
@ -224,9 +226,11 @@ PDMFactory::CreateDecoder(const CreateDecoderParams& aParams)
if (mFFmpegFailedToLoad) {
diagnostics->SetFFmpegFailedToLoad();
}
#ifdef MOZ_GMP
if (mGMPPDMFailedToStartup) {
diagnostics->SetGMPPDMFailedToStartup();
}
#endif
}
for (auto& current : mCurrentPDMs) {
@ -396,12 +400,14 @@ PDMFactory::CreatePDMs()
m = new AgnosticDecoderModule();
StartupPDM(m);
#ifdef MOZ_GMP
if (MediaPrefs::PDMGMPEnabled()) {
m = new GMPDecoderModule();
mGMPPDMFailedToStartup = !StartupPDM(m);
} else {
mGMPPDMFailedToStartup = false;
}
#endif
}
void
@ -434,9 +440,11 @@ PDMFactory::GetDecoder(const TrackInfo& aTrackInfo,
if (mFFmpegFailedToLoad) {
aDiagnostics->SetFFmpegFailedToLoad();
}
#ifdef MOZ_GMP
if (mGMPPDMFailedToStartup) {
aDiagnostics->SetGMPPDMFailedToStartup();
}
#endif
}
RefPtr<PlatformDecoderModule> pdm;