aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSimon Wilson <simonwilson@google.com>2012-10-31 12:52:39 -0700
committerSimon Wilson <simonwilson@google.com>2012-12-03 10:31:44 -0800
commit43544884f44313176621f57b370b4ba114fe5b8c (patch)
tree562e8dbb469c2f7770484393428687c82dbbc8f2 /include
parent2c3a8e24ec76c1db37ca6576e4685e805f74929d (diff)
pcm: add pcm_get_params API
This enables the capabilities of any given PCM to be queried. Created with input from Priyesh Bisla and Gabriel Beddingfield.
Diffstat (limited to 'include')
-rw-r--r--include/tinyalsa/asoundlib.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/include/tinyalsa/asoundlib.h b/include/tinyalsa/asoundlib.h
index bdb4b7a..a4ebec8 100644
--- a/include/tinyalsa/asoundlib.h
+++ b/include/tinyalsa/asoundlib.h
@@ -98,6 +98,23 @@ struct pcm_config {
unsigned int silence_threshold;
};
+/* PCM parameters */
+enum pcm_param
+{
+ PCM_PARAM_SAMPLE_BITS,
+ PCM_PARAM_FRAME_BITS,
+ PCM_PARAM_CHANNELS,
+ PCM_PARAM_RATE,
+ PCM_PARAM_PERIOD_TIME,
+ PCM_PARAM_PERIOD_SIZE,
+ PCM_PARAM_PERIOD_BYTES,
+ PCM_PARAM_PERIODS,
+ PCM_PARAM_BUFFER_TIME,
+ PCM_PARAM_BUFFER_SIZE,
+ PCM_PARAM_BUFFER_BYTES,
+ PCM_PARAM_TICK_TIME,
+};
+
/* Mixer control types */
enum mixer_ctl_type {
MIXER_CTL_TYPE_BOOL,
@@ -117,6 +134,15 @@ struct pcm *pcm_open(unsigned int card, unsigned int device,
int pcm_close(struct pcm *pcm);
int pcm_is_ready(struct pcm *pcm);
+/* Obtain the parameters for a PCM */
+struct pcm_params *pcm_params_get(unsigned int card, unsigned int device,
+ unsigned int flags);
+void pcm_params_free(struct pcm_params *pcm_params);
+unsigned int pcm_params_get_min(struct pcm_params *pcm_params,
+ enum pcm_param param);
+unsigned int pcm_params_get_max(struct pcm_params *pcm_params,
+ enum pcm_param param);
+
/* Set and get config */
int pcm_get_config(struct pcm *pcm, struct pcm_config *config);
int pcm_set_config(struct pcm *pcm, struct pcm_config *config);