FFmpeg
|
#include "avassert.h"
#include "container_fifo.h"
#include "error.h"
#include "fifo.h"
#include "frame.h"
#include "mem.h"
#include "refstruct.h"
Go to the source code of this file.
Data Structures | |
struct | AVContainerFifo |
AVContainerFifo is a FIFO for "containers" - dynamically allocated reusable structs (e.g. More... | |
Functions | |
static int | container_fifo_init_entry (AVRefStructOpaque opaque, void *obj) |
static void | container_fifo_reset_entry (AVRefStructOpaque opaque, void *obj) |
static void | container_fifo_free_entry (AVRefStructOpaque opaque, void *obj) |
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. More... | |
void | av_container_fifo_free (AVContainerFifo **pcf) |
Free a AVContainerFifo and everything in it. More... | |
int | av_container_fifo_read (AVContainerFifo *cf, void *obj, unsigned flags) |
Read the next available object from the FIFO into obj. More... | |
int | av_container_fifo_peek (AVContainerFifo *cf, void **pdst, size_t offset) |
Access objects stored in the FIFO without retrieving them. More... | |
void | av_container_fifo_drain (AVContainerFifo *cf, size_t nb_elems) |
Discard the specified number of elements from the FIFO. More... | |
int | av_container_fifo_write (AVContainerFifo *cf, void *obj, unsigned flags) |
Write the contents of obj to the FIFO. More... | |
size_t | av_container_fifo_can_read (const AVContainerFifo *cf) |
static void * | frame_alloc (void *opaque) |
static void | frame_reset (void *opaque, void *obj) |
static void | frame_free (void *opaque, void *obj) |
static int | frame_transfer (void *opaque, void *dst, void *src, unsigned flags) |
AVContainerFifo * | av_container_fifo_alloc_avframe (unsigned flags) |
Allocate an AVContainerFifo instance for AVFrames. More... | |
|
static |
Definition at line 39 of file container_fifo.c.
Referenced by av_container_fifo_alloc().
|
static |
Definition at line 51 of file container_fifo.c.
Referenced by av_container_fifo_alloc().
|
static |
Definition at line 57 of file container_fifo.c.
Referenced by av_container_fifo_alloc().
AVContainerFifo* av_container_fifo_alloc | ( | void * | opaque, |
void *(*)(void *opaque) | container_alloc, | ||
void(*)(void *opaque, void *obj) | container_reset, | ||
void(*)(void *opaque, void *obj) | container_free, | ||
int(*)(void *opaque, void *dst, void *src, unsigned flags) | fifo_transfer, | ||
unsigned | flags | ||
) |
Allocate a new AVContainerFifo for the container type defined by provided callbacks.
opaque | user data that will be passed to the callbacks provided to this function |
container_alloc | allocate a new container instance and return a pointer to it, or NULL on failure |
container_reset | reset the provided container instance to a clean state |
container_free | free the provided container instance |
fifo_transfer | Transfer the contents of container src to dst. |
flags | currently unused |
Definition at line 64 of file container_fifo.c.
Referenced by av_container_fifo_alloc_avframe(), and av_container_fifo_alloc_avpacket().
void av_container_fifo_free | ( | AVContainerFifo ** | pcf | ) |
Free a AVContainerFifo and everything in it.
Definition at line 101 of file container_fifo.c.
Referenced by av_container_fifo_alloc(), hevc_decode_free(), sq_free(), and tq_free().
int av_container_fifo_read | ( | AVContainerFifo * | cf, |
void * | obj, | ||
unsigned | flags | ||
) |
Read the next available object from the FIFO into obj.
The fifo_read() callback previously provided to av_container_fifo_alloc() will be called with obj as dst in order to perform the actual transfer.
Definition at line 122 of file container_fifo.c.
Referenced by hevc_receive_frame(), receive_for_stream(), and receive_locked().
int av_container_fifo_peek | ( | AVContainerFifo * | cf, |
void ** | pobj, | ||
size_t | offset | ||
) |
Access objects stored in the FIFO without retrieving them.
The fifo_transfer() callback will NOT be invoked and the FIFO state will not be modified.
pobj | Pointer to the object stored in the FIFO will be written here on success. The object remains owned by the FIFO and the caller may only access it as long as the FIFO is not modified. |
offset | Position of the object to retrieve - 0 is the next item that would be read, 1 the one after, etc. Must be smaller than av_container_fifo_can_read(). |
0 | success, a pointer was written into pobj |
AVERROR(EINVAL) | invalid offset value |
Definition at line 137 of file container_fifo.c.
Referenced by overflow_heartbeat(), receive_for_stream(), and receive_samples().
void av_container_fifo_drain | ( | AVContainerFifo * | cf, |
size_t | nb_elems | ||
) |
Discard the specified number of elements from the FIFO.
nb_elems | number of elements to discard, MUST NOT be larger than av_fifo_can_read(f) |
Definition at line 151 of file container_fifo.c.
Referenced by receive_samples().
int av_container_fifo_write | ( | AVContainerFifo * | cf, |
void * | obj, | ||
unsigned | flags | ||
) |
Write the contents of obj to the FIFO.
The fifo_transfer() callback previously provided to av_container_fifo_alloc() will be called with obj as src in order to perform the actual transfer.
Definition at line 162 of file container_fifo.c.
Referenced by ff_hevc_output_frames(), sq_send(), and tq_send().
size_t av_container_fifo_can_read | ( | const AVContainerFifo * | cf | ) |
Definition at line 185 of file container_fifo.c.
Referenced by hevc_receive_frame(), receive_for_stream(), tb_update(), and tq_receive().
|
static |
Definition at line 190 of file container_fifo.c.
Referenced by av_container_fifo_alloc_avframe().
|
static |
Definition at line 195 of file container_fifo.c.
Referenced by av_container_fifo_alloc_avframe().
|
static |
Definition at line 200 of file container_fifo.c.
Referenced by av_container_fifo_alloc_avframe().
|
static |
Definition at line 206 of file container_fifo.c.
Referenced by av_container_fifo_alloc_avframe().
AVContainerFifo* av_container_fifo_alloc_avframe | ( | unsigned | flags | ) |
Allocate an AVContainerFifo instance for AVFrames.
flags | currently unused |
Definition at line 215 of file container_fifo.c.
Referenced by hevc_init_context(), sq_add_stream(), and tq_alloc().