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 "base/basictypes.h" | 5 #include "base/basictypes.h" |
6 #include "base/environment.h" | 6 #include "base/environment.h" |
7 #include "base/files/file_util.h" | 7 #include "base/files/file_util.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "base/synchronization/lock.h" | 10 #include "base/synchronization/lock.h" |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 // Double the buffer capacity to ensure that we have a buffer large | 209 // Double the buffer capacity to ensure that we have a buffer large |
210 // enough to handle the current sample test scenario. | 210 // enough to handle the current sample test scenario. |
211 // buffer_->set_forward_capacity(2 * buffer_->forward_capacity()); | 211 // buffer_->set_forward_capacity(2 * buffer_->forward_capacity()); |
212 // buffer_->Clear(); | 212 // buffer_->Clear(); |
213 // } | 213 // } |
214 } | 214 } |
215 | 215 |
216 void OnError(AudioInputStream* stream) override {} | 216 void OnError(AudioInputStream* stream) override {} |
217 | 217 |
218 // AudioOutputStream::AudioSourceCallback. | 218 // AudioOutputStream::AudioSourceCallback. |
219 int OnMoreData(AudioBus* audio_bus, uint32 total_bytes_delay) override { | 219 int OnMoreData(AudioBus* audio_bus, |
| 220 uint32_t total_bytes_delay, |
| 221 uint32_t frames_skipped) override { |
220 base::AutoLock lock(lock_); | 222 base::AutoLock lock(lock_); |
221 | 223 |
222 // Update one component in the AudioDelayState for the packet | 224 // Update one component in the AudioDelayState for the packet |
223 // which is about to be played out. | 225 // which is about to be played out. |
224 if (output_elements_to_write_ < kMaxDelayMeasurements) { | 226 if (output_elements_to_write_ < kMaxDelayMeasurements) { |
225 delay_states_[output_elements_to_write_].output_delay_ms = | 227 delay_states_[output_elements_to_write_].output_delay_ms = |
226 BytesToMilliseconds(total_bytes_delay); | 228 BytesToMilliseconds(total_bytes_delay); |
227 ++output_elements_to_write_; | 229 ++output_elements_to_write_; |
228 } | 230 } |
229 | 231 |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
428 | 430 |
429 // All Close() operations that run on the mocked audio thread, | 431 // All Close() operations that run on the mocked audio thread, |
430 // should be synchronous and not post additional close tasks to | 432 // should be synchronous and not post additional close tasks to |
431 // mocked the audio thread. Hence, there is no need to call | 433 // mocked the audio thread. Hence, there is no need to call |
432 // message_loop()->RunUntilIdle() after the Close() methods. | 434 // message_loop()->RunUntilIdle() after the Close() methods. |
433 aos->Close(); | 435 aos->Close(); |
434 ais->Close(); | 436 ais->Close(); |
435 } | 437 } |
436 | 438 |
437 } // namespace media | 439 } // namespace media |
OLD | NEW |