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

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

Issue 1538563002: Forward the number of skipped frames by the OS in audio playout. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Code review fix. git cl format. Rebase. Created 5 years 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 <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
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 uint32_t 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
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
OLDNEW
« no previous file with comments | « content/renderer/media/renderer_webaudiodevice_impl.h ('k') | content/renderer/media/webrtc_audio_renderer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698