Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1050)

Unified Diff: media/base/pipeline_impl.cc

Issue 3030013: preparation for recycling buffer, patch 2 (Closed)
Patch Set: fix layout test Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/base/pipeline_impl.h ('k') | media/filters/ffmpeg_video_decode_engine.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/pipeline_impl.cc
diff --git a/media/base/pipeline_impl.cc b/media/base/pipeline_impl.cc
index e15492e3e01f90337a853abc0e7dc64d7fca6c51..d8b31924e4f1eae99d632bd94796c61eef127980 100644
--- a/media/base/pipeline_impl.cc
+++ b/media/base/pipeline_impl.cc
@@ -57,19 +57,6 @@ const char* GetThreadName() {
}
}
-// Helper function used with NewRunnableMethod to implement a (very) crude
-// blocking counter.
-//
-// TODO(scherkus): remove this as soon as Stop() is made asynchronous.
-void DecrementCounter(Lock* lock, ConditionVariable* cond_var, int* count) {
- AutoLock auto_lock(*lock);
- --(*count);
- CHECK(*count >= 0);
- if (*count == 0) {
- cond_var->Signal();
- }
-}
-
} // namespace
PipelineImpl::PipelineImpl(MessageLoop* message_loop)
@@ -149,6 +136,7 @@ bool PipelineImpl::IsInitialized() const {
AutoLock auto_lock(lock_);
switch (state_) {
case kPausing:
+ case kFlushing:
case kSeeking:
case kStarting:
case kStarted:
@@ -382,6 +370,7 @@ void PipelineImpl::FinishInitialization() {
// static
bool PipelineImpl::TransientState(State state) {
return state == kPausing ||
+ state == kFlushing ||
state == kSeeking ||
state == kStarting ||
state == kStopping;
@@ -391,6 +380,8 @@ bool PipelineImpl::TransientState(State state) {
PipelineImpl::State PipelineImpl::FindNextState(State current) {
// TODO(scherkus): refactor InitializeTask() to make use of this function.
if (current == kPausing)
+ return kFlushing;
+ if (current == kFlushing)
return kSeeking;
if (current == kSeeking)
return kStarting;
@@ -842,6 +833,8 @@ void PipelineImpl::FilterStateTransitionTask() {
MediaFilter* filter = filters_[filters_.size() - remaining_transitions_];
if (state_ == kPausing) {
filter->Pause(NewCallback(this, &PipelineImpl::OnFilterStateTransition));
+ } else if (state_ == kFlushing) {
+ filter->Flush(NewCallback(this, &PipelineImpl::OnFilterStateTransition));
} else if (state_ == kSeeking) {
filter->Seek(seek_timestamp_,
NewCallback(this, &PipelineImpl::OnFilterStateTransition));
« no previous file with comments | « media/base/pipeline_impl.h ('k') | media/filters/ffmpeg_video_decode_engine.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698