xine-lib 1.2.11
Data Structures | Macros | Functions
buffer.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#include <xine/buffer.h>
#include <xine/xineutils.h>
#include <xine/xine_internal.h>

Data Structures

struct  be_ei_t
 

Macros

#define LOG_MODULE   "buffer"
 
#define LOG_VERBOSE
 
#define LARGE_NUM   0x7fffffff
 

Functions

static void buffer_pool_free (buf_element_t *element)
 
static buf_element_tbuffer_pool_size_alloc_int (fifo_buffer_t *this, int n)
 
static buf_element_tbuffer_pool_size_alloc (fifo_buffer_t *this, size_t size)
 
static buf_element_tbuffer_pool_alloc (fifo_buffer_t *this)
 
static buf_element_tbuffer_pool_realloc (buf_element_t *buf, size_t new_size)
 
static buf_element_tbuffer_pool_try_alloc (fifo_buffer_t *this)
 
static void fifo_buffer_put (fifo_buffer_t *fifo, buf_element_t *element)
 
static void dummy_fifo_buffer_put (fifo_buffer_t *fifo, buf_element_t *element)
 
static void fifo_buffer_insert (fifo_buffer_t *fifo, buf_element_t *element)
 
static void dummy_fifo_buffer_insert (fifo_buffer_t *fifo, buf_element_t *element)
 
static buf_element_tfifo_buffer_get (fifo_buffer_t *fifo)
 
static buf_element_tfifo_buffer_tget (fifo_buffer_t *fifo, xine_ticket_t *ticket)
 
static void fifo_buffer_clear (fifo_buffer_t *fifo)
 
static void fifo_buffer_all_clear (fifo_buffer_t *fifo)
 
static int fifo_buffer_size (fifo_buffer_t *this)
 
static uint32_t fifo_buffer_data_size (fifo_buffer_t *this)
 
static int fifo_buffer_num_free (fifo_buffer_t *this)
 
static void fifo_buffer_dispose (fifo_buffer_t *this)
 
static void fifo_register_alloc_cb (fifo_buffer_t *this, void(*cb)(fifo_buffer_t *this, void *data_cb), void *data_cb)
 
static void fifo_register_put_cb (fifo_buffer_t *this, void(*cb)(fifo_buffer_t *this, buf_element_t *buf, void *data_cb), void *data_cb)
 
static void fifo_register_get_cb (fifo_buffer_t *this, void(*cb)(fifo_buffer_t *this, buf_element_t *buf, void *data_cb), void *data_cb)
 
static void fifo_unregister_alloc_cb (fifo_buffer_t *this, void(*cb)(fifo_buffer_t *this, void *data_cb))
 
static void fifo_unregister_put_cb (fifo_buffer_t *this, void(*cb)(fifo_buffer_t *this, buf_element_t *buf, void *data_cb))
 
static void fifo_unregister_get_cb (fifo_buffer_t *this, void(*cb)(fifo_buffer_t *this, buf_element_t *buf, void *data_cb))
 
fifo_buffer_t_x_fifo_buffer_new (int num_buffers, uint32_t buf_size)
 Allocate and initialise new (empty) FIFO buffers. More...
 
fifo_buffer_t_x_dummy_fifo_buffer_new (int num_buffers, uint32_t buf_size)
 Allocate and initialise new dummy FIFO buffers. More...
 
void _x_free_buf_elements (buf_element_t *head)
 Free chained list of buffer elements. More...
 

Macro Definition Documentation

◆ LARGE_NUM

#define LARGE_NUM   0x7fffffff

◆ LOG_MODULE

#define LOG_MODULE   "buffer"

◆ LOG_VERBOSE

#define LOG_VERBOSE

Function Documentation

◆ _x_dummy_fifo_buffer_new()

fifo_buffer_t * _x_dummy_fifo_buffer_new ( int  num_buffers,
uint32_t  buf_size 
)

Allocate and initialise new dummy FIFO buffers.

Parameters
num_bufferNumber of dummy buffers to allocate.
buf_sizeSize of each buffer.

Only used by video and audio decoder loops.

References _x_fifo_buffer_new(), dummy_fifo_buffer_insert(), dummy_fifo_buffer_put(), and put.

Referenced by _x_audio_decoder_init(), and _x_video_decoder_init().

◆ _x_fifo_buffer_new()

fifo_buffer_t * _x_fifo_buffer_new ( int  num_buffers,
uint32_t  buf_size 
)

◆ _x_free_buf_elements()

void _x_free_buf_elements ( buf_element_t head)

