diff options
author | acolwell@chromium.org <acolwell@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-23 17:49:24 +0000 |
---|---|---|
committer | acolwell@chromium.org <acolwell@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-23 17:49:24 +0000 |
commit | 16ca02ff5b00c4ee51ad9d233e14ade90d5d3ded (patch) | |
tree | 3501d46ada4d5a26287a67413215435f5f96a519 /webkit/glue/webmediaplayer_impl.cc | |
parent | 60e102b8c352484ab9535d2d4be244ef24ac74d5 (diff) | |
download | chromium_src-16ca02ff5b00c4ee51ad9d233e14ade90d5d3ded.zip chromium_src-16ca02ff5b00c4ee51ad9d233e14ade90d5d3ded.tar.gz chromium_src-16ca02ff5b00c4ee51ad9d233e14ade90d5d3ded.tar.bz2 |
Build a raw video pipeline for the <video> with a special src attribute (media://...).
The raw video pipeline graph only has two filters - one pass-thru decoder filter and one renderer filter.
Contributed by ronghuawu@google.com
Original code reviews:
http://codereview.chromium.org/6658001/ (pipeline changes)
http://codereview.chromium.org/6621049/ (pass-thru filter)
BUG=none
TEST=media_unittests
Review URL: http://codereview.chromium.org/6726006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79149 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/webmediaplayer_impl.cc')
-rw-r--r-- | webkit/glue/webmediaplayer_impl.cc | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/webkit/glue/webmediaplayer_impl.cc b/webkit/glue/webmediaplayer_impl.cc index 7ac8e76..54bc600 100644 --- a/webkit/glue/webmediaplayer_impl.cc +++ b/webkit/glue/webmediaplayer_impl.cc @@ -5,6 +5,7 @@ #include "webkit/glue/webmediaplayer_impl.h" #include <limits> +#include <string> #include "base/callback.h" #include "base/command_line.h" @@ -18,6 +19,7 @@ #include "media/filters/ffmpeg_audio_decoder.h" #include "media/filters/ffmpeg_demuxer_factory.h" #include "media/filters/ffmpeg_video_decoder.h" +#include "media/filters/rtc_video_decoder.h" #include "media/filters/null_audio_renderer.h" #include "skia/ext/platform_canvas.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebRect.h" @@ -367,6 +369,17 @@ void WebMediaPlayerImpl::load(const WebKit::WebURL& url) { DCHECK(MessageLoop::current() == main_loop_); DCHECK(proxy_); + if (media::RTCVideoDecoder::IsUrlSupported(url.spec())) { + // Remove the default decoder + scoped_refptr<media::VideoDecoder> old_videodecoder; + filter_collection_->SelectVideoDecoder(&old_videodecoder); + media::RTCVideoDecoder* rtc_video_decoder = + new media::RTCVideoDecoder( + message_loop_factory_->GetMessageLoop("VideoDecoderThread"), + url.spec()); + filter_collection_->AddVideoDecoder(rtc_video_decoder); + } + // Handle any volume changes that occured before load(). setVolume(GetClient()->volume()); @@ -687,32 +700,28 @@ WebKit::WebMediaPlayer::MovieLoadType return WebKit::WebMediaPlayer::Unknown; } -unsigned WebMediaPlayerImpl::decodedFrameCount() const -{ +unsigned WebMediaPlayerImpl::decodedFrameCount() const { DCHECK(MessageLoop::current() == main_loop_); media::PipelineStatistics stats = pipeline_->GetStatistics(); return stats.video_frames_decoded; } -unsigned WebMediaPlayerImpl::droppedFrameCount() const -{ +unsigned WebMediaPlayerImpl::droppedFrameCount() const { DCHECK(MessageLoop::current() == main_loop_); media::PipelineStatistics stats = pipeline_->GetStatistics(); return stats.video_frames_dropped; } -unsigned WebMediaPlayerImpl::audioDecodedByteCount() const -{ +unsigned WebMediaPlayerImpl::audioDecodedByteCount() const { DCHECK(MessageLoop::current() == main_loop_); media::PipelineStatistics stats = pipeline_->GetStatistics(); return stats.audio_bytes_decoded; } -unsigned WebMediaPlayerImpl::videoDecodedByteCount() const -{ +unsigned WebMediaPlayerImpl::videoDecodedByteCount() const { DCHECK(MessageLoop::current() == main_loop_); media::PipelineStatistics stats = pipeline_->GetStatistics(); |