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

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

Issue 6171009: Remove MessageLoop methods from Filter interface (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Applied more CR suggestions & removed message_loop() methods where possible. Created 9 years, 11 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/filters.h ('k') | media/base/message_loop_factory.h » ('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) 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 #include "media/base/filters.h" 5 #include "media/base/filters.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/message_loop.h"
9 8
10 namespace media { 9 namespace media {
11 10
12 Filter::Filter() : host_(NULL), message_loop_(NULL) {} 11 Filter::Filter() : host_(NULL) {}
13 12
14 Filter::~Filter() {} 13 Filter::~Filter() {}
15 14
16 const char* Filter::major_mime_type() const { 15 const char* Filter::major_mime_type() const {
17 return ""; 16 return "";
18 } 17 }
19 18
20 void Filter::set_host(FilterHost* host) { 19 void Filter::set_host(FilterHost* host) {
21 DCHECK(host); 20 DCHECK(host);
22 DCHECK(!host_); 21 DCHECK(!host_);
23 host_ = host; 22 host_ = host;
24 } 23 }
25 24
26 FilterHost* Filter::host() { 25 FilterHost* Filter::host() {
27 return host_; 26 return host_;
28 } 27 }
29 28
30 bool Filter::requires_message_loop() const {
31 return false;
32 }
33
34 const char* Filter::message_loop_name() const {
35 return "FilterThread";
36 }
37
38 void Filter::set_message_loop(MessageLoop* message_loop) {
39 DCHECK(message_loop);
40 DCHECK(!message_loop_);
41 message_loop_ = message_loop;
42 }
43
44 MessageLoop* Filter::message_loop() {
45 return message_loop_;
46 }
47
48 void Filter::Play(FilterCallback* callback) { 29 void Filter::Play(FilterCallback* callback) {
49 DCHECK(callback); 30 DCHECK(callback);
50 if (callback) { 31 if (callback) {
51 callback->Run(); 32 callback->Run();
52 delete callback; 33 delete callback;
53 } 34 }
54 } 35 }
55 36
56 void Filter::Pause(FilterCallback* callback) { 37 void Filter::Pause(FilterCallback* callback) {
57 DCHECK(callback); 38 DCHECK(callback);
(...skipping 28 matching lines...) Expand all
86 } 67 }
87 } 68 }
88 69
89 void Filter::OnAudioRendererDisabled() { 70 void Filter::OnAudioRendererDisabled() {
90 } 71 }
91 72
92 bool DataSource::IsUrlSupported(const std::string& url) { 73 bool DataSource::IsUrlSupported(const std::string& url) {
93 return true; 74 return true;
94 } 75 }
95 76
96 bool Demuxer::requires_message_loop() const {
97 return true;
98 }
99
100 const char* Demuxer::message_loop_name() const {
101 return "DemuxerThread";
102 }
103
104 const char* AudioDecoder::major_mime_type() const { 77 const char* AudioDecoder::major_mime_type() const {
105 return mime_type::kMajorTypeAudio; 78 return mime_type::kMajorTypeAudio;
106 } 79 }
107 80
108 bool AudioDecoder::requires_message_loop() const {
109 return true;
110 }
111
112 const char* AudioDecoder::message_loop_name() const {
113 return "AudioDecoderThread";
114 }
115
116 const char* AudioRenderer::major_mime_type() const { 81 const char* AudioRenderer::major_mime_type() const {
117 return mime_type::kMajorTypeAudio; 82 return mime_type::kMajorTypeAudio;
118 } 83 }
119 84
120 const char* VideoDecoder::major_mime_type() const { 85 const char* VideoDecoder::major_mime_type() const {
121 return mime_type::kMajorTypeVideo; 86 return mime_type::kMajorTypeVideo;
122 } 87 }
123 88
124 bool VideoDecoder::requires_message_loop() const {
125 return true;
126 }
127
128 const char* VideoDecoder::message_loop_name() const {
129 return "VideoDecoderThread";
130 }
131
132 const char* VideoRenderer::major_mime_type() const { 89 const char* VideoRenderer::major_mime_type() const {
133 return mime_type::kMajorTypeVideo; 90 return mime_type::kMajorTypeVideo;
134 } 91 }
135 92
136 void* DemuxerStream::QueryInterface(const char* interface_id) { 93 void* DemuxerStream::QueryInterface(const char* interface_id) {
137 return NULL; 94 return NULL;
138 } 95 }
139 96
140 DemuxerStream::~DemuxerStream() {} 97 DemuxerStream::~DemuxerStream() {}
141 98
142 VideoDecoder::VideoDecoder() {} 99 VideoDecoder::VideoDecoder() {}
143 100
144 VideoDecoder::~VideoDecoder() {} 101 VideoDecoder::~VideoDecoder() {}
145 102
146 AudioDecoder::AudioDecoder() {} 103 AudioDecoder::AudioDecoder() {}
147 104
148 AudioDecoder::~AudioDecoder() {} 105 AudioDecoder::~AudioDecoder() {}
149 106
150 } // namespace media 107 } // namespace media
OLDNEW
« no previous file with comments | « media/base/filters.h ('k') | media/base/message_loop_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698