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

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

Issue 10830268: Allow audio system to handle synchronized low-latency audio I/O (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 3 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 | « media/audio/mac/audio_output_mac_unittest.cc ('k') | media/audio/simple_sources.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_SIMPLE_SOURCES_H_ 5 #ifndef MEDIA_AUDIO_SIMPLE_SOURCES_H_
6 #define MEDIA_AUDIO_SIMPLE_SOURCES_H_ 6 #define MEDIA_AUDIO_SIMPLE_SOURCES_H_
7 7
8 #include "base/synchronization/lock.h" 8 #include "base/synchronization/lock.h"
9 #include "media/audio/audio_io.h" 9 #include "media/audio/audio_io.h"
10 #include "media/base/seekable_buffer.h" 10 #include "media/base/seekable_buffer.h"
(...skipping 11 matching lines...) Expand all
22 virtual ~SineWaveAudioSource() {} 22 virtual ~SineWaveAudioSource() {}
23 23
24 // Return up to |cap| samples of data via OnMoreData(). Use Reset() to 24 // Return up to |cap| samples of data via OnMoreData(). Use Reset() to
25 // allow more data to be served. 25 // allow more data to be served.
26 void CapSamples(int cap); 26 void CapSamples(int cap);
27 void Reset(); 27 void Reset();
28 28
29 // Implementation of AudioSourceCallback. 29 // Implementation of AudioSourceCallback.
30 virtual int OnMoreData(AudioBus* audio_bus, 30 virtual int OnMoreData(AudioBus* audio_bus,
31 AudioBuffersState audio_buffers) OVERRIDE; 31 AudioBuffersState audio_buffers) OVERRIDE;
32 virtual int OnMoreIOData(AudioBus* source,
33 AudioBus* dest,
34 AudioBuffersState audio_buffers) OVERRIDE;
32 virtual void OnError(AudioOutputStream* stream, int code) OVERRIDE; 35 virtual void OnError(AudioOutputStream* stream, int code) OVERRIDE;
33 36
34 protected: 37 protected:
35 int channels_; 38 int channels_;
36 double f_; 39 double f_;
37 int time_state_; 40 int time_state_;
38 int cap_; 41 int cap_;
39 base::Lock time_lock_; 42 base::Lock time_lock_;
40 }; 43 };
41 44
42 } // namespace media 45 } // namespace media
43 46
44 #endif // MEDIA_AUDIO_SIMPLE_SOURCES_H_ 47 #endif // MEDIA_AUDIO_SIMPLE_SOURCES_H_
OLDNEW
« no previous file with comments | « media/audio/mac/audio_output_mac_unittest.cc ('k') | media/audio/simple_sources.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698