| OLD | NEW |
| 1 // Copyright (c) 2008-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2008-2009 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/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/condition_variable.h" | 9 #include "base/condition_variable.h" |
| 10 #include "base/stl_util-inl.h" | 10 #include "base/stl_util-inl.h" |
| (...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 597 scoped_ptr<FilterHostImpl> host(new FilterHostImpl(this, filter.get())); | 597 scoped_ptr<FilterHostImpl> host(new FilterHostImpl(this, filter.get())); |
| 598 // Create a dedicated thread for this filter. | 598 // Create a dedicated thread for this filter. |
| 599 if (SupportsSetMessageLoop<Filter>()) { | 599 if (SupportsSetMessageLoop<Filter>()) { |
| 600 // TODO(scherkus): figure out a way to name these threads so it matches | 600 // TODO(scherkus): figure out a way to name these threads so it matches |
| 601 // the filter type. | 601 // the filter type. |
| 602 scoped_ptr<base::Thread> thread(new base::Thread("FilterThread")); | 602 scoped_ptr<base::Thread> thread(new base::Thread("FilterThread")); |
| 603 if (!thread.get() || !thread->Start()) { | 603 if (!thread.get() || !thread->Start()) { |
| 604 NOTREACHED() << "Could not start filter thread"; | 604 NOTREACHED() << "Could not start filter thread"; |
| 605 Error(PIPELINE_ERROR_INITIALIZATION_FAILED); | 605 Error(PIPELINE_ERROR_INITIALIZATION_FAILED); |
| 606 } else { | 606 } else { |
| 607 filter->SetMessageLoop(thread->message_loop()); | 607 filter->set_message_loop(thread->message_loop()); |
| 608 filter_threads_.push_back(thread.release()); | 608 filter_threads_.push_back(thread.release()); |
| 609 } | 609 } |
| 610 } | 610 } |
| 611 | 611 |
| 612 // Creating a thread could have failed, verify we're still OK. | 612 // Creating a thread could have failed, verify we're still OK. |
| 613 if (IsPipelineOk()) { | 613 if (IsPipelineOk()) { |
| 614 filter_hosts_.push_back(host.get()); | 614 filter_hosts_.push_back(host.get()); |
| 615 filter->SetFilterHost(host.release()); | 615 filter->set_host(host.release()); |
| 616 if (!filter->Initialize(source)) { | 616 if (!filter->Initialize(source)) { |
| 617 Error(PIPELINE_ERROR_INITIALIZATION_FAILED); | 617 Error(PIPELINE_ERROR_INITIALIZATION_FAILED); |
| 618 } | 618 } |
| 619 } | 619 } |
| 620 } | 620 } |
| 621 } | 621 } |
| 622 | 622 |
| 623 void PipelineThread::CreateDataSource() { | 623 void PipelineThread::CreateDataSource() { |
| 624 DCHECK_EQ(PlatformThread::CurrentId(), thread_.thread_id()); | 624 DCHECK_EQ(PlatformThread::CurrentId(), thread_.thread_id()); |
| 625 DCHECK(IsPipelineOk()); | 625 DCHECK(IsPipelineOk()); |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 686 | 686 |
| 687 *filter_out = NULL; | 687 *filter_out = NULL; |
| 688 for (FilterHostVector::const_iterator iter = filter_hosts_.begin(); | 688 for (FilterHostVector::const_iterator iter = filter_hosts_.begin(); |
| 689 iter != filter_hosts_.end() && NULL == *filter_out; | 689 iter != filter_hosts_.end() && NULL == *filter_out; |
| 690 iter++) { | 690 iter++) { |
| 691 (*iter)->GetFilter(filter_out); | 691 (*iter)->GetFilter(filter_out); |
| 692 } | 692 } |
| 693 } | 693 } |
| 694 | 694 |
| 695 } // namespace media | 695 } // namespace media |
| OLD | NEW |