FFmpeg
Functions
container_fifo.h File Reference
#include <stddef.h>

Go to the source code of this file.

Functions

ContainerFifoff_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. More...
 
ContainerFifoff_container_fifo_alloc_avframe (unsigned flags)
 Allocate a ContainerFifo instance for AVFrames. More...
 
void ff_container_fifo_free (ContainerFifo **pf)
 Free a ContainerFifo and everything in it. More...
 
int ff_container_fifo_write (ContainerFifo *pf, void *obj)
 Write the contents of obj to the FIFO. More...
 
int ff_container_fifo_read (ContainerFifo *pf, void *obj)
 Read the next available object from the FIFO into obj. More...
 
size_t ff_container_fifo_can_read (ContainerFifo *pf)
 

Function Documentation

◆ ff_container_fifo_alloc()

ContainerFifo* ff_container_fifo_alloc ( void *(*)(void)  container_alloc,
void(*)(void *obj)  container_reset,
void(*)(void *obj)  container_free,
int(*)(void *dst, void *src fifo_write,
int(*)(void *dst, void *src fifo_read 
)

Allocate a new ContainerFifo for the container type defined by provided callbacks.

Parameters
container_allocallocate a new container instance and return a pointer to it, or NULL on failure
container_resetreset the provided container instance to a clean state
container_freefree the provided container instance
fifo_writetransfer the contents of src to dst, where src is a container instance provided to ff_container_fifo_write()
fifo_readtransfer the contents of src to dst in other cases
Note
fifo_read() and fifo_write() are different parameters in order to allow fifo_write() implementations that make a new reference in dst, leaving src untouched (see e.g. ff_container_fifo_alloc_avframe())

Definition at line 64 of file container_fifo.c.

Referenced by ff_container_fifo_alloc_avframe().

◆ ff_container_fifo_alloc_avframe()

ContainerFifo* ff_container_fifo_alloc_avframe ( unsigned  flags)

Allocate a ContainerFifo instance for AVFrames.

Note that ff_container_fifo_write() will call av_frame_ref() on src, making a new reference in dst and leaving src untouched.

Parameters
flagsunused currently

Definition at line 191 of file container_fifo.c.

Referenced by hevc_init_context().

◆ ff_container_fifo_free()

void ff_container_fifo_free ( ContainerFifo **  pf)

Free a ContainerFifo and everything in it.

Definition at line 100 of file container_fifo.c.

Referenced by ff_container_fifo_alloc(), and hevc_decode_free().

◆ ff_container_fifo_write()

int ff_container_fifo_write ( ContainerFifo pf,
void *  obj 
)

Write the contents of obj to the FIFO.

The fifo_write() callback previously provided to ff_container_fifo_alloc() will be called with obj as src in order to perform the actual transfer.

Definition at line 136 of file container_fifo.c.

Referenced by ff_hevc_output_frames().

◆ ff_container_fifo_read()

int ff_container_fifo_read ( ContainerFifo pf,
void *  obj 
)

Read the next available object from the FIFO into obj.

The fifo_read() callback previously provided to ff_container_fifo_alloc() will be called with obj as dst in order to perform the actual transfer.

Definition at line 121 of file container_fifo.c.

Referenced by hevc_receive_frame().

◆ ff_container_fifo_can_read()

size_t ff_container_fifo_can_read ( ContainerFifo pf)
Returns
number of objects available for reading

Definition at line 159 of file container_fifo.c.

Referenced by hevc_receive_frame().