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

Unified Diff: media/base/pipeline_impl.cc

Issue 146068: Switching decoders to use the injected message loop. (Closed)
Patch Set: More fixes Created 11 years, 6 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/filters.h ('k') | media/filters/decoder_base.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 8a433825adc6882f04beb5a2dd01e77a898cc003..5ed70e343eea4c89f3c5c2b41940f8f8f6404c83 100644
--- a/media/base/pipeline_impl.cc
+++ b/media/base/pipeline_impl.cc
@@ -23,6 +23,8 @@ template <class Filter>
bool SupportsSetMessageLoop() {
switch (Filter::filter_type()) {
case FILTER_DEMUXER:
+ case FILTER_AUDIO_DECODER:
+ case FILTER_VIDEO_DECODER:
return true;
default:
return false;
@@ -456,7 +458,9 @@ void PipelineThread::StartTask(FilterFactory* filter_factory,
// pipeline's error_ member to PIPELINE_STOPPING. We stop the filters in the
// reverse order.
//
-// TODO(scherkus): beware! this can get posted multiple times! it shouldn't!
+// TODO(scherkus): beware! this can get posted multiple times since we post
+// Stop() tasks even if we've already stopped. Perhaps this should no-op for
+// additional calls, however most of this logic will be changing.
void PipelineThread::StopTask() {
if (PipelineOk()) {
pipeline_->error_ = PIPELINE_STOPPING;
@@ -635,6 +639,8 @@ scoped_refptr<Filter> PipelineThread::CreateFilter(
} else {
// Create a dedicated thread for this filter.
if (SupportsSetMessageLoop<Filter>()) {
+ // TODO(scherkus): figure out a way to name these threads so it matches
+ // the filter type.
scoped_ptr<base::Thread> thread(new base::Thread("FilterThread"));
if (!thread.get() || !thread->Start()) {
NOTREACHED() << "Could not start filter thread";
« no previous file with comments | « media/base/filters.h ('k') | media/filters/decoder_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698