aboutsummaryrefslogtreecommitdiffstats
path: root/src/pcm_resample.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_resample.h
parentcae7c160a3084acf9e68845b16bae34772d18e4e (diff)
downloadmpd-f0554d9a75abab093fe5169bdab6b6b75ae4f97a.tar.gz
mpd-f0554d9a75abab093fe5169bdab6b6b75ae4f97a.tar.xz
mpd-f0554d9a75abab093fe5169bdab6b6b75ae4f97a.zip
pcm: added API documentation
Diffstat (limited to 'src/pcm_resample.h')
-rw-r--r--src/pcm_resample.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/pcm_resample.h b/src/pcm_resample.h
index 66a746ae2..5042f4c99 100644
--- a/src/pcm_resample.h
+++ b/src/pcm_resample.h
@@ -31,6 +31,10 @@
#include <samplerate.h>
#endif
+/**
+ * This object is statically allocated (within another struct), and
+ * holds buffer allocations and the state for the resampler.
+ */
struct pcm_resample_state {
#ifdef HAVE_LIBSAMPLERATE
SRC_STATE *state;
@@ -50,10 +54,29 @@ struct pcm_resample_state {
struct pcm_buffer buffer;
};
+/**
+ * Initializes a pcm_resample_state object.
+ */
void pcm_resample_init(struct pcm_resample_state *state);
+/**
+ * Deinitializes a pcm_resample_state object and frees allocated
+ * memory.
+ */
void pcm_resample_deinit(struct pcm_resample_state *state);
+/**
+ * Resamples 16 bit PCM data.
+ *
+ * @param state an initialized pcm_resample_state object
+ * @param channels the number of channels
+ * @param src_rate the source sample rate
+ * @param src the source PCM buffer
+ * @param src_size the size of #src in bytes
+ * @param dest_rate the requested destination sample rate
+ * @param dest_size_r returns the number of bytes of the destination buffer
+ * @return the destination buffer
+ */
const int16_t *
pcm_resample_16(struct pcm_resample_state *state,
uint8_t channels,
@@ -62,6 +85,18 @@ pcm_resample_16(struct pcm_resample_state *state,
unsigned dest_rate,
size_t *dest_size_r);
+/**
+ * Resamples 24 bit PCM data.
+ *
+ * @param state an initialized pcm_resample_state object
+ * @param channels the number of channels
+ * @param src_rate the source sample rate
+ * @param src the source PCM buffer
+ * @param src_size the size of #src in bytes
+ * @param dest_rate the requested destination sample rate
+ * @param dest_size_r returns the number of bytes of the destination buffer
+ * @return the destination buffer
+ */
const int32_t *
pcm_resample_24(struct pcm_resample_state *state,
uint8_t channels,