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

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

Issue 11348166: Always wait for DataReady() on Windows WaveOut. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Only wait on WaveOut. Created 8 years, 1 month 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
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_AUDIO_IO_H_ 5 #ifndef MEDIA_AUDIO_AUDIO_IO_H_
6 #define MEDIA_AUDIO_AUDIO_IO_H_ 6 #define MEDIA_AUDIO_AUDIO_IO_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "media/audio/audio_buffers_state.h" 9 #include "media/audio/audio_buffers_state.h"
10 #include "media/base/audio_bus.h" 10 #include "media/base/audio_bus.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 AudioBus* dest, 67 AudioBus* dest,
68 AudioBuffersState buffers_state) = 0; 68 AudioBuffersState buffers_state) = 0;
69 69
70 // There was an error while playing a buffer. Audio source cannot be 70 // There was an error while playing a buffer. Audio source cannot be
71 // destroyed yet. No direct action needed by the AudioStream, but it is 71 // destroyed yet. No direct action needed by the AudioStream, but it is
72 // a good place to stop accumulating sound data since is is likely that 72 // a good place to stop accumulating sound data since is is likely that
73 // playback will not continue. |code| is an error code that is platform 73 // playback will not continue. |code| is an error code that is platform
74 // specific. 74 // specific.
75 virtual void OnError(AudioOutputStream* stream, int code) = 0; 75 virtual void OnError(AudioOutputStream* stream, int code) = 0;
76 76
77 // Waits till data becomes available. Used when buffering data starting 77 // Deprecated. DO NOT USE. Waits until data becomes available. Used only
78 // new audio stream. 78 // by Window's WaveOut clients which may be extremely laggy. Will yield the
scherkus (not reviewing) 2012/11/21 21:37:57 nit: Windows'
DaleCurtis 2012/11/21 22:42:10 Done.
79 // Polling is not the best approach, but incorporating messaging loop 79 // current thread until the renderer client has written its audio data.
80 // with delayed tasks into guts of complex code is even worse, as it is
81 // very error-prone. We cannot easily add synchronization, interface is
82 // already cut in stone because of need of backward compatibility with
83 // plugins. In any case, data is usually immediately available,
84 // so there would be no delay.
85 virtual void WaitTillDataReady() {} 80 virtual void WaitTillDataReady() {}
86 81
87 protected: 82 protected:
88 virtual ~AudioSourceCallback() {} 83 virtual ~AudioSourceCallback() {}
89 }; 84 };
90 85
91 virtual ~AudioOutputStream() {} 86 virtual ~AudioOutputStream() {}
92 87
93 // Open the stream. false is returned if the stream cannot be opened. Open() 88 // Open the stream. false is returned if the stream cannot be opened. Open()
94 // must always be followed by a call to Close() even if Open() fails. 89 // must always be followed by a call to Close() even if Open() fails.
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 // Sets the Automatic Gain Control (AGC) state. 170 // Sets the Automatic Gain Control (AGC) state.
176 virtual void SetAutomaticGainControl(bool enabled) = 0; 171 virtual void SetAutomaticGainControl(bool enabled) = 0;
177 172
178 // Returns the Automatic Gain Control (AGC) state. 173 // Returns the Automatic Gain Control (AGC) state.
179 virtual bool GetAutomaticGainControl() = 0; 174 virtual bool GetAutomaticGainControl() = 0;
180 }; 175 };
181 176
182 } // namespace media 177 } // namespace media
183 178
184 #endif // MEDIA_AUDIO_AUDIO_IO_H_ 179 #endif // MEDIA_AUDIO_AUDIO_IO_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698