| 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 #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" | 8 #include "base/message_loop.h" |
| 9 | 9 |
| 10 namespace media { | 10 namespace media { |
| 11 | 11 |
| 12 MediaFilter::MediaFilter() : host_(NULL), message_loop_(NULL) {} | 12 Filter::Filter() : host_(NULL), message_loop_(NULL) {} |
| 13 | 13 |
| 14 const char* MediaFilter::major_mime_type() const { | 14 Filter::~Filter() {} |
| 15 |
| 16 const char* Filter::major_mime_type() const { |
| 15 return ""; | 17 return ""; |
| 16 } | 18 } |
| 17 | 19 |
| 18 void MediaFilter::set_host(FilterHost* host) { | 20 void Filter::set_host(FilterHost* host) { |
| 19 DCHECK(host); | 21 DCHECK(host); |
| 20 DCHECK(!host_); | 22 DCHECK(!host_); |
| 21 host_ = host; | 23 host_ = host; |
| 22 } | 24 } |
| 23 | 25 |
| 24 FilterHost* MediaFilter::host() { | 26 FilterHost* Filter::host() { |
| 25 return host_; | 27 return host_; |
| 26 } | 28 } |
| 27 | 29 |
| 28 bool MediaFilter::requires_message_loop() const { | 30 bool Filter::requires_message_loop() const { |
| 29 return false; | 31 return false; |
| 30 } | 32 } |
| 31 | 33 |
| 32 const char* MediaFilter::message_loop_name() const { | 34 const char* Filter::message_loop_name() const { |
| 33 return "FilterThread"; | 35 return "FilterThread"; |
| 34 } | 36 } |
| 35 | 37 |
| 36 void MediaFilter::set_message_loop(MessageLoop* message_loop) { | 38 void Filter::set_message_loop(MessageLoop* message_loop) { |
| 37 DCHECK(message_loop); | 39 DCHECK(message_loop); |
| 38 DCHECK(!message_loop_); | 40 DCHECK(!message_loop_); |
| 39 message_loop_ = message_loop; | 41 message_loop_ = message_loop; |
| 40 } | 42 } |
| 41 | 43 |
| 42 MessageLoop* MediaFilter::message_loop() { | 44 MessageLoop* Filter::message_loop() { |
| 43 return message_loop_; | 45 return message_loop_; |
| 44 } | 46 } |
| 45 | 47 |
| 46 void MediaFilter::Play(FilterCallback* callback) { | 48 void Filter::Play(FilterCallback* callback) { |
| 47 DCHECK(callback); | 49 DCHECK(callback); |
| 48 if (callback) { | 50 if (callback) { |
| 49 callback->Run(); | 51 callback->Run(); |
| 50 delete callback; | 52 delete callback; |
| 51 } | 53 } |
| 52 } | 54 } |
| 53 | 55 |
| 54 void MediaFilter::Pause(FilterCallback* callback) { | 56 void Filter::Pause(FilterCallback* callback) { |
| 55 DCHECK(callback); | 57 DCHECK(callback); |
| 56 if (callback) { | 58 if (callback) { |
| 57 callback->Run(); | 59 callback->Run(); |
| 58 delete callback; | 60 delete callback; |
| 59 } | 61 } |
| 60 } | 62 } |
| 61 | 63 |
| 62 void MediaFilter::Flush(FilterCallback* callback) { | 64 void Filter::Flush(FilterCallback* callback) { |
| 63 DCHECK(callback); | 65 DCHECK(callback); |
| 64 if (callback) { | 66 if (callback) { |
| 65 callback->Run(); | 67 callback->Run(); |
| 66 delete callback; | 68 delete callback; |
| 67 } | 69 } |
| 68 } | 70 } |
| 69 | 71 |
| 70 void MediaFilter::Stop(FilterCallback* callback) { | 72 void Filter::Stop(FilterCallback* callback) { |
| 71 DCHECK(callback); | 73 DCHECK(callback); |
| 72 if (callback) { | 74 if (callback) { |
| 73 callback->Run(); | 75 callback->Run(); |
| 74 delete callback; | 76 delete callback; |
| 75 } | 77 } |
| 76 } | 78 } |
| 77 | 79 |
| 78 void MediaFilter::SetPlaybackRate(float playback_rate) {} | 80 void Filter::SetPlaybackRate(float playback_rate) {} |
| 79 | 81 |
| 80 void MediaFilter::Seek(base::TimeDelta time, FilterCallback* callback) { | 82 void Filter::Seek(base::TimeDelta time, FilterCallback* callback) { |
| 81 scoped_ptr<FilterCallback> seek_callback(callback); | 83 scoped_ptr<FilterCallback> seek_callback(callback); |
| 82 if (seek_callback.get()) { | 84 if (seek_callback.get()) { |
| 83 seek_callback->Run(); | 85 seek_callback->Run(); |
| 84 } | 86 } |
| 85 } | 87 } |
| 86 | 88 |
| 87 void MediaFilter::OnAudioRendererDisabled() { | 89 void Filter::OnAudioRendererDisabled() { |
| 88 } | 90 } |
| 89 | 91 |
| 90 MediaFilter::~MediaFilter() {} | |
| 91 | |
| 92 bool DataSource::IsUrlSupported(const std::string& url) { | 92 bool DataSource::IsUrlSupported(const std::string& url) { |
| 93 return true; | 93 return true; |
| 94 } | 94 } |
| 95 | 95 |
| 96 bool Demuxer::requires_message_loop() const { | 96 bool Demuxer::requires_message_loop() const { |
| 97 return true; | 97 return true; |
| 98 } | 98 } |
| 99 | 99 |
| 100 const char* Demuxer::message_loop_name() const { | 100 const char* Demuxer::message_loop_name() const { |
| 101 return "DemuxerThread"; | 101 return "DemuxerThread"; |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 | 137 |
| 138 VideoDecoder::VideoDecoder() {} | 138 VideoDecoder::VideoDecoder() {} |
| 139 | 139 |
| 140 VideoDecoder::~VideoDecoder() {} | 140 VideoDecoder::~VideoDecoder() {} |
| 141 | 141 |
| 142 AudioDecoder::AudioDecoder() {} | 142 AudioDecoder::AudioDecoder() {} |
| 143 | 143 |
| 144 AudioDecoder::~AudioDecoder() {} | 144 AudioDecoder::~AudioDecoder() {} |
| 145 | 145 |
| 146 } // namespace media | 146 } // namespace media |
| OLD | NEW |