| 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 1009 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1020 | 1020 |
| 1021 filter->set_message_loop(thread->message_loop()); | 1021 filter->set_message_loop(thread->message_loop()); |
| 1022 filter_threads_.push_back(thread.release()); | 1022 filter_threads_.push_back(thread.release()); |
| 1023 } | 1023 } |
| 1024 | 1024 |
| 1025 // Register ourselves as the filter's host. | 1025 // Register ourselves as the filter's host. |
| 1026 DCHECK(IsPipelineOk()); | 1026 DCHECK(IsPipelineOk()); |
| 1027 DCHECK(filter_types_.find(filter->filter_type()) == filter_types_.end()) | 1027 DCHECK(filter_types_.find(filter->filter_type()) == filter_types_.end()) |
| 1028 << "Filter type " << filter->filter_type() << " already exists"; | 1028 << "Filter type " << filter->filter_type() << " already exists"; |
| 1029 filter->set_host(this); | 1029 filter->set_host(this); |
| 1030 filters_.push_back(filter.get()); | 1030 filters_.push_back(make_scoped_refptr(filter.get())); |
| 1031 filter_types_[filter->filter_type()] = filter.get(); | 1031 filter_types_[filter->filter_type()] = filter.get(); |
| 1032 } | 1032 } |
| 1033 | 1033 |
| 1034 void PipelineImpl::InitializeDataSource() { | 1034 void PipelineImpl::InitializeDataSource() { |
| 1035 DCHECK_EQ(MessageLoop::current(), message_loop_); | 1035 DCHECK_EQ(MessageLoop::current(), message_loop_); |
| 1036 DCHECK(IsPipelineOk()); | 1036 DCHECK(IsPipelineOk()); |
| 1037 | 1037 |
| 1038 scoped_refptr<DataSource> data_source; | 1038 scoped_refptr<DataSource> data_source; |
| 1039 while (true) { | 1039 while (true) { |
| 1040 SelectFilter(FILTER_DATA_SOURCE, &data_source); | 1040 SelectFilter(FILTER_DATA_SOURCE, &data_source); |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1221 this, &PipelineImpl::OnFilterStateTransition)); | 1221 this, &PipelineImpl::OnFilterStateTransition)); |
| 1222 } | 1222 } |
| 1223 } else { | 1223 } else { |
| 1224 state_ = kStopped; | 1224 state_ = kStopped; |
| 1225 message_loop_->PostTask(FROM_HERE, | 1225 message_loop_->PostTask(FROM_HERE, |
| 1226 NewRunnableMethod(this, &PipelineImpl::FinishDestroyingFiltersTask)); | 1226 NewRunnableMethod(this, &PipelineImpl::FinishDestroyingFiltersTask)); |
| 1227 } | 1227 } |
| 1228 } | 1228 } |
| 1229 | 1229 |
| 1230 } // namespace media | 1230 } // namespace media |
| OLD | NEW |