mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-21 01:05:45 +00:00
Bug 1274626 - Part 4 - provide APIs to create blank decoders; r=jya
MozReview-Commit-ID: LiXOAzvVb1K --HG-- extra : transplant_source : %F8%29%C0%9C/%A7%17-%E1%04r%A2%FD%00%93e%21Z%29%A4
This commit is contained in:
parent
d22560cfe6
commit
59a499df96
@ -79,6 +79,7 @@ PDMFactory::PDMFactory()
|
||||
{
|
||||
EnsureInit();
|
||||
CreatePDMs();
|
||||
CreateBlankPDM();
|
||||
}
|
||||
|
||||
PDMFactory::~PDMFactory()
|
||||
@ -118,6 +119,11 @@ PDMFactory::EnsureInit() const
|
||||
already_AddRefed<MediaDataDecoder>
|
||||
PDMFactory::CreateDecoder(const CreateDecoderParams& aParams)
|
||||
{
|
||||
if (aParams.mUseBlankDecoder) {
|
||||
MOZ_ASSERT(mBlankPDM);
|
||||
return CreateDecoderWithPDM(mBlankPDM, aParams);
|
||||
}
|
||||
|
||||
const TrackInfo& config = aParams.mConfig;
|
||||
bool isEncrypted = mEMEPDM && config.mCrypto.mValid;
|
||||
|
||||
@ -285,6 +291,13 @@ PDMFactory::CreatePDMs()
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
PDMFactory::CreateBlankPDM()
|
||||
{
|
||||
mBlankPDM = CreateBlankDecoderModule();
|
||||
MOZ_ASSERT(mBlankPDM && NS_SUCCEEDED(mBlankPDM->Startup()));
|
||||
}
|
||||
|
||||
bool
|
||||
PDMFactory::StartupPDM(PlatformDecoderModule* aPDM)
|
||||
{
|
||||
|
@ -47,6 +47,7 @@ public:
|
||||
private:
|
||||
virtual ~PDMFactory();
|
||||
void CreatePDMs();
|
||||
void CreateBlankPDM();
|
||||
// Startup the provided PDM and add it to our list if successful.
|
||||
bool StartupPDM(PlatformDecoderModule* aPDM);
|
||||
// Returns the first PDM in our list supporting the mimetype.
|
||||
@ -60,6 +61,7 @@ private:
|
||||
|
||||
nsTArray<RefPtr<PlatformDecoderModule>> mCurrentPDMs;
|
||||
RefPtr<PlatformDecoderModule> mEMEPDM;
|
||||
RefPtr<PlatformDecoderModule> mBlankPDM;
|
||||
|
||||
bool mWMFFailedToLoad = false;
|
||||
bool mFFmpegFailedToLoad = false;
|
||||
|
@ -64,6 +64,7 @@ struct CreateDecoderParams {
|
||||
layers::ImageContainer* mImageContainer = nullptr;
|
||||
layers::LayersBackend mLayersBackend = layers::LayersBackend::LAYERS_NONE;
|
||||
RefPtr<GMPCrashHelper> mCrashHelper;
|
||||
bool mUseBlankDecoder = false;
|
||||
|
||||
private:
|
||||
void Set(TaskQueue* aTaskQueue) { mTaskQueue = aTaskQueue; }
|
||||
@ -72,6 +73,7 @@ private:
|
||||
void Set(layers::ImageContainer* aImageContainer) { mImageContainer = aImageContainer; }
|
||||
void Set(layers::LayersBackend aLayersBackend) { mLayersBackend = aLayersBackend; }
|
||||
void Set(GMPCrashHelper* aCrashHelper) { mCrashHelper = aCrashHelper; }
|
||||
void Set(bool aUseBlankDecoder) { mUseBlankDecoder = aUseBlankDecoder; }
|
||||
template <typename T1, typename T2, typename... Ts>
|
||||
void Set(T1&& a1, T2&& a2, Ts&&... args)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user