mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-18 15:55:36 +00:00
Bug 1699249 - part1 : add a probe to measure the source buffer usage for different mime types. r=bryce
Differential Revision: https://phabricator.services.mozilla.com/D108885
This commit is contained in:
parent
897010cdec
commit
7dfd8f5884
@ -88,6 +88,41 @@ static bool IsVP9Forced(DecoderDoctorDiagnostics* aDiagnostics) {
|
|||||||
|
|
||||||
namespace dom {
|
namespace dom {
|
||||||
|
|
||||||
|
static void RecordTypeForTelemetry(const nsAString& aType,
|
||||||
|
nsPIDOMWindowInner* aWindow) {
|
||||||
|
Maybe<MediaContainerType> containerType = MakeMediaContainerType(aType);
|
||||||
|
if (!containerType) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const MediaMIMEType& mimeType = containerType->Type();
|
||||||
|
if (mimeType == MEDIAMIMETYPE(VIDEO_WEBM)) {
|
||||||
|
AccumulateCategorical(
|
||||||
|
mozilla::Telemetry::LABELS_MSE_SOURCE_BUFFER_TYPE::VideoWebm);
|
||||||
|
} else if (mimeType == MEDIAMIMETYPE(AUDIO_WEBM)) {
|
||||||
|
AccumulateCategorical(
|
||||||
|
mozilla::Telemetry::LABELS_MSE_SOURCE_BUFFER_TYPE::AudioWebm);
|
||||||
|
} else if (mimeType == MEDIAMIMETYPE(VIDEO_MP4)) {
|
||||||
|
AccumulateCategorical(
|
||||||
|
mozilla::Telemetry::LABELS_MSE_SOURCE_BUFFER_TYPE::VideoMp4);
|
||||||
|
} else if (mimeType == MEDIAMIMETYPE(AUDIO_MP4)) {
|
||||||
|
AccumulateCategorical(
|
||||||
|
mozilla::Telemetry::LABELS_MSE_SOURCE_BUFFER_TYPE::AudioMp4);
|
||||||
|
} else if (mimeType == MEDIAMIMETYPE(VIDEO_MPEG_TS)) {
|
||||||
|
AccumulateCategorical(
|
||||||
|
mozilla::Telemetry::LABELS_MSE_SOURCE_BUFFER_TYPE::VideoMp2t);
|
||||||
|
} else if (mimeType == MEDIAMIMETYPE(AUDIO_MPEG_TS)) {
|
||||||
|
AccumulateCategorical(
|
||||||
|
mozilla::Telemetry::LABELS_MSE_SOURCE_BUFFER_TYPE::AudioMp2t);
|
||||||
|
} else if (mimeType == MEDIAMIMETYPE(AUDIO_MP3)) {
|
||||||
|
AccumulateCategorical(
|
||||||
|
mozilla::Telemetry::LABELS_MSE_SOURCE_BUFFER_TYPE::AudioMpeg);
|
||||||
|
} else if (mimeType == MEDIAMIMETYPE(AUDIO_AAC)) {
|
||||||
|
AccumulateCategorical(
|
||||||
|
mozilla::Telemetry::LABELS_MSE_SOURCE_BUFFER_TYPE::AudioAac);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* static */
|
/* static */
|
||||||
void MediaSource::IsTypeSupported(const nsAString& aType,
|
void MediaSource::IsTypeSupported(const nsAString& aType,
|
||||||
DecoderDoctorDiagnostics* aDiagnostics,
|
DecoderDoctorDiagnostics* aDiagnostics,
|
||||||
@ -241,6 +276,7 @@ already_AddRefed<SourceBuffer> MediaSource::AddSourceBuffer(
|
|||||||
MOZ_ASSERT(NS_IsMainThread());
|
MOZ_ASSERT(NS_IsMainThread());
|
||||||
DecoderDoctorDiagnostics diagnostics;
|
DecoderDoctorDiagnostics diagnostics;
|
||||||
IsTypeSupported(aType, &diagnostics, aRv);
|
IsTypeSupported(aType, &diagnostics, aRv);
|
||||||
|
RecordTypeForTelemetry(aType, GetOwner());
|
||||||
bool supported = !aRv.Failed();
|
bool supported = !aRv.Failed();
|
||||||
diagnostics.StoreFormatDiagnostics(
|
diagnostics.StoreFormatDiagnostics(
|
||||||
GetOwner() ? GetOwner()->GetExtantDoc() : nullptr, aType, supported,
|
GetOwner() ? GetOwner()->GetExtantDoc() : nullptr, aType, supported,
|
||||||
@ -394,6 +430,7 @@ bool MediaSource::IsTypeSupported(const GlobalObject& aOwner,
|
|||||||
bool supported = !rv.Failed();
|
bool supported = !rv.Failed();
|
||||||
nsCOMPtr<nsPIDOMWindowInner> window =
|
nsCOMPtr<nsPIDOMWindowInner> window =
|
||||||
do_QueryInterface(aOwner.GetAsSupports());
|
do_QueryInterface(aOwner.GetAsSupports());
|
||||||
|
RecordTypeForTelemetry(aType, window);
|
||||||
diagnostics.StoreFormatDiagnostics(window ? window->GetExtantDoc() : nullptr,
|
diagnostics.StoreFormatDiagnostics(window ? window->GetExtantDoc() : nullptr,
|
||||||
aType, supported, __func__);
|
aType, supported, __func__);
|
||||||
MOZ_LOG(GetMediaSourceAPILog(), mozilla::LogLevel::Debug,
|
MOZ_LOG(GetMediaSourceAPILog(), mozilla::LogLevel::Debug,
|
||||||
|
@ -90,6 +90,7 @@
|
|||||||
#define AUDIO_MIDI "audio/x-midi"
|
#define AUDIO_MIDI "audio/x-midi"
|
||||||
#define AUDIO_MATROSKA "audio/x-matroska"
|
#define AUDIO_MATROSKA "audio/x-matroska"
|
||||||
#define AUDIO_AAC "audio/aac"
|
#define AUDIO_AAC "audio/aac"
|
||||||
|
#define AUDIO_MPEG_TS "audio/mp2t"
|
||||||
|
|
||||||
#define BINARY_OCTET_STREAM "binary/octet-stream"
|
#define BINARY_OCTET_STREAM "binary/octet-stream"
|
||||||
|
|
||||||
|
@ -13291,6 +13291,17 @@
|
|||||||
"releaseChannelCollection": "opt-out",
|
"releaseChannelCollection": "opt-out",
|
||||||
"description": "Count of use of audio/video codecs in HTMLMediaElements and WebAudio. Those with 'resource' prefix are approximate; report based on HTTP ContentType or sniffing. Those with 'webaudio' prefix are for WebAudio."
|
"description": "Count of use of audio/video codecs in HTMLMediaElements and WebAudio. Those with 'resource' prefix are approximate; report based on HTTP ContentType or sniffing. Those with 'webaudio' prefix are for WebAudio."
|
||||||
},
|
},
|
||||||
|
"MSE_SOURCE_BUFFER_TYPE": {
|
||||||
|
"products": ["firefox", "geckoview_streaming"],
|
||||||
|
"record_in_processes": ["main", "content"],
|
||||||
|
"alert_emails": ["alwu@mozilla.com", "bryce@mozilla.com"],
|
||||||
|
"bug_numbers": [1699249],
|
||||||
|
"expires_in_version": "never",
|
||||||
|
"kind": "categorical",
|
||||||
|
"labels": ["VideoWebm", "AudioWebm", "VideoMp4", "AudioMp4", "VideoMp2t", "AudioMp2t", "AudioMpeg", "AudioAac"],
|
||||||
|
"releaseChannelCollection": "opt-out",
|
||||||
|
"description": "Count the actual or possible (because we don't support some of them for now) usage amount for each media mime type used in MSE. We collect this data in MediaSource's `AddSourceBuffer()` and `IsTypeSupported()`."
|
||||||
|
},
|
||||||
"FX_SANITIZE_TOTAL": {
|
"FX_SANITIZE_TOTAL": {
|
||||||
"record_in_processes": ["main", "content"],
|
"record_in_processes": ["main", "content"],
|
||||||
"products": ["firefox", "fennec"],
|
"products": ["firefox", "fennec"],
|
||||||
|
Loading…
Reference in New Issue
Block a user