[FFmpeg-devel] [PATCH] swresample: misc. doxy improvements

Michael Niedermayer michaelni at gmx.at
Mon Jul 7 13:43:40 CEST 2014


On Sun, Jul 06, 2014 at 05:21:19PM -0700, Timothy Gu wrote:
> Signed-off-by: Timothy Gu <timothygu99 at gmail.com>
> ---
> 
> I can't really split this patch into smaller ones.
> 
> ---
>  libswresample/swresample.h | 82 +++++++++++++++++++++++++++++++++++-----------
>  1 file changed, 63 insertions(+), 19 deletions(-)
> 
> diff --git a/libswresample/swresample.h b/libswresample/swresample.h
> index 838fb5c..1d793c4 100644
> --- a/libswresample/swresample.h
> +++ b/libswresample/swresample.h
> @@ -189,6 +189,7 @@ typedef struct SwrContext SwrContext;
>   * AV_OPT_SEARCH_FAKE_OBJ for examining options.
>   *
>   * @see av_opt_find().
> + * @return the AVClass of SwrContext
>   */
>  const AVClass *swr_get_class(void);
>  
> @@ -211,6 +212,7 @@ struct SwrContext *swr_alloc(void);
>  /**
>   * Initialize context after user parameters have been set.
>   *
> + * @param[in,out]   s Swr context to initialize
>   * @return AVERROR error code in case of failure.
>   */
>  int swr_init(struct SwrContext *s);
> @@ -218,6 +220,8 @@ int swr_init(struct SwrContext *s);
>  /**
>   * Check whether an swr context has been initialized or not.
>   *
> + * @param[in]       s Swr context to check
> + * @see swr_init()
>   * @return positive if it has been initialized, 0 if not initialized
>   */
>  int swr_is_initialized(struct SwrContext *s);
> @@ -229,7 +233,7 @@ int swr_is_initialized(struct SwrContext *s);
>   * other hand, swr_alloc() can use swr_alloc_set_opts() to set the parameters
>   * on the allocated context.
>   *
> - * @param s               Swr context, can be NULL
> + * @param s               existing Swr context if available, or NULL if not
>   * @param out_ch_layout   output channel layout (AV_CH_LAYOUT_*)
>   * @param out_sample_fmt  output sample format (AV_SAMPLE_FMT_*).
>   * @param out_sample_rate output sample rate (frequency in Hz)

> @@ -256,6 +260,8 @@ struct SwrContext *swr_alloc_set_opts(struct SwrContext *s,
>  
>  /**
>   * Free the given SwrContext and set the pointer to NULL.
> + *
> + * @param[in] s double pointer to Swr context

a pointer to a pointer to a Swr context

"double" could be mistaken for the floating point data type and
confuse the reader


[...]
> @@ -321,17 +333,29 @@ int64_t swr_next_pts(struct SwrContext *s, int64_t pts);
>   */
>  
>  /**
> - * Activate resampling compensation.
> + * Activate resampling compensation ("soft" compensation). This function is
> + * internally called when needed in swr_next_pts().
> + *

> + * @param[in,out] s             allocated Swr context. If it is not initialized,
> + *                              swr_init() is called with SWR_FLAG_RESAMPLE set.

if resampling isnt enabled, the context is reinitialized and
resampling is enabled as its neccessry for "resampling compensation"
to function

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Republics decline into democracies and democracies degenerate into
despotisms. -- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20140707/f62ddb66/attachment.asc>


More information about the ffmpeg-devel mailing list