X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=include%2Fvlc_block.h;h=98e562645079fadc2d8cacda0dec8551a75ef4ab;hb=b56436908febcba671fde78649f172e48a998165;hp=5ce9ab428c731e044d22528203b76e5469c18f94;hpb=cf270dd3c0201b2bb1ace5748e55d2300b782e38;p=vlc diff --git a/include/vlc_block.h b/include/vlc_block.h index 5ce9ab428c..98e5626450 100644 --- a/include/vlc_block.h +++ b/include/vlc_block.h @@ -37,7 +37,7 @@ * - i_flags may not always be set (ie could be 0, even for a key frame * it depends where you receive the buffer (before/after a packetizer * and the demux/packetizer implementations. - * - i_dts/i_pts could be 0, it means no pts + * - i_dts/i_pts could be VLC_TS_INVALID, it means no pts/dts * - i_length: length in microseond of the packet, can be null except in the * sout where it is mandatory. * - i_rate 0 or a valid input rate, look at vlc_input.h @@ -82,15 +82,19 @@ typedef struct block_sys_t block_sys_t; #define BLOCK_FLAG_TYPE_MASK \ (BLOCK_FLAG_TYPE_I|BLOCK_FLAG_TYPE_P|BLOCK_FLAG_TYPE_B|BLOCK_FLAG_TYPE_PB) -#define BLOCK_FLAG_PRIVATE_MASK 0xffff0000 -#define BLOCK_FLAG_PRIVATE_SHIFT 16 +/* These are for input core private usage only */ +#define BLOCK_FLAG_CORE_PRIVATE_MASK 0x00ff0000 +#define BLOCK_FLAG_CORE_PRIVATE_SHIFT 16 + +/* These are for module private usage only */ +#define BLOCK_FLAG_PRIVATE_MASK 0xff000000 +#define BLOCK_FLAG_PRIVATE_SHIFT 24 typedef void (*block_free_t) (block_t *); struct block_t { block_t *p_next; - block_t *p_prev; uint32_t i_flags; @@ -153,6 +157,7 @@ static inline void block_Release( block_t *p_block ) p_block->pf_release( p_block ); } +VLC_EXPORT( block_t *, block_heap_Alloc, (void *, void *, size_t) LIBVLC_USED ); VLC_EXPORT( block_t *, block_mmap_Alloc, (void *addr, size_t length) LIBVLC_USED ); VLC_EXPORT( block_t *, block_File, (int fd) LIBVLC_USED ); @@ -231,7 +236,7 @@ static inline void block_ChainProperties( block_t *p_list, int *pi_count, size_t { size_t i_size = 0; mtime_t i_length = 0; - int i_count; + int i_count = 0; while( p_list ) { @@ -286,7 +291,6 @@ static inline block_t *block_ChainGather( block_t *p_list ) * needed), be carefull, you can use it ONLY if you are sure to be the * only one getting data from the fifo. * - block_FifoCount : how many packets are waiting in the fifo - * - block_FifoSize : how many cumulated bytes are waiting in the fifo * - block_FifoWake : wake ups a thread with block_FifoGet() = NULL * (this is used to wakeup a thread when there is no data to queue) * @@ -295,12 +299,14 @@ static inline block_t *block_ChainGather( block_t *p_list ) VLC_EXPORT( block_fifo_t *, block_FifoNew, ( void ) LIBVLC_USED ); VLC_EXPORT( void, block_FifoRelease, ( block_fifo_t * ) ); +/* TODO: do we need to export this? */ +void block_FifoPace (block_fifo_t *fifo, size_t max_depth, size_t max_size); VLC_EXPORT( void, block_FifoEmpty, ( block_fifo_t * ) ); VLC_EXPORT( size_t, block_FifoPut, ( block_fifo_t *, block_t * ) ); VLC_EXPORT( void, block_FifoWake, ( block_fifo_t * ) ); VLC_EXPORT( block_t *, block_FifoGet, ( block_fifo_t * ) LIBVLC_USED ); VLC_EXPORT( block_t *, block_FifoShow, ( block_fifo_t * ) ); -VLC_EXPORT( size_t, block_FifoSize, ( const block_fifo_t *p_fifo ) LIBVLC_USED ); +size_t block_FifoSize( const block_fifo_t *p_fifo ) LIBVLC_USED; VLC_EXPORT( size_t, block_FifoCount, ( const block_fifo_t *p_fifo ) LIBVLC_USED ); #endif /* VLC_BLOCK_H */