OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef MEDIA_FILTERS_FFMPEG_AUDIO_DECODER_H_ | 5 #ifndef MEDIA_FILTERS_FFMPEG_AUDIO_DECODER_H_ |
6 #define MEDIA_FILTERS_FFMPEG_AUDIO_DECODER_H_ | 6 #define MEDIA_FILTERS_FFMPEG_AUDIO_DECODER_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
11 #include "base/message_loop.h" | 11 #include "base/message_loop.h" |
12 #include "media/base/audio_decoder.h" | 12 #include "media/base/audio_decoder.h" |
13 | 13 |
14 struct AVCodecContext; | 14 struct AVCodecContext; |
15 | 15 |
16 namespace media { | 16 namespace media { |
17 | 17 |
18 class DataBuffer; | 18 class DataBuffer; |
19 | 19 |
20 class MEDIA_EXPORT FFmpegAudioDecoder : public AudioDecoder { | 20 class MEDIA_EXPORT FFmpegAudioDecoder : public AudioDecoder { |
21 public: | 21 public: |
22 FFmpegAudioDecoder(const base::Callback<MessageLoop*()>& message_loop_cb); | 22 FFmpegAudioDecoder(const base::Callback<MessageLoop*()>& message_loop_cb); |
23 virtual ~FFmpegAudioDecoder(); | |
24 | 23 |
25 // AudioDecoder implementation. | 24 // AudioDecoder implementation. |
26 virtual void Initialize(const scoped_refptr<DemuxerStream>& stream, | 25 virtual void Initialize(const scoped_refptr<DemuxerStream>& stream, |
27 const PipelineStatusCB& status_cb, | 26 const PipelineStatusCB& status_cb, |
28 const StatisticsCB& statistics_cb) OVERRIDE; | 27 const StatisticsCB& statistics_cb) OVERRIDE; |
29 virtual void Read(const ReadCB& read_cb) OVERRIDE; | 28 virtual void Read(const ReadCB& read_cb) OVERRIDE; |
30 virtual int bits_per_channel() OVERRIDE; | 29 virtual int bits_per_channel() OVERRIDE; |
31 virtual ChannelLayout channel_layout() OVERRIDE; | 30 virtual ChannelLayout channel_layout() OVERRIDE; |
32 virtual int samples_per_second() OVERRIDE; | 31 virtual int samples_per_second() OVERRIDE; |
33 virtual void Reset(const base::Closure& closure) OVERRIDE; | 32 virtual void Reset(const base::Closure& closure) OVERRIDE; |
34 | 33 |
| 34 protected: |
| 35 virtual ~FFmpegAudioDecoder(); |
| 36 |
35 private: | 37 private: |
36 // Methods running on decoder thread. | 38 // Methods running on decoder thread. |
37 void DoInitialize(const scoped_refptr<DemuxerStream>& stream, | 39 void DoInitialize(const scoped_refptr<DemuxerStream>& stream, |
38 const PipelineStatusCB& status_cb, | 40 const PipelineStatusCB& status_cb, |
39 const StatisticsCB& statistics_cb); | 41 const StatisticsCB& statistics_cb); |
40 void DoReset(const base::Closure& closure); | 42 void DoReset(const base::Closure& closure); |
41 void DoRead(const ReadCB& read_cb); | 43 void DoRead(const ReadCB& read_cb); |
42 void DoDecodeBuffer(const scoped_refptr<Buffer>& input); | 44 void DoDecodeBuffer(const scoped_refptr<Buffer>& input); |
43 | 45 |
44 // Reads from the demuxer stream with corresponding callback method. | 46 // Reads from the demuxer stream with corresponding callback method. |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 uint8* decoded_audio_; // Allocated via av_malloc(). | 80 uint8* decoded_audio_; // Allocated via av_malloc(). |
79 | 81 |
80 ReadCB read_cb_; | 82 ReadCB read_cb_; |
81 | 83 |
82 DISALLOW_IMPLICIT_CONSTRUCTORS(FFmpegAudioDecoder); | 84 DISALLOW_IMPLICIT_CONSTRUCTORS(FFmpegAudioDecoder); |
83 }; | 85 }; |
84 | 86 |
85 } // namespace media | 87 } // namespace media |
86 | 88 |
87 #endif // MEDIA_FILTERS_FFMPEG_AUDIO_DECODER_H_ | 89 #endif // MEDIA_FILTERS_FFMPEG_AUDIO_DECODER_H_ |
OLD | NEW |