[FFmpeg-devel] [PATCH v3 2/3] avutil/random_seed: add av_random_bytes()

Anton Khirnov anton at khirnov.net
Wed Jul 5 13:24:21 EEST 2023


Quoting James Almer (2023-07-05 01:26:13)
> diff --git a/libavutil/random_seed.h b/libavutil/random_seed.h
> index 0462a048e0..8df37da8f8 100644
> --- a/libavutil/random_seed.h
> +++ b/libavutil/random_seed.h
> @@ -36,6 +36,18 @@
>   */
>  uint32_t av_get_random_seed(void);
>  
> +/**
> + * Generate cryptographically secure random data, i.e. suitable for use as
> + * encryption keys and similar.
> + *
> + * @param buf buffer into which the random data will be written
> + * @param len size of buf in bytes
> + *
> + * @retval 0 success, and len bytes of random data was written into buf, or
> + *         a negative AVERROR code if random data could not be generated.

@retval declares behavior for a specific return value out of several, so
there should be a separate @retval for each of those

See e.g. doxy for avcodec_send_packet() [1] for an example of what it
looks like.

[1] http://ffmpeg.org/doxygen/trunk/group__lavc__decoding.html#ga58bc4bf1e0ac59e27362597e467efff3

-- 
Anton Khirnov


More information about the ffmpeg-devel mailing list