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

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

Issue 12224114: Guard against midstream audio configuration changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 58
59 scoped_refptr<base::MessageLoopProxy> message_loop_; 59 scoped_refptr<base::MessageLoopProxy> message_loop_;
60 60
61 scoped_refptr<DemuxerStream> demuxer_stream_; 61 scoped_refptr<DemuxerStream> demuxer_stream_;
62 StatisticsCB statistics_cb_; 62 StatisticsCB statistics_cb_;
63 AVCodecContext* codec_context_; 63 AVCodecContext* codec_context_;
64 64
65 // Decoded audio format. 65 // Decoded audio format.
66 int bits_per_channel_; 66 int bits_per_channel_;
67 ChannelLayout channel_layout_; 67 ChannelLayout channel_layout_;
68 int channels_;
68 int samples_per_second_; 69 int samples_per_second_;
69 70
71 // AVSampleFormat initially requested; not Chrome's SampleFormat.
72 int av_sample_format_;
73
70 // Used for computing output timestamps. 74 // Used for computing output timestamps.
71 scoped_ptr<AudioTimestampHelper> output_timestamp_helper_; 75 scoped_ptr<AudioTimestampHelper> output_timestamp_helper_;
72 int bytes_per_frame_; 76 int bytes_per_frame_;
73 base::TimeDelta last_input_timestamp_; 77 base::TimeDelta last_input_timestamp_;
74 78
75 // Number of output sample bytes to drop before generating 79 // Number of output sample bytes to drop before generating
76 // output buffers. 80 // output buffers.
77 int output_bytes_to_drop_; 81 int output_bytes_to_drop_;
78 82
79 // Holds decoded audio. 83 // Holds decoded audio.
80 AVFrame* av_frame_; 84 AVFrame* av_frame_;
81 85
82 ReadCB read_cb_; 86 ReadCB read_cb_;
83 87
84 // 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
85 // them up and hand them out as we receive Read() calls. 89 // them up and hand them out as we receive Read() calls.
86 std::list<QueuedAudioBuffer> queued_audio_; 90 std::list<QueuedAudioBuffer> queued_audio_;
87 91
88 // We may need to convert the audio data coming out of FFmpeg from planar 92 // We may need to convert the audio data coming out of FFmpeg from planar
89 // float to integer. 93 // float to integer.
90 scoped_ptr<AudioBus> converter_bus_; 94 scoped_ptr<AudioBus> converter_bus_;
91 95
92 DISALLOW_IMPLICIT_CONSTRUCTORS(FFmpegAudioDecoder); 96 DISALLOW_IMPLICIT_CONSTRUCTORS(FFmpegAudioDecoder);
93 }; 97 };
94 98
95 } // namespace media 99 } // namespace media
96 100
97 #endif // MEDIA_FILTERS_FFMPEG_AUDIO_DECODER_H_ 101 #endif // MEDIA_FILTERS_FFMPEG_AUDIO_DECODER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698