| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 // | 4 // |
| 5 // TODO(scherkus): clean up PipelineImpl... too many crazy function names, | 5 // TODO(scherkus): clean up PipelineImpl... too many crazy function names, |
| 6 // potential deadlocks, etc... | 6 // potential deadlocks, etc... |
| 7 | 7 |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/stl_util-inl.h" | 10 #include "base/stl_util-inl.h" |
| (...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 370 } | 370 } |
| 371 | 371 |
| 372 // static | 372 // static |
| 373 PipelineImpl::State PipelineImpl::FindNextState(State current) { | 373 PipelineImpl::State PipelineImpl::FindNextState(State current) { |
| 374 // TODO(scherkus): refactor InitializeTask() to make use of this function. | 374 // TODO(scherkus): refactor InitializeTask() to make use of this function. |
| 375 if (current == kPausing) { | 375 if (current == kPausing) { |
| 376 return kFlushing; | 376 return kFlushing; |
| 377 } else if (current == kFlushing) { | 377 } else if (current == kFlushing) { |
| 378 // We will always honor Seek() before Stop(). This is based on the | 378 // We will always honor Seek() before Stop(). This is based on the |
| 379 // assumption that we never accept Seek() after Stop(). | 379 // assumption that we never accept Seek() after Stop(). |
| 380 DCHECK(IsPipelineSeeking() || IsPipelineStopPending()); | 380 DCHECK(IsPipelineSeeking() || |
| 381 IsPipelineStopPending() || |
| 382 IsPipelineTearingDown()); |
| 381 return IsPipelineSeeking() ? kSeeking : kStopping; | 383 return IsPipelineSeeking() ? kSeeking : kStopping; |
| 382 } else if (current == kSeeking) { | 384 } else if (current == kSeeking) { |
| 383 return kStarting; | 385 return kStarting; |
| 384 } else if (current == kStarting) { | 386 } else if (current == kStarting) { |
| 385 return kStarted; | 387 return kStarted; |
| 386 } else if (current == kStopping) { | 388 } else if (current == kStopping) { |
| 387 return error_caused_teardown_ ? kError : kStopped; | 389 return error_caused_teardown_ ? kError : kStopped; |
| 388 } else { | 390 } else { |
| 389 return current; | 391 return current; |
| 390 } | 392 } |
| (...skipping 773 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1164 case kStopping: | 1166 case kStopping: |
| 1165 case kStopped: | 1167 case kStopped: |
| 1166 NOTREACHED() << "Unexpected state for teardown: " << state_; | 1168 NOTREACHED() << "Unexpected state for teardown: " << state_; |
| 1167 break; | 1169 break; |
| 1168 // default: intentionally left out to force new states to cause compiler | 1170 // default: intentionally left out to force new states to cause compiler |
| 1169 // errors. | 1171 // errors. |
| 1170 }; | 1172 }; |
| 1171 } | 1173 } |
| 1172 | 1174 |
| 1173 } // namespace media | 1175 } // namespace media |
| OLD | NEW |