On Thu, Mar 07, 2013 at 03:46:24PM +0100, Anton Khirnov wrote:
> --- /dev/null
> +++ b/libavutil/buffer.h
> @@ -0,0 +1,197 @@
> +/**
> + * @defgroup lavu_buffer AVBuffer
> + * @ingroup lavu_data
> + *
> + * @{
> + * AVBuffer is an API for reference-counted data buffers.
> + *
> + * There are two core objects in this API -- AVBuffer and AVBufferRef.
> AVBuffer
> + * represents the data buffer itself; it is opaque and not meant to be
> accessed
> + * by the caller directly, but only through AVBufferRef. However, the caller
> may
> + * e.g. compare two AVBuffer pointers to check whether two different
> references
> + * are describing the same data buffer. AVBufferRef represents a single
> + * reference to an AVBuffer and it is the object that may be manipulated by
> the
> + * caller directly.
I'd say
However, the caller may e.g. compare two AVBuffer pointers to check
if they refer to the same data buffer.
as I don't think of pointers as "describing" whatever they point to.
> + * The convention throughout this API and the rest of Libav is such that the
> + * buffer is considered writable if there exists only one reference to it
> (and
> + * it has not been marked as read-only). The av_buffer_is_writable()
> function is
> + * provided to check whether this is true and av_buffer_make_writable() will
> + * automatically create a new writable buffer when necessary.
> + * Of course nothing prevents the calling code from violating this
> convention,
> + * however that is safe only when all the existing references are under its
, however,
> +/**
> + * A reference counted buffer type. It is opaque and is meant to be used
> through
reference-counted
> +/**
> + * A reference to a data buffer.
> + *
> + * The size of this struct is not a part of the public ABI and it is not
> meant
> + * to be allocated directly.
.. and the struct is not ..
> +/**
> + * Allocate an AVBuffer of the given size using av_malloc().
> + *
> + * @return an AVBufferRef of given size or NULL when out of memory
of the given
> +/**
> + * @return 1 if the caller may write to the data referred to by buf (which is
> + * true if and only if buf is the only reference to the underlying AVBuffer).
> + * Return 0 otherwise.
> + * A positive answer is valid until av_buffer_ref() is called on buf.
> + */
> +int av_buffer_is_writable(const AVBufferRef *buf);
Why is this function described in a different style than the others?
Diego
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel