Chromium Code Reviews| 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 #include <vector> | |
| 9 | 10 |
| 10 #include "base/callback.h" | 11 #include "base/callback.h" |
| 11 #include "media/base/audio_decoder.h" | 12 #include "media/base/audio_decoder.h" |
| 12 #include "media/base/demuxer_stream.h" | 13 #include "media/base/demuxer_stream.h" |
| 13 | 14 |
| 14 struct AVCodecContext; | 15 struct AVCodecContext; |
| 15 struct AVFrame; | 16 struct AVFrame; |
| 16 | 17 |
| 17 namespace base { | 18 namespace base { |
| 18 class MessageLoopProxy; | 19 class MessageLoopProxy; |
| 19 } | 20 } |
| 20 | 21 |
| 21 namespace media { | 22 namespace media { |
| 22 | 23 |
| 23 class DataBuffer; | 24 class DataBuffer; |
| 24 class DecoderBuffer; | 25 class DecoderBuffer; |
| 26 struct QueuedAudioBuffer; | |
| 25 | 27 |
| 26 class MEDIA_EXPORT FFmpegAudioDecoder : public AudioDecoder { | 28 class MEDIA_EXPORT FFmpegAudioDecoder : public AudioDecoder { |
| 27 public: | 29 public: |
| 28 typedef base::Callback< | 30 typedef base::Callback< |
| 29 scoped_refptr<base::MessageLoopProxy>()> MessageLoopFactoryCB; | 31 scoped_refptr<base::MessageLoopProxy>()> MessageLoopFactoryCB; |
| 30 explicit FFmpegAudioDecoder( | 32 explicit FFmpegAudioDecoder( |
| 31 const MessageLoopFactoryCB& message_loop_factory_cb); | 33 const MessageLoopFactoryCB& message_loop_factory_cb); |
| 32 | 34 |
| 33 // AudioDecoder implementation. | 35 // AudioDecoder implementation. |
| 34 virtual void Initialize(const scoped_refptr<DemuxerStream>& stream, | 36 virtual void Initialize(const scoped_refptr<DemuxerStream>& stream, |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 85 | 87 |
| 86 // Number of output sample bytes to drop before generating | 88 // Number of output sample bytes to drop before generating |
| 87 // output buffers. | 89 // output buffers. |
| 88 int output_bytes_to_drop_; | 90 int output_bytes_to_drop_; |
| 89 | 91 |
| 90 // Holds decoded audio. | 92 // Holds decoded audio. |
| 91 AVFrame* av_frame_; | 93 AVFrame* av_frame_; |
| 92 | 94 |
| 93 ReadCB read_cb_; | 95 ReadCB read_cb_; |
| 94 | 96 |
| 97 // Since multiple frames may be decoded from the same packet we need to queue | |
| 98 // them up and hand them out as we receive Read() calls. | |
| 99 std::vector<QueuedAudioBuffer> queued_audio_; | |
|
acolwell GONE FROM CHROMIUM
2012/08/28 14:40:49
use a std::list here so popping from the front doe
DaleCurtis
2012/08/28 20:19:16
Oh no, I'm in CS 101 all over again. /hangs head i
| |
| 100 | |
| 95 DISALLOW_IMPLICIT_CONSTRUCTORS(FFmpegAudioDecoder); | 101 DISALLOW_IMPLICIT_CONSTRUCTORS(FFmpegAudioDecoder); |
| 96 }; | 102 }; |
| 97 | 103 |
| 98 } // namespace media | 104 } // namespace media |
| 99 | 105 |
| 100 #endif // MEDIA_FILTERS_FFMPEG_AUDIO_DECODER_H_ | 106 #endif // MEDIA_FILTERS_FFMPEG_AUDIO_DECODER_H_ |
| OLD | NEW |