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

Side by Side Diff: media/base/audio_converter.h

Issue 177333003: Add support for midstream audio configuration changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ABS
Patch Set: Created 6 years, 9 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
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 // AudioConverter is a complete mixing, resampling, buffering, and channel 5 // AudioConverter is a complete mixing, resampling, buffering, and channel
6 // mixing solution for converting data from one set of AudioParameters to 6 // mixing solution for converting data from one set of AudioParameters to
7 // another. 7 // another.
8 // 8 //
9 // For efficiency, pieces are only invoked when necessary; i.e., 9 // For efficiency, pieces are only invoked when necessary; i.e.,
10 // - The resampler is only used if sample rates differ. 10 // - The resampler is only used if sample rates differ.
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 void AddInput(InputCallback* input); 83 void AddInput(InputCallback* input);
84 void RemoveInput(InputCallback* input); 84 void RemoveInput(InputCallback* input);
85 85
86 // Flushes all buffered data. 86 // Flushes all buffered data.
87 void Reset(); 87 void Reset();
88 88
89 // The maximum size in frames that guarantees we will only make a single call 89 // The maximum size in frames that guarantees we will only make a single call
90 // to each input's ProvideInput for more data. 90 // to each input's ProvideInput for more data.
91 int ChunkSize() const; 91 int ChunkSize() const;
92 92
93 // How many frames will be requested via a single ProvideInput() call.
DaleCurtis 2014/03/20 19:29:01 You should be able to calculate this within your c
rileya (GONE FROM CHROMIUM) 2014/03/21 20:58:49 Good point, I'd previously disabled the fifo, but
94 int RequestSize() const;
95
93 private: 96 private:
94 // Provides input to the MultiChannelResampler. Called by the resampler when 97 // Provides input to the MultiChannelResampler. Called by the resampler when
95 // more data is necessary. 98 // more data is necessary.
96 void ProvideInput(int resampler_frame_delay, AudioBus* audio_bus); 99 void ProvideInput(int resampler_frame_delay, AudioBus* audio_bus);
97 100
98 // Provides input to the AudioPullFifo. Called by the fifo when more data is 101 // Provides input to the AudioPullFifo. Called by the fifo when more data is
99 // necessary. 102 // necessary.
100 void SourceCallback(int fifo_frame_delay, AudioBus* audio_bus); 103 void SourceCallback(int fifo_frame_delay, AudioBus* audio_bus);
101 104
102 // (Re)creates the temporary |unmixed_audio_| buffer if necessary. 105 // (Re)creates the temporary |unmixed_audio_| buffer if necessary.
(...skipping 27 matching lines...) Expand all
130 base::TimeDelta input_frame_duration_; 133 base::TimeDelta input_frame_duration_;
131 base::TimeDelta output_frame_duration_; 134 base::TimeDelta output_frame_duration_;
132 base::TimeDelta initial_delay_; 135 base::TimeDelta initial_delay_;
133 int resampler_frame_delay_; 136 int resampler_frame_delay_;
134 137
135 // Number of channels of input audio data. Set during construction via the 138 // Number of channels of input audio data. Set during construction via the
136 // value from the input AudioParameters class. Preserved to recreate internal 139 // value from the input AudioParameters class. Preserved to recreate internal
137 // AudioBus structures on demand in response to varying frame size requests. 140 // AudioBus structures on demand in response to varying frame size requests.
138 const int input_channel_count_; 141 const int input_channel_count_;
139 142
143 const double io_sample_rate_ratio_;
144
140 DISALLOW_COPY_AND_ASSIGN(AudioConverter); 145 DISALLOW_COPY_AND_ASSIGN(AudioConverter);
141 }; 146 };
142 147
143 } // namespace media 148 } // namespace media
144 149
145 #endif // MEDIA_BASE_AUDIO_CONVERTER_H_ 150 #endif // MEDIA_BASE_AUDIO_CONVERTER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698