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 "content/renderer/media/renderer_webaudiodevice_impl.h" | 5 #include "content/renderer/media/renderer_webaudiodevice_impl.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 is_using_null_audio_sink_ = false; | 87 is_using_null_audio_sink_ = false; |
88 is_first_buffer_after_silence_ = false; | 88 is_first_buffer_after_silence_ = false; |
89 start_null_audio_sink_callback_.Cancel(); | 89 start_null_audio_sink_callback_.Cancel(); |
90 } | 90 } |
91 | 91 |
92 double RendererWebAudioDeviceImpl::sampleRate() { | 92 double RendererWebAudioDeviceImpl::sampleRate() { |
93 return params_.sample_rate(); | 93 return params_.sample_rate(); |
94 } | 94 } |
95 | 95 |
96 int RendererWebAudioDeviceImpl::Render(media::AudioBus* dest, | 96 int RendererWebAudioDeviceImpl::Render(media::AudioBus* dest, |
97 uint32_t audio_delay_milliseconds, | 97 int audio_delay_milliseconds) { |
98 uint32_t frames_skipped) { | |
99 #if defined(OS_ANDROID) | 98 #if defined(OS_ANDROID) |
100 if (is_first_buffer_after_silence_) { | 99 if (is_first_buffer_after_silence_) { |
101 DCHECK(!is_using_null_audio_sink_); | 100 DCHECK(!is_using_null_audio_sink_); |
102 first_buffer_after_silence_->CopyTo(dest); | 101 first_buffer_after_silence_->CopyTo(dest); |
103 is_first_buffer_after_silence_ = false; | 102 is_first_buffer_after_silence_ = false; |
104 return dest->frames(); | 103 return dest->frames(); |
105 } | 104 } |
106 #endif | 105 #endif |
107 // Wrap the output pointers using WebVector. | 106 // Wrap the output pointers using WebVector. |
108 WebVector<float*> web_audio_dest_data( | 107 WebVector<float*> web_audio_dest_data( |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 } | 149 } |
151 #endif | 150 #endif |
152 return dest->frames(); | 151 return dest->frames(); |
153 } | 152 } |
154 | 153 |
155 void RendererWebAudioDeviceImpl::OnRenderError() { | 154 void RendererWebAudioDeviceImpl::OnRenderError() { |
156 // TODO(crogers): implement error handling. | 155 // TODO(crogers): implement error handling. |
157 } | 156 } |
158 | 157 |
159 } // namespace content | 158 } // namespace content |
OLD | NEW |