Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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(); |
|
no longer working on chromium
2014/04/14 08:51:50
why not add a GetHighLatencyConfigue() method to h
DaleCurtis
2014/04/16 00:39:46
I wanted it to be clear that this is only adjustin
| |
| 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 Loading... | |
| 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 |
| OLD | NEW |