[vlc-commits] stream: move Doxygen for steam_Read() and stream_Peek()

Rémi Denis-Courmont git at videolan.org
Mon Aug 31 22:03:27 CEST 2015


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Aug 31 22:17:35 2015 +0300| [79b36fbb5b305e6a3d28da73368df9b01881c5eb] | committer: Rémi Denis-Courmont

stream: move Doxygen for steam_Read() and stream_Peek()

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=79b36fbb5b305e6a3d28da73368df9b01881c5eb
---

 include/vlc_stream.h |   31 +++++++++++++++++++++++++++++++
 src/input/stream.c   |   29 -----------------------------
 2 files changed, 31 insertions(+), 29 deletions(-)

diff --git a/include/vlc_stream.h b/include/vlc_stream.h
index 285c679..a1ab152 100644
--- a/include/vlc_stream.h
+++ b/include/vlc_stream.h
@@ -109,8 +109,39 @@ enum stream_query_e
     STREAM_GET_PRIVATE_BLOCK, /**< arg1= block_t **b, arg2=bool *eof */
 };
 
+/**
+ * Reads data from a byte stream.
+ *
+ * This function always waits for the requested number of bytes, unless a fatal
+ * error is encountered or the end-of-stream is reached first.
+ *
+ * If the buffer is NULL, data is skipped instead of read. This is effectively
+ * a relative forward seek, but it works even on non-seekable streams.
+ *
+ * \param buf start of buffer to read data into [OUT]
+ * \param len number of bytes to read
+ * \return the number of bytes read or a negative value on error.
+ */
 VLC_API ssize_t stream_Read(stream_t *, void *, size_t) VLC_USED;
+
+/**
+ * Peeks at data from a byte stream.
+ *
+ * This function buffers for the requested number of bytes, waiting if
+ * necessary. Then it stores a pointer to the buffer. Unlike stream_Read()
+ * or stream_Block(), this function does not modify the stream read offset.
+ *
+ * \note
+ * The buffer remains valid until the next read/peek or seek operation on the
+ * same stream. In case of error, the buffer address is undefined.
+ *
+ * \param bufp storage space for the buffer address [OUT]
+ * \param len number of bytes to peek
+ * \return the number of bytes actually available (shorter than requested if
+ * the end-of-stream is reached), or a negative value on error.
+ */
 VLC_API ssize_t stream_Peek(stream_t *, const uint8_t **, size_t) VLC_USED;
+
 VLC_API int stream_vaControl( stream_t *s, int i_query, va_list args );
 VLC_API void stream_Delete( stream_t *s );
 VLC_API int stream_Control( stream_t *s, int i_query, ... );
diff --git a/src/input/stream.c b/src/input/stream.c
index ea0eeb9..f215a53 100644
--- a/src/input/stream.c
+++ b/src/input/stream.c
@@ -338,19 +338,6 @@ static ssize_t stream_ReadRaw(stream_t *s, void *buf, size_t len)
     return (copy > 0) ? (ssize_t)copy : ret;
 }
 
-/**
- * Reads data from a byte stream.
- *
- * This function always waits for the requested number of bytes, unless a fatal
- * error is encountered or the end-of-stream is reached first.
- *
- * If the buffer is NULL, data is skipped instead of read. This is effectively
- * a relative forward seek, but it works even on non-seekable streams.
- *
- * \param buf start of buffer to read data into [OUT]
- * \param len number of bytes to read
- * \return the number of bytes read or a negative value on error.
- */
 ssize_t stream_Read(stream_t *s, void *buf, size_t len)
 {
     stream_priv_t *priv = (stream_priv_t *)s;
@@ -387,22 +374,6 @@ ssize_t stream_Read(stream_t *s, void *buf, size_t len)
                       : ((copy > 0) ? (ssize_t)copy : ret);
 }
 
-/**
- * Peeks at data from a byte stream.
- *
- * This function buffers for the requested number of bytes, waiting if
- * necessary. Then it stores a pointer to the buffer. Unlike stream_Read()
- * or stream_Block(), this function does not modify the stream read offset.
- *
- * \note
- * The buffer remains valid until the next read/peek or seek operation on the
- * same stream. In case of error, the buffer address is undefined.
- *
- * \param bufp storage space for the buffer address [OUT]
- * \param len number of bytes to peek
- * \return the number of bytes actually available (shorter than requested if
- * the end-of-stream is reached), or a negative value on error.
- */
 ssize_t stream_Peek(stream_t *s, const uint8_t **restrict bufp, size_t len)
 {
     stream_priv_t *priv = (stream_priv_t *)s;



More information about the vlc-commits mailing list