diff options
author | scherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-12 17:51:56 +0000 |
---|---|---|
committer | scherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-12 17:51:56 +0000 |
commit | cec4eb8eb2fe3c19376d26d52ad85cb98d949fae (patch) | |
tree | 6e5d9b01bbea404d54ae714881990c83d4c85fae /webkit/media | |
parent | 262b51025f77a5f72c9b07614cbb730966d8ccd3 (diff) | |
download | chromium_src-cec4eb8eb2fe3c19376d26d52ad85cb98d949fae.zip chromium_src-cec4eb8eb2fe3c19376d26d52ad85cb98d949fae.tar.gz chromium_src-cec4eb8eb2fe3c19376d26d52ad85cb98d949fae.tar.bz2 |
Remove --simple-data-source and convert WebMediaPlayerImpl::Initialize() to a void function.
This is a step in removing WebMediaPlayerImpl::Initialize() entirely.
BUG=109958
Review URL: http://codereview.chromium.org/9195001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@117447 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/media')
-rw-r--r-- | webkit/media/webmediaplayer_impl.cc | 21 | ||||
-rw-r--r-- | webkit/media/webmediaplayer_impl.h | 35 |
2 files changed, 20 insertions, 36 deletions
diff --git a/webkit/media/webmediaplayer_impl.cc b/webkit/media/webmediaplayer_impl.cc index c9aa47f..8a181c7 100644 --- a/webkit/media/webmediaplayer_impl.cc +++ b/webkit/media/webmediaplayer_impl.cc @@ -132,16 +132,11 @@ WebMediaPlayerImpl::WebMediaPlayerImpl( media_log_->CreateEvent(media::MediaLogEvent::WEBMEDIAPLAYER_CREATED)); } -bool WebMediaPlayerImpl::Initialize( - WebKit::WebFrame* frame, - bool use_simple_data_source) { +void WebMediaPlayerImpl::Initialize(WebKit::WebFrame* frame) { DCHECK_EQ(main_loop_, MessageLoop::current()); MessageLoop* pipeline_message_loop = message_loop_factory_->GetMessageLoop("PipelineThread"); - if (!pipeline_message_loop) { - NOTREACHED() << "Could not start PipelineThread"; - return false; - } + CHECK(pipeline_message_loop) << "Failed to create a new thread"; // Let V8 know we started new thread if we did not did it yet. // Made separate task to avoid deletion of player currently being created. @@ -195,14 +190,8 @@ bool WebMediaPlayerImpl::Initialize( scoped_ptr<media::CompositeDataSourceFactory> data_source_factory( new media::CompositeDataSourceFactory()); - - if (use_simple_data_source) { - data_source_factory->AddFactory(simple_data_source_factory.Pass()); - data_source_factory->AddFactory(buffered_data_source_factory.Pass()); - } else { - data_source_factory->AddFactory(buffered_data_source_factory.Pass()); - data_source_factory->AddFactory(simple_data_source_factory.Pass()); - } + data_source_factory->AddFactory(buffered_data_source_factory.Pass()); + data_source_factory->AddFactory(simple_data_source_factory.Pass()); scoped_ptr<media::DemuxerFactory> demuxer_factory( // TODO(fischman): replace the extra scoped_ptr+release() with Pass() when @@ -226,8 +215,6 @@ bool WebMediaPlayerImpl::Initialize( filter_collection_->AddVideoDecoder(new media::FFmpegVideoDecoder( message_loop_factory_->GetMessageLoop("VideoDecoderThread"))); filter_collection_->AddAudioRenderer(new media::NullAudioRenderer()); - - return true; } WebMediaPlayerImpl::~WebMediaPlayerImpl() { diff --git a/webkit/media/webmediaplayer_impl.h b/webkit/media/webmediaplayer_impl.h index b9600ec..1e14a5c 100644 --- a/webkit/media/webmediaplayer_impl.h +++ b/webkit/media/webmediaplayer_impl.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -86,23 +86,18 @@ class WebMediaPlayerImpl // Construct a WebMediaPlayerImpl with reference to the client, and media // filter collection. By providing the filter collection the implementor can // provide more specific media filters that does resource loading and - // rendering. |collection| should contain filter factories for: - // 1. Data source - // 2. Audio renderer - // 3. Video renderer (optional) + // rendering. + // + // WebMediaPlayerImpl comes packaged with the following media filters: + // - URL fetching + // - Demuxing + // - Software audio/video decoding + // - Video rendering + // + // Clients are expected to add their platform-specific audio rendering media + // filter if they wish to hear any sound coming out the speakers, otherwise + // audio data is discarded and media plays back based on wall clock time. // - // There are some default filters provided by this method: - // 1. FFmpeg demuxer - // 2. FFmpeg audio decoder - // 3. FFmpeg video decoder - // 4. Video renderer - // 5. Null audio renderer - // The video renderer provided by this class is using the graphics context - // provided by WebKit to perform renderering. The simple data source does - // resource loading by loading the whole resource object into memory. Null - // audio renderer is a fake audio device that plays silence. Provider of the - // |collection| can override the default filters by adding extra filters to - // |collection| before calling this method. // This object takes ownership of the |audio_source_provider|. // // Callers must call |Initialize()| before they can use the object. @@ -115,8 +110,10 @@ class WebMediaPlayerImpl media::MediaLog* media_log); virtual ~WebMediaPlayerImpl(); - // Finalizes initialization of the object. - bool Initialize(WebKit::WebFrame* frame, bool use_simple_data_source); + // Finalizes initialization of the object using the given WebFrame. + // + // TODO(scherkus): fold this into the constructor http://crbug.com/109958 + void Initialize(WebKit::WebFrame* frame); virtual void load(const WebKit::WebURL& url); virtual void cancelLoad(); |