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/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "base/time/time.h" | 12 #include "base/time/time.h" |
13 #include "media/base/audio_decoder.h" | 13 #include "media/base/audio_decoder.h" |
14 #include "media/base/demuxer_stream.h" | 14 #include "media/base/demuxer_stream.h" |
| 15 #include "media/base/media_log.h" |
15 #include "media/base/sample_format.h" | 16 #include "media/base/sample_format.h" |
16 #include "media/ffmpeg/ffmpeg_deleters.h" | 17 #include "media/ffmpeg/ffmpeg_deleters.h" |
17 | 18 |
18 struct AVCodecContext; | 19 struct AVCodecContext; |
19 struct AVFrame; | 20 struct AVFrame; |
20 | 21 |
21 namespace base { | 22 namespace base { |
22 class SingleThreadTaskRunner; | 23 class SingleThreadTaskRunner; |
23 } | 24 } |
24 | 25 |
25 namespace media { | 26 namespace media { |
26 | 27 |
27 class AudioDiscardHelper; | 28 class AudioDiscardHelper; |
28 class DecoderBuffer; | 29 class DecoderBuffer; |
29 | 30 |
30 class MEDIA_EXPORT FFmpegAudioDecoder : public AudioDecoder { | 31 class MEDIA_EXPORT FFmpegAudioDecoder : public AudioDecoder { |
31 public: | 32 public: |
32 explicit FFmpegAudioDecoder( | 33 FFmpegAudioDecoder( |
33 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner); | 34 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, |
| 35 const LogCB& log_cb); |
34 virtual ~FFmpegAudioDecoder(); | 36 virtual ~FFmpegAudioDecoder(); |
35 | 37 |
36 // AudioDecoder implementation. | 38 // AudioDecoder implementation. |
37 virtual void Initialize(const AudioDecoderConfig& config, | 39 virtual void Initialize(const AudioDecoderConfig& config, |
38 const PipelineStatusCB& status_cb) OVERRIDE; | 40 const PipelineStatusCB& status_cb) OVERRIDE; |
39 virtual void Decode(const scoped_refptr<DecoderBuffer>& buffer, | 41 virtual void Decode(const scoped_refptr<DecoderBuffer>& buffer, |
40 const DecodeCB& decode_cb) OVERRIDE; | 42 const DecodeCB& decode_cb) OVERRIDE; |
41 virtual scoped_refptr<AudioBuffer> GetDecodeOutput() OVERRIDE; | 43 virtual scoped_refptr<AudioBuffer> GetDecodeOutput() OVERRIDE; |
42 virtual void Reset(const base::Closure& closure) OVERRIDE; | 44 virtual void Reset(const base::Closure& closure) OVERRIDE; |
43 virtual void Stop() OVERRIDE; | 45 virtual void Stop() OVERRIDE; |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 | 82 |
81 // AVSampleFormat initially requested; not Chrome's SampleFormat. | 83 // AVSampleFormat initially requested; not Chrome's SampleFormat. |
82 int av_sample_format_; | 84 int av_sample_format_; |
83 | 85 |
84 scoped_ptr<AudioDiscardHelper> discard_helper_; | 86 scoped_ptr<AudioDiscardHelper> discard_helper_; |
85 | 87 |
86 // Since multiple frames may be decoded from the same packet we need to queue | 88 // Since multiple frames may be decoded from the same packet we need to queue |
87 // them up. | 89 // them up. |
88 std::list<scoped_refptr<AudioBuffer> > queued_audio_; | 90 std::list<scoped_refptr<AudioBuffer> > queued_audio_; |
89 | 91 |
| 92 LogCB log_cb_; |
| 93 |
90 DISALLOW_IMPLICIT_CONSTRUCTORS(FFmpegAudioDecoder); | 94 DISALLOW_IMPLICIT_CONSTRUCTORS(FFmpegAudioDecoder); |
91 }; | 95 }; |
92 | 96 |
93 } // namespace media | 97 } // namespace media |
94 | 98 |
95 #endif // MEDIA_FILTERS_FFMPEG_AUDIO_DECODER_H_ | 99 #endif // MEDIA_FILTERS_FFMPEG_AUDIO_DECODER_H_ |
OLD | NEW |