diff options
author | scherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-16 02:03:16 +0000 |
---|---|---|
committer | scherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-16 02:03:16 +0000 |
commit | 4c51bc66e6496234d5a3a7cbdfb1cf07cca2167e (patch) | |
tree | 03e28346b7752cec02e91ba925694548b49b8184 /chrome/gpu | |
parent | 9cadfb34adaf42ad30e398b24ab06e5bc587e57a (diff) | |
download | chromium_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 'chrome/gpu')
-rw-r--r-- | chrome/gpu/gpu_video_decoder.cc | 5 | ||||
-rw-r--r-- | chrome/gpu/gpu_video_decoder.h | 6 | ||||
-rw-r--r-- | chrome/gpu/gpu_video_decoder_unittest.cc | 4 | ||||
-rw-r--r-- | chrome/gpu/media/fake_gl_video_decode_engine.cc | 4 | ||||
-rw-r--r-- | chrome/gpu/media/fake_gl_video_decode_engine.h | 4 |
5 files changed, 17 insertions, 6 deletions
diff --git a/chrome/gpu/gpu_video_decoder.cc b/chrome/gpu/gpu_video_decoder.cc index ee213bf..c1210d4 100644 --- a/chrome/gpu/gpu_video_decoder.cc +++ b/chrome/gpu/gpu_video_decoder.cc @@ -121,7 +121,10 @@ void GpuVideoDecoder::ProduceVideoSample(scoped_refptr<Buffer> buffer) { SendEmptyBufferDone(); } -void GpuVideoDecoder::ConsumeVideoFrame(scoped_refptr<VideoFrame> frame) { +void GpuVideoDecoder::ConsumeVideoFrame(scoped_refptr<VideoFrame> frame, + const PipelineStatistics& statistics) { + // TODO(sjl): Do something with the statistics... + if (frame->IsEndOfStream()) { SendConsumeVideoFrame(kGpuVideoInvalidFrameId, 0, 0, kGpuVideoEndOfStream); return; diff --git a/chrome/gpu/gpu_video_decoder.h b/chrome/gpu/gpu_video_decoder.h index ae1da3b..5fcd5cc 100644 --- a/chrome/gpu/gpu_video_decoder.h +++ b/chrome/gpu/gpu_video_decoder.h @@ -18,11 +18,12 @@ #include "media/video/video_decode_engine.h" #include "ipc/ipc_channel.h" +using media::Buffer; +using media::PipelineStatistics; using media::VideoCodecConfig; using media::VideoCodecInfo; using media::VideoStreamInfo; using media::VideoFrame; -using media::Buffer; namespace gpu { namespace gles2 { @@ -112,7 +113,8 @@ class GpuVideoDecoder virtual void OnError(); virtual void OnFormatChange(VideoStreamInfo stream_info); virtual void ProduceVideoSample(scoped_refptr<Buffer> buffer); - virtual void ConsumeVideoFrame(scoped_refptr<VideoFrame> frame); + virtual void ConsumeVideoFrame(scoped_refptr<VideoFrame> frame, + const PipelineStatistics& statistics); // VideoDecodeContext implementation. virtual void* GetDevice(); diff --git a/chrome/gpu/gpu_video_decoder_unittest.cc b/chrome/gpu/gpu_video_decoder_unittest.cc index 7767dcd..f88f30c 100644 --- a/chrome/gpu/gpu_video_decoder_unittest.cc +++ b/chrome/gpu/gpu_video_decoder_unittest.cc @@ -8,6 +8,7 @@ #include "chrome/gpu/gpu_video_decoder.h" #include "gpu/command_buffer/service/gles2_cmd_decoder_mock.h" #include "ipc/ipc_message_utils.h" +#include "media/base/pipeline.h" #include "media/video/video_mock_objects.h" #include "testing/gtest/include/gtest/gtest.h" @@ -62,7 +63,8 @@ ACTION_P(SendVideoFrameAllocated, handler) { } ACTION_P2(SendConsumeVideoFrame, handler, frame) { - handler->ConsumeVideoFrame(frame); + media::PipelineStatistics statistics; + handler->ConsumeVideoFrame(frame, statistics); } class GpuVideoDecoderTest : public testing::Test, diff --git a/chrome/gpu/media/fake_gl_video_decode_engine.cc b/chrome/gpu/media/fake_gl_video_decode_engine.cc index db0f7a5..0e6a696 100644 --- a/chrome/gpu/media/fake_gl_video_decode_engine.cc +++ b/chrome/gpu/media/fake_gl_video_decode_engine.cc @@ -75,7 +75,7 @@ void FakeGlVideoDecodeEngine::Seek() { // *push* decoded frames to downstream. The model used in VideoRendererBase // to wait for *push* is flawed. for (size_t i = 0; i < external_frames_.size(); ++i) - handler_->ConsumeVideoFrame(external_frames_[i]); + handler_->ConsumeVideoFrame(external_frames_[i], dummy_stats_); handler_->OnSeekComplete(); } @@ -126,7 +126,7 @@ void FakeGlVideoDecodeEngine::ProduceVideoFrame( void FakeGlVideoDecodeEngine::UploadCompleteTask( scoped_refptr<media::VideoFrame> frame) { // |frame| is the upload target. We can immediately send this frame out. - handler_->ConsumeVideoFrame(frame); + handler_->ConsumeVideoFrame(frame, dummy_stats_); } DISABLE_RUNNABLE_METHOD_REFCOUNT(FakeGlVideoDecodeEngine); diff --git a/chrome/gpu/media/fake_gl_video_decode_engine.h b/chrome/gpu/media/fake_gl_video_decode_engine.h index 24d3b33..9ffe4268 100644 --- a/chrome/gpu/media/fake_gl_video_decode_engine.h +++ b/chrome/gpu/media/fake_gl_video_decode_engine.h @@ -9,6 +9,7 @@ #include <vector> #include "base/scoped_ptr.h" +#include "media/base/pipeline.h" #include "media/video/video_decode_engine.h" namespace media { @@ -58,6 +59,9 @@ class FakeGlVideoDecodeEngine : public media::VideoDecodeEngine { // fake pattern in them. std::queue<scoped_refptr<media::VideoFrame> > pending_frames_; + // Dummy statistics. + media::PipelineStatistics dummy_stats_; + DISALLOW_COPY_AND_ASSIGN(FakeGlVideoDecodeEngine); }; |