Go to the documentation of this file.
25 #ifndef AVUTIL_BUFFER_H
26 #define AVUTIL_BUFFER_H
114 #define AV_BUFFER_FLAG_READONLY (1 << 0)
132 void (*free)(
void *opaque, uint8_t *
data),
133 void *opaque,
int flags);
AVBufferPool * av_buffer_pool_init(size_t size, AVBufferRef *(*alloc)(size_t size))
Allocate and initialize a buffer pool.
uint8_t * data
The data buffer.
AVBufferRef * av_buffer_ref(const AVBufferRef *buf)
Create a new reference to an AVBuffer.
AVBufferPool * av_buffer_pool_init2(size_t size, void *opaque, AVBufferRef *(*alloc)(void *opaque, size_t size), void(*pool_free)(void *opaque))
Allocate and initialize a buffer pool with a more complex allocator.
AVBufferRef * av_buffer_pool_get(AVBufferPool *pool)
Allocate a new AVBuffer, reusing an old buffer from the pool when available.
void av_buffer_default_free(void *opaque, uint8_t *data)
Default free callback, which calls av_free() on the buffer data.
void(* pool_free)(void *opaque)
void av_buffer_unref(AVBufferRef **buf)
Free a given reference and automatically free the buffer if there are no more references to it.
void av_buffer_pool_uninit(AVBufferPool **pool)
Mark the pool as being available for freeing.
AVBufferRef * av_buffer_create(uint8_t *data, size_t size, void(*free)(void *opaque, uint8_t *data), void *opaque, int flags)
Create an AVBuffer from an existing array.
AVBufferRef *(* alloc)(size_t size)
int av_buffer_make_writable(AVBufferRef **buf)
Create a writable reference from a given buffer reference, avoiding data copy if possible.
int av_buffer_get_ref_count(const AVBufferRef *buf)
void * av_buffer_pool_buffer_get_opaque(const AVBufferRef *ref)
Query the original opaque parameter of an allocated buffer in the pool.
AVBufferRef * av_buffer_alloc(size_t size)
Allocate an AVBuffer of the given size using av_malloc().
size_t size
Size of data in bytes.
A reference counted buffer type.
int av_buffer_replace(AVBufferRef **dst, const AVBufferRef *src)
Ensure dst refers to the same data as src.
int av_buffer_is_writable(const AVBufferRef *buf)
AVBufferRef * av_buffer_allocz(size_t size)
Same as av_buffer_alloc(), except the returned buffer will be initialized to zero.
static int ref[MAX_W *MAX_W]
int av_buffer_realloc(AVBufferRef **buf, size_t size)
Reallocate a given buffer.
void * av_buffer_get_opaque(const AVBufferRef *buf)
A reference to a data buffer.
#define flags(name, subs,...)