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

Side by Side Diff: media/audio/virtual_audio_input_stream.h

Issue 11889041: Fix VirtualAudioInputStream callback timing issues. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use microseconds for buffer length because for some reason input params specify a 440 frame buffer … Created 7 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | 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 4
5 #ifndef MEDIA_AUDIO_VIRTUAL_AUDIO_INPUT_STREAM_H_ 5 #ifndef MEDIA_AUDIO_VIRTUAL_AUDIO_INPUT_STREAM_H_
6 #define MEDIA_AUDIO_VIRTUAL_AUDIO_INPUT_STREAM_H_ 6 #define MEDIA_AUDIO_VIRTUAL_AUDIO_INPUT_STREAM_H_
7 7
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 10
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 // When Start() is called on this class, we continuously schedule this 69 // When Start() is called on this class, we continuously schedule this
70 // callback to render audio using any attached VirtualAudioOutputStreams until 70 // callback to render audio using any attached VirtualAudioOutputStreams until
71 // Stop() is called. 71 // Stop() is called.
72 void ReadAudio(); 72 void ReadAudio();
73 73
74 AudioManagerBase* audio_manager_; 74 AudioManagerBase* audio_manager_;
75 base::MessageLoopProxy* message_loop_; 75 base::MessageLoopProxy* message_loop_;
76 AudioInputCallback* callback_; 76 AudioInputCallback* callback_;
77 77
78 // Non-const for testing. 78 // Non-const for testing.
79 base::TimeDelta buffer_duration_ms_; 79 base::TimeDelta buffer_duration_us_;
DaleCurtis 2013/01/17 22:34:21 As a time delta this doesn't have units.
justinlin 2013/01/17 22:50:15 Done.
80 base::Time next_read_time_;
80 scoped_array<uint8> buffer_; 81 scoped_array<uint8> buffer_;
81 AudioParameters params_; 82 AudioParameters params_;
82 scoped_ptr<AudioBus> audio_bus_; 83 scoped_ptr<AudioBus> audio_bus_;
83 base::CancelableClosure on_more_data_cb_; 84 base::CancelableClosure on_more_data_cb_;
84 85
85 // AudioConverters associated with the attached VirtualAudioOutputStreams, 86 // AudioConverters associated with the attached VirtualAudioOutputStreams,
86 // partitioned by common AudioParameters. 87 // partitioned by common AudioParameters.
87 AudioConvertersMap converters_; 88 AudioConvertersMap converters_;
88 89
89 // AudioConverter that takes all the audio converters and mixes them into one 90 // AudioConverter that takes all the audio converters and mixes them into one
90 // final audio stream. 91 // final audio stream.
91 AudioConverter mixer_; 92 AudioConverter mixer_;
92 93
93 // Number of currently attached VirtualAudioOutputStreams. 94 // Number of currently attached VirtualAudioOutputStreams.
94 int num_attached_outputs_streams_; 95 int num_attached_outputs_streams_;
95 96
96 DISALLOW_COPY_AND_ASSIGN(VirtualAudioInputStream); 97 DISALLOW_COPY_AND_ASSIGN(VirtualAudioInputStream);
97 }; 98 };
98 99
99 } // namespace media 100 } // namespace media
100 101
101 #endif // MEDIA_AUDIO_VIRTUAL_AUDIO_INPUT_STREAM_H_ 102 #endif // MEDIA_AUDIO_VIRTUAL_AUDIO_INPUT_STREAM_H_
OLDNEW
« no previous file with comments | « no previous file | media/audio/virtual_audio_input_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698