PulseAudio  4.0-186-ga89ca
format.h
Go to the documentation of this file.
1 #ifndef fooformathfoo
2 #define fooformathfoo
3 
4 /***
5  This file is part of PulseAudio.
6 
7  Copyright 2011 Intel Corporation
8  Copyright 2011 Collabora Multimedia
9  Copyright 2011 Arun Raghavan <arun.raghavan@collabora.co.uk>
10 
11  PulseAudio is free software; you can redistribute it and/or modify
12  it under the terms of the GNU Lesser General Public License as published
13  by the Free Software Foundation; either version 2.1 of the License,
14  or (at your option) any later version.
15 
16  PulseAudio is distributed in the hope that it will be useful, but
17  WITHOUT ANY WARRANTY; without even the implied warranty of
18  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19  General Public License for more details.
20 
21  You should have received a copy of the GNU Lesser General Public License
22  along with PulseAudio; if not, write to the Free Software
23  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
24  USA.
25 ***/
26 
27 #include <pulse/cdecl.h>
28 #include <pulse/gccmacro.h>
29 #include <pulse/proplist.h>
30 #include <pulse/sample.h>
31 #include <pulse/channelmap.h>
32 
36 PA_C_DECL_BEGIN
37 
39 typedef enum pa_encoding {
67 
69 #define PA_ENCODING_ANY PA_ENCODING_ANY
70 #define PA_ENCODING_PCM PA_ENCODING_PCM
71 #define PA_ENCODING_AC3_IEC61937 PA_ENCODING_AC3_IEC61937
72 #define PA_ENCODING_EAC3_IEC61937 PA_ENCODING_EAC3_IEC61937
73 #define PA_ENCODING_MPEG_IEC61937 PA_ENCODING_MPEG_IEC61937
74 #define PA_ENCODING_DTS_IEC61937 PA_ENCODING_DTS_IEC61937
75 #define PA_ENCODING_MPEG2_AAC_IEC61937 PA_ENCODING_MPEG2_AAC_IEC61937
76 #define PA_ENCODING_MAX PA_ENCODING_MAX
77 #define PA_ENCODING_INVALID PA_ENCODING_INVALID
78 
82 
84 pa_encoding_t pa_encoding_from_string(const char *encoding);
85 
87 typedef struct pa_format_info {
94 
97 
100 
103 
106 
109 
118 
124 #define PA_FORMAT_INFO_SNPRINT_MAX 256
125 
127 char *pa_format_info_snprint(char *s, size_t l, const pa_format_info *f);
128 
132 
135 
142 
144 typedef enum pa_prop_type_t {
163 
165 #define PA_PROP_TYPE_INT PA_PROP_TYPE_INT
166 #define PA_PROP_TYPE_INT_RANGE PA_PROP_TYPE_INT_RANGE
167 #define PA_PROP_TYPE_INT_ARRAY PA_PROP_TYPE_INT_ARRAY
168 #define PA_PROP_TYPE_STRING PA_PROP_TYPE_STRING
169 #define PA_PROP_TYPE_STRING_ARRAY PA_PROP_TYPE_STRING_ARRAY
170 #define PA_PROP_TYPE_INVALID PA_PROP_TYPE_INVALID
171 
175 
177 int pa_format_info_get_prop_int(pa_format_info *f, const char *key, int *v);
180 int pa_format_info_get_prop_int_range(pa_format_info *f, const char *key, int *min, int *max);
184 int pa_format_info_get_prop_int_array(pa_format_info *f, const char *key, int **values, int *n_values);
187 int pa_format_info_get_prop_string(pa_format_info *f, const char *key, char **v);
191 int pa_format_info_get_prop_string_array(pa_format_info *f, const char *key, char ***values, int *n_values);
192 
194 void pa_format_info_free_string_array(char **values, int n_values);
195 
197 void pa_format_info_set_prop_int(pa_format_info *f, const char *key, int value);
199 void pa_format_info_set_prop_int_array(pa_format_info *f, const char *key, const int *values, int n_values);
201 void pa_format_info_set_prop_int_range(pa_format_info *f, const char *key, int min, int max);
203 void pa_format_info_set_prop_string(pa_format_info *f, const char *key, const char *value);
205 void pa_format_info_set_prop_string_array(pa_format_info *f, const char *key, const char **values, int n_values);
206 
210 void pa_format_info_set_rate(pa_format_info *f, int rate);
212 void pa_format_info_set_channels(pa_format_info *f, int channels);
215 
216 PA_C_DECL_END
217 
218 #endif