| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this |
| 2 // source code is governed by a BSD-style license that can be found in the | 2 // source code is governed by a BSD-style license that can be found in the |
| 3 // LICENSE file. | 3 // LICENSE file. |
| 4 | 4 |
| 5 // A base class that provides the plumbing for a decoder filters. | 5 // A base class that provides the plumbing for a decoder filters. |
| 6 | 6 |
| 7 #ifndef MEDIA_FILTERS_DECODER_BASE_H_ | 7 #ifndef MEDIA_FILTERS_DECODER_BASE_H_ |
| 8 #define MEDIA_FILTERS_DECODER_BASE_H_ | 8 #define MEDIA_FILTERS_DECODER_BASE_H_ |
| 9 | 9 |
| 10 #include <deque> | 10 #include <deque> |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 | 150 |
| 151 void InitializeTask(DemuxerStream* demuxer_stream, FilterCallback* callback) { | 151 void InitializeTask(DemuxerStream* demuxer_stream, FilterCallback* callback) { |
| 152 DCHECK_EQ(MessageLoop::current(), this->message_loop()); | 152 DCHECK_EQ(MessageLoop::current(), this->message_loop()); |
| 153 DCHECK(state_ == UNINITIALIZED); | 153 DCHECK(state_ == UNINITIALIZED); |
| 154 DCHECK(!demuxer_stream_); | 154 DCHECK(!demuxer_stream_); |
| 155 scoped_ptr<FilterCallback> c(callback); | 155 scoped_ptr<FilterCallback> c(callback); |
| 156 demuxer_stream_ = demuxer_stream; | 156 demuxer_stream_ = demuxer_stream; |
| 157 | 157 |
| 158 // Delegate to subclass first. | 158 // Delegate to subclass first. |
| 159 if (!OnInitialize(demuxer_stream_)) { | 159 if (!OnInitialize(demuxer_stream_)) { |
| 160 this->host()->Error(PIPELINE_ERROR_DECODE); | 160 this->host()->SetError(PIPELINE_ERROR_DECODE); |
| 161 callback->Run(); | 161 callback->Run(); |
| 162 return; | 162 return; |
| 163 } | 163 } |
| 164 | 164 |
| 165 // TODO(scherkus): subclass shouldn't mutate superclass media format. | 165 // TODO(scherkus): subclass shouldn't mutate superclass media format. |
| 166 DCHECK(!media_format_.empty()) << "Subclass did not set media_format_"; | 166 DCHECK(!media_format_.empty()) << "Subclass did not set media_format_"; |
| 167 state_ = INITIALIZED; | 167 state_ = INITIALIZED; |
| 168 callback->Run(); | 168 callback->Run(); |
| 169 } | 169 } |
| 170 | 170 |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 STOPPED, | 281 STOPPED, |
| 282 }; | 282 }; |
| 283 State state_; | 283 State state_; |
| 284 | 284 |
| 285 DISALLOW_COPY_AND_ASSIGN(DecoderBase); | 285 DISALLOW_COPY_AND_ASSIGN(DecoderBase); |
| 286 }; | 286 }; |
| 287 | 287 |
| 288 } // namespace media | 288 } // namespace media |
| 289 | 289 |
| 290 #endif // MEDIA_FILTERS_DECODER_BASE_H_ | 290 #endif // MEDIA_FILTERS_DECODER_BASE_H_ |
| OLD | NEW |