Free chained list of buffer elements.

Parameters
headList to free. May be NULL.

References buf_element_s::free_buffer, and buf_element_s::next.

Referenced by audio_decoder_loop().

◆ buffer_pool_alloc()

static buf_element_t * buffer_pool_alloc ( fifo_buffer_t this)
static

◆ buffer_pool_free()

static void buffer_pool_free ( buf_element_t element)
static

◆ buffer_pool_realloc()

static buf_element_t * buffer_pool_realloc ( buf_element_t buf,
size_t  new_size 
)
static

◆ buffer_pool_size_alloc()

static buf_element_t * buffer_pool_size_alloc ( fifo_buffer_t this,
size_t  size 
)
static

◆ buffer_pool_size_alloc_int()

static buf_element_t * buffer_pool_size_alloc_int ( fifo_buffer_t this,
int  n 
)
static

◆ buffer_pool_try_alloc()

static buf_element_t * buffer_pool_try_alloc ( fifo_buffer_t this)
static

◆ dummy_fifo_buffer_insert()

static void dummy_fifo_buffer_insert ( fifo_buffer_t fifo,
buf_element_t element 
)
static

◆ dummy_fifo_buffer_put()

static void dummy_fifo_buffer_put ( fifo_buffer_t fifo,
buf_element_t element 
)
static

◆ fifo_buffer_all_clear()

static void fifo_buffer_all_clear ( fifo_buffer_t fifo)
static

◆ fifo_buffer_clear()

static void fifo_buffer_clear ( fifo_buffer_t fifo)
static

◆ fifo_buffer_data_size()

static uint32_t fifo_buffer_data_size ( fifo_buffer_t this)
static

Referenced by _x_fifo_buffer_new().

◆ fifo_buffer_dispose()

static void fifo_buffer_dispose ( fifo_buffer_t this)
static

◆ fifo_buffer_get()

static buf_element_t * fifo_buffer_get ( fifo_buffer_t fifo)
static

◆ fifo_buffer_insert()

static void fifo_buffer_insert ( fifo_buffer_t fifo,
buf_element_t element 
)
static

◆ fifo_buffer_num_free()

static int fifo_buffer_num_free ( fifo_buffer_t this)
static

Referenced by _x_fifo_buffer_new().

◆ fifo_buffer_put()

static void fifo_buffer_put ( fifo_buffer_t fifo,
buf_element_t element 
)
static

◆ fifo_buffer_size()

static int fifo_buffer_size ( fifo_buffer_t this)
static

Referenced by _x_fifo_buffer_new().

◆ fifo_buffer_tget()

static buf_element_t * fifo_buffer_tget ( fifo_buffer_t fifo,
xine_ticket_t ticket 
)
static

◆ fifo_register_alloc_cb()

static void fifo_register_alloc_cb ( fifo_buffer_t this,
void(*)(fifo_buffer_t *this, void *data_cb)  cb,
void *  data_cb 
)
static

References BUF_MAX_CALLBACKS, and NULL.

Referenced by _x_fifo_buffer_new().

◆ fifo_register_get_cb()

static void fifo_register_get_cb ( fifo_buffer_t this,
void(*)(fifo_buffer_t *this, buf_element_t *buf, void *data_cb)  cb,
void *  data_cb 
)
static

References BUF_MAX_CALLBACKS, and NULL.

Referenced by _x_fifo_buffer_new().

◆ fifo_register_put_cb()

static void fifo_register_put_cb ( fifo_buffer_t this,
void(*)(fifo_buffer_t *this, buf_element_t *buf, void *data_cb)  cb,
void *  data_cb 
)
static

References BUF_MAX_CALLBACKS, and NULL.

Referenced by _x_fifo_buffer_new().

◆ fifo_unregister_alloc_cb()

static void fifo_unregister_alloc_cb ( fifo_buffer_t this,
void(*)(fifo_buffer_t *this, void *data_cb)  cb 
)
static

Referenced by _x_fifo_buffer_new().

◆ fifo_unregister_get_cb()

static void fifo_unregister_get_cb ( fifo_buffer_t this,
void(*)(fifo_buffer_t *this, buf_element_t *buf, void *data_cb)  cb 
)
static

Referenced by _x_fifo_buffer_new().

◆ fifo_unregister_put_cb()

static void fifo_unregister_put_cb ( fifo_buffer_t this,
void(*)(fifo_buffer_t *this, buf_element_t *buf, void *data_cb)  cb 
)
static

Referenced by _x_fifo_buffer_new().