diff options
author | scherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-08 19:19:32 +0000 |
---|---|---|
committer | scherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-08 19:19:32 +0000 |
commit | c599d0b35fa92e0fa1d84fb1d010f61b8c763889 (patch) | |
tree | ba3991237854cfc3ac604bfff2395ec619514d60 /media | |
parent | ac5c0e9d02a9fe80cd9ee6c0cba651ff2ccd3d55 (diff) | |
download | chromium_src-c599d0b35fa92e0fa1d84fb1d010f61b8c763889.zip chromium_src-c599d0b35fa92e0fa1d84fb1d010f61b8c763889.tar.gz chromium_src-c599d0b35fa92e0fa1d84fb1d010f61b8c763889.tar.bz2 |
Revert 150591 - Remove Pipeline::kEnded state as it is redundant with Pipeline::kStarted.
Review URL: https://chromiumcodereview.appspot.com/10855041
TBR=scherkus@chromium.org
Review URL: https://chromiumcodereview.appspot.com/10832209
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@150599 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media')
-rw-r--r-- | media/base/media_log.cc | 2 | ||||
-rw-r--r-- | media/base/pipeline.cc | 9 | ||||
-rw-r--r-- | media/base/pipeline.h | 4 |
3 files changed, 13 insertions, 2 deletions
diff --git a/media/base/media_log.cc b/media/base/media_log.cc index eead734..d52c24b 100644 --- a/media/base/media_log.cc +++ b/media/base/media_log.cc @@ -81,6 +81,8 @@ const char* MediaLog::PipelineStateToString(Pipeline::State state) { return "starting"; case Pipeline::kStarted: return "started"; + case Pipeline::kEnded: + return "ended"; case Pipeline::kStopping: return "stopping"; case Pipeline::kStopped: diff --git a/media/base/pipeline.cc b/media/base/pipeline.cc index 022f024..470f186 100644 --- a/media/base/pipeline.cc +++ b/media/base/pipeline.cc @@ -151,6 +151,7 @@ bool Pipeline::IsInitialized() const { case kSeeking: case kStarting: case kStarted: + case kEnded: return true; default: return false; @@ -795,7 +796,7 @@ void Pipeline::SeekTask(TimeDelta time, const PipelineStatusCB& seek_cb) { DCHECK(!IsPipelineStopPending()); // Suppress seeking if we're not fully started. - if (state_ != kStarted) { + if (state_ != kStarted && state_ != kEnded) { // TODO(scherkus): should we run the callback? I'm tempted to say the API // will only execute the first Seek() request. DVLOG(1) << "Media pipeline has not started, ignoring seek to " @@ -808,7 +809,7 @@ void Pipeline::SeekTask(TimeDelta time, const PipelineStatusCB& seek_cb) { // We'll need to pause every filter before seeking. The state transition // is as follows: - // kStarted + // kStarted/kEnded // kPausing (for each filter) // kSeeking (for each filter) // kStarting (for each filter) @@ -853,6 +854,8 @@ void Pipeline::OnRendererEndedTask() { return; } + // Transition to ended, executing the callback if present. + SetState(kEnded); { base::AutoLock auto_lock(lock_); clock_->EndOfStream(); @@ -987,6 +990,7 @@ void Pipeline::TeardownStateTransitionTask() { case kStarting: case kStopped: case kStarted: + case kEnded: NOTREACHED() << "Unexpected state for teardown: " << state_; break; // default: intentionally left out to force new states to cause compiler @@ -1215,6 +1219,7 @@ void Pipeline::TearDownPipeline() { break; case kStarted: + case kEnded: SetState(kPausing); DoPause(base::Bind(&Pipeline::OnTeardownStateTransition, this)); break; diff --git a/media/base/pipeline.h b/media/base/pipeline.h index 9dfbf55..1d50f04 100644 --- a/media/base/pipeline.h +++ b/media/base/pipeline.h @@ -80,6 +80,9 @@ class MEDIA_EXPORT PipelineStatusNotification { // | | // V Seek()/Stop() | // [ Started ] -------------------------> [ Pausing (for each filter) ] +// | ^ +// | OnRendererEnded() Seek()/Stop() | +// `-------------> [ Ended ] ---------------------' // ^ SetError() // | // [ Any State Other Than InitXXX ] @@ -243,6 +246,7 @@ class MEDIA_EXPORT Pipeline kFlushing, kStarting, kStarted, + kEnded, kStopping, kStopped, kError, |