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

Unified Diff: media/audio/audio_input_controller.h

Issue 9702019: Adds Analog Gain Control (AGC) to the WebRTC client. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 8 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/pepper/pepper_platform_audio_input_impl.cc ('k') | media/audio/audio_input_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/audio_input_controller.h
diff --git a/media/audio/audio_input_controller.h b/media/audio/audio_input_controller.h
index feeb895c6b71ea7bfbf8eb323f06c09f0721bc1d..8fd69b0fa6299151822f8bc6ec8c97247ff6cb91 100644
--- a/media/audio/audio_input_controller.h
+++ b/media/audio/audio_input_controller.h
@@ -97,7 +97,7 @@ class MEDIA_EXPORT AudioInputController
// Write certain amount of data from |data|. This method returns
// number of written bytes.
- virtual uint32 Write(const void* data, uint32 size) = 0;
+ virtual uint32 Write(const void* data, uint32 size, double volume) = 0;
// Close this synchronous writer.
virtual void Close() = 0;
@@ -157,10 +157,18 @@ class MEDIA_EXPORT AudioInputController
// This method trampolines to the audio thread.
virtual void Close(const base::Closure& closed_task);
+ // Sets the capture volume of the input stream. The value 0.0 corresponds
+ // to muted and 1.0 to maximum volume.
+ virtual void SetVolume(double volume);
+
+ // Sets the Automatic Gain Control (AGC) state of the input stream.
+ // Changing the AGC state is not supported while recording is active.
+ virtual void SetAutomaticGainControl(bool enabled);
+
// AudioInputCallback implementation. Threading details depends on the
// device-specific implementation.
virtual void OnData(AudioInputStream* stream, const uint8* src, uint32 size,
- uint32 hardware_delay_bytes) OVERRIDE;
+ uint32 hardware_delay_bytes, double volume) OVERRIDE;
virtual void OnClose(AudioInputStream* stream) OVERRIDE;
virtual void OnError(AudioInputStream* stream, int code) OVERRIDE;
@@ -187,6 +195,8 @@ class MEDIA_EXPORT AudioInputController
void DoRecord();
void DoClose();
void DoReportError(int code);
+ void DoSetVolume(double volume);
+ void DoSetAutomaticGainControl(bool enabled);
// Methods which ensures that OnError() is triggered when data recording
// times out. Both are called on the creating thread.
@@ -229,6 +239,8 @@ class MEDIA_EXPORT AudioInputController
static Factory* factory_;
+ double max_volume_;
+
DISALLOW_COPY_AND_ASSIGN(AudioInputController);
};
« no previous file with comments | « content/renderer/pepper/pepper_platform_audio_input_impl.cc ('k') | media/audio/audio_input_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698