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

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

Issue 335343004: Revert 277794 "Modifies AudioInputCallback::OnData and use media..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: 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, 112 virtual void OnData(AudioInputStream* stream, const uint8* src,
113 const AudioBus* source, 113 uint32 size, uint32 hardware_delay_bytes,
114 uint32 hardware_delay_bytes,
115 double volume) = 0; 114 double volume) = 0;
116 115
117 // There was an error while recording audio. The audio sink cannot be 116 // There was an error while recording audio. The audio sink cannot be
118 // destroyed yet. No direct action needed by the AudioInputStream, but it 117 // destroyed yet. No direct action needed by the AudioInputStream, but it
119 // is a good place to stop accumulating sound data since is is likely that 118 // is a good place to stop accumulating sound data since is is likely that
120 // recording will not continue. 119 // recording will not continue.
121 virtual void OnError(AudioInputStream* stream) = 0; 120 virtual void OnError(AudioInputStream* stream) = 0;
122 121
123 protected: 122 protected:
124 virtual ~AudioInputCallback() {} 123 virtual ~AudioInputCallback() {}
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 // Sets the Automatic Gain Control (AGC) state. 155 // Sets the Automatic Gain Control (AGC) state.
157 virtual void SetAutomaticGainControl(bool enabled) = 0; 156 virtual void SetAutomaticGainControl(bool enabled) = 0;
158 157
159 // Returns the Automatic Gain Control (AGC) state. 158 // Returns the Automatic Gain Control (AGC) state.
160 virtual bool GetAutomaticGainControl() = 0; 159 virtual bool GetAutomaticGainControl() = 0;
161 }; 160 };
162 161
163 } // namespace media 162 } // namespace media
164 163
165 #endif // MEDIA_AUDIO_AUDIO_IO_H_ 164 #endif // MEDIA_AUDIO_AUDIO_IO_H_
OLDNEW
« no previous file with comments | « trunk/src/media/audio/audio_input_unittest.cc ('k') | trunk/src/media/audio/audio_low_latency_input_output_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698