mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 13:21:05 +00:00
Backed out 13 changesets (bug 1247056) for WinXP bc7 failures in browser_decoderDoctor.js CLOSED TREE
Backed out changeset ff3538fd40fe (bug 1247056) Backed out changeset a444d7cb1091 (bug 1247056) Backed out changeset 03553484a062 (bug 1247056) Backed out changeset 001b42631702 (bug 1247056) Backed out changeset d0d71a80a029 (bug 1247056) Backed out changeset cd40559e25d7 (bug 1247056) Backed out changeset b8857adc4003 (bug 1247056) Backed out changeset 1f3b037bfd1f (bug 1247056) Backed out changeset c5cd9597ec02 (bug 1247056) Backed out changeset 2bfe3aeb9f59 (bug 1247056) Backed out changeset 934d7c9628f1 (bug 1247056) Backed out changeset 63094a80bee7 (bug 1247056) Backed out changeset 511ed53eee9a (bug 1247056)
This commit is contained in:
parent
c5cac1582b
commit
b20dd04b94
@ -201,6 +201,10 @@ const TELEMETRY_DDSTAT_CLICKED_FIRST = 3;
|
||||
const TELEMETRY_DDSTAT_SOLVED = 4;
|
||||
|
||||
let gDecoderDoctorHandler = {
|
||||
shouldShowLearnMoreButton() {
|
||||
return AppConstants.platform == "win";
|
||||
},
|
||||
|
||||
getLabelForNotificationBox(type) {
|
||||
if (type == "adobe-cdm-not-found" &&
|
||||
AppConstants.platform == "win") {
|
||||
@ -231,23 +235,6 @@ let gDecoderDoctorHandler = {
|
||||
return gNavigatorBundle.getString("decoder.noCodecsLinux.message");
|
||||
}
|
||||
}
|
||||
if (type == "cannot-initialize-pulseaudio") {
|
||||
return gNavigatorBundle.getString("decoder.noPulseAudio.message");
|
||||
}
|
||||
return "";
|
||||
},
|
||||
|
||||
getSumoForLearnHowButton(type) {
|
||||
if (AppConstants.isPlatformAndVersionAtLeast("win", "6")) {
|
||||
if (type == "adobe-cdm-not-found" ||
|
||||
type == "adobe-cdm-not-activated" ||
|
||||
type == "platform-decoder-not-found") {
|
||||
return "fix-video-audio-problems-firefox-windows";
|
||||
}
|
||||
}
|
||||
if (type == "cannot-initialize-pulseaudio") {
|
||||
return "fix-common-audio-and-video-issues";
|
||||
}
|
||||
return "";
|
||||
},
|
||||
|
||||
@ -319,8 +306,7 @@ let gDecoderDoctorHandler = {
|
||||
histogram.add(decoderDoctorReportId, TELEMETRY_DDSTAT_SHOWN);
|
||||
|
||||
let buttons = [];
|
||||
let sumo = gDecoderDoctorHandler.getSumoForLearnHowButton(type);
|
||||
if (sumo) {
|
||||
if (gDecoderDoctorHandler.shouldShowLearnMoreButton()) {
|
||||
buttons.push({
|
||||
label: gNavigatorBundle.getString("decoder.noCodecs.button"),
|
||||
accessKey: gNavigatorBundle.getString("decoder.noCodecs.accesskey"),
|
||||
@ -334,7 +320,7 @@ let gDecoderDoctorHandler = {
|
||||
histogram.add(decoderDoctorReportId, TELEMETRY_DDSTAT_CLICKED);
|
||||
|
||||
let baseURL = Services.urlFormatter.formatURLPref("app.support.baseURL");
|
||||
openUILinkIn(baseURL + sumo, "tab");
|
||||
openUILinkIn(baseURL + "fix-video-audio-problems-firefox-windows", "tab");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -37,8 +37,7 @@ function* test_decoder_doctor_notification(type, notificationMessage, options) {
|
||||
"notification button should have accesskey");
|
||||
|
||||
let baseURL = Services.urlFormatter.formatURLPref("app.support.baseURL");
|
||||
let url = baseURL + ((options && options.sumo) ||
|
||||
"fix-video-audio-problems-firefox-windows");
|
||||
let url = baseURL + "fix-video-audio-problems-firefox-windows";
|
||||
let awaitNewTab = BrowserTestUtils.waitForNewTab(gBrowser, url);
|
||||
button.click();
|
||||
let sumoTab = yield awaitNewTab;
|
||||
@ -96,15 +95,3 @@ add_task(function* test_platform_decoder_not_found() {
|
||||
message,
|
||||
{noLearnMoreButton: isLinux});
|
||||
});
|
||||
|
||||
add_task(function* test_cannot_initialize_pulseaudio() {
|
||||
// This is only sent on Linux.
|
||||
if (AppConstants.platform != "linux") {
|
||||
return;
|
||||
}
|
||||
|
||||
let message = gNavigatorBundle.getString("decoder.noPulseAudio.message");
|
||||
yield test_decoder_doctor_notification("cannot-initialize-pulseaudio",
|
||||
message,
|
||||
{sumo: "fix-common-audio-and-video-issues"});
|
||||
});
|
||||
|
@ -734,7 +734,6 @@ decoder.noCodecsXP.message = To play video, you may need to enable Adobe’s Pri
|
||||
decoder.noCodecsLinux.message = To play video, you may need to install the required video codecs.
|
||||
decoder.noHWAcceleration.message = To improve video quality, you may need to install Microsoft’s Media Feature Pack.
|
||||
decoder.noHWAccelerationVista.message = To improve video quality, you may need to install Microsoft’s Platform Update Supplement for Windows Vista.
|
||||
decoder.noPulseAudio.message = To play audio, you may need to install the required PulseAudio software.
|
||||
|
||||
permissions.remove.tooltip = Clear this permission and ask again
|
||||
|
||||
|
@ -134,7 +134,6 @@ MediaPlatformDecoderNotFound=The video on this page can’t be played. Your syst
|
||||
MediaCannotPlayNoDecoders=Cannot play media. No decoders for requested formats: %S
|
||||
# LOCALIZATION NOTE: %S is a comma-separated list of codecs (e.g. 'video/mp4, video/webm')
|
||||
MediaNoDecoders=No decoders for some of the requested formats: %S
|
||||
MediaCannotInitializePulseAudio=Unable to use PulseAudio
|
||||
# LOCALIZATION NOTE: Do not translate "MediaRecorder".
|
||||
MediaRecorderMultiTracksNotSupported=MediaRecorder does not support recording multiple tracks of the same type at this time.
|
||||
# LOCALIZATION NOTE: %S is the ID of the MediaStreamTrack passed to MediaStream.addTrack(). Do not translate "MediaStreamTrack" and "AudioChannel".
|
||||
|
@ -351,7 +351,7 @@ AudioStream::Init(uint32_t aNumChannels, uint32_t aRate,
|
||||
if (!cubebContext) {
|
||||
NS_WARNING("Can't get cubeb context!");
|
||||
CubebUtils::ReportCubebStreamInitFailure(true);
|
||||
return NS_ERROR_DOM_MEDIA_CUBEB_INITIALIZATION_ERR;
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
return OpenCubeb(cubebContext, params, startTime, CubebUtils::GetFirstStream());
|
||||
|
@ -17,7 +17,6 @@
|
||||
#include "nsITimer.h"
|
||||
#include "nsIWeakReference.h"
|
||||
#include "nsPluginHost.h"
|
||||
#include "nsPrintfCString.h"
|
||||
#include "VideoUtils.h"
|
||||
|
||||
#if defined(XP_WIN)
|
||||
@ -81,6 +80,10 @@ private:
|
||||
static const uint32_t sAnalysisPeriod_ms = 1000;
|
||||
void EnsureTimerIsStarted();
|
||||
|
||||
void ReportAnalysis(const NotificationAndReportStringId& aNotification,
|
||||
bool aIsSolved,
|
||||
const nsAString& aFormats);
|
||||
|
||||
void SynthesizeAnalysis();
|
||||
|
||||
// Raw pointer to an nsIDocument.
|
||||
@ -264,9 +267,6 @@ static const NotificationAndReportStringId sMediaCannotPlayNoDecoders =
|
||||
static const NotificationAndReportStringId sMediaNoDecoders =
|
||||
{ dom::DecoderDoctorNotificationType::Can_play_but_some_missing_decoders,
|
||||
"MediaNoDecoders" };
|
||||
static const NotificationAndReportStringId sCannotInitializePulseAudio =
|
||||
{ dom::DecoderDoctorNotificationType::Cannot_initialize_pulseaudio,
|
||||
"MediaCannotInitializePulseAudio" };
|
||||
|
||||
static const NotificationAndReportStringId*
|
||||
sAllNotificationsAndReportStringIds[] =
|
||||
@ -276,8 +276,7 @@ sAllNotificationsAndReportStringIds[] =
|
||||
&sMediaUnsupportedBeforeWindowsVista,
|
||||
&sMediaPlatformDecoderNotFound,
|
||||
&sMediaCannotPlayNoDecoders,
|
||||
&sMediaNoDecoders,
|
||||
&sCannotInitializePulseAudio
|
||||
&sMediaNoDecoders
|
||||
};
|
||||
|
||||
static void
|
||||
@ -312,43 +311,32 @@ DispatchNotification(nsISupports* aSubject,
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
ReportToConsole(nsIDocument* aDocument,
|
||||
const char* aConsoleStringId,
|
||||
const nsAString& aParams)
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
MOZ_ASSERT(aDocument);
|
||||
|
||||
// 'params' will only be forwarded for non-empty strings.
|
||||
const char16_t* params[1] = { aParams.Data() };
|
||||
DD_DEBUG("DecoderDoctorDiagnostics.cpp:ReportToConsole(doc=%p) ReportToConsole - aMsg='%s' params[0]='%s'",
|
||||
aDocument, aConsoleStringId,
|
||||
aParams.IsEmpty() ? "<no params>" : NS_ConvertUTF16toUTF8(params[0]).get());
|
||||
nsContentUtils::ReportToConsole(nsIScriptError::warningFlag,
|
||||
NS_LITERAL_CSTRING("Media"),
|
||||
aDocument,
|
||||
nsContentUtils::eDOM_PROPERTIES,
|
||||
aConsoleStringId,
|
||||
aParams.IsEmpty() ? nullptr : params,
|
||||
aParams.IsEmpty() ? 0 : 1);
|
||||
}
|
||||
|
||||
static void
|
||||
ReportAnalysis(nsIDocument* aDocument,
|
||||
const NotificationAndReportStringId& aNotification,
|
||||
bool aIsSolved,
|
||||
const nsAString& aParams)
|
||||
void
|
||||
DecoderDoctorDocumentWatcher::ReportAnalysis(
|
||||
const NotificationAndReportStringId& aNotification,
|
||||
bool aIsSolved,
|
||||
const nsAString& aParams)
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
if (!aDocument) {
|
||||
if (!mDocument) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Report non-solved issues to console.
|
||||
if (!aIsSolved) {
|
||||
ReportToConsole(aDocument, aNotification.mReportStringId, aParams);
|
||||
// 'params' will only be forwarded for non-empty strings.
|
||||
const char16_t* params[1] = { aParams.Data() };
|
||||
DD_DEBUG("DecoderDoctorDocumentWatcher[%p, doc=%p]::ReportAnalysis() ReportToConsole - aMsg='%s' params[0]='%s'",
|
||||
this, mDocument, aNotification.mReportStringId,
|
||||
aParams.IsEmpty() ? "<no params>" : NS_ConvertUTF16toUTF8(params[0]).get());
|
||||
nsContentUtils::ReportToConsole(nsIScriptError::warningFlag,
|
||||
NS_LITERAL_CSTRING("Media"),
|
||||
mDocument,
|
||||
nsContentUtils::eDOM_PROPERTIES,
|
||||
aNotification.mReportStringId,
|
||||
aParams.IsEmpty() ? nullptr : params,
|
||||
aParams.IsEmpty() ? 0 : 1);
|
||||
}
|
||||
|
||||
// "media.decoder-doctor.notifications-allowed" controls which notifications
|
||||
@ -363,7 +351,7 @@ ReportAnalysis(nsIDocument* aDocument,
|
||||
if (filter.EqualsLiteral("*")
|
||||
|| StringListContains(filter, aNotification.mReportStringId)) {
|
||||
DispatchNotification(
|
||||
aDocument->GetInnerWindow(), aNotification, aIsSolved, aParams);
|
||||
mDocument->GetInnerWindow(), aNotification, aIsSolved, aParams);
|
||||
}
|
||||
}
|
||||
|
||||
@ -477,10 +465,6 @@ DecoderDoctorDocumentWatcher::SynthesizeAnalysis()
|
||||
}
|
||||
}
|
||||
break;
|
||||
case DecoderDoctorDiagnostics::eEvent:
|
||||
// Events shouldn't be stored for processing.
|
||||
MOZ_ASSERT(false);
|
||||
break;
|
||||
default:
|
||||
MOZ_ASSERT(diag.mDecoderDoctorDiagnostics.Type()
|
||||
== DecoderDoctorDiagnostics::eFormatSupportCheck
|
||||
@ -523,7 +507,7 @@ DecoderDoctorDocumentWatcher::SynthesizeAnalysis()
|
||||
NS_ConvertUTF16toUTF8(workingFormat).get(),
|
||||
formatsPref.Data(),
|
||||
NS_ConvertUTF16toUTF8(formatsWithIssues).get());
|
||||
ReportAnalysis(mDocument, *id, true, workingFormat);
|
||||
ReportAnalysis(*id, true, workingFormat);
|
||||
// This particular Notification&ReportId has been solved, no need
|
||||
// to keep looking at other keysys/formats that might solve it too.
|
||||
solved = true;
|
||||
@ -550,8 +534,8 @@ DecoderDoctorDocumentWatcher::SynthesizeAnalysis()
|
||||
if (CheckSilverlight() != eSilverlightEnabled) {
|
||||
DD_INFO("DecoderDoctorDocumentWatcher[%p, doc=%p]::SynthesizeAnalysis() - unsupported key systems: %s, widevine without WMF nor Silverlight",
|
||||
this, mDocument, NS_ConvertUTF16toUTF8(unsupportedKeySystems).get());
|
||||
ReportAnalysis(mDocument, sMediaWidevineNoWMFNoSilverlight,
|
||||
false, unsupportedKeySystems);
|
||||
ReportAnalysis(
|
||||
sMediaWidevineNoWMFNoSilverlight, false, unsupportedKeySystems);
|
||||
return;
|
||||
}
|
||||
break;
|
||||
@ -571,12 +555,11 @@ DecoderDoctorDocumentWatcher::SynthesizeAnalysis()
|
||||
if (IsVistaOrLater()) {
|
||||
DD_INFO("DecoderDoctorDocumentWatcher[%p, doc=%p]::SynthesizeAnalysis() - unplayable formats: %s -> Cannot play media because WMF was not found",
|
||||
this, mDocument, NS_ConvertUTF16toUTF8(formatsRequiringWMF).get());
|
||||
ReportAnalysis(mDocument, sMediaWMFNeeded, false, formatsRequiringWMF);
|
||||
ReportAnalysis(sMediaWMFNeeded, false, formatsRequiringWMF);
|
||||
} else {
|
||||
DD_INFO("DecoderDoctorDocumentWatcher[%p, doc=%p]::SynthesizeAnalysis() - unplayable formats: %s -> Cannot play media before Windows Vista",
|
||||
this, mDocument, NS_ConvertUTF16toUTF8(formatsRequiringWMF).get());
|
||||
ReportAnalysis(mDocument, sMediaUnsupportedBeforeWindowsVista,
|
||||
false, formatsRequiringWMF);
|
||||
ReportAnalysis(sMediaUnsupportedBeforeWindowsVista, false, formatsRequiringWMF);
|
||||
}
|
||||
return;
|
||||
}
|
||||
@ -585,22 +568,21 @@ DecoderDoctorDocumentWatcher::SynthesizeAnalysis()
|
||||
if (!formatsRequiringFFMpeg.IsEmpty()) {
|
||||
DD_INFO("DecoderDoctorDocumentWatcher[%p, doc=%p]::SynthesizeAnalysis() - unplayable formats: %s -> Cannot play media because platform decoder was not found",
|
||||
this, mDocument, NS_ConvertUTF16toUTF8(formatsRequiringFFMpeg).get());
|
||||
ReportAnalysis(mDocument, sMediaPlatformDecoderNotFound,
|
||||
ReportAnalysis(sMediaPlatformDecoderNotFound,
|
||||
false, formatsRequiringFFMpeg);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
DD_INFO("DecoderDoctorDocumentWatcher[%p, doc=%p]::SynthesizeAnalysis() - Cannot play media, unplayable formats: %s",
|
||||
this, mDocument, NS_ConvertUTF16toUTF8(unplayableFormats).get());
|
||||
ReportAnalysis(mDocument, sMediaCannotPlayNoDecoders,
|
||||
false, unplayableFormats);
|
||||
ReportAnalysis(sMediaCannotPlayNoDecoders, false, unplayableFormats);
|
||||
return;
|
||||
}
|
||||
|
||||
DD_INFO("DecoderDoctorDocumentWatcher[%p, doc=%p]::SynthesizeAnalysis() - Can play media, but no decoders for some requested formats: %s",
|
||||
this, mDocument, NS_ConvertUTF16toUTF8(unplayableFormats).get());
|
||||
if (Preferences::GetBool("media.decoder-doctor.verbose", false)) {
|
||||
ReportAnalysis(mDocument, sMediaNoDecoders, false, unplayableFormats);
|
||||
ReportAnalysis(sMediaNoDecoders, false, unplayableFormats);
|
||||
}
|
||||
return;
|
||||
}
|
||||
@ -613,7 +595,6 @@ DecoderDoctorDocumentWatcher::AddDiagnostics(DecoderDoctorDiagnostics&& aDiagnos
|
||||
const char* aCallSite)
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
MOZ_ASSERT(aDiagnostics.Type() != DecoderDoctorDiagnostics::eEvent);
|
||||
|
||||
if (!mDocument) {
|
||||
return;
|
||||
@ -621,7 +602,8 @@ DecoderDoctorDocumentWatcher::AddDiagnostics(DecoderDoctorDiagnostics&& aDiagnos
|
||||
|
||||
DD_DEBUG("DecoderDoctorDocumentWatcher[%p, doc=%p]::AddDiagnostics(DecoderDoctorDiagnostics{%s}, call site '%s')",
|
||||
this, mDocument, aDiagnostics.GetDescription().Data(), aCallSite);
|
||||
mDiagnosticsSequence.AppendElement(Diagnostics(Move(aDiagnostics), aCallSite));
|
||||
mDiagnosticsSequence.AppendElement(
|
||||
Diagnostics(Move(aDiagnostics), aCallSite));
|
||||
EnsureTimerIsStarted();
|
||||
}
|
||||
|
||||
@ -729,71 +711,26 @@ DecoderDoctorDiagnostics::StoreMediaKeySystemAccess(nsIDocument* aDocument,
|
||||
|
||||
if (NS_WARN_IF(!watcher)) {
|
||||
DD_WARN("DecoderDoctorDiagnostics[%p]::StoreMediaKeySystemAccess(nsIDocument* aDocument=%p, keysystem='%s', supported=%d, call site '%s') - Could not create document watcher",
|
||||
this, aDocument, NS_ConvertUTF16toUTF8(aKeySystem).get(), aIsSupported, aCallSite);
|
||||
this, NS_ConvertUTF16toUTF8(aKeySystem).get(), aIsSupported, aCallSite);
|
||||
return;
|
||||
}
|
||||
|
||||
mKeySystem = aKeySystem;
|
||||
mIsKeySystemSupported = aIsSupported;
|
||||
|
||||
// StoreMediaKeySystemAccess should only be called once, after all data is
|
||||
// available, so it is safe to Move() from this object.
|
||||
// StoreDiagnostics should only be called once, after all data is available,
|
||||
// so it is safe to Move() from this object.
|
||||
watcher->AddDiagnostics(Move(*this), aCallSite);
|
||||
// Even though it's moved-from, the type should stay set
|
||||
// (Only used to ensure that we do store only once.)
|
||||
MOZ_ASSERT(mDiagnosticsType == eMediaKeySystemAccessRequest);
|
||||
}
|
||||
|
||||
void
|
||||
DecoderDoctorDiagnostics::StoreEvent(nsIDocument* aDocument,
|
||||
const DecoderDoctorEvent& aEvent,
|
||||
const char* aCallSite)
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
// Make sure we only store once.
|
||||
MOZ_ASSERT(mDiagnosticsType == eUnsaved);
|
||||
mDiagnosticsType = eEvent;
|
||||
mEvent = aEvent;
|
||||
|
||||
if (NS_WARN_IF(!aDocument)) {
|
||||
DD_WARN("DecoderDoctorDiagnostics[%p]::StoreEvent(nsIDocument* aDocument=nullptr, aEvent=%s, call site '%s')",
|
||||
this, GetDescription().get(), aCallSite);
|
||||
return;
|
||||
}
|
||||
|
||||
// Don't keep events for later processing, just handle them now.
|
||||
#ifdef MOZ_PULSEAUDIO
|
||||
switch (aEvent.mDomain) {
|
||||
case DecoderDoctorEvent::eAudioSinkStartup:
|
||||
if (aEvent.mResult == NS_ERROR_DOM_MEDIA_CUBEB_INITIALIZATION_ERR) {
|
||||
DD_INFO("DecoderDoctorDocumentWatcher[%p, doc=%p]::AddDiagnostics() - unable to initialize PulseAudio",
|
||||
this, aDocument);
|
||||
ReportAnalysis(aDocument, sCannotInitializePulseAudio,
|
||||
false, NS_LITERAL_STRING("*"));
|
||||
} else if (aEvent.mResult == NS_OK) {
|
||||
DD_INFO("DecoderDoctorDocumentWatcher[%p, doc=%p]::AddDiagnostics() - now able to initialize PulseAudio",
|
||||
this, aDocument);
|
||||
ReportAnalysis(aDocument, sCannotInitializePulseAudio,
|
||||
true, NS_LITERAL_STRING("*"));
|
||||
}
|
||||
break;
|
||||
}
|
||||
#endif // MOZ_PULSEAUDIO
|
||||
}
|
||||
|
||||
static const char*
|
||||
EventDomainString(DecoderDoctorEvent::Domain aDomain)
|
||||
{
|
||||
switch (aDomain) {
|
||||
case DecoderDoctorEvent::eAudioSinkStartup:
|
||||
return "audio-sink-startup";
|
||||
}
|
||||
return "?";
|
||||
}
|
||||
|
||||
nsCString
|
||||
DecoderDoctorDiagnostics::GetDescription() const
|
||||
{
|
||||
MOZ_ASSERT(mDiagnosticsType == eFormatSupportCheck
|
||||
|| mDiagnosticsType == eMediaKeySystemAccessRequest);
|
||||
nsCString s;
|
||||
switch (mDiagnosticsType) {
|
||||
case eUnsaved:
|
||||
@ -835,12 +772,7 @@ DecoderDoctorDiagnostics::GetDescription() const
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case eEvent:
|
||||
s = nsPrintfCString("event domain %s result=%u",
|
||||
EventDomainString(mEvent.mDomain), mEvent.mResult);
|
||||
break;
|
||||
default:
|
||||
MOZ_ASSERT_UNREACHABLE("Unexpected DiagnosticsType");
|
||||
s = "?";
|
||||
break;
|
||||
}
|
||||
|
@ -13,13 +13,6 @@ class nsIDocument;
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
struct DecoderDoctorEvent {
|
||||
enum Domain {
|
||||
eAudioSinkStartup,
|
||||
} mDomain;
|
||||
nsresult mResult;
|
||||
};
|
||||
|
||||
// DecoderDoctorDiagnostics class, used to gather data from PDMs/DecoderTraits,
|
||||
// and then notify the user about issues preventing (or worsening) playback.
|
||||
//
|
||||
@ -53,15 +46,10 @@ public:
|
||||
bool aIsSupported,
|
||||
const char* aCallSite);
|
||||
|
||||
void StoreEvent(nsIDocument* aDocument,
|
||||
const DecoderDoctorEvent& aEvent,
|
||||
const char* aCallSite);
|
||||
|
||||
enum DiagnosticsType {
|
||||
eUnsaved,
|
||||
eFormatSupportCheck,
|
||||
eMediaKeySystemAccessRequest,
|
||||
eEvent
|
||||
eMediaKeySystemAccessRequest
|
||||
};
|
||||
DiagnosticsType Type() const { return mDiagnosticsType; }
|
||||
|
||||
@ -103,11 +91,6 @@ public:
|
||||
return mKeySystemIssue;
|
||||
}
|
||||
|
||||
DecoderDoctorEvent event() const
|
||||
{
|
||||
return mEvent;
|
||||
}
|
||||
|
||||
private:
|
||||
// Currently-known type of diagnostics. Set from one of the 'Store...' methods.
|
||||
// This helps ensure diagnostics are only stored once,
|
||||
@ -128,8 +111,6 @@ private:
|
||||
nsString mKeySystem;
|
||||
bool mIsKeySystemSupported = false;
|
||||
KeySystemIssue mKeySystemIssue = eUnset;
|
||||
|
||||
DecoderDoctorEvent mEvent;
|
||||
};
|
||||
|
||||
} // namespace mozilla
|
||||
|
@ -607,7 +607,6 @@ MediaDecoder::Shutdown()
|
||||
mFirstFrameLoadedListener.Disconnect();
|
||||
mOnPlaybackEvent.Disconnect();
|
||||
mOnPlaybackErrorEvent.Disconnect();
|
||||
mOnDecoderDoctorEvent.Disconnect();
|
||||
mOnMediaNotSeekable.Disconnect();
|
||||
|
||||
mDecoderStateMachine->BeginShutdown()
|
||||
@ -680,24 +679,6 @@ MediaDecoder::OnPlaybackErrorEvent(const MediaResult& aError)
|
||||
DecodeError(aError);
|
||||
}
|
||||
|
||||
void
|
||||
MediaDecoder::OnDecoderDoctorEvent(DecoderDoctorEvent aEvent)
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
// OnDecoderDoctorEvent is disconnected at shutdown time.
|
||||
MOZ_ASSERT(!IsShutdown());
|
||||
HTMLMediaElement* element = mOwner->GetMediaElement();
|
||||
if (!element) {
|
||||
return;
|
||||
}
|
||||
nsIDocument* doc = element->OwnerDoc();
|
||||
if (!doc) {
|
||||
return;
|
||||
}
|
||||
DecoderDoctorDiagnostics diags;
|
||||
diags.StoreEvent(doc, aEvent, __func__);
|
||||
}
|
||||
|
||||
void
|
||||
MediaDecoder::FinishShutdown()
|
||||
{
|
||||
@ -776,8 +757,6 @@ MediaDecoder::SetStateMachineParameters()
|
||||
AbstractThread::MainThread(), this, &MediaDecoder::OnPlaybackEvent);
|
||||
mOnPlaybackErrorEvent = mDecoderStateMachine->OnPlaybackErrorEvent().Connect(
|
||||
AbstractThread::MainThread(), this, &MediaDecoder::OnPlaybackErrorEvent);
|
||||
mOnDecoderDoctorEvent = mDecoderStateMachine->OnDecoderDoctorEvent().Connect(
|
||||
AbstractThread::MainThread(), this, &MediaDecoder::OnDecoderDoctorEvent);
|
||||
mOnMediaNotSeekable = mDecoderStateMachine->OnMediaNotSeekable().Connect(
|
||||
AbstractThread::MainThread(), this, &MediaDecoder::OnMediaNotSeekable);
|
||||
}
|
||||
|
@ -27,7 +27,6 @@
|
||||
#include "nsITimer.h"
|
||||
|
||||
#include "AbstractMediaDecoder.h"
|
||||
#include "DecoderDoctorDiagnostics.h"
|
||||
#include "MediaDecoderOwner.h"
|
||||
#include "MediaEventSource.h"
|
||||
#include "MediaMetadataManager.h"
|
||||
@ -595,8 +594,6 @@ private:
|
||||
void OnPlaybackEvent(MediaEventType aEvent);
|
||||
void OnPlaybackErrorEvent(const MediaResult& aError);
|
||||
|
||||
void OnDecoderDoctorEvent(DecoderDoctorEvent aEvent);
|
||||
|
||||
void OnMediaNotSeekable()
|
||||
{
|
||||
SetMediaSeekable(false);
|
||||
@ -736,7 +733,6 @@ protected:
|
||||
|
||||
MediaEventListener mOnPlaybackEvent;
|
||||
MediaEventListener mOnPlaybackErrorEvent;
|
||||
MediaEventListener mOnDecoderDoctorEvent;
|
||||
MediaEventListener mOnMediaNotSeekable;
|
||||
|
||||
protected:
|
||||
|
@ -2877,13 +2877,9 @@ void MediaDecoderStateMachine::OnMediaSinkAudioComplete()
|
||||
mAudioCompleted = true;
|
||||
// To notify PlaybackEnded as soon as possible.
|
||||
ScheduleStateMachine();
|
||||
|
||||
// Report OK to Decoder Doctor (to know if issue may have been resolved).
|
||||
mOnDecoderDoctorEvent.Notify(
|
||||
DecoderDoctorEvent{DecoderDoctorEvent::eAudioSinkStartup, NS_OK});
|
||||
}
|
||||
|
||||
void MediaDecoderStateMachine::OnMediaSinkAudioError(nsresult aResult)
|
||||
void MediaDecoderStateMachine::OnMediaSinkAudioError()
|
||||
{
|
||||
MOZ_ASSERT(OnTaskQueue());
|
||||
MOZ_ASSERT(mInfo.HasAudio());
|
||||
@ -2892,11 +2888,6 @@ void MediaDecoderStateMachine::OnMediaSinkAudioError(nsresult aResult)
|
||||
mMediaSinkAudioPromise.Complete();
|
||||
mAudioCompleted = true;
|
||||
|
||||
// Result should never be NS_OK in this *error* handler. Report to Dec-Doc.
|
||||
MOZ_ASSERT(NS_FAILED(aResult));
|
||||
mOnDecoderDoctorEvent.Notify(
|
||||
DecoderDoctorEvent{DecoderDoctorEvent::eAudioSinkStartup, aResult});
|
||||
|
||||
// Make the best effort to continue playback when there is video.
|
||||
if (HasVideo()) {
|
||||
return;
|
||||
|
@ -253,9 +253,6 @@ public:
|
||||
MediaEventSource<MediaResult>&
|
||||
OnPlaybackErrorEvent() { return mOnPlaybackErrorEvent; }
|
||||
|
||||
MediaEventSource<DecoderDoctorEvent>&
|
||||
OnDecoderDoctorEvent() { return mOnDecoderDoctorEvent; }
|
||||
|
||||
size_t SizeOfVideoQueue() const;
|
||||
|
||||
size_t SizeOfAudioQueue() const;
|
||||
@ -564,7 +561,7 @@ private:
|
||||
void OnMediaSinkVideoComplete();
|
||||
|
||||
// Rejected by the MediaSink to signal errors for audio/video.
|
||||
void OnMediaSinkAudioError(nsresult aResult);
|
||||
void OnMediaSinkAudioError();
|
||||
void OnMediaSinkVideoError();
|
||||
|
||||
// Return true if the video decoder's decode speed can not catch up the
|
||||
@ -867,8 +864,6 @@ private:
|
||||
MediaEventProducer<MediaEventType> mOnPlaybackEvent;
|
||||
MediaEventProducer<MediaResult> mOnPlaybackErrorEvent;
|
||||
|
||||
MediaEventProducer<DecoderDoctorEvent> mOnDecoderDoctorEvent;
|
||||
|
||||
// True if audio is offloading.
|
||||
// Playback will not start when audio is offloading.
|
||||
bool mAudioOffloading;
|
||||
|
@ -7,8 +7,7 @@
|
||||
enum DecoderDoctorNotificationType {
|
||||
"cannot-play",
|
||||
"platform-decoder-not-found",
|
||||
"can-play-but-some-missing-decoders",
|
||||
"cannot-initialize-pulseaudio",
|
||||
"can-play-but-some-missing-decoders"
|
||||
};
|
||||
|
||||
dictionary DecoderDoctorNotification {
|
||||
|
@ -391,7 +391,7 @@ pref("media.gmp.storage.version.expected", 1);
|
||||
|
||||
// Filter what triggers user notifications.
|
||||
// See DecoderDoctorDocumentWatcher::ReportAnalysis for details.
|
||||
pref("media.decoder-doctor.notifications-allowed", "MediaWMFNeeded,MediaWidevineNoWMFNoSilverlight,MediaCannotInitializePulseAudio");
|
||||
pref("media.decoder-doctor.notifications-allowed", "MediaWMFNeeded,MediaWidevineNoWMFNoSilverlight");
|
||||
// Whether we report partial failures.
|
||||
pref("media.decoder-doctor.verbose", false);
|
||||
// Whether DD should consider WMF-disabled a WMF failure, useful for testing.
|
||||
|
@ -3252,8 +3252,13 @@ dnl ==================================
|
||||
dnl = Check alsa availability on Linux
|
||||
dnl ==================================
|
||||
|
||||
dnl If using Linux, ensure that the alsa library is available
|
||||
if test "$OS_TARGET" = "Linux"; then
|
||||
MOZ_ALSA=1
|
||||
fi
|
||||
|
||||
MOZ_ARG_ENABLE_BOOL(alsa,
|
||||
[ --enable-alsa Enable Alsa support],
|
||||
[ --enable-alsa Enable Alsa support (default on Linux)],
|
||||
MOZ_ALSA=1,
|
||||
MOZ_ALSA=)
|
||||
|
||||
@ -3284,7 +3289,6 @@ MOZ_ARG_DISABLE_BOOL(pulseaudio,
|
||||
MOZ_PULSEAUDIO=1)
|
||||
|
||||
if test -n "$MOZ_PULSEAUDIO"; then
|
||||
AC_DEFINE(MOZ_PULSEAUDIO)
|
||||
if test -z "$gonkdir"; then
|
||||
PKG_CHECK_MODULES(MOZ_PULSEAUDIO, libpulse, ,
|
||||
[echo "$MOZ_PULSEAUDIO_PKG_ERRORS"
|
||||
|
@ -988,9 +988,6 @@
|
||||
ERROR(NS_ERROR_DOM_MEDIA_MEDIASINK_ERR, FAILURE(11)),
|
||||
ERROR(NS_ERROR_DOM_MEDIA_DEMUXER_ERR, FAILURE(12)),
|
||||
ERROR(NS_ERROR_DOM_MEDIA_CDM_ERR, FAILURE(13)),
|
||||
|
||||
/* Internal platform-related errors */
|
||||
ERROR(NS_ERROR_DOM_MEDIA_CUBEB_INITIALIZATION_ERR, FAILURE(101)),
|
||||
#undef MODULE
|
||||
|
||||
/* ======================================================================= */
|
||||
|
Loading…
Reference in New Issue
Block a user