libavutil/fifo.h File Reference

a very simple circular buffer FIFO implementation More...

#include <stdint.h>
#include "avutil.h"
#include "common.h"

Go to the source code of this file.

Data Structures

struct  AVFifoBuffer

Functions

int av_fifo_init (AVFifoBuffer *f, unsigned int size)
 Initializes an AVFifoBuffer.
void av_fifo_free (AVFifoBuffer *f)
 Frees an AVFifoBuffer.
int av_fifo_size (AVFifoBuffer *f)
 Returns the amount of data in bytes in the AVFifoBuffer, that is the amount of data you can read from it.
int av_fifo_read (AVFifoBuffer *f, uint8_t *buf, int buf_size)
 Reads data from an AVFifoBuffer.
int av_fifo_generic_read (AVFifoBuffer *f, int buf_size, void(*func)(void *, void *, int), void *dest)
 Feeds data from an AVFifoBuffer to a user-supplied callback.
attribute_deprecated void av_fifo_write (AVFifoBuffer *f, const uint8_t *buf, int size)
 Writes data into an AVFifoBuffer.
int av_fifo_generic_write (AVFifoBuffer *f, void *src, int size, int(*func)(void *, void *, int))
 Feeds data from a user-supplied callback to an AVFifoBuffer.
attribute_deprecated void av_fifo_realloc (AVFifoBuffer *f, unsigned int size)
 Resizes an AVFifoBuffer.
int av_fifo_realloc2 (AVFifoBuffer *f, unsigned int size)
 Resizes an AVFifoBuffer.
void av_fifo_drain (AVFifoBuffer *f, int size)
 Reads and discards the specified amount of data from an AVFifoBuffer.
static uint8_t av_fifo_peek (AVFifoBuffer *f, int offs)


Detailed Description

a very simple circular buffer FIFO implementation

Definition in file fifo.h.


Function Documentation

void av_fifo_drain ( AVFifoBuffer f,
int  size 
)

Reads and discards the specified amount of data from an AVFifoBuffer.

Parameters:
*f AVFifoBuffer to read from
size amount of data to read in bytes

Definition at line 121 of file fifo.c.

Referenced by av_fifo_generic_read(), and dv_assemble_frame().

void av_fifo_free ( AVFifoBuffer f  ) 

Frees an AVFifoBuffer.

Parameters:
*f AVFifoBuffer to free

Definition at line 36 of file fifo.c.

Referenced by av_encode(), dv_delete_mux(), dv_init_mux(), ff_audio_interleave_close(), mpeg_mux_end(), and swf_write_trailer().

int av_fifo_generic_read ( AVFifoBuffer f,
int  buf_size,
void(*)(void *, void *, int)  func,
void *  dest 
)

Feeds data from an AVFifoBuffer to a user-supplied callback.

Parameters:
*f AVFifoBuffer to read from
buf_size number of bytes to read
*func generic read function
*dest data destination

Definition at line 105 of file fifo.c.

Referenced by av_fifo_read(), flush_packet(), and swf_write_video().

int av_fifo_generic_write ( AVFifoBuffer f,
void *  src,
int  size,
int(*)(void *, void *, int)  func 
)

Feeds data from a user-supplied callback to an AVFifoBuffer.

Parameters:
*f AVFifoBuffer to write to
*src data source
size number of bytes to write
*func generic write function; the first parameter is src, the second is dest_buf, the third is dest_buf_size. func must return the number of bytes written to dest_buf, or <= 0 to indicate no more data available to write. If func is NULL, src is interpreted as a simple byte array for source data.
Returns:
the number of bytes written to the FIFO

Definition at line 84 of file fifo.c.

Referenced by av_fifo_write(), do_audio_out(), dv_assemble_frame(), ff_audio_rechunk_interleave(), mpeg_mux_write_packet(), and swf_write_audio().

int av_fifo_init ( AVFifoBuffer f,
unsigned int  size 
)

Initializes an AVFifoBuffer.

Parameters:
*f AVFifoBuffer to initialize
size of FIFO
Returns:
<0 for failure >=0 otherwise

Definition at line 25 of file fifo.c.

Referenced by av_encode(), av_fifo_realloc2(), dv_init_mux(), ff_audio_interleave_init(), mpeg_mux_init(), and swf_write_header().

static uint8_t av_fifo_peek ( AVFifoBuffer f,
int  offs 
) [inline, static]

Definition at line 124 of file fifo.h.

Referenced by dv_inject_audio().

int av_fifo_read ( AVFifoBuffer f,
uint8_t *  buf,
int  buf_size 
)

Reads data from an AVFifoBuffer.

Parameters:
*f AVFifoBuffer to read from
*buf data destination
buf_size number of bytes to read

Definition at line 49 of file fifo.c.

Referenced by av_fifo_realloc2(), do_audio_out(), ff_interleave_new_audio_packet(), and output_packet().

attribute_deprecated void av_fifo_realloc ( AVFifoBuffer f,
unsigned int  size 
)

Resizes an AVFifoBuffer.

Parameters:
*f AVFifoBuffer to resize
size new AVFifoBuffer size in bytes
See also:
av_fifo_realloc2()

Definition at line 55 of file fifo.c.

int av_fifo_realloc2 ( AVFifoBuffer f,
unsigned int  size 
)

Resizes an AVFifoBuffer.

Parameters:
*f AVFifoBuffer to resize
size new AVFifoBuffer size in bytes
Returns:
<0 for failure, >=0 otherwise

Definition at line 60 of file fifo.c.

Referenced by av_fifo_realloc(), do_audio_out(), ff_audio_rechunk_interleave(), and mpeg_mux_write_packet().

int av_fifo_size ( AVFifoBuffer f  ) 

Returns the amount of data in bytes in the AVFifoBuffer, that is the amount of data you can read from it.

Parameters:
*f AVFifoBuffer to read from
Returns:
size

Definition at line 41 of file fifo.c.

Referenced by av_fifo_realloc2(), do_audio_out(), dv_assemble_frame(), ff_audio_rechunk_interleave(), ff_interleave_new_audio_packet(), flush_packet(), mpeg_mux_end(), mpeg_mux_write_packet(), output_packet(), swf_write_audio(), and swf_write_video().

attribute_deprecated void av_fifo_write ( AVFifoBuffer f,
const uint8_t *  buf,
int  size 
)

Writes data into an AVFifoBuffer.

Parameters:
*f AVFifoBuffer to write to
*buf data source
size data size

Definition at line 78 of file fifo.c.


Generated on Fri Oct 26 02:35:46 2012 for FFmpeg by  doxygen 1.5.8