Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(228)

Side by Side Diff: content/renderer/media/renderer_webaudiodevice_impl.cc

Issue 1687213002: Express audio delay more precisely in frames rather than milliseconds. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <stddef.h> 7 #include <stddef.h>
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 is_using_null_audio_sink_ = false; 93 is_using_null_audio_sink_ = false;
94 is_first_buffer_after_silence_ = false; 94 is_first_buffer_after_silence_ = false;
95 start_null_audio_sink_callback_.Cancel(); 95 start_null_audio_sink_callback_.Cancel();
96 } 96 }
97 97
98 double RendererWebAudioDeviceImpl::sampleRate() { 98 double RendererWebAudioDeviceImpl::sampleRate() {
99 return params_.sample_rate(); 99 return params_.sample_rate();
100 } 100 }
101 101
102 int RendererWebAudioDeviceImpl::Render(media::AudioBus* dest, 102 int RendererWebAudioDeviceImpl::Render(media::AudioBus* dest,
103 uint32_t audio_delay_milliseconds, 103 uint32_t frames_delayed,
chcunningham 2016/02/11 01:25:42 This method isn't making use of delay... should it
chcunningham 2016/02/11 21:02:52 @dale, your thoughts?
DaleCurtis 2016/02/11 21:04:19 Oh didn't realize that question was for me. +rtoy
104 uint32_t frames_skipped) { 104 uint32_t frames_skipped) {
105 #if defined(OS_ANDROID) 105 #if defined(OS_ANDROID)
106 if (is_first_buffer_after_silence_) { 106 if (is_first_buffer_after_silence_) {
107 DCHECK(!is_using_null_audio_sink_); 107 DCHECK(!is_using_null_audio_sink_);
108 first_buffer_after_silence_->CopyTo(dest); 108 first_buffer_after_silence_->CopyTo(dest);
109 is_first_buffer_after_silence_ = false; 109 is_first_buffer_after_silence_ = false;
110 return dest->frames(); 110 return dest->frames();
111 } 111 }
112 #endif 112 #endif
113 // Wrap the output pointers using WebVector. 113 // Wrap the output pointers using WebVector.
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 } 160 }
161 #endif 161 #endif
162 return dest->frames(); 162 return dest->frames();
163 } 163 }
164 164
165 void RendererWebAudioDeviceImpl::OnRenderError() { 165 void RendererWebAudioDeviceImpl::OnRenderError() {
166 // TODO(crogers): implement error handling. 166 // TODO(crogers): implement error handling.
167 } 167 }
168 168
169 } // namespace content 169 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698