Go to the documentation of this file.
31 void* (*container_alloc)(void);
65 void (*container_reset)(
void *obj),
66 void (*container_free) (
void *obj),
67 int (*fifo_write) (
void *
dst,
void *
src),
68 int (*fifo_read) (
void *
dst,
void *
src))
void(* container_free)(void *obj)
int ff_container_fifo_write(ContainerFifo *cf, void *obj)
Write the contents of obj to the FIFO.
static void frame_reset(void *obj)
static void frame_free(void *obj)
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
static void container_fifo_free_entry(FFRefStructOpaque opaque, void *obj)
ContainerFifo * ff_container_fifo_alloc(void *(*container_alloc)(void), void(*container_reset)(void *obj), void(*container_free)(void *obj), int(*fifo_write)(void *dst, void *src), int(*fifo_read)(void *dst, void *src))
Allocate a new ContainerFifo for the container type defined by provided callbacks.
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
This structure describes decoded (raw) audio or video data.
RefStruct is an API for creating reference-counted objects with minimal overhead.
int ff_container_fifo_read(ContainerFifo *cf, void *obj)
Read the next available object from the FIFO into obj.
ContainerFifo * ff_container_fifo_alloc_avframe(unsigned flags)
Allocate a ContainerFifo instance for AVFrames.
int av_fifo_write(AVFifo *f, const void *buf, size_t nb_elems)
Write data into a FIFO.
static void ff_refstruct_pool_uninit(FFRefStructPool **poolp)
Mark the pool as being available for freeing.
static int container_fifo_init_entry(FFRefStructOpaque opaque, void *obj)
AVFrame * av_frame_alloc(void)
Allocate an AVFrame and set its fields to default values.
static int frame_move_ref(void *dst, void *src)
int av_fifo_read(AVFifo *f, void *buf, size_t nb_elems)
Read data from a FIFO.
FFRefStructPool is an API for a thread-safe pool of objects managed via the RefStruct API.
static void * frame_alloc(void)
size_t av_fifo_can_read(const AVFifo *f)
static void container_fifo_reset_entry(FFRefStructOpaque opaque, void *obj)
void ff_container_fifo_free(ContainerFifo **pcf)
Free a ContainerFifo and everything in it.
int av_frame_ref(AVFrame *dst, const AVFrame *src)
Set up a new reference to the data described by the source frame.
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
ContainerFifo is a FIFO for "containers" - dynamically allocated reusable structs (e....
void av_frame_move_ref(AVFrame *dst, AVFrame *src)
Move everything contained in src to dst and reset src.
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(* fifo_write)(void *dst, void *src)
int(* fifo_read)(void *dst, void *src)
static int frame_ref(void *dst, void *src)
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
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 ff_container_fifo_can_read(ContainerFifo *cf)
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.
#define flags(name, subs,...)
void av_fifo_freep2(AVFifo **f)
Free an AVFifo and reset pointer to NULL.
void *(* container_alloc)(void)
void(* container_reset)(void *obj)
void ff_refstruct_unref(void *objp)
Decrement the reference count of the underlying object and automatically free the object if there are...
#define AV_FIFO_FLAG_AUTO_GROW
Automatically resize the FIFO on writes, so that the data fits.
void * ff_refstruct_pool_get(FFRefStructPool *pool)
Get an object from the pool, reusing an old one from the pool when available.