[vlc-devel] [PATCH] stream: move documentation for vlc_stream_Block, vlc_stream_ReadLine and vlc_stream_vaControl

Alexandre Janniaux ajanni at videolabs.io
Thu Jul 23 08:49:41 CEST 2020


Hi,

LGTM, but nit on the patch title and commit message, you should
put a shorter commit title and wrap the commit body at correct
length, like explained in the wiki. :)

Regards,
--
Alexandre Janniaux
Videolabs

On Thu, Jul 23, 2020 at 11:45:54AM +0530, rustyc wrote:
> From: Kartik Ohri <kartikohri13 at gmail.com>
>
> Most VLC API methods have documentation in headers in include directories and developers also look there. Hence, moved the documentation from src/input/stream.c to include/vlc_stream.h
> ---
>  include/vlc_stream.h | 20 ++++++++++++++++++++
>  src/input/stream.c   | 19 -------------------
>  2 files changed, 20 insertions(+), 19 deletions(-)
>
> diff --git a/include/vlc_stream.h b/include/vlc_stream.h
> index bc6c0d30b7..f31683d427 100644
> --- a/include/vlc_stream.h
> +++ b/include/vlc_stream.h
> @@ -296,6 +296,11 @@ VLC_API bool vlc_stream_Eof(const stream_t *) VLC_USED;
>   */
>  VLC_API int vlc_stream_Seek(stream_t *, uint64_t offset) VLC_USED;
>
> +/**
> + * Use to control the "stream_t *". Look at #stream_query_e for
> + * possible "i_query" value and format arguments.  Return VLC_SUCCESS
> + * if ... succeed ;) and VLC_EGENERIC if failed or unimplemented
> + */
>  VLC_API int vlc_stream_vaControl(stream_t *s, int query, va_list args);
>
>  static inline int vlc_stream_Control(stream_t *s, int query, ...)
> @@ -309,7 +314,22 @@ static inline int vlc_stream_Control(stream_t *s, int query, ...)
>      return ret;
>  }
>
> +/**
> + * Read data into a block.
> + *
> + * @param s stream to read data from
> + * @param size number of bytes to read
> + * @return a block of data, or NULL on error
> + @ note The block size may be shorter than requested if the end-of-stream was
> + * reached.
> + */
>  VLC_API block_t *vlc_stream_Block(stream_t *s, size_t);
> +
> +/**
> + * Read from the stream until first newline.
> + * \param s Stream handle to read from
> + * \return A pointer to the allocated output string. You need to free this when you are done.
> + */
>  VLC_API char *vlc_stream_ReadLine(stream_t *);
>
>  /**
> diff --git a/src/input/stream.c b/src/input/stream.c
> index 35c5a04870..945901f801 100644
> --- a/src/input/stream.c
> +++ b/src/input/stream.c
> @@ -177,11 +177,6 @@ stream_t *(vlc_stream_NewMRL)(vlc_object_t* parent, const char* mrl )
>      return stream;
>  }
>
> -/**
> - * Read from the stream until first newline.
> - * \param s Stream handle to read from
> - * \return A pointer to the allocated output string. You need to free this when you are done.
> - */
>  #define STREAM_PROBE_LINE 2048
>  #define STREAM_LINE_MAX (2048*100)
>  char *vlc_stream_ReadLine( stream_t *s )
> @@ -665,11 +660,6 @@ int vlc_stream_Seek(stream_t *s, uint64_t offset)
>      return VLC_SUCCESS;
>  }
>
> -/**
> - * Use to control the "stream_t *". Look at #stream_query_e for
> - * possible "i_query" value and format arguments.  Return VLC_SUCCESS
> - * if ... succeed ;) and VLC_EGENERIC if failed or unimplemented
> - */
>  int vlc_stream_vaControl(stream_t *s, int cmd, va_list args)
>  {
>      stream_priv_t *priv = (stream_priv_t *)s;
> @@ -703,15 +693,6 @@ int vlc_stream_vaControl(stream_t *s, int cmd, va_list args)
>      return s->pf_control(s, cmd, args);
>  }
>
> -/**
> - * Read data into a block.
> - *
> - * @param s stream to read data from
> - * @param size number of bytes to read
> - * @return a block of data, or NULL on error
> - @ note The block size may be shorter than requested if the end-of-stream was
> - * reached.
> - */
>  block_t *vlc_stream_Block( stream_t *s, size_t size )
>  {
>      if( unlikely(size > SSIZE_MAX) )
> --
> 2.25.1
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel


More information about the vlc-devel mailing list