Go to the documentation of this file.
44 #include <sys/types.h>
67 #define BLOCK_FLAG_DISCONTINUITY 0x0001
69 #define BLOCK_FLAG_TYPE_I 0x0002
71 #define BLOCK_FLAG_TYPE_P 0x0004
73 #define BLOCK_FLAG_TYPE_B 0x0008
75 #define BLOCK_FLAG_TYPE_PB 0x0010
77 #define BLOCK_FLAG_HEADER 0x0020
79 #define BLOCK_FLAG_END_OF_SEQUENCE 0x0040
81 #define BLOCK_FLAG_CLOCK 0x0080
83 #define BLOCK_FLAG_SCRAMBLED 0x0100
85 #define BLOCK_FLAG_PREROLL 0x0200
87 #define BLOCK_FLAG_CORRUPTED 0x0400
89 #define BLOCK_FLAG_TOP_FIELD_FIRST 0x0800
91 #define BLOCK_FLAG_BOTTOM_FIELD_FIRST 0x1000
93 #define BLOCK_FLAG_SINGLE_FIELD 0x2000
96 #define BLOCK_FLAG_INTERLACED_MASK \
97 (BLOCK_FLAG_TOP_FIELD_FIRST|BLOCK_FLAG_BOTTOM_FIELD_FIRST|BLOCK_FLAG_SINGLE_FIELD)
99 #define BLOCK_FLAG_TYPE_MASK \
100 (BLOCK_FLAG_TYPE_I|BLOCK_FLAG_TYPE_P|BLOCK_FLAG_TYPE_B|BLOCK_FLAG_TYPE_PB)
103 #define BLOCK_FLAG_CORE_PRIVATE_MASK 0x00ff0000
104 #define BLOCK_FLAG_CORE_PRIVATE_SHIFT 16
107 #define BLOCK_FLAG_PRIVATE_MASK 0xff000000
108 #define BLOCK_FLAG_PRIVATE_SHIFT 24
295 #define block_cleanup_push( block ) vlc_cleanup_push (block_Cleanup, block)
316 if( *pp_list == NULL )
324 while(
p->p_next )
p =
p->p_next;
333 **ppp_last = p_block;
336 *ppp_last = &p_last->
p_next;
352 uint8_t *
p = (uint8_t*)p_data;
354 while( p_list && i_max )
356 size_t i_copy = __MIN( i_max, p_list->
i_buffer );
385 *pi_length = i_length;
396 if( p_list->
p_next == NULL )
620 #define vlc_fifo_CleanupPush(fifo) vlc_cleanup_push(vlc_fifo_Cleanup, fifo)
void block_Init(block_t *, void *, size_t)
static void block_ChainLastAppend(block_t ***ppp_last, block_t *p_block)
Definition: vlc_block.h:327
#define VLC_API
Definition: fourcc_gen.c:30
static void block_ChainRelease(block_t *p_block)
Definition: vlc_block.h:337
#define VLC_DEPRECATED
Definition: vlc_common.h:98
size_t i_buffer
Payload length.
Definition: vlc_block.h:116
size_t block_FifoCount(block_fifo_t *)
Definition: fifo.c:226
static void block_Cleanup(void *block)
Definition: vlc_block.h:290
int64_t vlc_tick_t
High precision date or time interval.
Definition: vlc_common.h:150
void vlc_fifo_WaitCond(vlc_fifo_t *, vlc_cond_t *)
Definition: fifo.c:68
block_t * block_FilePath(const char *, bool write)
Maps a file in memory.
Definition: block.c:434
block_t * block_shm_Alloc(void *addr, size_t length)
Wraps a System V memory segment in a block.
Definition: block.c:338
void vlc_fifo_Wait(vlc_fifo_t *)
Waits on the FIFO.
Definition: fifo.c:63
block_t * block_heap_Alloc(void *, size_t)
Wraps heap in a block.
Definition: block.c:253
size_t vlc_fifo_GetCount(const vlc_fifo_t *)
Counts blocks in a FIFO.
Definition: fifo.c:78
void vlc_fifo_QueueUnlocked(vlc_fifo_t *, block_t *)
Queues a linked-list of blocks into a locked FIFO.
Definition: fifo.c:88
size_t i_size
Buffer total size.
Definition: vlc_block.h:118
Internal state for block queues.
Definition: fifo.c:37
vlc_tick_t i_length
Definition: vlc_block.h:125
block_t * block_FifoShow(block_fifo_t *)
Peeks the first block in the FIFO.
Definition: fifo.c:202
pthread_cond_t vlc_cond_t
Condition variable.
Definition: vlc_threads.h:279
block_t * block_mmap_Alloc(void *addr, size_t length)
Wraps a memory mapping in a block.
Definition: block.c:300
block_t * vlc_fifo_DequeueUnlocked(vlc_fifo_t *)
Dequeues the first block from a locked FIFO, if any.
Definition: fifo.c:107
void block_FifoRelease(block_fifo_t *)
Destroys a FIFO created by block_FifoNew().
Definition: fifo.c:158
block_t * vlc_fifo_DequeueAllUnlocked(vlc_fifo_t *)
Dequeues the all blocks from a locked FIFO.
Definition: fifo.c:129
void vlc_fifo_Unlock(vlc_fifo_t *)
Unlocks a block FIFO.
Definition: fifo.c:53
block_t * p_next
Definition: vlc_block.h:113
void(* block_free_t)(block_t *)
Definition: vlc_block.h:109
static void block_ChainAppend(block_t **pp_list, block_t *p_block)
Definition: vlc_block.h:312
void vlc_fifo_Lock(vlc_fifo_t *)
Locks a block FIFO.
Definition: fifo.c:48
uint32_t i_flags
Definition: vlc_block.h:120
void vlc_fifo_Signal(vlc_fifo_t *)
Wakes up one thread waiting on the FIFO, if any.
Definition: fifo.c:58
unsigned i_nb_samples
Definition: vlc_block.h:121
static void block_Release(block_t *block)
Releases a block.
Definition: vlc_block.h:181
static block_t * block_ChainGather(block_t *p_list)
Definition: vlc_block.h:388
block_fifo_t * block_FifoNew(void)
Creates a thread-safe FIFO queue of blocks.
Definition: fifo.c:143
static bool vlc_fifo_IsEmpty(const vlc_fifo_t *fifo)
Definition: vlc_block.h:609
vlc_tick_t i_pts
Definition: vlc_block.h:123
block_t * block_Realloc(block_t *, ssize_t pre, size_t body)
Reallocates a block.
Definition: block.c:238
void block_FifoPut(block_fifo_t *fifo, block_t *block)
Immediately queue one block at the end of a FIFO.
Definition: fifo.c:176
block_t * block_File(int fd, bool write)
Maps a file handle in memory.
Definition: block.c:367
void block_FifoEmpty(block_fifo_t *)
Clears all blocks in a FIFO.
Definition: fifo.c:166
uint8_t * p_start
Buffer start.
Definition: vlc_block.h:117
size_t vlc_fifo_GetBytes(const vlc_fifo_t *)
Counts bytes in a FIFO.
Definition: fifo.c:83
static void block_ChainProperties(block_t *p_list, int *pi_count, size_t *pi_size, vlc_tick_t *pi_length)
Definition: vlc_block.h:365
static void block_CopyProperties(block_t *dst, block_t *src)
Definition: vlc_block.h:186
#define VLC_USED
Definition: fourcc_gen.c:31
#define VLC_MALLOC
Definition: vlc_common.h:102
int vlc_fifo_TimedWaitCond(vlc_fifo_t *, vlc_cond_t *, vlc_tick_t)
Timed variant of vlc_fifo_WaitCond().
Definition: fifo.c:73
static size_t block_ChainExtract(block_t *p_list, void *p_data, size_t i_max)
Definition: vlc_block.h:347
static block_t * block_Duplicate(block_t *p_block)
Duplicates a block.
Definition: vlc_block.h:203
block_t * block_Alloc(size_t size)
Allocates a block.
Definition: block.c:119
vlc_tick_t i_dts
Definition: vlc_block.h:124
block_free_t pf_release
Definition: vlc_block.h:128
uint8_t * p_buffer
Payload start.
Definition: vlc_block.h:115
Definition: vlc_block.h:111
size_t block_FifoSize(block_fifo_t *)
Definition: fifo.c:215
block_t * block_FifoGet(block_fifo_t *)
Dequeue the first block from the FIFO.
Definition: fifo.c:183
static void vlc_fifo_Cleanup(void *fifo)
Definition: vlc_block.h:614
block_t * block_TryRealloc(block_t *, ssize_t pre, size_t body)
Definition: block.c:147