| 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" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 | 38 |
| 39 // AudioDecoder implementation. | 39 // AudioDecoder implementation. |
| 40 virtual void Initialize(DemuxerStream* stream, | 40 virtual void Initialize(DemuxerStream* stream, |
| 41 const PipelineStatusCB& status_cb, | 41 const PipelineStatusCB& status_cb, |
| 42 const StatisticsCB& statistics_cb) OVERRIDE; | 42 const StatisticsCB& statistics_cb) OVERRIDE; |
| 43 virtual void Read(const ReadCB& read_cb) OVERRIDE; | 43 virtual void Read(const ReadCB& read_cb) OVERRIDE; |
| 44 virtual int bits_per_channel() OVERRIDE; | 44 virtual int bits_per_channel() OVERRIDE; |
| 45 virtual ChannelLayout channel_layout() OVERRIDE; | 45 virtual ChannelLayout channel_layout() OVERRIDE; |
| 46 virtual int samples_per_second() OVERRIDE; | 46 virtual int samples_per_second() OVERRIDE; |
| 47 virtual void Reset(const base::Closure& closure) OVERRIDE; | 47 virtual void Reset(const base::Closure& closure) OVERRIDE; |
| 48 virtual void Stop(const base::Closure& closure) OVERRIDE; |
| 48 | 49 |
| 49 // Callback called from within FFmpeg to allocate a buffer based on | 50 // Callback called from within FFmpeg to allocate a buffer based on |
| 50 // the dimensions of |codec_context|. See AVCodecContext.get_buffer2 | 51 // the dimensions of |codec_context|. See AVCodecContext.get_buffer2 |
| 51 // documentation inside FFmpeg. | 52 // documentation inside FFmpeg. |
| 52 int GetAudioBuffer(AVCodecContext* codec, AVFrame* frame, int flags); | 53 int GetAudioBuffer(AVCodecContext* codec, AVFrame* frame, int flags); |
| 53 | 54 |
| 54 private: | 55 private: |
| 55 // Reads from the demuxer stream with corresponding callback method. | 56 // Reads from the demuxer stream with corresponding callback method. |
| 56 void ReadFromDemuxerStream(); | 57 void ReadFromDemuxerStream(); |
| 57 void BufferReady(DemuxerStream::Status status, | 58 void BufferReady(DemuxerStream::Status status, |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 // Since multiple frames may be decoded from the same packet we need to queue | 97 // Since multiple frames may be decoded from the same packet we need to queue |
| 97 // them up and hand them out as we receive Read() calls. | 98 // them up and hand them out as we receive Read() calls. |
| 98 std::list<QueuedAudioBuffer> queued_audio_; | 99 std::list<QueuedAudioBuffer> queued_audio_; |
| 99 | 100 |
| 100 DISALLOW_IMPLICIT_CONSTRUCTORS(FFmpegAudioDecoder); | 101 DISALLOW_IMPLICIT_CONSTRUCTORS(FFmpegAudioDecoder); |
| 101 }; | 102 }; |
| 102 | 103 |
| 103 } // namespace media | 104 } // namespace media |
| 104 | 105 |
| 105 #endif // MEDIA_FILTERS_FFMPEG_AUDIO_DECODER_H_ | 106 #endif // MEDIA_FILTERS_FFMPEG_AUDIO_DECODER_H_ |
| OLD | NEW |