diff options
author | scherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-15 17:39:56 +0000 |
---|---|---|
committer | scherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-15 17:39:56 +0000 |
commit | 2216d02d83e8c7ef50187384f6ce24ebeb16962c (patch) | |
tree | 4eab5dbf6b59a363925d7fa4f7cc1e12c360f752 /media/base/pipeline_impl.cc | |
parent | aa8cc5a24cb681eb307635679a69512548896b5e (diff) | |
download | chromium_src-2216d02d83e8c7ef50187384f6ce24ebeb16962c.zip chromium_src-2216d02d83e8c7ef50187384f6ce24ebeb16962c.tar.gz chromium_src-2216d02d83e8c7ef50187384f6ce24ebeb16962c.tar.bz2 |
Revert "Splitting media filter's Initialize() into Create() + callback and Seek() + callback."
Review URL: http://codereview.chromium.org/149682
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20745 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/base/pipeline_impl.cc')
-rw-r--r-- | media/base/pipeline_impl.cc | 34 |
1 files changed, 15 insertions, 19 deletions
diff --git a/media/base/pipeline_impl.cc b/media/base/pipeline_impl.cc index 7ef051d..f021ad3 100644 --- a/media/base/pipeline_impl.cc +++ b/media/base/pipeline_impl.cc @@ -328,6 +328,15 @@ void PipelineInternal::VolumeChanged(float volume) { NewRunnableMethod(this, &PipelineInternal::VolumeChangedTask, volume)); } +// Called from any thread. +void PipelineInternal::InitializationComplete(FilterHostImpl* host) { + if (IsPipelineOk()) { + // Continue the initialize task by proceeding to the next stage. + message_loop_->PostTask(FROM_HERE, + NewRunnableMethod(this, &PipelineInternal::InitializeTask)); + } +} + // Called from any thread. Updates the pipeline time. void PipelineInternal::SetTime(base::TimeDelta time) { // TODO(scherkus): why not post a task? @@ -341,19 +350,6 @@ void PipelineInternal::Error(PipelineError error) { NewRunnableMethod(this, &PipelineInternal::ErrorTask, error)); } -// Called from any thread. -void PipelineInternal::OnFilterInitialize() { - // Continue the initialize task by proceeding to the next stage. - message_loop_->PostTask(FROM_HERE, - NewRunnableMethod(this, &PipelineInternal::InitializeTask)); -} - -// Called from any thread. -void PipelineInternal::OnFilterSeek() { - // TODO(scherkus): have PipelineInternal wait to receive replies from every - // filter before calling the client's |seek_callback_|. -} - void PipelineInternal::StartTask(FilterFactory* filter_factory, const std::string& url, PipelineCallback* start_callback) { @@ -387,8 +383,8 @@ void PipelineInternal::StartTask(FilterFactory* filter_factory, void PipelineInternal::InitializeTask() { DCHECK_EQ(MessageLoop::current(), message_loop_); - // If we have received the stop or error signal, return immediately. - if (state_ == kStopped || state_ == kError) + // If we have received the stop signal, return immediately. + if (state_ == kStopped) return; DCHECK(state_ == kCreated || IsPipelineInitializing()); @@ -555,8 +551,7 @@ void PipelineInternal::SeekTask(base::TimeDelta time, for (FilterHostVector::iterator iter = filter_hosts_.begin(); iter != filter_hosts_.end(); ++iter) { - (*iter)->media_filter()->Seek(time, - NewCallback(this, &PipelineInternal::OnFilterSeek)); + (*iter)->media_filter()->Seek(time); } // TODO(hclam): we should set the time when the above seek operations were all @@ -607,8 +602,9 @@ void PipelineInternal::CreateFilter(FilterFactory* filter_factory, filter_hosts_.push_back(host.release()); // Now initialize the filter. - filter->Initialize(source, - NewCallback(this, &PipelineInternal::OnFilterInitialize)); + if (!filter->Initialize(source)) { + Error(PIPELINE_ERROR_INITIALIZATION_FAILED); + } } void PipelineInternal::CreateDataSource() { |