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

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

Issue 12662038: Revert 187936 "Pass more detailed audio hardware configuration i..." (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1440/src/
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « media/audio/mac/audio_manager_mac.cc ('k') | media/base/audio_hardware_config.h » ('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 #include "media/base/audio_converter.h" 5 #include "media/base/audio_converter.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 12 matching lines...) Expand all
23 input_channel_count_(input_params.channels()) { 23 input_channel_count_(input_params.channels()) {
24 CHECK(input_params.IsValid()); 24 CHECK(input_params.IsValid());
25 CHECK(output_params.IsValid()); 25 CHECK(output_params.IsValid());
26 26
27 // Handle different input and output channel layouts. 27 // Handle different input and output channel layouts.
28 if (input_params.channel_layout() != output_params.channel_layout()) { 28 if (input_params.channel_layout() != output_params.channel_layout()) {
29 DVLOG(1) << "Remixing channel layout from " << input_params.channel_layout() 29 DVLOG(1) << "Remixing channel layout from " << input_params.channel_layout()
30 << " to " << output_params.channel_layout() << "; from " 30 << " to " << output_params.channel_layout() << "; from "
31 << input_params.channels() << " channels to " 31 << input_params.channels() << " channels to "
32 << output_params.channels() << " channels."; 32 << output_params.channels() << " channels.";
33 channel_mixer_.reset(new ChannelMixer(input_params, output_params)); 33 channel_mixer_.reset(new ChannelMixer(
34 input_params.channel_layout(), output_params.channel_layout()));
34 35
35 // Pare off data as early as we can for efficiency. 36 // Pare off data as early as we can for efficiency.
36 downmix_early_ = input_params.channels() > output_params.channels(); 37 downmix_early_ = input_params.channels() > output_params.channels();
37 if (downmix_early_) { 38 if (downmix_early_) {
38 DVLOG(1) << "Remixing channel layout prior to resampling."; 39 DVLOG(1) << "Remixing channel layout prior to resampling.";
39 // |unmixed_audio_| will be allocated on the fly. 40 // |unmixed_audio_| will be allocated on the fly.
40 } else { 41 } else {
41 // Instead, if we're not downmixing early we need a temporary AudioBus 42 // Instead, if we're not downmixing early we need a temporary AudioBus
42 // which matches the input channel count but uses the output frame size 43 // which matches the input channel count but uses the output frame size
43 // since we'll mix into the AudioBus from the output stream. 44 // since we'll mix into the AudioBus from the output stream.
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 204
204 void AudioConverter::ProvideInput(int resampler_frame_delay, AudioBus* dest) { 205 void AudioConverter::ProvideInput(int resampler_frame_delay, AudioBus* dest) {
205 resampler_frame_delay_ = resampler_frame_delay; 206 resampler_frame_delay_ = resampler_frame_delay;
206 if (audio_fifo_) 207 if (audio_fifo_)
207 audio_fifo_->Consume(dest, dest->frames()); 208 audio_fifo_->Consume(dest, dest->frames());
208 else 209 else
209 SourceCallback(0, dest); 210 SourceCallback(0, dest);
210 } 211 }
211 212
212 } // namespace media 213 } // namespace media
OLDNEW
« no previous file with comments | « media/audio/mac/audio_manager_mac.cc ('k') | media/base/audio_hardware_config.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698