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

Side by Side Diff: media/base/message_loop_factory.cc

Issue 10915091: Combine audio decoding and video decoding onto a single thread. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « media/base/message_loop_factory.h ('k') | media/filters/pipeline_integration_test_base.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "media/base/message_loop_factory.h" 5 #include "media/base/message_loop_factory.h"
6 6
7 #include "base/threading/thread.h" 7 #include "base/threading/thread.h"
8 8
9 namespace media { 9 namespace media {
10 10
(...skipping 16 matching lines...) Expand all
27 27
28 base::Thread* MessageLoopFactory::GetThread(Type type) { 28 base::Thread* MessageLoopFactory::GetThread(Type type) {
29 base::AutoLock auto_lock(lock_); 29 base::AutoLock auto_lock(lock_);
30 for (ThreadList::iterator it = threads_.begin(); it != threads_.end(); ++it) { 30 for (ThreadList::iterator it = threads_.begin(); it != threads_.end(); ++it) {
31 if (it->first == type) 31 if (it->first == type)
32 return it->second; 32 return it->second;
33 } 33 }
34 34
35 const char* name = NULL; 35 const char* name = NULL;
36 switch (type) { 36 switch (type) {
37 case kAudioDecoder: 37 case kDecoder:
38 name = "AudioDecoderThread"; 38 name = "MediaDecoder";
39 break;
40 case kVideoDecoder:
41 name = "VideoDecoderThread";
42 break; 39 break;
43 case kPipeline: 40 case kPipeline:
44 name = "PipelineThread"; 41 name = "MediaPipeline";
45 break; 42 break;
46 } 43 }
47 44
48 base::Thread* thread = new base::Thread(name); 45 base::Thread* thread = new base::Thread(name);
49 CHECK(thread->Start()) << "Failed to start thread: " << name; 46 CHECK(thread->Start()) << "Failed to start thread: " << name;
50 threads_.push_back(std::make_pair(type, thread)); 47 threads_.push_back(std::make_pair(type, thread));
51 return thread; 48 return thread;
52 } 49 }
53 50
54 } // namespace media 51 } // namespace media
OLDNEW
« no previous file with comments | « media/base/message_loop_factory.h ('k') | media/filters/pipeline_integration_test_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698