Go to the documentation of this file.
19 #ifndef AVCODEC_REFSTRUCT_H
20 #define AVCODEC_REFSTRUCT_H
67 #define FF_REFSTRUCT_FLAG_NO_ZEROING (1 << 0)
196 #define FF_REFSTRUCT_POOL_FLAG_NO_ZEROING FF_REFSTRUCT_FLAG_NO_ZEROING
202 #define FF_REFSTRUCT_POOL_FLAG_RESET_ON_INIT_ERROR (1 << 16)
213 #define FF_REFSTRUCT_POOL_FLAG_FREE_ON_INIT_ERROR (1 << 17)
221 #define FF_REFSTRUCT_POOL_FLAG_ZERO_EVERY_TIME (1 << 18)
static void * ff_refstruct_alloc_ext(size_t size, unsigned flags, void *opaque, void(*free_cb)(FFRefStructOpaque opaque, void *obj))
A wrapper around ff_refstruct_alloc_ext_c() for the common case of a non-const qualified opaque.
void(* free_entry_cb)(FFRefStructOpaque opaque, void *obj)
RefStruct is an API for creating reference-counted objects with minimal overhead.
FFRefStructPool * ff_refstruct_pool_alloc(size_t size, unsigned flags)
Equivalent to ff_refstruct_pool_alloc(size, flags, NULL, NULL, NULL, NULL, NULL)
void * ff_refstruct_pool_get(FFRefStructPool *pool)
Get an object from the pool, reusing an old one from the pool when available.
void(* reset_cb)(FFRefStructOpaque opaque, void *obj)
static void ff_refstruct_pool_uninit(FFRefStructPool **poolp)
Mark the pool as being available for freeing.
void(* free_cb)(FFRefStructOpaque opaque)
int ff_refstruct_exclusive(const void *obj)
Check whether the reference count of an object managed via this API is 1.
FFRefStructPool is an API for a thread-safe pool of objects managed via the RefStruct API.
FFRefStructPool * ff_refstruct_pool_alloc_ext_c(size_t size, unsigned flags, FFRefStructOpaque opaque, int(*init_cb)(FFRefStructOpaque opaque, void *obj), void(*reset_cb)(FFRefStructOpaque opaque, void *obj), void(*free_entry_cb)(FFRefStructOpaque opaque, void *obj), void(*free_cb)(FFRefStructOpaque opaque))
Allocate an FFRefStructPool, potentially using complex callbacks.
static void * ff_refstruct_allocz(size_t size)
Equivalent to ff_refstruct_alloc_ext(size, 0, NULL, NULL)
const void * ff_refstruct_ref_c(const void *obj)
Analog of ff_refstruct_ref(), but for constant objects.
void * ff_refstruct_alloc_ext_c(size_t size, unsigned flags, FFRefStructOpaque opaque, void(*free_cb)(FFRefStructOpaque opaque, void *obj))
Allocate a refcounted object of usable size size managed via the RefStruct API.
void * ff_refstruct_ref(void *obj)
Create a new reference to an object managed via this API, i.e.
static FFRefStructPool * ff_refstruct_pool_alloc_ext(size_t size, unsigned flags, void *opaque, int(*init_cb)(FFRefStructOpaque opaque, void *obj), void(*reset_cb)(FFRefStructOpaque opaque, void *obj), void(*free_entry_cb)(FFRefStructOpaque opaque, void *obj), void(*free_cb)(FFRefStructOpaque opaque))
A wrapper around ff_refstruct_pool_alloc_ext_c() for the common case of a non-const qualified opaque.
void ff_refstruct_replace(void *dstp, const void *src)
Ensure *dstp refers to the same object as src.
int(* init_cb)(FFRefStructOpaque opaque, void *obj)
#define flags(name, subs,...)
void ff_refstruct_unref(void *objp)
Decrement the reference count of the underlying object and automatically free the object if there are...