Go to the documentation of this file.
32 void* (*container_alloc)(
void *
opaque);
65 void* (*container_alloc)(
void *opaque),
66 void (*container_reset)(
void *opaque,
void *obj),
67 void (*container_free) (
void *opaque,
void *obj),
68 int (*fifo_transfer) (
void *opaque,
void *
dst,
void *
src,
unsigned flags),
@ AV_CONTAINER_FIFO_FLAG_REF
Signal to av_container_fifo_write() that it should make a new reference to data in src rather than co...
int av_container_fifo_write(AVContainerFifo *cf, void *obj, unsigned flags)
Write the contents of obj to the FIFO.
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
AVContainerFifo * av_container_fifo_alloc_avframe(unsigned flags)
Allocate an AVContainerFifo instance for AVFrames.
RefStruct is an API for creating reference-counted objects with minimal overhead.
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
int av_fifo_peek(const AVFifo *f, void *buf, size_t nb_elems, size_t offset)
Read data from a FIFO without modifying FIFO state.
This structure describes decoded (raw) audio or video data.
static int container_fifo_init_entry(AVRefStructOpaque opaque, void *obj)
int av_fifo_write(AVFifo *f, const void *buf, size_t nb_elems)
Write data into a FIFO.
AVFrame * av_frame_alloc(void)
Allocate an AVFrame and set its fields to default values.
int av_fifo_read(AVFifo *f, void *buf, size_t nb_elems)
Read data from a FIFO.
#define av_assert0(cond)
assert() equivalent, that is always enabled.
AVRefStructPool is an API for a thread-safe pool of objects managed via the RefStruct API.
int av_container_fifo_read(AVContainerFifo *cf, void *obj, unsigned flags)
Read the next available object from the FIFO into obj.
AVContainerFifo is a FIFO for "containers" - dynamically allocated reusable structs (e....
static void frame_reset(void *opaque, void *obj)
size_t av_fifo_can_read(const AVFifo *f)
static AVRefStructPool * av_refstruct_pool_alloc_ext(size_t size, unsigned flags, void *opaque, int(*init_cb)(AVRefStructOpaque opaque, void *obj), void(*reset_cb)(AVRefStructOpaque opaque, void *obj), void(*free_entry_cb)(AVRefStructOpaque opaque, void *obj), void(*free_cb)(AVRefStructOpaque opaque))
A wrapper around av_refstruct_pool_alloc_ext_c() for the common case of a non-const qualified opaque.
void * av_refstruct_pool_get(AVRefStructPool *pool)
Get an object from the pool, reusing an old one from the pool when available.
void *(* container_alloc)(void *opaque)
int av_frame_ref(AVFrame *dst, const AVFrame *src)
Set up a new reference to the data described by the source frame.
void(* container_free)(void *opaque, void *obj)
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
int(* fifo_transfer)(void *opaque, void *dst, void *src, unsigned flags)
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf offset
static void frame_free(void *opaque, void *obj)
static void * frame_alloc(void *opaque)
void av_refstruct_unref(void *objp)
Decrement the reference count of the underlying object and automatically free the object if there are...
void(* container_reset)(void *opaque, void *obj)
void av_frame_move_ref(AVFrame *dst, AVFrame *src)
Move everything contained in src to dst and reset src.
static void container_fifo_free_entry(AVRefStructOpaque opaque, void *obj)
void av_frame_unref(AVFrame *frame)
Unreference all the buffers referenced by frame and reset the frame fields.
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
int av_container_fifo_peek(AVContainerFifo *cf, void **pdst, size_t offset)
Access objects stored in the FIFO without retrieving them.
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame For filters that do not use the this method is called when a frame is wanted on an output For a it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return or at least make progress towards producing a frame
void av_container_fifo_free(AVContainerFifo **pcf)
Free a AVContainerFifo and everything in it.
AVFifo * av_fifo_alloc2(size_t nb_elems, size_t elem_size, unsigned int flags)
Allocate and initialize an AVFifo with a given element size.
size_t av_container_fifo_can_read(const AVContainerFifo *cf)
static void container_fifo_reset_entry(AVRefStructOpaque opaque, void *obj)
static int frame_transfer(void *opaque, void *dst, void *src, unsigned flags)
static void av_refstruct_pool_uninit(AVRefStructPool **poolp)
Mark the pool as being available for freeing.
#define flags(name, subs,...)
void av_fifo_freep2(AVFifo **f)
Free an AVFifo and reset pointer to NULL.
#define AV_FIFO_FLAG_AUTO_GROW
Automatically resize the FIFO on writes, so that the data fits.
void av_container_fifo_drain(AVContainerFifo *cf, size_t nb_elems)
Discard the specified number of elements from the FIFO.
AVContainerFifo * av_container_fifo_alloc(void *opaque, void *(*container_alloc)(void *opaque), void(*container_reset)(void *opaque, void *obj), void(*container_free)(void *opaque, void *obj), int(*fifo_transfer)(void *opaque, void *dst, void *src, unsigned flags), unsigned flags)
Allocate a new AVContainerFifo for the container type defined by provided callbacks.