diff options
author | wuchengli@chromium.org <wuchengli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-09-15 15:24:11 +0000 |
---|---|---|
committer | wuchengli@chromium.org <wuchengli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-09-15 15:24:11 +0000 |
commit | 70cdf8d473698e4f9203dde64bfa9147dc4d70e7 (patch) | |
tree | 8951c0cf4a6e16cc2b035f66cd8f43151fb7badb | |
parent | 4b3f988d688a9e3667660490350ec6defb4caa9c (diff) | |
download | chromium_src-70cdf8d473698e4f9203dde64bfa9147dc4d70e7.zip chromium_src-70cdf8d473698e4f9203dde64bfa9147dc4d70e7.tar.gz chromium_src-70cdf8d473698e4f9203dde64bfa9147dc4d70e7.tar.bz2 |
Add UMA reporting for RTCVideoDecoder.
Media.RTCVideoDecoderInitDecodeStatus: the results of InitDecode
Media.RTCVideoDecoderError: errors reported from VDA
BUG=170345
TEST=Run apprtc.appspot.com on Chromebook Daisy.
Review URL: https://chromiumcodereview.appspot.com/23967010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@223288 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | content/renderer/media/rtc_video_decoder.cc | 18 | ||||
-rw-r--r-- | content/renderer/media/rtc_video_decoder.h | 3 | ||||
-rw-r--r-- | tools/metrics/histograms/histograms.xml | 8 |
3 files changed, 26 insertions, 3 deletions
diff --git a/content/renderer/media/rtc_video_decoder.cc b/content/renderer/media/rtc_video_decoder.cc index adce1f6..70f8add 100644 --- a/content/renderer/media/rtc_video_decoder.cc +++ b/content/renderer/media/rtc_video_decoder.cc @@ -8,6 +8,7 @@ #include "base/logging.h" #include "base/memory/ref_counted.h" #include "base/message_loop/message_loop_proxy.h" +#include "base/metrics/histogram.h" #include "base/safe_numerics.h" #include "base/stl_util.h" #include "base/task_runner_util.h" @@ -155,13 +156,13 @@ int32_t RTCVideoDecoder::InitDecode(const webrtc::VideoCodec* codecSettings, DCHECK_EQ(codecSettings->codecType, webrtc::kVideoCodecVP8); if (codecSettings->codecSpecific.VP8.feedbackModeOn) { LOG(ERROR) << "Feedback mode not supported"; - return WEBRTC_VIDEO_CODEC_ERROR; + return RecordInitDecodeUMA(WEBRTC_VIDEO_CODEC_ERROR); } base::AutoLock auto_lock(lock_); if (state_ == UNINITIALIZED || state_ == DECODE_ERROR) { LOG(ERROR) << "VDA is not initialized. state=" << state_; - return WEBRTC_VIDEO_CODEC_UNINITIALIZED; + return RecordInitDecodeUMA(WEBRTC_VIDEO_CODEC_UNINITIALIZED); } // Create some shared memory if the queue is empty. if (available_shm_segments_.size() == 0) { @@ -171,7 +172,7 @@ int32_t RTCVideoDecoder::InitDecode(const webrtc::VideoCodec* codecSettings, kMaxInFlightDecodes, kSharedMemorySegmentBytes)); } - return WEBRTC_VIDEO_CODEC_OK; + return RecordInitDecodeUMA(WEBRTC_VIDEO_CODEC_OK); } int32_t RTCVideoDecoder::Decode( @@ -461,6 +462,9 @@ void RTCVideoDecoder::NotifyError(media::VideoDecodeAccelerator::Error error) { return; LOG(ERROR) << "VDA Error:" << error; + UMA_HISTOGRAM_ENUMERATION("Media.RTCVideoDecoderError", + error, + media::VideoDecodeAccelerator::LARGEST_ERROR_ENUM); DestroyVDA(); base::AutoLock auto_lock(lock_); @@ -747,4 +751,12 @@ void RTCVideoDecoder::GetBufferData(int32 bitstream_buffer_id, NOTREACHED() << "Missing bitstream buffer id: " << bitstream_buffer_id; } +int32_t RTCVideoDecoder::RecordInitDecodeUMA(int32_t status) { + // Logging boolean is enough to know if HW decoding has been used. Also, + // InitDecode is less likely to return an error so enum is not used here. + bool sample = (status == WEBRTC_VIDEO_CODEC_OK) ? true : false; + UMA_HISTOGRAM_BOOLEAN("Media.RTCVideoDecoderInitDecodeStatus", sample); + return status; +} + } // namespace content diff --git a/content/renderer/media/rtc_video_decoder.h b/content/renderer/media/rtc_video_decoder.h index 13adf37..d73fc14 100644 --- a/content/renderer/media/rtc_video_decoder.h +++ b/content/renderer/media/rtc_video_decoder.h @@ -181,6 +181,9 @@ class CONTENT_EXPORT RTCVideoDecoder uint32_t* height, size_t* size); + // Records the result of InitDecode to UMA and returns |status|. + int32_t RecordInitDecodeUMA(int32_t status); + enum State { UNINITIALIZED, // The decoder has not initialized. INITIALIZED, // The decoder has initialized. diff --git a/tools/metrics/histograms/histograms.xml b/tools/metrics/histograms/histograms.xml index d45b24a..770c44c 100644 --- a/tools/metrics/histograms/histograms.xml +++ b/tools/metrics/histograms/histograms.xml @@ -5736,6 +5736,14 @@ other types of suffix sets. </summary> </histogram> +<histogram name="Media.RTCVideoDecoderError" enum="PepperVideoDecodeError"> + <summary>Counts of video decode errors reported to RTCVideoDecoder.</summary> +</histogram> + +<histogram name="Media.RTCVideoDecoderInitDecodeStatus" enum="BooleanSuccess"> + <summary>Results of attempts to RTCVideoDecoder::InitDecode().</summary> +</histogram> + <histogram name="Media.TimeToPipelineStarted" units="ms"> <summary> Time in milliseconds from HTML5 media pipeline creation to playing event. |