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

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

Issue 10540067: Switch to using avcodec_decode_audio4, avcodec_alloc_context3. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix tools. Created 8 years, 6 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
« no previous file with comments | « media/filters/audio_file_reader.cc ('k') | media/filters/ffmpeg_audio_decoder.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "base/message_loop.h" 11 #include "base/message_loop.h"
12 #include "media/base/audio_decoder.h" 12 #include "media/base/audio_decoder.h"
13 13
14 struct AVCodecContext; 14 struct AVCodecContext;
15 struct AVFrame;
15 16
16 namespace media { 17 namespace media {
17 18
18 class DataBuffer; 19 class DataBuffer;
19 class DecoderBuffer; 20 class DecoderBuffer;
20 21
21 class MEDIA_EXPORT FFmpegAudioDecoder : public AudioDecoder { 22 class MEDIA_EXPORT FFmpegAudioDecoder : public AudioDecoder {
22 public: 23 public:
23 FFmpegAudioDecoder(const base::Callback<MessageLoop*()>& message_loop_cb); 24 FFmpegAudioDecoder(const base::Callback<MessageLoop*()>& message_loop_cb);
24 25
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 StatisticsCB statistics_cb_; 68 StatisticsCB statistics_cb_;
68 AVCodecContext* codec_context_; 69 AVCodecContext* codec_context_;
69 70
70 // Decoded audio format. 71 // Decoded audio format.
71 int bits_per_channel_; 72 int bits_per_channel_;
72 ChannelLayout channel_layout_; 73 ChannelLayout channel_layout_;
73 int samples_per_second_; 74 int samples_per_second_;
74 75
75 base::TimeDelta estimated_next_timestamp_; 76 base::TimeDelta estimated_next_timestamp_;
76 77
77 // Holds decoded audio. As required by FFmpeg, input/output buffers should 78 // Holds decoded audio.
78 // be allocated with suitable padding and alignment. av_malloc() provides 79 AVFrame* av_frame_;
79 // us that guarantee.
80 const int decoded_audio_size_;
81 uint8* decoded_audio_; // Allocated via av_malloc().
82 80
83 ReadCB read_cb_; 81 ReadCB read_cb_;
84 82
85 DISALLOW_IMPLICIT_CONSTRUCTORS(FFmpegAudioDecoder); 83 DISALLOW_IMPLICIT_CONSTRUCTORS(FFmpegAudioDecoder);
86 }; 84 };
87 85
88 } // namespace media 86 } // namespace media
89 87
90 #endif // MEDIA_FILTERS_FFMPEG_AUDIO_DECODER_H_ 88 #endif // MEDIA_FILTERS_FFMPEG_AUDIO_DECODER_H_
OLDNEW
« no previous file with comments | « media/filters/audio_file_reader.cc ('k') | media/filters/ffmpeg_audio_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698