зеркало из https://github.com/mozilla/gecko-dev.git
Bug 848994 - p2. Detect when WMF is not found - r=cpearce
MozReview-Commit-ID: IHvgJNjuyQA
This commit is contained in:
Родитель
0451e54ac6
Коммит
6494d247f8
|
@ -446,6 +446,9 @@ DecoderDoctorDiagnostics::GetDescription() const
|
|||
s = "format='";
|
||||
s += NS_ConvertUTF16toUTF8(mFormat).get();
|
||||
s += mCanPlay ? "', can play" : "', cannot play";
|
||||
if (mWMFFailedToLoad) {
|
||||
s += ", Windows platform decoder failed to load";
|
||||
}
|
||||
if (mFFmpegFailedToLoad) {
|
||||
s += ", Linux platform decoder failed to load";
|
||||
}
|
||||
|
|
|
@ -48,6 +48,9 @@ public:
|
|||
const nsAString& Format() const { return mFormat; }
|
||||
bool CanPlay() const { return mCanPlay; }
|
||||
|
||||
void SetWMFFailedToLoad() { mWMFFailedToLoad = true; }
|
||||
bool DidWMFFailToLoad() const { return mWMFFailedToLoad; }
|
||||
|
||||
void SetFFmpegFailedToLoad() { mFFmpegFailedToLoad = true; }
|
||||
bool DidFFmpegFailToLoad() const { return mFFmpegFailedToLoad; }
|
||||
|
||||
|
@ -56,6 +59,7 @@ private:
|
|||
// True if there is at least one decoder that can play that format.
|
||||
bool mCanPlay = false;
|
||||
|
||||
bool mWMFFailedToLoad = false;
|
||||
bool mFFmpegFailedToLoad = false;
|
||||
};
|
||||
|
||||
|
|
|
@ -165,6 +165,9 @@ PDMFactory::CreateDecoder(const TrackInfo& aConfig,
|
|||
if (aDiagnostics) {
|
||||
// If libraries failed to load, the following loop over mCurrentPDMs
|
||||
// will not even try to use them. So we record failures now.
|
||||
if (mWMFFailedToLoad) {
|
||||
aDiagnostics->SetWMFFailedToLoad();
|
||||
}
|
||||
if (mFFmpegFailedToLoad) {
|
||||
aDiagnostics->SetFFmpegFailedToLoad();
|
||||
}
|
||||
|
@ -290,7 +293,9 @@ PDMFactory::CreatePDMs()
|
|||
#ifdef XP_WIN
|
||||
if (sWMFDecoderEnabled) {
|
||||
m = new WMFDecoderModule();
|
||||
StartupPDM(m);
|
||||
if (!StartupPDM(m)) {
|
||||
mWMFFailedToLoad = true;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#ifdef MOZ_FFVPX
|
||||
|
@ -350,6 +355,9 @@ PDMFactory::GetDecoder(const nsACString& aMimeType,
|
|||
if (aDiagnostics) {
|
||||
// If libraries failed to load, the following loop over mCurrentPDMs
|
||||
// will not even try to use them. So we record failures now.
|
||||
if (mWMFFailedToLoad) {
|
||||
aDiagnostics->SetWMFFailedToLoad();
|
||||
}
|
||||
if (mFFmpegFailedToLoad) {
|
||||
aDiagnostics->SetFFmpegFailedToLoad();
|
||||
}
|
||||
|
|
|
@ -95,6 +95,7 @@ private:
|
|||
nsTArray<RefPtr<PlatformDecoderModule>> mCurrentPDMs;
|
||||
RefPtr<PlatformDecoderModule> mEMEPDM;
|
||||
|
||||
bool mWMFFailedToLoad = false;
|
||||
bool mFFmpegFailedToLoad = false;
|
||||
};
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче