| 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/renderers/audio_renderer_impl.h" | 5 #include "media/renderers/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 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 388 if (!audio_parameters_.IsValid()) { | 388 if (!audio_parameters_.IsValid()) { |
| 389 DVLOG(1) << __FUNCTION__ << ": Invalid audio parameters: " | 389 DVLOG(1) << __FUNCTION__ << ": Invalid audio parameters: " |
| 390 << audio_parameters_.AsHumanReadableString(); | 390 << audio_parameters_.AsHumanReadableString(); |
| 391 ChangeState_Locked(kUninitialized); | 391 ChangeState_Locked(kUninitialized); |
| 392 base::ResetAndReturn(&init_cb_).Run(PIPELINE_ERROR_INITIALIZATION_FAILED); | 392 base::ResetAndReturn(&init_cb_).Run(PIPELINE_ERROR_INITIALIZATION_FAILED); |
| 393 return; | 393 return; |
| 394 } | 394 } |
| 395 | 395 |
| 396 if (expecting_config_changes_) | 396 if (expecting_config_changes_) |
| 397 buffer_converter_.reset(new AudioBufferConverter(audio_parameters_)); | 397 buffer_converter_.reset(new AudioBufferConverter(audio_parameters_)); |
| 398 splicer_.reset(new AudioSplicer(audio_parameters_.sample_rate())); | 398 splicer_.reset(new AudioSplicer(audio_parameters_.sample_rate(), media_log_)); |
| 399 | 399 |
| 400 // We're all good! Continue initializing the rest of the audio renderer | 400 // We're all good! Continue initializing the rest of the audio renderer |
| 401 // based on the decoder format. | 401 // based on the decoder format. |
| 402 algorithm_.reset(new AudioRendererAlgorithm()); | 402 algorithm_.reset(new AudioRendererAlgorithm()); |
| 403 algorithm_->Initialize(audio_parameters_); | 403 algorithm_->Initialize(audio_parameters_); |
| 404 | 404 |
| 405 ChangeState_Locked(kFlushed); | 405 ChangeState_Locked(kFlushed); |
| 406 | 406 |
| 407 HistogramRendererEvent(INITIALIZED); | 407 HistogramRendererEvent(INITIALIZED); |
| 408 | 408 |
| (...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 803 << buffering_state; | 803 << buffering_state; |
| 804 DCHECK_NE(buffering_state_, buffering_state); | 804 DCHECK_NE(buffering_state_, buffering_state); |
| 805 lock_.AssertAcquired(); | 805 lock_.AssertAcquired(); |
| 806 buffering_state_ = buffering_state; | 806 buffering_state_ = buffering_state; |
| 807 | 807 |
| 808 task_runner_->PostTask(FROM_HERE, | 808 task_runner_->PostTask(FROM_HERE, |
| 809 base::Bind(buffering_state_cb_, buffering_state_)); | 809 base::Bind(buffering_state_cb_, buffering_state_)); |
| 810 } | 810 } |
| 811 | 811 |
| 812 } // namespace media | 812 } // namespace media |
| OLD | NEW |