diff options
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(); |