| 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 int audio_delay_milliseconds) { | 97 int audio_delay_milliseconds, |
| 98 uint32_t frames_skipped) { |
| 98 #if defined(OS_ANDROID) | 99 #if defined(OS_ANDROID) |
| 99 if (is_first_buffer_after_silence_) { | 100 if (is_first_buffer_after_silence_) { |
| 100 DCHECK(!is_using_null_audio_sink_); | 101 DCHECK(!is_using_null_audio_sink_); |
| 101 first_buffer_after_silence_->CopyTo(dest); | 102 first_buffer_after_silence_->CopyTo(dest); |
| 102 is_first_buffer_after_silence_ = false; | 103 is_first_buffer_after_silence_ = false; |
| 103 return dest->frames(); | 104 return dest->frames(); |
| 104 } | 105 } |
| 105 #endif | 106 #endif |
| 106 // Wrap the output pointers using WebVector. | 107 // Wrap the output pointers using WebVector. |
| 107 WebVector<float*> web_audio_dest_data( | 108 WebVector<float*> web_audio_dest_data( |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 } | 150 } |
| 150 #endif | 151 #endif |
| 151 return dest->frames(); | 152 return dest->frames(); |
| 152 } | 153 } |
| 153 | 154 |
| 154 void RendererWebAudioDeviceImpl::OnRenderError() { | 155 void RendererWebAudioDeviceImpl::OnRenderError() { |
| 155 // TODO(crogers): implement error handling. | 156 // TODO(crogers): implement error handling. |
| 156 } | 157 } |
| 157 | 158 |
| 158 } // namespace content | 159 } // namespace content |
| OLD | NEW |