format: Add some convenience functions for printing

This commit is contained in:
Arun Raghavan 2011-03-08 20:15:36 +05:30
parent a3a0042144
commit 8631f4e2c4
3 changed files with 51 additions and 0 deletions

View file

@ -53,6 +53,9 @@ typedef enum pa_encoding {
/**< Represents an invalid encoding */
} pa_encoding_t;
/** Returns a printable string representing the given encoding type. \since 1.0 */
const char *pa_encoding_to_string(pa_encoding_t e) PA_GCC_CONST;
/**< Represents the format of data provided in a stream or processed by a sink. \since 1.0 */
typedef struct pa_format_info {
pa_encoding_t encoding;
@ -77,6 +80,16 @@ int pa_format_info_valid(const pa_format_info *f);
/** Returns non-zero when the format info structure represents a PCM (i.e. uncompressed data) format */
int pa_format_info_is_pcm(const pa_format_info *f);
/** Maximum required string length for
* pa_format_info_snprint(). Please note that this value can change
* with any release without warning and without being considered API
* or ABI breakage. You should not use this definition anywhere where
* it might become part of an ABI. \since 1.0 */
#define PA_FORMAT_INFO_SNPRINT_MAX 256
/** Return a human-readable string representing the given format. \since 1.0 */
char *pa_format_info_snprint(char *s, size_t l, const pa_format_info *f);
PA_C_DECL_END
#endif