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