mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 11:25:00 +00:00
Bug 1247056 - Handle PulseAudio init error in DecDoc - r=jwwang
MozReview-Commit-ID: 8qa0MO35mRD --HG-- extra : rebase_source : b557992bb78c0d6c776adf83740bbc07b831c898
This commit is contained in:
parent
2e32eccffc
commit
7368a3ff17
@ -134,6 +134,7 @@ 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".
|
||||
|
@ -264,6 +264,9 @@ 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[] =
|
||||
@ -273,7 +276,8 @@ sAllNotificationsAndReportStringIds[] =
|
||||
&sMediaUnsupportedBeforeWindowsVista,
|
||||
&sMediaPlatformDecoderNotFound,
|
||||
&sMediaCannotPlayNoDecoders,
|
||||
&sMediaNoDecoders
|
||||
&sMediaNoDecoders,
|
||||
&sCannotInitializePulseAudio
|
||||
};
|
||||
|
||||
static void
|
||||
@ -757,14 +761,32 @@ DecoderDoctorDiagnostics::StoreEvent(nsIDocument* aDocument,
|
||||
return;
|
||||
}
|
||||
|
||||
// TODO: Handle event here.
|
||||
// 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) {
|
||||
// TODO
|
||||
case DecoderDoctorEvent::eAudioSinkStartup:
|
||||
return "audio-sink-startup";
|
||||
}
|
||||
return "?";
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ namespace mozilla {
|
||||
|
||||
struct DecoderDoctorEvent {
|
||||
enum Domain {
|
||||
// TODO
|
||||
eAudioSinkStartup,
|
||||
} mDomain;
|
||||
nsresult mResult;
|
||||
};
|
||||
|
@ -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");
|
||||
pref("media.decoder-doctor.notifications-allowed", "MediaWMFNeeded,MediaWidevineNoWMFNoSilverlight,MediaCannotInitializePulseAudio");
|
||||
// Whether we report partial failures.
|
||||
pref("media.decoder-doctor.verbose", false);
|
||||
// Whether DD should consider WMF-disabled a WMF failure, useful for testing.
|
||||
|
Loading…
Reference in New Issue
Block a user