On Mon, Mar 04, 2013 at 11:35:05AM +0100, Anton Khirnov wrote: > --- /dev/null > +++ b/libavutil/buffer.h > @@ -0,0 +1,195 @@ > + > + * 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 (note that the two references may > point > + * to different parts of the buffer, so comparing the data pointers will not > + * work).
I am now thoroughly confused why you suggest comparing two pointers and then go on to explain why comparing two pointers may fail... > + /** > + * The data buffer. It is considered writable if and only if > + * this is the only reference to buffer, in which case to the buffer > +/** > + * Allocate an AVBuffer of the given size using av_malloc(). > + * > + * @return an AVBufferRef of given size or NULL when out of memory > + */ > +AVBufferRef *av_buffer_alloc(int size); > + > +/** > + * Same as av_buffer_alloc(), except the returned buffer will be initialized > + * to zero. > + */ > +AVBufferRef *av_buffer_allocz(int size); Please document the parameters. > +/** > + * Create an AVBuffer from an existing array. > + * > + * If this function is successful, data is owned by the AVBuffer. The caller > may > + * only access data through the returned AVBufferRef and references derived > from > + * it. > + * If this function fails, data is left untouched. > + * @param data data array. s/.// > + * @param size size of data in bytes > + * @param free a callback for freeing data > + * @param opaque parameter to be passed to free > + * @param flags a combination of AV_BUFFER_FLAG_* This would be more readable vertically aligned. > +/** > + * @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); What does the generated documentation look like if you place the whole description in the @return statement? Diego _______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
