| 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 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 309 stream->audio_decoder_config().channel_layout()), | 309 stream->audio_decoder_config().channel_layout()), |
| 310 hw_params.sample_rate(), | 310 hw_params.sample_rate(), |
| 311 hw_params.bits_per_sample(), | 311 hw_params.bits_per_sample(), |
| 312 hardware_config_.GetHighLatencyBufferSize()); | 312 hardware_config_.GetHighLatencyBufferSize()); |
| 313 } | 313 } |
| 314 | 314 |
| 315 audio_clock_.reset( | 315 audio_clock_.reset( |
| 316 new AudioClock(base::TimeDelta(), audio_parameters_.sample_rate())); | 316 new AudioClock(base::TimeDelta(), audio_parameters_.sample_rate())); |
| 317 | 317 |
| 318 audio_buffer_stream_->Initialize( | 318 audio_buffer_stream_->Initialize( |
| 319 stream, | 319 stream, statistics_cb, |
| 320 false, | |
| 321 statistics_cb, | |
| 322 base::Bind(&AudioRendererImpl::OnAudioBufferStreamInitialized, | 320 base::Bind(&AudioRendererImpl::OnAudioBufferStreamInitialized, |
| 323 weak_factory_.GetWeakPtr())); | 321 weak_factory_.GetWeakPtr())); |
| 324 } | 322 } |
| 325 | 323 |
| 326 void AudioRendererImpl::OnAudioBufferStreamInitialized(bool success) { | 324 void AudioRendererImpl::OnAudioBufferStreamInitialized(bool success) { |
| 327 DVLOG(1) << __FUNCTION__ << ": " << success; | 325 DVLOG(1) << __FUNCTION__ << ": " << success; |
| 328 DCHECK(task_runner_->BelongsToCurrentThread()); | 326 DCHECK(task_runner_->BelongsToCurrentThread()); |
| 329 | 327 |
| 330 base::AutoLock auto_lock(lock_); | 328 base::AutoLock auto_lock(lock_); |
| 331 | 329 |
| (...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 716 << buffering_state; | 714 << buffering_state; |
| 717 DCHECK_NE(buffering_state_, buffering_state); | 715 DCHECK_NE(buffering_state_, buffering_state); |
| 718 lock_.AssertAcquired(); | 716 lock_.AssertAcquired(); |
| 719 buffering_state_ = buffering_state; | 717 buffering_state_ = buffering_state; |
| 720 | 718 |
| 721 task_runner_->PostTask(FROM_HERE, | 719 task_runner_->PostTask(FROM_HERE, |
| 722 base::Bind(buffering_state_cb_, buffering_state_)); | 720 base::Bind(buffering_state_cb_, buffering_state_)); |
| 723 } | 721 } |
| 724 | 722 |
| 725 } // namespace media | 723 } // namespace media |
| OLD | NEW |