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/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 // enough to handle the current sample test scenario. | 211 // enough to handle the current sample test scenario. |
212 buffer_->set_forward_capacity(2 * buffer_->forward_capacity()); | 212 buffer_->set_forward_capacity(2 * buffer_->forward_capacity()); |
213 buffer_->Clear(); | 213 buffer_->Clear(); |
214 } | 214 } |
215 } | 215 } |
216 | 216 |
217 virtual void OnClose(AudioInputStream* stream) OVERRIDE {} | 217 virtual void OnClose(AudioInputStream* stream) OVERRIDE {} |
218 virtual void OnError(AudioInputStream* stream, int code) OVERRIDE {} | 218 virtual void OnError(AudioInputStream* stream, int code) OVERRIDE {} |
219 | 219 |
220 // AudioOutputStream::AudioSourceCallback. | 220 // AudioOutputStream::AudioSourceCallback. |
221 virtual uint32 OnMoreData(AudioOutputStream* stream, | 221 virtual uint32 OnMoreData(uint8* dest, |
222 uint8* dest, uint32 max_size, | 222 uint32 max_size, |
223 AudioBuffersState buffers_state) OVERRIDE { | 223 AudioBuffersState buffers_state) OVERRIDE { |
224 base::AutoLock lock(lock_); | 224 base::AutoLock lock(lock_); |
225 | 225 |
226 // Update one component in the AudioDelayState for the packet | 226 // Update one component in the AudioDelayState for the packet |
227 // which is about to be played out. | 227 // which is about to be played out. |
228 if (output_elements_to_write_ < kMaxDelayMeasurements) { | 228 if (output_elements_to_write_ < kMaxDelayMeasurements) { |
229 int output_delay_bytes = buffers_state.hardware_delay_bytes; | 229 int output_delay_bytes = buffers_state.hardware_delay_bytes; |
230 #if defined(OS_WIN) | 230 #if defined(OS_WIN) |
231 // Special fix for Windows in combination with Wave where the | 231 // Special fix for Windows in combination with Wave where the |
232 // pending bytes field of the audio buffer state is used to | 232 // pending bytes field of the audio buffer state is used to |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
457 | 457 |
458 // All Close() operations that run on the mocked audio thread, | 458 // All Close() operations that run on the mocked audio thread, |
459 // should be synchronous and not post additional close tasks to | 459 // should be synchronous and not post additional close tasks to |
460 // mocked the audio thread. Hence, there is no need to call | 460 // mocked the audio thread. Hence, there is no need to call |
461 // message_loop()->RunAllPending() after the Close() methods. | 461 // message_loop()->RunAllPending() after the Close() methods. |
462 aos->Close(); | 462 aos->Close(); |
463 ais->Close(); | 463 ais->Close(); |
464 } | 464 } |
465 | 465 |
466 } // namespace media | 466 } // namespace media |
OLD | NEW |