ffmpeg.libavutil.buffer

@file @ingroup lavu_buffer refcounted data buffer API

Members

Functions

av_buffer_alloc
AVBufferRef* av_buffer_alloc(int size)

Allocate an AVBuffer of the given size using av_malloc().

av_buffer_allocz
AVBufferRef* av_buffer_allocz(int size)

Same as av_buffer_alloc(), except the returned buffer will be initialized to zero.

av_buffer_create
AVBufferRef* av_buffer_create(ubyte* data, int size, void function(void* opaque, ubyte* data) free, void* opaque, int flags)

Create an AVBuffer from an existing array.

av_buffer_default_free
void av_buffer_default_free(void* opaque, ubyte* data)

Default free callback, which calls av_free() on the buffer data. This function is meant to be passed to av_buffer_create(), not called directly.

av_buffer_get_opaque
void* av_buffer_get_opaque(const(AVBufferRef)* buf)

@return the opaque parameter set by av_buffer_create.

av_buffer_get_ref_count
int av_buffer_get_ref_count(const(AVBufferRef)* buf)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
av_buffer_is_writable
int av_buffer_is_writable(const(AVBufferRef)* buf)

@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.

av_buffer_make_writable
int av_buffer_make_writable(AVBufferRef** buf)

Create a writable reference from a given buffer reference, avoiding data copy if possible.

av_buffer_pool_get
AVBufferRef* av_buffer_pool_get(AVBufferPool* pool)

Allocate a new AVBuffer, reusing an old buffer from the pool when available. This function may be called simultaneously from multiple threads.

av_buffer_pool_init
AVBufferPool* av_buffer_pool_init(int size, AVBufferRef* function(int size) alloc)

Allocate and initialize a buffer pool.

av_buffer_pool_init2
AVBufferPool* av_buffer_pool_init2(int size, void* opaque, AVBufferRef* function(void* opaque, int size) alloc, void function(void* opaque) pool_free)

Allocate and initialize a buffer pool with a more complex allocator.

av_buffer_pool_uninit
void av_buffer_pool_uninit(AVBufferPool** pool)

Mark the pool as being available for freeing. It will actually be freed only once all the allocated buffers associated with the pool are released. Thus it is safe to call this function while some of the allocated buffers are still in use.

av_buffer_realloc
int av_buffer_realloc(AVBufferRef** buf, int size)

Reallocate a given buffer.

av_buffer_ref
AVBufferRef* av_buffer_ref(AVBufferRef* buf)

Create a new reference to an AVBuffer.

av_buffer_unref
void av_buffer_unref(AVBufferRef** buf)

Free a given reference and automatically free the buffer if there are no more references to it.

Manifest constants

AV_BUFFER_FLAG_READONLY
enum AV_BUFFER_FLAG_READONLY;

Always treat the buffer as read-only, even when it has only one reference.

Structs

AVBuffer
struct AVBuffer

A reference counted buffer type. It is opaque and is meant to be used through references (AVBufferRef).

AVBufferPool
struct AVBufferPool

The buffer pool. This structure is opaque and not meant to be accessed directly. It is allocated with av_buffer_pool_init() and freed with av_buffer_pool_uninit().

AVBufferRef
struct AVBufferRef

A reference to a data buffer.

Meta