| 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 DCHECK(!media_format_.empty()); | 51 DCHECK(!media_format_.empty()); |
| 52 host()->InitializationComplete(); | 52 host()->InitializationComplete(); |
| 53 return true; | 53 return true; |
| 54 } else { | 54 } else { |
| 55 demuxer_stream_ = NULL; | 55 demuxer_stream_ = NULL; |
| 56 decode_thread_.reset(); | 56 decode_thread_.reset(); |
| 57 return false; | 57 return false; |
| 58 } | 58 } |
| 59 } | 59 } |
| 60 | 60 |
| 61 virtual const MediaFormat* GetMediaFormat() { return &media_format_; } | 61 virtual const MediaFormat& media_format() { return media_format_; } |
| 62 | 62 |
| 63 // Audio or Video decoder. | 63 // Audio or Video decoder. |
| 64 virtual void Read(Assignable<Output>* output) { | 64 virtual void Read(Assignable<Output>* output) { |
| 65 AutoLock auto_lock(lock_); | 65 AutoLock auto_lock(lock_); |
| 66 if (IsRunning()) { | 66 if (IsRunning()) { |
| 67 output->AddRef(); | 67 output->AddRef(); |
| 68 output_queue_.push_back(output); | 68 output_queue_.push_back(output); |
| 69 ScheduleProcessTask(); | 69 ScheduleProcessTask(); |
| 70 } | 70 } |
| 71 } | 71 } |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 // Queue of buffers supplied by the renderer through the Read() method. | 287 // Queue of buffers supplied by the renderer through the Read() method. |
| 288 typedef std::deque<Assignable<Output>*> OutputQueue; | 288 typedef std::deque<Assignable<Output>*> OutputQueue; |
| 289 OutputQueue output_queue_; | 289 OutputQueue output_queue_; |
| 290 | 290 |
| 291 DISALLOW_COPY_AND_ASSIGN(DecoderBase); | 291 DISALLOW_COPY_AND_ASSIGN(DecoderBase); |
| 292 }; | 292 }; |
| 293 | 293 |
| 294 } // namespace media | 294 } // namespace media |
| 295 | 295 |
| 296 #endif // MEDIA_FILTERS_DECODER_BASE_H_ | 296 #endif // MEDIA_FILTERS_DECODER_BASE_H_ |
| OLD | NEW |