From 8631f4e2c44b47db76795bebdbab54914a1f3ea0 Mon Sep 17 00:00:00 2001 From: Arun Raghavan Date: Tue, 8 Mar 2011 20:15:36 +0530 Subject: format: Add some convenience functions for printing --- src/pulse/format.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/pulse/format.h') diff --git a/src/pulse/format.h b/src/pulse/format.h index 03b34059..51c9426c 100644 --- a/src/pulse/format.h +++ b/src/pulse/format.h @@ -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 -- cgit