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 "media/base/audio_decoder.h" | 11 #include "media/base/audio_decoder.h" |
12 #include "media/base/demuxer_stream.h" | 12 #include "media/base/demuxer_stream.h" |
13 | 13 |
14 struct AVCodecContext; | 14 struct AVCodecContext; |
15 struct AVFrame; | 15 struct AVFrame; |
16 | 16 |
17 namespace base { | 17 namespace base { |
18 class MessageLoopProxy; | 18 class MessageLoopProxy; |
19 } | 19 } |
20 | 20 |
21 namespace media { | 21 namespace media { |
22 | 22 |
| 23 class AudioBus; |
23 class AudioTimestampHelper; | 24 class AudioTimestampHelper; |
24 class DataBuffer; | 25 class DataBuffer; |
25 class DecoderBuffer; | 26 class DecoderBuffer; |
26 struct QueuedAudioBuffer; | 27 struct QueuedAudioBuffer; |
27 | 28 |
28 class MEDIA_EXPORT FFmpegAudioDecoder : public AudioDecoder { | 29 class MEDIA_EXPORT FFmpegAudioDecoder : public AudioDecoder { |
29 public: | 30 public: |
30 explicit FFmpegAudioDecoder( | 31 explicit FFmpegAudioDecoder( |
31 const scoped_refptr<base::MessageLoopProxy>& message_loop); | 32 const scoped_refptr<base::MessageLoopProxy>& message_loop); |
32 | 33 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 | 85 |
85 // Holds decoded audio. | 86 // Holds decoded audio. |
86 AVFrame* av_frame_; | 87 AVFrame* av_frame_; |
87 | 88 |
88 ReadCB read_cb_; | 89 ReadCB read_cb_; |
89 | 90 |
90 // Since multiple frames may be decoded from the same packet we need to queue | 91 // Since multiple frames may be decoded from the same packet we need to queue |
91 // them up and hand them out as we receive Read() calls. | 92 // them up and hand them out as we receive Read() calls. |
92 std::list<QueuedAudioBuffer> queued_audio_; | 93 std::list<QueuedAudioBuffer> queued_audio_; |
93 | 94 |
| 95 // We may need to convert the audio data coming out of FFmpeg from planar |
| 96 // float to integer. |
| 97 scoped_ptr<AudioBus> converter_bus_; |
| 98 |
94 DISALLOW_IMPLICIT_CONSTRUCTORS(FFmpegAudioDecoder); | 99 DISALLOW_IMPLICIT_CONSTRUCTORS(FFmpegAudioDecoder); |
95 }; | 100 }; |
96 | 101 |
97 } // namespace media | 102 } // namespace media |
98 | 103 |
99 #endif // MEDIA_FILTERS_FFMPEG_AUDIO_DECODER_H_ | 104 #endif // MEDIA_FILTERS_FFMPEG_AUDIO_DECODER_H_ |
OLD | NEW |