PulseAudio  1.1
format.h
Go to the documentation of this file.
00001 #ifndef fooformathfoo
00002 #define fooformathfoo
00003 
00004 /***
00005   This file is part of PulseAudio.
00006 
00007   Copyright 2011 Intel Corporation
00008   Copyright 2011 Collabora Multimedia
00009   Copyright 2011 Arun Raghavan <arun.raghavan@collabora.co.uk>
00010 
00011   PulseAudio is free software; you can redistribute it and/or modify
00012   it under the terms of the GNU Lesser General Public License as published
00013   by the Free Software Foundation; either version 2.1 of the License,
00014   or (at your option) any later version.
00015 
00016   PulseAudio is distributed in the hope that it will be useful, but
00017   WITHOUT ANY WARRANTY; without even the implied warranty of
00018   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
00019   General Public License for more details.
00020 
00021   You should have received a copy of the GNU Lesser General Public License
00022   along with PulseAudio; if not, write to the Free Software
00023   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00024   USA.
00025 ***/
00026 
00027 #include <pulse/cdecl.h>
00028 #include <pulse/gccmacro.h>
00029 #include <pulse/proplist.h>
00030 #include <pulse/sample.h>
00031 #include <pulse/channelmap.h>
00032 
00033 PA_C_DECL_BEGIN
00034 
00036 typedef enum pa_encoding {
00037     PA_ENCODING_ANY,
00040     PA_ENCODING_PCM,
00043     PA_ENCODING_AC3_IEC61937,
00046     PA_ENCODING_EAC3_IEC61937,
00049     PA_ENCODING_MPEG_IEC61937,
00052     PA_ENCODING_DTS_IEC61937,
00055     PA_ENCODING_MAX,
00058     PA_ENCODING_INVALID = -1,
00060 } pa_encoding_t;
00061 
00063 const char *pa_encoding_to_string(pa_encoding_t e) PA_GCC_CONST;
00064 
00066 pa_encoding_t pa_encoding_from_string(const char *encoding);
00067 
00069 typedef struct pa_format_info {
00070     pa_encoding_t encoding;
00073     pa_proplist *plist;
00075 } pa_format_info;
00076 
00078 pa_format_info* pa_format_info_new(void);
00079 
00081 pa_format_info* pa_format_info_copy(const pa_format_info *src);
00082 
00084 void pa_format_info_free(pa_format_info *f);
00085 
00087 int pa_format_info_valid(const pa_format_info *f);
00088 
00090 int pa_format_info_is_pcm(const pa_format_info *f);
00091 
00099 int pa_format_info_is_compatible(pa_format_info *first, pa_format_info *second);
00100 
00106 #define PA_FORMAT_INFO_SNPRINT_MAX 256
00107 
00109 char *pa_format_info_snprint(char *s, size_t l, const pa_format_info *f);
00110 
00113 pa_format_info* pa_format_info_from_string(const char *str);
00114 
00116 void pa_format_info_set_prop_int(pa_format_info *f, const char *key, int value);
00118 void pa_format_info_set_prop_int_array(pa_format_info *f, const char *key, const int *values, int n_values);
00120 void pa_format_info_set_prop_int_range(pa_format_info *f, const char *key, int min, int max);
00122 void pa_format_info_set_prop_string(pa_format_info *f, const char *key, const char *value);
00124 void pa_format_info_set_prop_string_array(pa_format_info *f, const char *key, const char **values, int n_values);
00125 
00127 void pa_format_info_set_sample_format(pa_format_info *f, pa_sample_format_t sf);
00129 void pa_format_info_set_rate(pa_format_info *f, int rate);
00131 void pa_format_info_set_channels(pa_format_info *f, int channels);
00133 void pa_format_info_set_channel_map(pa_format_info *f, const pa_channel_map *map);
00134 
00135 PA_C_DECL_END
00136 
00137 #endif