VLC  4.0.0-dev
Data Structures | Macros | Typedefs | Functions
vlc_block.h File Reference

Data block definition and functions. More...

Include dependency graph for vlc_block.h:

Go to the source code of this file.

Data Structures

struct  vlc_block_callbacks
 
struct  block_t
 

Macros

#define BLOCK_FLAG_DISCONTINUITY   0x0001
 The content doesn't follow the last block, possible some blocks in between have been lost. More...
 
#define BLOCK_FLAG_TYPE_I   0x0002
 Intra frame. More...
 
#define BLOCK_FLAG_TYPE_P   0x0004
 Inter frame with backward reference only. More...
 
#define BLOCK_FLAG_TYPE_B   0x0008
 Inter frame with backward and forward reference. More...
 
#define BLOCK_FLAG_TYPE_PB   0x0010
 For inter frame when you don't know the real type. More...
 
#define BLOCK_FLAG_HEADER   0x0020
 Warn that this block is a header one. More...
 
#define BLOCK_FLAG_END_OF_SEQUENCE   0x0040
 This block contains the last part of a sequence. More...
 
#define BLOCK_FLAG_CLOCK   0x0080
 This block contains a clock reference. More...
 
#define BLOCK_FLAG_SCRAMBLED   0x0100
 This block is scrambled. More...
 
#define BLOCK_FLAG_PREROLL   0x0200
 This block has to be decoded but not be displayed. More...
 
#define BLOCK_FLAG_CORRUPTED   0x0400
 This block is corrupted and/or there is data loss. More...
 
#define BLOCK_FLAG_AU_END   0x0800
 This block is last of its access unit. More...
 
#define BLOCK_FLAG_TOP_FIELD_FIRST   0x1000
 This block contains an interlaced picture with top field stored first. More...
 
#define BLOCK_FLAG_BOTTOM_FIELD_FIRST   0x2000
 This block contains an interlaced picture with bottom field stored first. More...
 
#define BLOCK_FLAG_SINGLE_FIELD   0x4000
 This block contains a single field from interlaced picture. More...
 
#define BLOCK_FLAG_INTERLACED_MASK   (BLOCK_FLAG_TOP_FIELD_FIRST|BLOCK_FLAG_BOTTOM_FIELD_FIRST|BLOCK_FLAG_SINGLE_FIELD)
 This block contains an interlaced picture. More...
 
#define BLOCK_FLAG_TYPE_MASK   (BLOCK_FLAG_TYPE_I|BLOCK_FLAG_TYPE_P|BLOCK_FLAG_TYPE_B|BLOCK_FLAG_TYPE_PB)
 
#define BLOCK_FLAG_CORE_PRIVATE_MASK   0x00ff0000
 
#define BLOCK_FLAG_CORE_PRIVATE_SHIFT   16
 
#define BLOCK_FLAG_PRIVATE_MASK   0xff000000
 
#define BLOCK_FLAG_PRIVATE_SHIFT   24
 
#define block_cleanup_push(block)   vlc_cleanup_push (block_Cleanup, block)
 
#define vlc_fifo_CleanupPush(fifo)   vlc_cleanup_push(vlc_fifo_Cleanup, fifo)
 

Typedefs

typedef struct block_fifo_t vlc_fifo_t
 

Functions

block_tblock_Init (block_t *block, const struct vlc_block_callbacks *cbs, void *base, size_t length)
 Initializes a custom block. More...
 
block_tblock_Alloc (size_t size)
 Allocates a block. More...
 
block_tblock_TryRealloc (block_t *, ssize_t pre, size_t body)
 
block_tblock_Realloc (block_t *, ssize_t pre, size_t body)
 Reallocates a block. More...
 
void block_Release (block_t *block)
 Releases a block. More...
 
static void block_CopyProperties (block_t *dst, const block_t *src)
 
static block_tblock_Duplicate (const block_t *p_block)
 Duplicates a block. More...
 
block_tblock_heap_Alloc (void *, size_t)
 Wraps heap in a block. More...
 
block_tblock_mmap_Alloc (void *addr, size_t length)
 Wraps a memory mapping in a block. More...
 
block_tblock_shm_Alloc (void *addr, size_t length)
 Wraps a System V memory segment in a block. More...
 
block_tblock_File (int fd, bool write)
 Maps a file handle in memory. More...
 
block_tblock_FilePath (const char *, bool write)
 Maps a file in memory. More...
 
static void block_Cleanup (void *block)
 
static void block_ChainAppend (block_t **pp_list, block_t *p_block)
 
static void block_ChainLastAppend (block_t ***ppp_last, block_t *p_block)
 
static void block_ChainRelease (block_t *p_block)
 
static size_t block_ChainExtract (block_t *p_list, void *p_data, size_t i_max)
 
static void block_ChainProperties (block_t *p_list, int *pi_count, size_t *pi_size, vlc_tick_t *pi_length)
 
static block_tblock_ChainGather (block_t *p_list)
 
block_fifo_tblock_FifoNew (void)
 Creates a thread-safe FIFO queue of blocks. More...
 
void block_FifoRelease (block_fifo_t *)
 Destroys a FIFO created by block_FifoNew(). More...
 
block_tblock_FifoGet (block_fifo_t *)
 Dequeue the first block from the FIFO. More...
 
block_tblock_FifoShow (block_fifo_t *)
 Peeks the first block in the FIFO. More...
 
static vlc_queue_tvlc_fifo_queue (const vlc_fifo_t *fifo)
 
static void vlc_fifo_Lock (vlc_fifo_t *fifo)
 Locks a block FIFO. More...
 
static void vlc_fifo_Unlock (vlc_fifo_t *fifo)
 Unlocks a block FIFO. More...
 
static void vlc_fifo_Signal (vlc_fifo_t *fifo)
 Wakes up one thread waiting on the FIFO, if any. More...
 
static void vlc_fifo_Wait (vlc_fifo_t *fifo)
 Waits on the FIFO. More...
 
static void vlc_fifo_WaitCond (vlc_fifo_t *fifo, vlc_cond_t *condvar)
 
void vlc_fifo_QueueUnlocked (vlc_fifo_t *fifo, block_t *)
 Queues a linked-list of blocks into a locked FIFO. More...
 
block_tvlc_fifo_DequeueUnlocked (vlc_fifo_t *)
 Dequeues the first block from a locked FIFO, if any. More...
 
block_tvlc_fifo_DequeueAllUnlocked (vlc_fifo_t *)
 Dequeues the all blocks from a locked FIFO. More...
 
size_t vlc_fifo_GetCount (const vlc_fifo_t *)
 Counts blocks in a FIFO. More...
 
size_t vlc_fifo_GetBytes (const vlc_fifo_t *)
 Counts bytes in a FIFO. More...
 
static bool vlc_fifo_IsEmpty (const vlc_fifo_t *fifo)
 
static void vlc_fifo_Cleanup (void *fifo)
 
static void block_FifoEmpty (block_fifo_t *fifo)
 Clears all blocks in a FIFO. More...
 
static void block_FifoPut (block_fifo_t *fifo, block_t *block)
 Immediately queue one block at the end of a FIFO. More...
 
static size_t block_FifoSize (block_fifo_t *fifo)
 
static size_t block_FifoCount (block_fifo_t *fifo)
 

Detailed Description

Data block definition and functions.