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 // 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 12 matching lines...) Expand all Loading... |
23 | 23 |
24 // In this class, we over-specify method lookup via this-> to avoid unexpected | 24 // In this class, we over-specify method lookup via this-> to avoid unexpected |
25 // name resolution issues due to the two-phase lookup needed for dependent | 25 // name resolution issues due to the two-phase lookup needed for dependent |
26 // name resolution in templates. | 26 // name resolution in templates. |
27 template <class Decoder, class Output> | 27 template <class Decoder, class Output> |
28 class DecoderBase : public Decoder { | 28 class DecoderBase : public Decoder { |
29 public: | 29 public: |
30 | 30 |
31 // MediaFilter implementation. | 31 // MediaFilter implementation. |
32 virtual void Stop(FilterCallback* callback) { | 32 virtual void Stop(FilterCallback* callback) { |
33 this->message_loop()->PostTask(FROM_HERE, | 33 this->message_loop()->PostTask( |
| 34 FROM_HERE, |
34 NewRunnableMethod(this, &DecoderBase::StopTask, callback)); | 35 NewRunnableMethod(this, &DecoderBase::StopTask, callback)); |
35 } | 36 } |
36 | 37 |
37 virtual void Seek(base::TimeDelta time, | 38 virtual void Seek(base::TimeDelta time, |
38 FilterCallback* callback) { | 39 FilterCallback* callback) { |
39 this->message_loop()->PostTask(FROM_HERE, | 40 this->message_loop()->PostTask( |
| 41 FROM_HERE, |
40 NewRunnableMethod(this, &DecoderBase::SeekTask, time, callback)); | 42 NewRunnableMethod(this, &DecoderBase::SeekTask, time, callback)); |
41 } | 43 } |
42 | 44 |
43 // Decoder implementation. | 45 // Decoder implementation. |
44 virtual void Initialize(DemuxerStream* demuxer_stream, | 46 virtual void Initialize(DemuxerStream* demuxer_stream, |
45 FilterCallback* callback) { | 47 FilterCallback* callback) { |
46 this->message_loop()->PostTask(FROM_HERE, | 48 this->message_loop()->PostTask( |
47 NewRunnableMethod(this, &DecoderBase::InitializeTask, demuxer_stream, | 49 FROM_HERE, |
| 50 NewRunnableMethod(this, |
| 51 &DecoderBase::InitializeTask, |
| 52 make_scoped_refptr(demuxer_stream), |
48 callback)); | 53 callback)); |
49 } | 54 } |
50 | 55 |
51 virtual const MediaFormat& media_format() { return media_format_; } | 56 virtual const MediaFormat& media_format() { return media_format_; } |
52 | 57 |
53 // Audio decoder. | 58 // Audio decoder. |
54 // Note that this class is only used by the audio decoder, this will | 59 // Note that this class is only used by the audio decoder, this will |
55 // eventually be merged into FFmpegAudioDecoder. | 60 // eventually be merged into FFmpegAudioDecoder. |
56 virtual void ProduceAudioSamples(scoped_refptr<Output> output) { | 61 virtual void ProduceAudioSamples(scoped_refptr<Output> output) { |
57 this->message_loop()->PostTask(FROM_HERE, | 62 this->message_loop()->PostTask(FROM_HERE, |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
317 kStopped, | 322 kStopped, |
318 }; | 323 }; |
319 State state_; | 324 State state_; |
320 | 325 |
321 DISALLOW_COPY_AND_ASSIGN(DecoderBase); | 326 DISALLOW_COPY_AND_ASSIGN(DecoderBase); |
322 }; | 327 }; |
323 | 328 |
324 } // namespace media | 329 } // namespace media |
325 | 330 |
326 #endif // MEDIA_FILTERS_DECODER_BASE_H_ | 331 #endif // MEDIA_FILTERS_DECODER_BASE_H_ |
OLD | NEW |