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

Side by Side Diff: media/filters/audio_renderer_impl.cc

Issue 235723003: Use larger buffer sizes for lower power on Linux. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix test on other platforms. Created 6 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 | Annotate | Revision Log
« no previous file with comments | « media/base/audio_hardware_config_unittest.cc ('k') | no next file » | 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/filters/audio_renderer_impl.h" 5 #include "media/filters/audio_renderer_impl.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 stream->audio_decoder_config().channel_layout(), 271 stream->audio_decoder_config().channel_layout(),
272 ChannelLayoutToChannelCount( 272 ChannelLayoutToChannelCount(
273 stream->audio_decoder_config().channel_layout()), 273 stream->audio_decoder_config().channel_layout()),
274 0, 274 0,
275 stream->audio_decoder_config().samples_per_second(), 275 stream->audio_decoder_config().samples_per_second(),
276 stream->audio_decoder_config().bits_per_channel(), 276 stream->audio_decoder_config().bits_per_channel(),
277 buffer_size); 277 buffer_size);
278 buffer_converter_.reset(); 278 buffer_converter_.reset();
279 } else { 279 } else {
280 // TODO(rileya): Support hardware config changes 280 // TODO(rileya): Support hardware config changes
281 audio_parameters_ = hardware_config_->GetOutputConfig(); 281 const AudioParameters& hw_params = hardware_config_->GetOutputConfig();
282 audio_parameters_.Reset(hw_params.format(),
283 hw_params.channel_layout(),
284 hw_params.channels(),
285 hw_params.input_channels(),
286 hw_params.sample_rate(),
287 hw_params.bits_per_sample(),
288 hardware_config_->GetHighLatencyBufferSize());
282 } 289 }
283 290
284 audio_buffer_stream_.Initialize( 291 audio_buffer_stream_.Initialize(
285 stream, 292 stream,
286 statistics_cb, 293 statistics_cb,
287 base::Bind(&AudioRendererImpl::OnAudioBufferStreamInitialized, 294 base::Bind(&AudioRendererImpl::OnAudioBufferStreamInitialized,
288 weak_factory_.GetWeakPtr())); 295 weak_factory_.GetWeakPtr()));
289 } 296 }
290 297
291 void AudioRendererImpl::OnAudioBufferStreamInitialized(bool success) { 298 void AudioRendererImpl::OnAudioBufferStreamInitialized(bool success) {
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after
746 splicer_->SetSpliceTimestamp(splice_timestamp); 753 splicer_->SetSpliceTimestamp(splice_timestamp);
747 } 754 }
748 755
749 void AudioRendererImpl::OnConfigChange() { 756 void AudioRendererImpl::OnConfigChange() {
750 DCHECK(task_runner_->BelongsToCurrentThread()); 757 DCHECK(task_runner_->BelongsToCurrentThread());
751 DCHECK(expecting_config_changes_); 758 DCHECK(expecting_config_changes_);
752 buffer_converter_->ResetTimestampState(); 759 buffer_converter_->ResetTimestampState();
753 } 760 }
754 761
755 } // namespace media 762 } // namespace media
OLDNEW
« no previous file with comments | « media/base/audio_hardware_config_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698