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

This reverts commit 9e7d1492e6.
This commit is contained in:
roytam1 2023-09-18 21:32:06 +08:00
commit 119feb053c
54 changed files with 30 additions and 314 deletions

View file

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

View file

@ -70,9 +70,7 @@ private:
bool mWMFFailedToLoad = false;
bool mFFmpegFailedToLoad = false;
#ifdef MOZ_GMP
bool mGMPPDMFailedToStartup = false;
#endif
void EnsureInit() const;
template<class T> friend class StaticAutoPtr;

View file

@ -16,9 +16,7 @@
#include "mozilla/layers/KnowsCompositor.h"
#include "nsTArray.h"
#include "mozilla/RefPtr.h"
#ifdef MOZ_GMP
#include "GMPService.h"
#endif
#include <queue>
#include "MediaResult.h"
@ -40,9 +38,7 @@ class RemoteDecoderModule;
class MediaDataDecoder;
class MediaDataDecoderCallback;
class TaskQueue;
#ifdef MOZ_EME
class CDMProxy;
#endif
static LazyLogModule sPDMLog("PlatformDecoderModule");
@ -85,9 +81,7 @@ struct MOZ_STACK_CLASS CreateDecoderParams final {
layers::ImageContainer* mImageContainer = nullptr;
MediaResult* mError = nullptr;
RefPtr<layers::KnowsCompositor> mKnowsCompositor;
#ifdef MOZ_GMP
RefPtr<GMPCrashHelper> mCrashHelper;
#endif
bool mUseBlankDecoder = false;
private:
@ -96,9 +90,7 @@ private:
void Set(DecoderDoctorDiagnostics* aDiagnostics) { mDiagnostics = aDiagnostics; }
void Set(layers::ImageContainer* aImageContainer) { mImageContainer = aImageContainer; }
void Set(MediaResult* aError) { mError = aError; }
#ifdef MOZ_GMP
void Set(GMPCrashHelper* aCrashHelper) { mCrashHelper = aCrashHelper; }
#endif
void Set(bool aUseBlankDecoder) { mUseBlankDecoder = aUseBlankDecoder; }
void Set(layers::KnowsCompositor* aKnowsCompositor) { mKnowsCompositor = aKnowsCompositor; }
template <typename T1, typename T2, typename... Ts>

View file

@ -29,15 +29,13 @@ UNIFIED_SOURCES += [
]
DIRS += [
'agnostic/gmp',
'omx'
]
if CONFIG['MOZ_EME']:
DIRS += ['agnostic/eme']
if CONFIG['MOZ_GMP']:
DIRS += ['agnostic/gmp']
if CONFIG['MOZ_WMF']:
DIRS += [ 'wmf' ];

View file

@ -25,9 +25,7 @@
#include "IMFYCbCrImage.h"
#include "mozilla/WindowsVersion.h"
#include "nsPrintfCString.h"
#ifdef MOZ_GMP
#include "GMPUtils.h" // For SplitAt. TODO: Move SplitAt to a central place.
#endif
#include "MP4Decoder.h"
#include "VPXDecoder.h"
#include "mozilla/SyncRunnable.h"
@ -68,23 +66,6 @@ const CLSID CLSID_WebmMfVpxDec =
namespace mozilla {
#ifndef MOZ_GMP
// Utility function only used when not building GMP
// XXXMC: Perhaps make this available globally?
void
SplitAt(const char* aDelims,
const nsACString& aInput,
nsTArray<nsCString>& aOutTokens)
{
nsAutoCString str(aInput);
char* end = str.BeginWriting();
const char* start = nullptr;
while (!!(start = NS_strtok(aDelims, &end))) {
aOutTokens.AppendElement(nsCString(start));
}
}
#endif
LayersBackend
GetCompositorBackendType(layers::KnowsCompositor* aKnowsCompositor)
{

View file

@ -25,9 +25,7 @@ H264Converter::H264Converter(PlatformDecoderModule* aPDM,
, mTaskQueue(aParams.mTaskQueue)
, mCallback(aParams.mCallback)
, mDecoder(nullptr)
#ifdef MOZ_GMP
, mGMPCrashHelper(aParams.mCrashHelper)
#endif
, mNeedAVCC(aPDM->DecoderNeedsConversion(aParams.mConfig)
== PlatformDecoderModule::ConversionRequired::kNeedAVCC)
, mLastError(NS_OK)
@ -203,12 +201,8 @@ H264Converter::CreateDecoder(DecoderDoctorDiagnostics* aDiagnostics)
mCallback,
aDiagnostics,
mImageContainer,
#ifdef MOZ_GMP
mKnowsCompositor,
mGMPCrashHelper
#else
mKnowsCompositor
#endif
});
if (!mDecoder) {

View file

@ -62,9 +62,7 @@ private:
MediaDataDecoderCallback* mCallback;
RefPtr<MediaDataDecoder> mDecoder;
MozPromiseRequestHolder<InitPromise> mInitPromiseRequest;
#ifdef MOZ_GMP
RefPtr<GMPCrashHelper> mGMPCrashHelper;
#endif
bool mNeedAVCC;
nsresult mLastError;
bool mNeedKeyframe = true;