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

Unified Diff: media/audio/linux/alsa_input.h

Issue 9418042: Adding microphone volume support to chrome. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressed henrik's comments Created 8 years, 10 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: media/audio/linux/alsa_input.h
diff --git a/media/audio/linux/alsa_input.h b/media/audio/linux/alsa_input.h
index c70f0de63cc7892b7212a7080961a451aeedf89a..f390813a3d998dac10e580691580a42f88504cbc 100644
--- a/media/audio/linux/alsa_input.h
+++ b/media/audio/linux/alsa_input.h
@@ -36,11 +36,14 @@ class AlsaPcmInputStream : public AudioInputStream {
AlsaWrapper* wrapper);
virtual ~AlsaPcmInputStream();
- // Implementation of AudioOutputStream.
+ // Implementation of AudioInputStream.
virtual bool Open() OVERRIDE;
virtual void Start(AudioInputCallback* callback) OVERRIDE;
virtual void Stop() OVERRIDE;
virtual void Close() OVERRIDE;
+ virtual double GetMaxVolume() OVERRIDE;
+ virtual void SetVolume(double volume) OVERRIDE;
+ virtual double GetVolume() OVERRIDE;
private:
// Logs the error and invokes any registered callbacks.
@@ -70,6 +73,8 @@ class AlsaPcmInputStream : public AudioInputStream {
AudioInputCallback* callback_; // Valid during a recording session.
base::Time next_read_time_; // Scheduled time for the next read callback.
snd_pcm_t* device_handle_; // Handle to the ALSA PCM recording device.
+ snd_mixer_t* mixer_handle_; // Handle to the ALSA microphone mixer.
+ snd_mixer_elem_t* mixer_element_handle_; // Handle to the capture element.
base::WeakPtrFactory<AlsaPcmInputStream> weak_factory_;
scoped_array<uint8> audio_packet_; // Buffer used for reading audio data.
bool read_callback_behind_schedule_;

Powered by Google App Engine
This is Rietveld 408576698