Bug 1238433: Added telemtry for the proportion of frames dropped during playback. r=cpearce

This commit is contained in:
Louis Christie
2016-02-12 10:02:00 +13:00
parent e59cb61044
commit 810c37bb91
2 changed files with 23 additions and 0 deletions

View File

@@ -108,6 +108,9 @@ static mozilla::LazyLogModule gMediaElementEventsLog("nsMediaElementEvents");
#include "mozilla/EventStateManager.h"
#include "mozilla/dom/HTMLVideoElement.h"
#include "mozilla/dom/VideoPlaybackQuality.h"
using namespace mozilla::layers;
using mozilla::net::nsMediaFragmentURIParser;
@@ -2701,6 +2704,17 @@ HTMLMediaElement::ReportMSETelemetry()
}
}
if (HTMLVideoElement* vid = HTMLVideoElement::FromContentOrNull(this)) {
RefPtr<VideoPlaybackQuality> quality = vid->GetVideoPlaybackQuality();
uint64_t totalFrames = quality->TotalVideoFrames();
uint64_t droppedFrames = quality->DroppedVideoFrames();
uint32_t percentage = 100 * droppedFrames / totalFrames;
LOG(LogLevel::Debug,
("Reporting telemetry DROPPED_FRAMES_IN_VIDEO_PLAYBACK"));
Telemetry::Accumulate(Telemetry::VIDEO_DROPPED_FRAMES_PROPORTION,
percentage);
}
Telemetry::Accumulate(Telemetry::VIDEO_MSE_UNLOAD_STATE, state);
LOG(LogLevel::Debug, ("%p VIDEO_MSE_UNLOAD_STATE = %d", this, state));