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

Unified Diff: content/renderer/media/audio_input_device.h

Issue 9702019: Adds Analog Gain Control (AGC) to the WebRTC client. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Improved volume updating on Mac 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
Index: content/renderer/media/audio_input_device.h
diff --git a/content/renderer/media/audio_input_device.h b/content/renderer/media/audio_input_device.h
index ed855548fbaa3dea40fad0eceda59c633ea51f89..4bff6dca3654fe21573041c1e92602ad0f2f6f40 100644
--- a/content/renderer/media/audio_input_device.h
+++ b/content/renderer/media/audio_input_device.h
@@ -95,7 +95,8 @@ class CONTENT_EXPORT AudioInputDevice
public:
virtual void Capture(const std::vector<float*>& audio_data,
size_t number_of_frames,
- size_t audio_delay_milliseconds) = 0;
+ size_t audio_delay_milliseconds,
+ double volume) = 0;
virtual void OnCaptureError() = 0;
protected:
virtual ~CaptureCallback() {}
@@ -144,6 +145,10 @@ class CONTENT_EXPORT AudioInputDevice
// Returns |true| on success.
bool GetVolume(double* volume);
+ // Sets the Automatic Gain Control state to on or off.
+ // TODO(henrika): extend the comments here...
tommi (sloooow) - chröme 2012/03/16 13:31:05 ping (or just remove the todo)
scherkus (not reviewing) 2012/03/20 13:49:41 ping again! :P
henrika (OOO until Aug 14) 2012/03/21 10:16:04 Much better now ;-)
+ void SetAutomaticGainControl(bool enabled);
+
double sample_rate() const { return audio_parameters_.sample_rate; }
size_t buffer_size() const { return audio_parameters_.samples_per_packet; }
@@ -166,6 +171,7 @@ class CONTENT_EXPORT AudioInputDevice
void StartOnIOThread();
void ShutDownOnIOThread();
void SetVolumeOnIOThread(double volume);
+ void SetAutomaticGainControlOnIOThread(bool enabled);
void Send(IPC::Message* message);
@@ -196,6 +202,10 @@ class CONTENT_EXPORT AudioInputDevice
// callback. Only modified on the IO thread.
bool pending_device_ready_;
+ // Stores the Automatic Gain Control state. Default is false.
+ // Only modified on the IO thread.
+ bool agc_is_enabled_;
+
// Our audio thread callback class. See source file for details.
class AudioThreadCallback;

Powered by Google App Engine
This is Rietveld 408576698