OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "content/renderer/audio_device.h" | 5 #include "content/renderer/media/audio_device.h" |
6 | 6 |
7 #include "base/memory/singleton.h" | 7 #include "base/memory/singleton.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "content/common/audio_messages.h" | 9 #include "content/common/audio_messages.h" |
10 #include "content/common/child_process.h" | 10 #include "content/common/child_process.h" |
11 #include "content/common/view_messages.h" | 11 #include "content/common/view_messages.h" |
12 #include "content/renderer/render_thread.h" | 12 #include "content/renderer/render_thread.h" |
13 #include "media/audio/audio_util.h" | 13 #include "media/audio/audio_util.h" |
14 | 14 |
15 scoped_refptr<AudioMessageFilter> AudioDevice::filter_; | 15 scoped_refptr<AudioMessageFilter> AudioDevice::filter_; |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 void AudioDevice::FireRenderCallback() { | 245 void AudioDevice::FireRenderCallback() { |
246 if (callback_) { | 246 if (callback_) { |
247 // Update the audio-delay measurement then ask client to render audio. | 247 // Update the audio-delay measurement then ask client to render audio. |
248 callback_->Render(audio_data_, buffer_size_, audio_delay_milliseconds_); | 248 callback_->Render(audio_data_, buffer_size_, audio_delay_milliseconds_); |
249 | 249 |
250 // Interleave, scale, and clip to int16. | 250 // Interleave, scale, and clip to int16. |
251 int16* output_buffer16 = static_cast<int16*>(shared_memory_data()); | 251 int16* output_buffer16 = static_cast<int16*>(shared_memory_data()); |
252 media::InterleaveFloatToInt16(audio_data_, output_buffer16, buffer_size_); | 252 media::InterleaveFloatToInt16(audio_data_, output_buffer16, buffer_size_); |
253 } | 253 } |
254 } | 254 } |
OLD | NEW |