diff options
author | kylep@chromium.org <kylep@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-30 18:51:52 +0000 |
---|---|---|
committer | kylep@chromium.org <kylep@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-30 18:51:52 +0000 |
commit | db190487d2bc37ef9a2852d948bd8dd4548a98bd (patch) | |
tree | bba60ce128d4e214663cbd45e6620224e2cf3ae4 /media/base/pipeline_impl.cc | |
parent | 66f16b11638993ead4028e853d5565a74b9acba3 (diff) | |
download | chromium_src-db190487d2bc37ef9a2852d948bd8dd4548a98bd.zip chromium_src-db190487d2bc37ef9a2852d948bd8dd4548a98bd.tar.gz chromium_src-db190487d2bc37ef9a2852d948bd8dd4548a98bd.tar.bz2 |
Pipeline will execute a callback whenever an run-time error has happened.
BUG=16738
TEST=pipeline_impl_unittest.cc
Review URL: http://codereview.chromium.org/160298
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22075 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/base/pipeline_impl.cc')
-rw-r--r-- | media/base/pipeline_impl.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/media/base/pipeline_impl.cc b/media/base/pipeline_impl.cc index 10ab9a3..05ee62e 100644 --- a/media/base/pipeline_impl.cc +++ b/media/base/pipeline_impl.cc @@ -247,6 +247,10 @@ PipelineError PipelineImpl::GetError() const { return error_; } +void PipelineImpl::SetPipelineErrorCallback(PipelineCallback* error_callback) { + error_callback_.reset(error_callback); +} + void PipelineImpl::ResetState() { AutoLock auto_lock(lock_); const base::TimeDelta kZero; @@ -551,6 +555,12 @@ void PipelineImpl::ErrorChangedTask(PipelineError error) { // Destroy every filter and reset the pipeline as well. DestroyFilters(); + + // If our owner has requested to be notified of an error, execute + // |error_callback_| unless we have a "good" error. + if (error_callback_.get() && error != PIPELINE_STOPPING) { + error_callback_->Run(); + } } void PipelineImpl::PlaybackRateChangedTask(float playback_rate) { |