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