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/condition_variable.h" | 10 #include "base/condition_variable.h" |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 if (running_) { | 86 if (running_) { |
87 LOG(INFO) << "Media pipeline is already running"; | 87 LOG(INFO) << "Media pipeline is already running"; |
88 return false; | 88 return false; |
89 } | 89 } |
90 if (!factory) { | 90 if (!factory) { |
91 return false; | 91 return false; |
92 } | 92 } |
93 | 93 |
94 // Kick off initialization! | 94 // Kick off initialization! |
95 running_ = true; | 95 running_ = true; |
96 message_loop_->PostTask( | 96 message_loop_->PostTask(FROM_HERE, |
97 FROM_HERE, | 97 NewRunnableMethod(this, &PipelineImpl::StartTask, factory, url, |
98 NewRunnableMethod(this, | |
99 &PipelineImpl::StartTask, | |
100 make_scoped_refptr(factory), | |
101 url, | |
102 callback.release())); | 98 callback.release())); |
103 return true; | 99 return true; |
104 } | 100 } |
105 | 101 |
106 void PipelineImpl::Stop(PipelineCallback* stop_callback) { | 102 void PipelineImpl::Stop(PipelineCallback* stop_callback) { |
107 AutoLock auto_lock(lock_); | 103 AutoLock auto_lock(lock_); |
108 scoped_ptr<PipelineCallback> callback(stop_callback); | 104 scoped_ptr<PipelineCallback> callback(stop_callback); |
109 if (!running_) { | 105 if (!running_) { |
110 LOG(INFO) << "Media pipeline has already stopped"; | 106 LOG(INFO) << "Media pipeline has already stopped"; |
111 return; | 107 return; |
(...skipping 995 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1107 this, &PipelineImpl::OnFilterStateTransition)); | 1103 this, &PipelineImpl::OnFilterStateTransition)); |
1108 } | 1104 } |
1109 } else { | 1105 } else { |
1110 state_ = kStopped; | 1106 state_ = kStopped; |
1111 message_loop_->PostTask(FROM_HERE, | 1107 message_loop_->PostTask(FROM_HERE, |
1112 NewRunnableMethod(this, &PipelineImpl::FinishDestroyingFiltersTask)); | 1108 NewRunnableMethod(this, &PipelineImpl::FinishDestroyingFiltersTask)); |
1113 } | 1109 } |
1114 } | 1110 } |
1115 | 1111 |
1116 } // namespace media | 1112 } // namespace media |
OLD | NEW |