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

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

Issue 314713002: Modifies AudioInputCallback::OnData and use media::AudioBus instead of plain byte vector (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed SpeechRecognitionBrowserTest Created 6 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 | 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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 }; 102 };
103 103
104 // Models an audio sink receiving recorded audio from the audio driver. 104 // Models an audio sink receiving recorded audio from the audio driver.
105 class MEDIA_EXPORT AudioInputStream { 105 class MEDIA_EXPORT AudioInputStream {
106 public: 106 public:
107 class MEDIA_EXPORT AudioInputCallback { 107 class MEDIA_EXPORT AudioInputCallback {
108 public: 108 public:
109 // Called by the audio recorder when a full packet of audio data is 109 // Called by the audio recorder when a full packet of audio data is
110 // available. This is called from a special audio thread and the 110 // available. This is called from a special audio thread and the
111 // implementation should return as soon as possible. 111 // implementation should return as soon as possible.
112 virtual void OnData(AudioInputStream* stream, const uint8* src, 112 virtual void OnData(AudioInputStream* stream,
113 uint32 size, uint32 hardware_delay_bytes, 113 const AudioBus* source,
114 uint32 hardware_delay_bytes,
114 double volume) = 0; 115 double volume) = 0;
115 116
116 // There was an error while recording audio. The audio sink cannot be 117 // There was an error while recording audio. The audio sink cannot be
117 // destroyed yet. No direct action needed by the AudioInputStream, but it 118 // destroyed yet. No direct action needed by the AudioInputStream, but it
118 // is a good place to stop accumulating sound data since is is likely that 119 // is a good place to stop accumulating sound data since is is likely that
119 // recording will not continue. 120 // recording will not continue.
120 virtual void OnError(AudioInputStream* stream) = 0; 121 virtual void OnError(AudioInputStream* stream) = 0;
121 122
122 protected: 123 protected:
123 virtual ~AudioInputCallback() {} 124 virtual ~AudioInputCallback() {}
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 // Sets the Automatic Gain Control (AGC) state. 156 // Sets the Automatic Gain Control (AGC) state.
156 virtual void SetAutomaticGainControl(bool enabled) = 0; 157 virtual void SetAutomaticGainControl(bool enabled) = 0;
157 158
158 // Returns the Automatic Gain Control (AGC) state. 159 // Returns the Automatic Gain Control (AGC) state.
159 virtual bool GetAutomaticGainControl() = 0; 160 virtual bool GetAutomaticGainControl() = 0;
160 }; 161 };
161 162
162 } // namespace media 163 } // namespace media
163 164
164 #endif // MEDIA_AUDIO_AUDIO_IO_H_ 165 #endif // MEDIA_AUDIO_AUDIO_IO_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698