Commit c4812393 authored by prabhur's avatar prabhur Committed by Commit bot

Add dedicated PipelineStatus UMAs for encrypted content to differentiate...

Add dedicated PipelineStatus UMAs for encrypted content to differentiate DecryptingVideoDecoder (DVD) & DecryptingDemuxerStream (DDS) codepath.

Tested the DVD path using netflix/Linux. DDS needs a chromeOS build.

BUG=435374

Review URL: https://codereview.chromium.org/770423004

Cr-Commit-Position: refs/heads/master@{#307062}
parent a35a12b4
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include "content/public/browser/web_ui.h" #include "content/public/browser/web_ui.h"
#include "media/audio/audio_parameters.h" #include "media/audio/audio_parameters.h"
#include "media/base/media_log_event.h" #include "media/base/media_log_event.h"
#include "media/filters/decrypting_video_decoder.h"
#include "media/filters/gpu_video_decoder.h" #include "media/filters/gpu_video_decoder.h"
namespace { namespace {
...@@ -198,18 +199,23 @@ class MediaInternals::MediaInternalsUMAHandler : public NotificationObserver { ...@@ -198,18 +199,23 @@ class MediaInternals::MediaInternalsUMAHandler : public NotificationObserver {
media::PipelineStatus last_pipeline_status; media::PipelineStatus last_pipeline_status;
bool has_audio; bool has_audio;
bool has_video; bool has_video;
bool video_dds;
std::string audio_codec_name; std::string audio_codec_name;
std::string video_codec_name; std::string video_codec_name;
std::string video_decoder; std::string video_decoder;
PipelineInfo() PipelineInfo()
: last_pipeline_status(media::PIPELINE_OK), : last_pipeline_status(media::PIPELINE_OK),
has_audio(false), has_audio(false),
has_video(false) {} has_video(false),
video_dds(false) {}
}; };
// Helper function to report PipelineStatus associated with a player to UMA. // Helper function to report PipelineStatus associated with a player to UMA.
void ReportUMAForPipelineStatus(const PipelineInfo& player_info); void ReportUMAForPipelineStatus(const PipelineInfo& player_info);
// Helper to generate PipelineStatus UMA name for AudioVideo streams.
std::string GetUMANameForAVStream(const PipelineInfo& player_info);
// Key is playerid // Key is playerid
typedef std::map<int, PipelineInfo> PlayerInfoMap; typedef std::map<int, PipelineInfo> PlayerInfoMap;
...@@ -286,6 +292,9 @@ void MediaInternals::MediaInternalsUMAHandler::SavePlayerState( ...@@ -286,6 +292,9 @@ void MediaInternals::MediaInternalsUMAHandler::SavePlayerState(
event.params.GetString("video_decoder", event.params.GetString("video_decoder",
&player_info[event.id].video_decoder); &player_info[event.id].video_decoder);
} }
if (event.params.HasKey("video_dds")) {
event.params.GetBoolean("video_dds", &player_info[event.id].video_dds);
}
break; break;
default: default:
break; break;
...@@ -293,33 +302,47 @@ void MediaInternals::MediaInternalsUMAHandler::SavePlayerState( ...@@ -293,33 +302,47 @@ void MediaInternals::MediaInternalsUMAHandler::SavePlayerState(
return; return;
} }
std::string MediaInternals::MediaInternalsUMAHandler::GetUMANameForAVStream(
const PipelineInfo& player_info) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
static const char kPipelineUmaPrefix[] = "Media.PipelineStatus.AudioVideo.";
std::string uma_name = kPipelineUmaPrefix;
if (player_info.video_codec_name == "vp8") {
uma_name += "VP8.";
} else if (player_info.video_codec_name == "vp9") {
uma_name += "VP9.";
} else if (player_info.video_codec_name == "h264") {
uma_name += "H264.";
} else {
return uma_name + "Other";
}
if (player_info.video_decoder ==
media::DecryptingVideoDecoder::kDecoderName) {
return uma_name + "DVD";
}
if (player_info.video_dds) {
uma_name += "DDS.";
}
if (player_info.video_decoder == media::GpuVideoDecoder::kDecoderName) {
uma_name += "HW";
} else {
uma_name += "SW";
}
return uma_name;
}
void MediaInternals::MediaInternalsUMAHandler::ReportUMAForPipelineStatus( void MediaInternals::MediaInternalsUMAHandler::ReportUMAForPipelineStatus(
const PipelineInfo& player_info) { const PipelineInfo& player_info) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
if (player_info.has_video && player_info.has_audio) { if (player_info.has_video && player_info.has_audio) {
if (player_info.video_codec_name == "vp8") { base::LinearHistogram::FactoryGet(
UMA_HISTOGRAM_ENUMERATION("Media.PipelineStatus.AudioVideo.VP8.SW", GetUMANameForAVStream(player_info), 1, media::PIPELINE_STATUS_MAX,
player_info.last_pipeline_status, media::PIPELINE_STATUS_MAX + 1,
media::PIPELINE_STATUS_MAX + 1); base::HistogramBase::kUmaTargetedHistogramFlag)
} else if (player_info.video_codec_name == "vp9") { ->Add(player_info.last_pipeline_status);
UMA_HISTOGRAM_ENUMERATION("Media.PipelineStatus.AudioVideo.VP9.SW",
player_info.last_pipeline_status,
media::PIPELINE_STATUS_MAX + 1);
} else if (player_info.video_codec_name == "h264") {
if (player_info.video_decoder == media::GpuVideoDecoder::kDecoderName) {
UMA_HISTOGRAM_ENUMERATION("Media.PipelineStatus.AudioVideo.H264.HW",
player_info.last_pipeline_status,
media::PIPELINE_STATUS_MAX + 1);
} else {
UMA_HISTOGRAM_ENUMERATION("Media.PipelineStatus.AudioVideo.H264.SW",
player_info.last_pipeline_status,
media::PIPELINE_STATUS_MAX + 1);
}
} else {
UMA_HISTOGRAM_ENUMERATION("Media.PipelineStatus.AudioVideo.Other",
player_info.last_pipeline_status,
media::PIPELINE_STATUS_MAX + 1);
}
} else if (player_info.has_audio) { } else if (player_info.has_audio) {
UMA_HISTOGRAM_ENUMERATION("Media.PipelineStatus.AudioOnly", UMA_HISTOGRAM_ENUMERATION("Media.PipelineStatus.AudioOnly",
player_info.last_pipeline_status, player_info.last_pipeline_status,
......
...@@ -19,6 +19,8 @@ ...@@ -19,6 +19,8 @@
namespace media { namespace media {
const char DecryptingVideoDecoder::kDecoderName[] = "DecryptingVideoDecoder";
DecryptingVideoDecoder::DecryptingVideoDecoder( DecryptingVideoDecoder::DecryptingVideoDecoder(
const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, const scoped_refptr<base::SingleThreadTaskRunner>& task_runner,
const SetDecryptorReadyCB& set_decryptor_ready_cb) const SetDecryptorReadyCB& set_decryptor_ready_cb)
...@@ -31,7 +33,7 @@ DecryptingVideoDecoder::DecryptingVideoDecoder( ...@@ -31,7 +33,7 @@ DecryptingVideoDecoder::DecryptingVideoDecoder(
weak_factory_(this) {} weak_factory_(this) {}
std::string DecryptingVideoDecoder::GetDisplayName() const { std::string DecryptingVideoDecoder::GetDisplayName() const {
return "DecryptingVideoDecoder"; return kDecoderName;
} }
void DecryptingVideoDecoder::Initialize(const VideoDecoderConfig& config, void DecryptingVideoDecoder::Initialize(const VideoDecoderConfig& config,
......
...@@ -41,6 +41,8 @@ class MEDIA_EXPORT DecryptingVideoDecoder : public VideoDecoder { ...@@ -41,6 +41,8 @@ class MEDIA_EXPORT DecryptingVideoDecoder : public VideoDecoder {
const DecodeCB& decode_cb) override; const DecodeCB& decode_cb) override;
void Reset(const base::Closure& closure) override; void Reset(const base::Closure& closure) override;
static const char kDecoderName[];
private: private:
// For a detailed state diagram please see this link: http://goo.gl/8jAok // For a detailed state diagram please see this link: http://goo.gl/8jAok
// TODO(xhwang): Add a ASCII state diagram in this file after this class // TODO(xhwang): Add a ASCII state diagram in this file after this class
......
...@@ -58639,15 +58639,46 @@ To add a new entry, add it with any value and run test to compute valid value. ...@@ -58639,15 +58639,46 @@ To add a new entry, add it with any value and run test to compute valid value.
<suffix name="AudioVideo.Other" <suffix name="AudioVideo.Other"
label="PipelineStatus for the codecs that dont have an explicit metric."/> label="PipelineStatus for the codecs that dont have an explicit metric."/>
<suffix name="AudioVideo.VP8.SW" <suffix name="AudioVideo.VP8.SW"
label="PipelineStatus for AV streams with VP8 Software decoder."/> label="PipelineStatus for AV streams with VP8 software decoder."/>
<suffix name="AudioVideo.VP8.HW"
label="PipelineStatus for AV streams with VP8 hardware decoder."/>
<suffix name="AudioVideo.VP8.DDS.SW"
label="PipelineStatus for AV streams with VP8 software codec and that
go through the DecryptingDemuxerStream (DDS)."/>
<suffix name="AudioVideo.VP8.DDS.HW"
label="PipelineStatus for AV streams with VP8 hardware codec and that
go through the DecryptingDemuxerStream (DDS)."/>
<suffix name="AudioVideo.VP8.DVD"
label="PipelineStatus for AV streams with VP8 codec and that go through
the DecryptingVideoDecoder (DVD)."/>
<suffix name="AudioVideo.VP9.SW" <suffix name="AudioVideo.VP9.SW"
label="PipelineStatus for AV streams with VP9 Software decoder."/> label="PipelineStatus for AV streams with VP9 software decoder."/>
<suffix name="AudioVideo.H264.HW" <suffix name="AudioVideo.VP9.HW"
label="PipelineStatus for hardware decoded AV streams with H264 label="PipelineStatus for AV streams with VP9 hardware decoder."/>
decoder."/> <suffix name="AudioVideo.VP9.DDS.SW"
label="PipelineStatus for AV streams with VP9 codec and that go through
the DecryptingDemuxerStream (DDS)."/>
<suffix name="AudioVideo.VP9.DDS.HW"
label="PipelineStatus for AV streams with VP9 hardware codec and that
go through the DecryptingDemuxerStream (DDS)."/>
<suffix name="AudioVideo.VP9.DVD"
label="PipelineStatus for AV streams with VP9 software codec and that
go through the DecryptingVideoDecoder (DVD)."/>
<suffix name="AudioVideo.H264.SW" <suffix name="AudioVideo.H264.SW"
label="PipelineStatus for software decoded AV streams with H264 label="PipelineStatus for software decoded AV streams with H264
decoder."/> decoder."/>
<suffix name="AudioVideo.H264.HW"
label="PipelineStatus for hardware decoded AV streams with H264
decoder."/>
<suffix name="AudioVideo.H264.DDS.SW"
label="PipelineStatus for AV streams with H264 software decoder and
that go through the DecryptingDemuxerStream (DDS)."/>
<suffix name="AudioVideo.H264.DDS.HW"
label="PipelineStatus for AV streams with H264 hardware decoder and
that go through the DecryptingDemuxerStream (DDS)."/>
<suffix name="AudioVideo.H264.DVD"
label="PipelineStatus for AV streams with H264 decoder and that go
through the DecryptingVideoDecoder (DVD)."/>
<suffix name="AudioOnly" label="PipelineStatus for Audio-only streams."/> <suffix name="AudioOnly" label="PipelineStatus for Audio-only streams."/>
<suffix name="VideoOnly" label="PipelineStatus for Video-only streams."/> <suffix name="VideoOnly" label="PipelineStatus for Video-only streams."/>
<suffix name="Unsupported" label="PipelineStatus for unsupported streams."/> <suffix name="Unsupported" label="PipelineStatus for unsupported streams."/>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment