summaryrefslogtreecommitdiffstats
path: root/webkit/glue/webmediaplayer_impl.cc
diff options
context:
space:
mode:
authorscherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-03 05:40:13 +0000
committerscherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-03 05:40:13 +0000
commit9e166974e33f359467458af13987c3d87663c163 (patch)
tree63ddfaa99458d1d06b120ec99383f6ff814933da /webkit/glue/webmediaplayer_impl.cc
parentbcc26067bf9a0bb7fe1600119a5b034b36b86da4 (diff)
downloadchromium_src-9e166974e33f359467458af13987c3d87663c163.zip
chromium_src-9e166974e33f359467458af13987c3d87663c163.tar.gz
chromium_src-9e166974e33f359467458af13987c3d87663c163.tar.bz2
Move MediaFilterCollection code into a class.
Refactored FilterType usage a bit to remove the need to manually associate FilterType values to filter base classes. Patch by acolwell@chromium.org: http://codereview.chromium.org/4176006/show BUG=60778 TEST=media_unittests git-svn-id: svn://svn.chromium.org/chrome/trunk/src@64885 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/webmediaplayer_impl.cc')
-rw-r--r--webkit/glue/webmediaplayer_impl.cc24
1 files changed, 10 insertions, 14 deletions
diff --git a/webkit/glue/webmediaplayer_impl.cc b/webkit/glue/webmediaplayer_impl.cc
index 21a083d..919cf2e 100644
--- a/webkit/glue/webmediaplayer_impl.cc
+++ b/webkit/glue/webmediaplayer_impl.cc
@@ -224,7 +224,7 @@ void WebMediaPlayerImpl::Proxy::PutCurrentFrame(
WebMediaPlayerImpl::WebMediaPlayerImpl(
WebKit::WebMediaPlayerClient* client,
- const media::MediaFilterCollection& collection,
+ media::MediaFilterCollection* collection,
MediaResourceLoaderBridgeFactory* bridge_factory_simple,
MediaResourceLoaderBridgeFactory* bridge_factory_buffered,
bool use_simple_data_source,
@@ -276,22 +276,18 @@ WebMediaPlayerImpl::WebMediaPlayerImpl(
proxy_->SetDataSource(buffered_data_source);
if (use_simple_data_source) {
- filter_collection_.push_back(simple_data_source);
- filter_collection_.push_back(buffered_data_source);
+ filter_collection_->AddFilter(simple_data_source);
+ filter_collection_->AddFilter(buffered_data_source);
} else {
- filter_collection_.push_back(buffered_data_source);
- filter_collection_.push_back(simple_data_source);
+ filter_collection_->AddFilter(buffered_data_source);
+ filter_collection_->AddFilter(simple_data_source);
}
// Add in the default filter factories.
- filter_collection_.push_back(make_scoped_refptr(
- new media::FFmpegDemuxer()));
- filter_collection_.push_back(make_scoped_refptr(
- new media::FFmpegAudioDecoder()));
- filter_collection_.push_back(make_scoped_refptr(
- new media::FFmpegVideoDecoder(NULL)));
- filter_collection_.push_back(make_scoped_refptr(
- new media::NullAudioRenderer()));
+ filter_collection_->AddFilter(new media::FFmpegDemuxer());
+ filter_collection_->AddFilter(new media::FFmpegAudioDecoder());
+ filter_collection_->AddFilter(new media::FFmpegVideoDecoder(NULL));
+ filter_collection_->AddFilter(new media::NullAudioRenderer());
}
WebMediaPlayerImpl::~WebMediaPlayerImpl() {
@@ -315,7 +311,7 @@ void WebMediaPlayerImpl::load(const WebKit::WebURL& url) {
SetNetworkState(WebKit::WebMediaPlayer::Loading);
SetReadyState(WebKit::WebMediaPlayer::HaveNothing);
pipeline_->Start(
- filter_collection_,
+ filter_collection_.release(),
url.spec(),
NewCallback(proxy_.get(),
&WebMediaPlayerImpl::Proxy::PipelineInitializationCallback));