56 return (uint32_t)(f->
wndx - f->
rndx);
66 unsigned int old_size = f->
end - f->
buffer;
68 if (old_size < new_size) {
86 unsigned int old_size = f->
end - f->
buffer;
100 int (*
func)(
void *,
void *,
int))
103 uint32_t wndx= f->
wndx;
109 if (
func(src, wptr, len) <= 0)
112 memcpy(wptr, src, len);
128 void (*
func)(
void *,
void *,
int))
136 memcpy(dest, f->
rptr, len);
142 }
while (buf_size > 0);
170 for (i = -n + 1; i <
n; i++) {
172 printf(
"%d: %d\n", i, *v);
void av_freep(void *ptr)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer ...
simple assert() macros that are a bit more flexible than ISO C assert().
int av_fifo_size(AVFifoBuffer *f)
Return the amount of data in bytes in the AVFifoBuffer, that is the amount of data you can read from ...
void av_fifo_free(AVFifoBuffer *f)
Free an AVFifoBuffer.
a very simple circular buffer FIFO implementation
void av_fifo_drain(AVFifoBuffer *f, int size)
Read and discard the specified amount of data from an AVFifoBuffer.
void av_free(void *ptr)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc(). ...
int av_fifo_generic_write(AVFifoBuffer *f, void *src, int size, int(*func)(void *, void *, int))
Feed data from a user-supplied callback to an AVFifoBuffer.
int av_fifo_realloc2(AVFifoBuffer *f, unsigned int size)
Resize an AVFifoBuffer.
static uint8_t * av_fifo_peek2(const AVFifoBuffer *f, int offs)
Return a pointer to the data stored in a FIFO buffer at a certain offset.
void * av_malloc(size_t size) av_malloc_attrib 1(1)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
AVFifoBuffer * av_fifo_alloc(unsigned int size)
Initialize an AVFifoBuffer.
int(* func)(AVBPrint *dst, const char *in, const char *arg)
int av_fifo_generic_read(AVFifoBuffer *f, void *dest, int buf_size, void(*func)(void *, void *, int))
Feed data from an AVFifoBuffer to a user-supplied callback.
int av_fifo_grow(AVFifoBuffer *f, unsigned int additional_space)
Enlarge an AVFifoBuffer.
int main(int argc, char **argv)
common internal and external API header
int av_fifo_space(AVFifoBuffer *f)
Return the amount of space in bytes in the AVFifoBuffer, that is the amount of data you can write int...
void * av_mallocz(size_t size) av_malloc_attrib 1(1)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
void av_fifo_reset(AVFifoBuffer *f)
Reset the AVFifoBuffer to the state right after av_fifo_alloc, in particular it is emptied...
#define av_assert2(cond)
assert() equivalent, that does lie in speed critical code.