aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder_api.h
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-08-26 08:27:14 +0200
committerMax Kellermann <max@duempel.org>2008-08-26 08:27:14 +0200
commit940ecf5345f339b9d3ec3e8029e345540358fa4c (patch)
treebe22d8c04732d41f1ba6f49298eef7829d097095 /src/decoder_api.h
parentd80260ab4e1d4f926344ab2074543ea4a7723216 (diff)
downloadmpd-940ecf5345f339b9d3ec3e8029e345540358fa4c.tar.gz
mpd-940ecf5345f339b9d3ec3e8029e345540358fa4c.tar.xz
mpd-940ecf5345f339b9d3ec3e8029e345540358fa4c.zip
added decoder_read()
On our way to stabilize the decoder API, we will one day remove the input stream functions. The most basic function, read() will be provided by decoder_api.h with this patch. It already contains a loop (still with manual polling), error/eof handling and decoder command checks. This kind of code used to be duplicated in all decoder plugins.
Diffstat (limited to 'src/decoder_api.h')
-rw-r--r--src/decoder_api.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/decoder_api.h b/src/decoder_api.h
index 5afa06e77..7a77bc93a 100644
--- a/src/decoder_api.h
+++ b/src/decoder_api.h
@@ -122,6 +122,15 @@ double decoder_seek_where(struct decoder * decoder);
void decoder_seek_error(struct decoder * decoder);
/**
+ * Blocking read from the input stream. Returns the number of bytes
+ * read, or 0 if one of the following occurs: end of file; error;
+ * command (like SEEK or STOP).
+ */
+size_t decoder_read(struct decoder *decoder,
+ InputStream *inStream,
+ void *buffer, size_t length);
+
+/**
* This function is called by the decoder plugin when it has
* successfully decoded block of input data.
*