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/message_loop.h" | |
12 #include "media/base/audio_decoder.h" | 11 #include "media/base/audio_decoder.h" |
13 #include "media/base/demuxer_stream.h" | 12 #include "media/base/demuxer_stream.h" |
14 | 13 |
15 struct AVCodecContext; | 14 struct AVCodecContext; |
16 struct AVFrame; | 15 struct AVFrame; |
17 | 16 |
17 namespace base { | |
18 class MessageLoopProxy; | |
19 } | |
20 | |
18 namespace media { | 21 namespace media { |
19 | 22 |
20 class DataBuffer; | 23 class DataBuffer; |
21 class DecoderBuffer; | 24 class DecoderBuffer; |
22 | 25 |
23 class MEDIA_EXPORT FFmpegAudioDecoder : public AudioDecoder { | 26 class MEDIA_EXPORT FFmpegAudioDecoder : public AudioDecoder { |
24 public: | 27 public: |
25 FFmpegAudioDecoder(const base::Callback<MessageLoop*()>& message_loop_cb); | 28 typedef base::Callback<scoped_refptr<base::MessageLoopProxy>()> MessageLoopCB; |
Ami GONE FROM CHROMIUM
2012/08/10 04:38:06
s/MessageLoopCB/MessageLoopFactoryCB/
xhwang
2012/08/10 19:33:33
Done.
| |
29 explicit FFmpegAudioDecoder(const MessageLoopCB& message_loop_cb); | |
26 | 30 |
27 // AudioDecoder implementation. | 31 // AudioDecoder implementation. |
28 virtual void Initialize(const scoped_refptr<DemuxerStream>& stream, | 32 virtual void Initialize(const scoped_refptr<DemuxerStream>& stream, |
29 const PipelineStatusCB& status_cb, | 33 const PipelineStatusCB& status_cb, |
30 const StatisticsCB& statistics_cb) OVERRIDE; | 34 const StatisticsCB& statistics_cb) OVERRIDE; |
31 virtual void Read(const ReadCB& read_cb) OVERRIDE; | 35 virtual void Read(const ReadCB& read_cb) OVERRIDE; |
32 virtual int bits_per_channel() OVERRIDE; | 36 virtual int bits_per_channel() OVERRIDE; |
33 virtual ChannelLayout channel_layout() OVERRIDE; | 37 virtual ChannelLayout channel_layout() OVERRIDE; |
34 virtual int samples_per_second() OVERRIDE; | 38 virtual int samples_per_second() OVERRIDE; |
35 virtual void Reset(const base::Closure& closure) OVERRIDE; | 39 virtual void Reset(const base::Closure& closure) OVERRIDE; |
(...skipping 15 matching lines...) Expand all Loading... | |
51 void ReadFromDemuxerStream(); | 55 void ReadFromDemuxerStream(); |
52 void DecodeBuffer(DemuxerStream::Status status, | 56 void DecodeBuffer(DemuxerStream::Status status, |
53 const scoped_refptr<DecoderBuffer>& buffer); | 57 const scoped_refptr<DecoderBuffer>& buffer); |
54 | 58 |
55 // Returns the timestamp that should be used for the next buffer returned | 59 // Returns the timestamp that should be used for the next buffer returned |
56 // via |read_cb_|. It is calculated from |output_timestamp_base_| and | 60 // via |read_cb_|. It is calculated from |output_timestamp_base_| and |
57 // |total_frames_decoded_|. | 61 // |total_frames_decoded_|. |
58 base::TimeDelta GetNextOutputTimestamp() const; | 62 base::TimeDelta GetNextOutputTimestamp() const; |
59 | 63 |
60 // This is !is_null() iff Initialize() hasn't been called. | 64 // This is !is_null() iff Initialize() hasn't been called. |
61 base::Callback<MessageLoop*()> message_loop_factory_cb_; | 65 MessageLoopCB message_loop_factory_cb_; |
62 MessageLoop* message_loop_; | 66 |
67 scoped_refptr<base::MessageLoopProxy> message_loop_; | |
63 | 68 |
64 scoped_refptr<DemuxerStream> demuxer_stream_; | 69 scoped_refptr<DemuxerStream> demuxer_stream_; |
65 StatisticsCB statistics_cb_; | 70 StatisticsCB statistics_cb_; |
66 AVCodecContext* codec_context_; | 71 AVCodecContext* codec_context_; |
67 | 72 |
68 // Decoded audio format. | 73 // Decoded audio format. |
69 int bits_per_channel_; | 74 int bits_per_channel_; |
70 ChannelLayout channel_layout_; | 75 ChannelLayout channel_layout_; |
71 int samples_per_second_; | 76 int samples_per_second_; |
72 | 77 |
(...skipping 11 matching lines...) Expand all Loading... | |
84 AVFrame* av_frame_; | 89 AVFrame* av_frame_; |
85 | 90 |
86 ReadCB read_cb_; | 91 ReadCB read_cb_; |
87 | 92 |
88 DISALLOW_IMPLICIT_CONSTRUCTORS(FFmpegAudioDecoder); | 93 DISALLOW_IMPLICIT_CONSTRUCTORS(FFmpegAudioDecoder); |
89 }; | 94 }; |
90 | 95 |
91 } // namespace media | 96 } // namespace media |
92 | 97 |
93 #endif // MEDIA_FILTERS_FFMPEG_AUDIO_DECODER_H_ | 98 #endif // MEDIA_FILTERS_FFMPEG_AUDIO_DECODER_H_ |
OLD | NEW |