Bug 1787561 Part 2: Expose HDR telemetry to HTMLMediaElement as a Chrome property. r=alwu,emilio

This is necessary scaffolding for testing of the HDR telemetry in a way
that involves the RDD process. This is important for matching real-world
conditions.

Depends on D155902

Differential Revision: https://phabricator.services.mozilla.com/D156245
This commit is contained in:
Brad Werth 2022-09-08 18:02:04 +00:00
Родитель ddc104b332
Коммит 51de674b99
5 изменённых файлов: 13 добавлений и 0 удалений

Просмотреть файл

@ -2080,6 +2080,10 @@ double HTMLMediaElement::TotalVideoPlayTime() const {
return mDecoder ? mDecoder->GetTotalVideoPlayTimeInSeconds() : -1.0;
}
double HTMLMediaElement::TotalVideoHDRPlayTime() const {
return mDecoder ? mDecoder->GetTotalVideoHDRPlayTimeInSeconds() : -1.0;
}
double HTMLMediaElement::VisiblePlayTime() const {
return mDecoder ? mDecoder->GetVisibleVideoPlayTimeInSeconds() : -1.0;
}

Просмотреть файл

@ -655,6 +655,7 @@ class HTMLMediaElement : public nsGenericHTMLElement,
// These functions return accumulated time, which are used for the telemetry
// usage. Return -1 for error.
double TotalVideoPlayTime() const;
double TotalVideoHDRPlayTime() const;
double VisiblePlayTime() const;
double InvisiblePlayTime() const;
double VideoDecodeSuspendedTime() const;

Просмотреть файл

@ -1498,6 +1498,10 @@ double MediaDecoder::GetTotalVideoPlayTimeInSeconds() const {
return mTelemetryProbesReporter->GetTotalVideoPlayTimeInSeconds();
}
double MediaDecoder::GetTotalVideoHDRPlayTimeInSeconds() const {
return mTelemetryProbesReporter->GetTotalVideoHDRPlayTimeInSeconds();
}
double MediaDecoder::GetVisibleVideoPlayTimeInSeconds() const {
return mTelemetryProbesReporter->GetVisibleVideoPlayTimeInSeconds();
}

Просмотреть файл

@ -730,6 +730,7 @@ class MediaDecoder : public DecoderDoctorLifeLogger<MediaDecoder> {
// Those methods exist to report telemetry related metrics.
double GetTotalVideoPlayTimeInSeconds() const;
double GetTotalVideoHDRPlayTimeInSeconds() const;
double GetVisibleVideoPlayTimeInSeconds() const;
double GetInvisibleVideoPlayTimeInSeconds() const;
double GetVideoDecodeSuspendedTimeInSeconds() const;

Просмотреть файл

@ -235,6 +235,9 @@ partial interface HTMLMediaElement {
[ChromeOnly]
readonly attribute double totalVideoPlayTime;
[ChromeOnly]
readonly attribute double totalVideoHDRPlayTime;
[ChromeOnly]
readonly attribute double visiblePlayTime;