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

Side by Side Diff: media/audio/linux/alsa_wrapper.h

Issue 9418042: Adding microphone volume support to chrome. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: please review 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 // AlsaWrapper is a simple stateless class that wraps the alsa library commands 5 // AlsaWrapper is a simple stateless class that wraps the alsa library commands
6 // we want to use. It's purpose is to allow injection of a mock so that the 6 // we want to use. It's purpose is to allow injection of a mock so that the
7 // higher level code is testable. 7 // higher level code is testable.
8 8
9 #include <alsa/asoundlib.h> 9 #include <alsa/asoundlib.h>
10 10
(...skipping 27 matching lines...) Expand all
38 snd_pcm_access_t access, unsigned int channels, 38 snd_pcm_access_t access, unsigned int channels,
39 unsigned int rate, int soft_resample, 39 unsigned int rate, int soft_resample,
40 unsigned int latency); 40 unsigned int latency);
41 virtual int PcmGetParams(snd_pcm_t* handle, snd_pcm_uframes_t* buffer_size, 41 virtual int PcmGetParams(snd_pcm_t* handle, snd_pcm_uframes_t* buffer_size,
42 snd_pcm_uframes_t* period_size); 42 snd_pcm_uframes_t* period_size);
43 virtual const char* PcmName(snd_pcm_t* handle); 43 virtual const char* PcmName(snd_pcm_t* handle);
44 virtual snd_pcm_sframes_t PcmAvailUpdate(snd_pcm_t* handle); 44 virtual snd_pcm_sframes_t PcmAvailUpdate(snd_pcm_t* handle);
45 virtual snd_pcm_state_t PcmState(snd_pcm_t* handle); 45 virtual snd_pcm_state_t PcmState(snd_pcm_t* handle);
46 virtual int PcmStart(snd_pcm_t* handle); 46 virtual int PcmStart(snd_pcm_t* handle);
47 47
48 virtual int MixerOpen(snd_mixer_t** mixer, int mode);
49 virtual int MixerAttach(snd_mixer_t* mixer, const char *name);
50 virtual int MixerElementRegister(snd_mixer_t* mixer,
51 struct snd_mixer_selem_regopt* options,
52 snd_mixer_class_t** classp);
53 virtual void MixerFree(snd_mixer_t* mixer);
54 virtual int MixerDetach(snd_mixer_t* mixer, const char* name);
55 virtual int MixerClose(snd_mixer_t* mixer);
56 virtual int MixerLoad(snd_mixer_t *mixer);
57 virtual snd_mixer_elem_t* MixerFirstElem(snd_mixer_t *mixer);
58 virtual snd_mixer_elem_t* MixerNextElem(snd_mixer_elem_t *elem);
59 virtual int MixerSelemIsActive(snd_mixer_elem_t *elem);
60 virtual const char* MixerSelemName(snd_mixer_elem_t *elem);
61 virtual int MixerSelemSetCaptureVolumeAll(snd_mixer_elem_t *elem, long value);
62 virtual int MixerSelemGetCaptureVolume(snd_mixer_elem_t *elem,
63 snd_mixer_selem_channel_id_t channel,
64 long *value);
65 virtual int MixerSelemHasCaptureVolume(snd_mixer_elem_t *elem);
66 virtual int MixerSelemGetCaptureVolumeRange(snd_mixer_elem_t *elem,
67 long *min, long *max);
68
48 virtual const char* StrError(int errnum); 69 virtual const char* StrError(int errnum);
49 70
50 private: 71 private:
51 int ConfigureHwParams(snd_pcm_t* handle, snd_pcm_hw_params_t* hw_params, 72 int ConfigureHwParams(snd_pcm_t* handle, snd_pcm_hw_params_t* hw_params,
52 snd_pcm_format_t format, snd_pcm_access_t access, 73 snd_pcm_format_t format, snd_pcm_access_t access,
53 unsigned int channels, unsigned int rate, 74 unsigned int channels, unsigned int rate,
54 int soft_resample, unsigned int latency); 75 int soft_resample, unsigned int latency);
55 DISALLOW_COPY_AND_ASSIGN(AlsaWrapper); 76 DISALLOW_COPY_AND_ASSIGN(AlsaWrapper);
56 }; 77 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698