aboutsummaryrefslogtreecommitdiffstats
path: root/src/pcm_convert.h
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-02-21 18:14:20 +0100
committerMax Kellermann <max@duempel.org>2009-02-21 18:14:20 +0100
commitf0554d9a75abab093fe5169bdab6b6b75ae4f97a (patch)
tree041e132660e2c6ea0865306d19d7a45314e0a7a8 /src/pcm_convert.h
parentcae7c160a3084acf9e68845b16bae34772d18e4e (diff)
downloadmpd-f0554d9a75abab093fe5169bdab6b6b75ae4f97a.tar.gz
mpd-f0554d9a75abab093fe5169bdab6b6b75ae4f97a.tar.xz
mpd-f0554d9a75abab093fe5169bdab6b6b75ae4f97a.zip
pcm: added API documentation
Diffstat (limited to 'src/pcm_convert.h')
-rw-r--r--src/pcm_convert.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/pcm_convert.h b/src/pcm_convert.h
index 18a1dbc49..35bbdad5c 100644
--- a/src/pcm_convert.h
+++ b/src/pcm_convert.h
@@ -25,6 +25,11 @@
struct audio_format;
+/**
+ * This object is statically allocated (within another struct), and
+ * holds buffer allocations and the state for all kinds of PCM
+ * conversions.
+ */
struct pcm_convert_state {
struct pcm_resample_state resample;
@@ -37,10 +42,28 @@ struct pcm_convert_state {
struct pcm_buffer channels_buffer;
};
+/**
+ * Initializes a pcm_convert_state object.
+ */
void pcm_convert_init(struct pcm_convert_state *state);
+/**
+ * Deinitializes a pcm_convert_state object and frees allocated
+ * memory.
+ */
void pcm_convert_deinit(struct pcm_convert_state *state);
+/**
+ * Converts PCM data between two audio formats.
+ *
+ * @param state an initialized pcm_convert_state object
+ * @param src_format the source audio format
+ * @param src the source PCM buffer
+ * @param src_size the size of #src in bytes
+ * @param dest_format the requested destination audio format
+ * @param dest_size_r returns the number of bytes of the destination buffer
+ * @return the destination buffer
+ */
const void *
pcm_convert(struct pcm_convert_state *state,
const struct audio_format *src_format,