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

Side by Side Diff: media/audio/simple_sources.cc

Issue 2004283002: AudioConverter: Express delay in frames rather than msec. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Missed files & removed rounding Created 4 years, 6 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
« no previous file with comments | « media/audio/simple_sources.h ('k') | media/audio/virtual_audio_input_stream.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 // MSVC++ requires this to be set before any other includes to get M_PI. 4 // MSVC++ requires this to be set before any other includes to get M_PI.
5 #define _USE_MATH_DEFINES 5 #define _USE_MATH_DEFINES
6 6
7 #include "media/audio/simple_sources.h" 7 #include "media/audio/simple_sources.h"
8 8
9 #include <stddef.h> 9 #include <stddef.h>
10 10
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 // Stop playing if we've played out the whole file. 216 // Stop playing if we've played out the whole file.
217 if (wav_audio_handler_->AtEnd(wav_file_read_pos_)) 217 if (wav_audio_handler_->AtEnd(wav_file_read_pos_))
218 return 0; 218 return 0;
219 219
220 // This pulls data from ProvideInput. 220 // This pulls data from ProvideInput.
221 file_audio_converter_->Convert(audio_bus); 221 file_audio_converter_->Convert(audio_bus);
222 return audio_bus->frames(); 222 return audio_bus->frames();
223 } 223 }
224 224
225 double FileSource::ProvideInput(AudioBus* audio_bus_into_converter, 225 double FileSource::ProvideInput(AudioBus* audio_bus_into_converter,
226 base::TimeDelta buffer_delay) { 226 uint32_t frames_delayed) {
227 // Unfilled frames will be zeroed by CopyTo. 227 // Unfilled frames will be zeroed by CopyTo.
228 size_t bytes_written; 228 size_t bytes_written;
229 wav_audio_handler_->CopyTo(audio_bus_into_converter, wav_file_read_pos_, 229 wav_audio_handler_->CopyTo(audio_bus_into_converter, wav_file_read_pos_,
230 &bytes_written); 230 &bytes_written);
231 wav_file_read_pos_ += bytes_written; 231 wav_file_read_pos_ += bytes_written;
232 return 1.0; 232 return 1.0;
233 } 233 }
234 234
235 void FileSource::OnError(AudioOutputStream* stream) { 235 void FileSource::OnError(AudioOutputStream* stream) {
236 } 236 }
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 } 302 }
303 303
304 void BeepingSource::OnError(AudioOutputStream* stream) { 304 void BeepingSource::OnError(AudioOutputStream* stream) {
305 } 305 }
306 306
307 void BeepingSource::BeepOnce() { 307 void BeepingSource::BeepOnce() {
308 g_beep_context.Pointer()->SetBeepOnce(true); 308 g_beep_context.Pointer()->SetBeepOnce(true);
309 } 309 }
310 310
311 } // namespace media 311 } // namespace media
OLDNEW
« no previous file with comments | « media/audio/simple_sources.h ('k') | media/audio/virtual_audio_input_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698