73#define VLC_FRAME_FLAG_DISCONTINUITY 0x0001
75#define VLC_FRAME_FLAG_TYPE_I 0x0002
77#define VLC_FRAME_FLAG_TYPE_P 0x0004
79#define VLC_FRAME_FLAG_TYPE_B 0x0008
81#define VLC_FRAME_FLAG_TYPE_PB 0x0010
83#define VLC_FRAME_FLAG_HEADER 0x0020
85#define VLC_FRAME_FLAG_END_OF_SEQUENCE 0x0040
87#define VLC_FRAME_FLAG_SCRAMBLED 0x0100
89#define VLC_FRAME_FLAG_PREROLL 0x0200
91#define VLC_FRAME_FLAG_CORRUPTED 0x0400
93#define VLC_FRAME_FLAG_AU_END 0x0800
95#define VLC_FRAME_FLAG_TOP_FIELD_FIRST 0x1000
97#define VLC_FRAME_FLAG_BOTTOM_FIELD_FIRST 0x2000
99#define VLC_FRAME_FLAG_SINGLE_FIELD 0x4000
102#define VLC_FRAME_FLAG_INTERLACED_MASK \
103 (VLC_FRAME_FLAG_TOP_FIELD_FIRST|VLC_FRAME_FLAG_BOTTOM_FIELD_FIRST|VLC_FRAME_FLAG_SINGLE_FIELD)
105#define VLC_FRAME_FLAG_TYPE_MASK \
106 (VLC_FRAME_FLAG_TYPE_I|VLC_FRAME_FLAG_TYPE_P|VLC_FRAME_FLAG_TYPE_B|VLC_FRAME_FLAG_TYPE_PB)
109#define VLC_FRAME_FLAG_CORE_PRIVATE_MASK 0x00ff0000
110#define VLC_FRAME_FLAG_CORE_PRIVATE_SHIFT 16
113#define VLC_FRAME_FLAG_PRIVATE_MASK 0xff000000
114#define VLC_FRAME_FLAG_PRIVATE_SHIFT 24
162 void *base,
size_t length);
180 void *base,
size_t length);
377#define vlc_frame_cleanup_push( frame ) vlc_cleanup_push (vlc_frame_Cleanup, frame)
409 if( *pp_list == NULL )
449 *ppp_last = &p_last->
p_next;
489 uint8_t *
p = (uint8_t*)p_data;
491 while( p_list && i_max )
493 size_t i_copy = __MIN( i_max, p_list->
i_buffer );
533 *pi_length = i_length;
558 if( p_list->
p_next == NULL )
792#define vlc_fifo_Assert(fifo) assert(vlc_fifo_Held(fifo))
803#define vlc_fifo_CleanupPush(fifo) vlc_cleanup_push(vlc_fifo_Cleanup, fifo)
#define VLC_USED
Definition fourcc_gen.c:32
#define VLC_API
Definition fourcc_gen.c:31
uint32_t vlc_ancillary_id
ID of an ancillary.
Definition vlc_ancillary.h:68
static void vlc_fifo_Empty(vlc_fifo_t *fifo)
Clears all blocks in a FIFO.
Definition vlc_frame.h:809
vlc_fifo_t * vlc_fifo_New(void)
Creates a thread-safe FIFO queue of blocks.
Definition fifo.c:95
static size_t vlc_fifo_Size(vlc_fifo_t *fifo)
Definition vlc_frame.h:834
static void vlc_fifo_Lock(vlc_fifo_t *fifo)
Locks a block FIFO.
Definition vlc_frame.h:646
static void vlc_fifo_WaitCond(vlc_fifo_t *fifo, vlc_cond_t *condvar)
Definition vlc_frame.h:693
size_t vlc_fifo_GetBytes(const vlc_fifo_t *)
Counts bytes in a FIFO.
Definition fifo.c:58
vlc_frame_t * vlc_fifo_Show(vlc_fifo_t *)
Peeks the first block in the FIFO.
Definition fifo.c:133
static void vlc_fifo_Wait(vlc_fifo_t *fifo)
Waits on the FIFO.
Definition vlc_frame.h:688
static void vlc_fifo_Unlock(vlc_fifo_t *fifo)
Unlocks a block FIFO.
Definition vlc_frame.h:659
bool vlc_fifo_Held(const vlc_fifo_t *fifo)
Checks whether the vlc_fifo_t object is being locked.
Definition fifo.c:47
vlc_frame_t * vlc_fifo_DequeueUnlocked(vlc_fifo_t *)
Dequeues the first block from a locked FIFO, if any.
Definition fifo.c:74
static vlc_queue_t * vlc_fifo_queue(const vlc_fifo_t *fifo)
Definition vlc_frame.h:628
void vlc_fifo_QueueUnlocked(vlc_fifo_t *fifo, vlc_frame_t *block)
Queues a linked-list of blocks into a locked FIFO.
Definition fifo.c:64
static void vlc_fifo_Put(vlc_fifo_t *fifo, vlc_frame_t *block)
Immediately queue one block at the end of a FIFO.
Definition vlc_frame.h:825
size_t vlc_fifo_GetCount(const vlc_fifo_t *)
Counts blocks in a FIFO.
Definition fifo.c:52
static void vlc_fifo_Signal(vlc_fifo_t *fifo)
Wakes up one thread waiting on the FIFO, if any.
Definition vlc_frame.h:672
vlc_frame_t * vlc_fifo_Get(vlc_fifo_t *)
Dequeue the first block from the FIFO.
Definition fifo.c:114
static size_t vlc_fifo_Count(vlc_fifo_t *fifo)
Definition vlc_frame.h:846
void vlc_fifo_Delete(vlc_fifo_t *)
Delete a FIFO created by vlc_fifo_New().
Definition fifo.c:108
vlc_frame_t * vlc_fifo_DequeueAllUnlocked(vlc_fifo_t *)
Dequeues the all blocks from a locked FIFO.
Definition fifo.c:88
static bool vlc_fifo_IsEmpty(const vlc_fifo_t *fifo)
Definition vlc_frame.h:795
static void vlc_fifo_Cleanup(void *fifo)
Definition vlc_frame.h:800
#define VLC_MALLOC
Definition vlc_common.h:157
#define VLC_DEPRECATED
Definition vlc_common.h:158
void vlc_cond_wait(vlc_cond_t *cond, vlc_mutex_t *mutex)
Waits on a condition variable.
Definition threads.c:280
void vlc_frame_Release(vlc_frame_t *frame)
Releases a frame.
Definition frame.c:154
vlc_frame_t * vlc_frame_Alloc(size_t size)
Allocates a frame.
Definition frame.c:115
struct vlc_ancillary * vlc_frame_GetAncillary(vlc_frame_t *frame, vlc_ancillary_id id)
Return the ancillary identified by an ID.
Definition frame.c:565
static vlc_frame_t * vlc_frame_Duplicate(const vlc_frame_t *frame)
Duplicates a frame.
Definition vlc_frame.h:284
vlc_frame_t * vlc_frame_FilePath(const char *path, bool write)
Maps a file in memory.
Definition frame.c:545
vlc_frame_t * vlc_frame_shm_Alloc(void *addr, size_t length)
Wraps a System V memory segment in a frame.
Definition frame.c:382
static void vlc_frame_Cleanup(void *frame)
Definition vlc_frame.h:374
vlc_frame_t * vlc_frame_New(const struct vlc_frame_callbacks *cbs, void *base, size_t length)
Creates a custom frame.
Definition frame.c:78
vlc_frame_t * vlc_frame_Init(vlc_frame_t *frame, const struct vlc_frame_callbacks *cbs, void *base, size_t length)
Initializes a custom frame.
void vlc_frame_CopyProperties(vlc_frame_t *dst, const vlc_frame_t *src)
Copy frame properties from src to dst.
int vlc_frame_AttachAncillary(vlc_frame_t *frame, struct vlc_ancillary *ancillary)
Attach an ancillary to the frame.
Definition frame.c:559
vlc_frame_t * vlc_frame_Realloc(vlc_frame_t *frame, ssize_t pre, size_t body)
Reallocates a frame.
Definition frame.c:256
vlc_frame_t * vlc_frame_heap_Alloc(void *addr, size_t length)
Wraps heap in a frame.
Definition frame.c:275
vlc_frame_t * vlc_frame_mmap_Alloc(void *addr, size_t length)
Wraps a memory mapping in a frame.
Definition frame.c:316
vlc_frame_t * vlc_frame_File(int fd, bool write)
Maps a file handle in memory.
Definition frame.c:398
vlc_frame_t * vlc_frame_TryRealloc(vlc_frame_t *, ssize_t pre, size_t body)
Definition frame.c:181
static void vlc_queue_Lock(vlc_queue_t *q)
Locks a queue.
Definition vlc_queue.h:88
static void vlc_queue_Wait(vlc_queue_t *q)
Waits for a queue entry.
Definition vlc_queue.h:122
static void vlc_queue_Signal(vlc_queue_t *q)
Wakes one thread waiting for a queue entry up.
Definition vlc_queue.h:108
static void vlc_queue_Unlock(vlc_queue_t *q)
Unlocks a queue.
Definition vlc_queue.h:100
static bool vlc_queue_IsEmpty(const vlc_queue_t *q)
Checks if a queue is empty (without locking).
Definition vlc_queue.h:179
static void vlc_frame_ChainLastAppend(vlc_frame_t ***ppp_last, vlc_frame_t *frame)
Appends a vlc_frame_t to the last frame pointer and update it.
Definition vlc_frame.h:443
static void vlc_frame_ChainProperties(const vlc_frame_t *p_list, int *pi_count, size_t *pi_size, vlc_tick_t *pi_length)
Retrieves chain properties.
Definition vlc_frame.h:516
static void vlc_frame_ChainAppend(vlc_frame_t **pp_list, vlc_frame_t *frame)
Appends a vlc_frame_t to the chain.
Definition vlc_frame.h:408
static void vlc_frame_ChainRelease(vlc_frame_t *frame)
Releases a chain of blocks.
Definition vlc_frame.h:463
static size_t vlc_frame_ChainExtract(vlc_frame_t *p_list, void *p_data, size_t i_max)
Extracts data from a chain of frames.
Definition vlc_frame.h:487
static vlc_frame_t * vlc_frame_ChainGather(vlc_frame_t *p_list)
Gathers a chain into a single vlc_frame_t.
Definition vlc_frame.h:553
Definition ancillary.c:31
Condition variable.
Definition vlc_threads.h:270
Internal state for block queues.
Definition fifo.c:39
Definition vlc_frame.h:118
void(* free)(vlc_frame_t *)
Definition vlc_frame.h:119
Definition vlc_frame.h:123
uint8_t * p_start
Buffer start.
Definition vlc_frame.h:128
vlc_tick_t i_dts
Definition vlc_frame.h:135
vlc_frame_t * p_next
Definition vlc_frame.h:124
vlc_tick_t i_length
Definition vlc_frame.h:136
uint8_t * p_buffer
Payload start.
Definition vlc_frame.h:126
struct vlc_ancillary ** priv_ancillaries
Private ancillary struct.
Definition vlc_frame.h:140
vlc_tick_t i_pts
Definition vlc_frame.h:134
unsigned i_nb_samples
Definition vlc_frame.h:132
uint32_t i_flags
Definition vlc_frame.h:131
size_t i_size
Buffer total size.
Definition vlc_frame.h:129
const struct vlc_frame_callbacks * cbs
Definition vlc_frame.h:142
size_t i_buffer
Payload length.
Definition vlc_frame.h:127
Thread-safe queue (a.k.a.
Definition vlc_queue.h:46
vlc_mutex_t lock
Definition vlc_queue.h:50
This file is a collection of common definitions and types.
uint32_t vlc_ancillary_id
Definition vlc_frame.h:30
int64_t vlc_tick_t
High precision date or time interval.
Definition vlc_tick.h:48