summaryrefslogtreecommitdiffstats
path: root/webkit/glue/webmediaplayer_impl.cc
diff options
context:
space:
mode:
authorscherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-16 02:03:16 +0000
committerscherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-16 02:03:16 +0000
commit4c51bc66e6496234d5a3a7cbdfb1cf07cca2167e (patch)
tree03e28346b7752cec02e91ba925694548b49b8184 /webkit/glue/webmediaplayer_impl.cc
parent9cadfb34adaf42ad30e398b24ab06e5bc587e57a (diff)
downloadchromium_src-4c51bc66e6496234d5a3a7cbdfb1cf07cca2167e.zip
chromium_src-4c51bc66e6496234d5a3a7cbdfb1cf07cca2167e.tar.gz
chromium_src-4c51bc66e6496234d5a3a7cbdfb1cf07cca2167e.tar.bz2
Implement webkit media metrics in chromium.
This implements the chromium side of the webkit media statistics feature. A followup cl (in webkit) will wire the two sides together. Patch by sjl@chromium.org: http://codereview.chromium.org/6246091/ BUG=71255 TEST=media_unittests git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75050 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/webmediaplayer_impl.cc')
-rw-r--r--webkit/glue/webmediaplayer_impl.cc32
1 files changed, 32 insertions, 0 deletions
diff --git a/webkit/glue/webmediaplayer_impl.cc b/webkit/glue/webmediaplayer_impl.cc
index 9d51910..3db6ff0 100644
--- a/webkit/glue/webmediaplayer_impl.cc
+++ b/webkit/glue/webmediaplayer_impl.cc
@@ -656,6 +656,38 @@ WebKit::WebMediaPlayer::MovieLoadType
return WebKit::WebMediaPlayer::Unknown;
}
+unsigned long WebMediaPlayerImpl::decodedFrames() const
+{
+ DCHECK(MessageLoop::current() == main_loop_);
+
+ media::PipelineStatistics stats = pipeline_->GetStatistics();
+ return stats.video_frames_decoded;
+}
+
+unsigned long WebMediaPlayerImpl::droppedFrames() const
+{
+ DCHECK(MessageLoop::current() == main_loop_);
+
+ media::PipelineStatistics stats = pipeline_->GetStatistics();
+ return stats.video_frames_dropped;
+}
+
+unsigned long WebMediaPlayerImpl::audioBytesDecoded() const
+{
+ DCHECK(MessageLoop::current() == main_loop_);
+
+ media::PipelineStatistics stats = pipeline_->GetStatistics();
+ return stats.audio_bytes_decoded;
+}
+
+unsigned long WebMediaPlayerImpl::videoBytesDecoded() const
+{
+ DCHECK(MessageLoop::current() == main_loop_);
+
+ media::PipelineStatistics stats = pipeline_->GetStatistics();
+ return stats.video_bytes_decoded;
+}
+
WebKit::WebVideoFrame* WebMediaPlayerImpl::getCurrentFrame() {
scoped_refptr<media::VideoFrame> video_frame;
proxy_->GetCurrentFrame(&video_frame);