Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(72)

Side by Side Diff: media/filters/ffmpeg_audio_decoder.h

Issue 10869085: Update FFmpegAudioDecoder to support multi-frame packets. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments. Fix WebAudio. Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 DataBuffer; 23 class DataBuffer;
24 class DecoderBuffer; 24 class DecoderBuffer;
25 struct QueuedAudioBuffer;
25 26
26 class MEDIA_EXPORT FFmpegAudioDecoder : public AudioDecoder { 27 class MEDIA_EXPORT FFmpegAudioDecoder : public AudioDecoder {
27 public: 28 public:
28 typedef base::Callback< 29 typedef base::Callback<
29 scoped_refptr<base::MessageLoopProxy>()> MessageLoopFactoryCB; 30 scoped_refptr<base::MessageLoopProxy>()> MessageLoopFactoryCB;
30 explicit FFmpegAudioDecoder( 31 explicit FFmpegAudioDecoder(
31 const MessageLoopFactoryCB& message_loop_factory_cb); 32 const MessageLoopFactoryCB& message_loop_factory_cb);
32 33
33 // AudioDecoder implementation. 34 // AudioDecoder implementation.
34 virtual void Initialize(const scoped_refptr<DemuxerStream>& stream, 35 virtual void Initialize(const scoped_refptr<DemuxerStream>& stream,
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 86
86 // Number of output sample bytes to drop before generating 87 // Number of output sample bytes to drop before generating
87 // output buffers. 88 // output buffers.
88 int output_bytes_to_drop_; 89 int output_bytes_to_drop_;
89 90
90 // Holds decoded audio. 91 // Holds decoded audio.
91 AVFrame* av_frame_; 92 AVFrame* av_frame_;
92 93
93 ReadCB read_cb_; 94 ReadCB read_cb_;
94 95
96 // 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 std::list<QueuedAudioBuffer> queued_audio_;
99
95 DISALLOW_IMPLICIT_CONSTRUCTORS(FFmpegAudioDecoder); 100 DISALLOW_IMPLICIT_CONSTRUCTORS(FFmpegAudioDecoder);
96 }; 101 };
97 102
98 } // namespace media 103 } // namespace media
99 104
100 #endif // MEDIA_FILTERS_FFMPEG_AUDIO_DECODER_H_ 105 #endif // MEDIA_FILTERS_FFMPEG_AUDIO_DECODER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698