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

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

Issue 1070923002: Fix incorrect AudioConverter setup for discrete channel layouts. (Closed) Base URL: http://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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
« no previous file with comments | « no previous file | media/base/audio_converter_unittest.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 // AudioConverter implementation. Uses MultiChannelSincResampler for resampling 5 // AudioConverter implementation. Uses MultiChannelSincResampler for resampling
6 // audio, ChannelMixer for channel mixing, and AudioPullFifo for buffering. 6 // audio, ChannelMixer for channel mixing, and AudioPullFifo for buffering.
7 // 7 //
8 // Delay estimates are provided to InputCallbacks based on the frame delay 8 // Delay estimates are provided to InputCallbacks based on the frame delay
9 // information reported via the resampler and FIFO units. 9 // information reported via the resampler and FIFO units.
10 10
(...skipping 15 matching lines...) Expand all
26 const AudioParameters& output_params, 26 const AudioParameters& output_params,
27 bool disable_fifo) 27 bool disable_fifo)
28 : chunk_size_(input_params.frames_per_buffer()), 28 : chunk_size_(input_params.frames_per_buffer()),
29 downmix_early_(false), 29 downmix_early_(false),
30 resampler_frame_delay_(0), 30 resampler_frame_delay_(0),
31 input_channel_count_(input_params.channels()) { 31 input_channel_count_(input_params.channels()) {
32 CHECK(input_params.IsValid()); 32 CHECK(input_params.IsValid());
33 CHECK(output_params.IsValid()); 33 CHECK(output_params.IsValid());
34 34
35 // Handle different input and output channel layouts. 35 // Handle different input and output channel layouts.
36 if (input_params.channel_layout() != output_params.channel_layout()) { 36 if (input_params.channel_layout() != output_params.channel_layout() ||
37 input_params.channels() != output_params.channels()) {
37 DVLOG(1) << "Remixing channel layout from " << input_params.channel_layout() 38 DVLOG(1) << "Remixing channel layout from " << input_params.channel_layout()
38 << " to " << output_params.channel_layout() << "; from " 39 << " to " << output_params.channel_layout() << "; from "
39 << input_params.channels() << " channels to " 40 << input_params.channels() << " channels to "
40 << output_params.channels() << " channels."; 41 << output_params.channels() << " channels.";
41 channel_mixer_.reset(new ChannelMixer(input_params, output_params)); 42 channel_mixer_.reset(new ChannelMixer(input_params, output_params));
42 43
43 // Pare off data as early as we can for efficiency. 44 // Pare off data as early as we can for efficiency.
44 downmix_early_ = input_params.channels() > output_params.channels(); 45 downmix_early_ = input_params.channels() > output_params.channels();
45 } 46 }
46 47
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 else 243 else
243 SourceCallback(0, dest); 244 SourceCallback(0, dest);
244 } 245 }
245 246
246 void AudioConverter::CreateUnmixedAudioIfNecessary(int frames) { 247 void AudioConverter::CreateUnmixedAudioIfNecessary(int frames) {
247 if (!unmixed_audio_ || unmixed_audio_->frames() != frames) 248 if (!unmixed_audio_ || unmixed_audio_->frames() != frames)
248 unmixed_audio_ = AudioBus::Create(input_channel_count_, frames); 249 unmixed_audio_ = AudioBus::Create(input_channel_count_, frames);
249 } 250 }
250 251
251 } // namespace media 252 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | media/base/audio_converter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698