FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions
buffer.c File Reference
#include <stdint.h>
#include <string.h>
#include "atomic.h"
#include "buffer_internal.h"
#include "common.h"
#include "mem.h"

Go to the source code of this file.

Functions

AVBufferRefav_buffer_create (uint8_t *data, int size, void(*free)(void *opaque, uint8_t *data), void *opaque, int flags)
 Create an AVBuffer from an existing array.
 
void av_buffer_default_free (void *opaque, uint8_t *data)
 Default free callback, which calls av_free() on the buffer data.
 
AVBufferRefav_buffer_alloc (int size)
 Allocate an AVBuffer of the given size using av_malloc().
 
AVBufferRefav_buffer_allocz (int size)
 Same as av_buffer_alloc(), except the returned buffer will be initialized to zero.
 
AVBufferRefav_buffer_ref (AVBufferRef *buf)
 Create a new reference to an AVBuffer.
 
void av_buffer_unref (AVBufferRef **buf)
 Free a given reference and automatically free the buffer if there are no more references to it.
 
int av_buffer_is_writable (const AVBufferRef *buf)
 
voidav_buffer_get_opaque (const AVBufferRef *buf)
 
int av_buffer_get_ref_count (const AVBufferRef *buf)
 
int av_buffer_make_writable (AVBufferRef **pbuf)
 Create a writable reference from a given buffer reference, avoiding data copy if possible.
 
int av_buffer_realloc (AVBufferRef **pbuf, int size)
 Reallocate a given buffer.
 
AVBufferPoolav_buffer_pool_init (int size, AVBufferRef *(*alloc)(int size))
 Allocate and initialize a buffer pool.
 
static void buffer_pool_free (AVBufferPool *pool)
 
void av_buffer_pool_uninit (AVBufferPool **ppool)
 Mark the pool as being available for freeing.
 
static BufferPoolEntryget_pool (AVBufferPool *pool)
 
static void add_to_pool (BufferPoolEntry *buf)
 
static void pool_release_buffer (void *opaque, uint8_t *data)
 
static AVBufferRefpool_alloc_buffer (AVBufferPool *pool)
 
AVBufferRefav_buffer_pool_get (AVBufferPool *pool)
 Allocate a new AVBuffer, reusing an old buffer from the pool when available.
 

Function Documentation

static void buffer_pool_free ( AVBufferPool pool)
static

Definition at line 224 of file buffer.c.

Referenced by av_buffer_pool_uninit(), and pool_release_buffer().

static BufferPoolEntry* get_pool ( AVBufferPool pool)
static

Definition at line 250 of file buffer.c.

Referenced by add_to_pool(), and av_buffer_pool_get().

static void add_to_pool ( BufferPoolEntry buf)
static

Definition at line 264 of file buffer.c.

Referenced by av_buffer_pool_get(), and pool_release_buffer().

static void pool_release_buffer ( void opaque,
uint8_t data 
)
static

Definition at line 285 of file buffer.c.

Referenced by av_buffer_pool_get(), and pool_alloc_buffer().

static AVBufferRef* pool_alloc_buffer ( AVBufferPool pool)
static

Definition at line 300 of file buffer.c.

Referenced by av_buffer_pool_get().