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