summaryrefslogtreecommitdiffstats
path: root/webkit/glue/webmediaplayer_impl.cc
diff options
context:
space:
mode:
authoracolwell@chromium.org <acolwell@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-23 21:28:59 +0000
committeracolwell@chromium.org <acolwell@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-23 21:28:59 +0000
commitd82b18ae3cf1a5976e85f773e9212431e46146cb (patch)
tree7547c63a852a7e9164985fedd9de7622a59234a5 /webkit/glue/webmediaplayer_impl.cc
parent238ca86df5ced41e7de04492fb547259803a93a4 (diff)
downloadchromium_src-d82b18ae3cf1a5976e85f773e9212431e46146cb.zip
chromium_src-d82b18ae3cf1a5976e85f773e9212431e46146cb.tar.gz
chromium_src-d82b18ae3cf1a5976e85f773e9212431e46146cb.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 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=79149 Review URL: http://codereview.chromium.org/6726006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79185 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/webmediaplayer_impl.cc')
-rw-r--r--webkit/glue/webmediaplayer_impl.cc25
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();