
Data Structures | |
| struct | block_fifo_t |
| Internal state for block queues. More... | |
Defines | |
| #define | BLOCK_ALIGN 16 |
| #define | BLOCK_PADDING 32 |
| #define | BLOCK_WASTE_SIZE 2048 |
| #define | S_TYPEISSHM(buf) (0) |
Functions | |
| static void | BlockNoRelease (block_t *b) |
| static void | block_Check (block_t *block) |
| static void | block_Invalidate (block_t *block) |
| void | block_Init (block_t *restrict b, void *buf, size_t size) |
| static void | BlockRelease (block_t *block) |
| static void | BlockMetaCopy (block_t *restrict out, const block_t *in) |
| block_t * | block_Alloc (size_t size) |
| block_t * | block_Realloc (block_t *p_block, ssize_t i_prebody, size_t i_body) |
| static void | block_heap_Release (block_t *block) |
| block_t * | block_heap_Alloc (void *addr, size_t length) |
| Creates a block from a heap allocation. | |
| block_t * | block_mmap_Alloc (void *addr, size_t length) |
| static ssize_t | pread (int fd, const void *buf, size_t size, off_t offset) |
| static ssize_t | pwrite (int fd, const void *buf, size_t size, off_t offset) |
| block_t * | block_File (int fd) |
| Loads a file into a block of memory. | |
| block_fifo_t * | block_FifoNew (void) |
| void | block_FifoRelease (block_fifo_t *p_fifo) |
| void | block_FifoEmpty (block_fifo_t *p_fifo) |
| void | block_FifoPace (block_fifo_t *fifo, size_t max_depth, size_t max_size) |
| Wait until the FIFO gets below a certain size (if needed). | |
| size_t | block_FifoPut (block_fifo_t *p_fifo, block_t *p_block) |
| Immediately queue one block at the end of a FIFO. | |
| void | block_FifoWake (block_fifo_t *p_fifo) |
| block_t * | block_FifoGet (block_fifo_t *p_fifo) |
| Dequeue the first block from the FIFO. | |
| block_t * | block_FifoShow (block_fifo_t *p_fifo) |
| Peeks the first block in the FIFO. | |
| size_t | block_FifoSize (const block_fifo_t *p_fifo) |
| size_t | block_FifoCount (const block_fifo_t *p_fifo) |
| #define BLOCK_ALIGN 16 |
Referenced by block_Alloc().
| #define BLOCK_PADDING 32 |
Referenced by block_Alloc().
| #define BLOCK_WASTE_SIZE 2048 |
Referenced by block_Realloc().
| #define S_TYPEISSHM | ( | buf | ) | (0) |
Referenced by block_File().
| block_t* block_Alloc | ( | size_t | size | ) |
References BLOCK_ALIGN, block_Init(), BLOCK_PADDING, block_t::i_buffer, block_t::p_buffer, block_t::pf_release, static_assert, and unlikely.
Referenced by aout_DecNewBuffer(), block_ChainGather(), block_Duplicate(), block_File(), block_Realloc(), DecoderBlockFlushNew(), EsOutControlLocked(), test_block(), TsStoragePopCmd(), and VoutDisplayEventKey().
| static void block_Check | ( | block_t * | block | ) | [static] |
References BlockNoRelease(), block_t::i_buffer, block_t::i_size, block_t::p_buffer, block_t::p_next, block_t::p_start, and block_t::pf_release.
Referenced by block_Invalidate(), and block_Realloc().
| size_t block_FifoCount | ( | const block_fifo_t * | p_fifo | ) |
References block_fifo_t::i_depth.
Referenced by DeleteDecoder(), input_DecoderIsEmpty(), sout_MuxDeleteStream(), and sout_MuxGetStream().
| void block_FifoEmpty | ( | block_fifo_t * | p_fifo | ) |
References block_Release(), block_fifo_t::i_depth, block_fifo_t::i_size, block_fifo_t::lock, block_fifo_t::p_first, block_t::p_next, block_fifo_t::pp_last, vlc_cond_broadcast(), vlc_mutex_lock(), vlc_mutex_unlock(), and block_fifo_t::wait_room.
Referenced by block_FifoRelease(), DecoderFlush(), DeleteDecoder(), and input_DecoderDecode().
| block_t* block_FifoGet | ( | block_fifo_t * | p_fifo | ) |
Dequeue the first block from the FIFO.
If necessary, wait until there is one block in the queue. This function is (always) cancellation point.
References block_fifo_t::b_force_wake, block_t::i_buffer, block_fifo_t::i_depth, block_fifo_t::i_size, block_fifo_t::lock, mutex_cleanup_push, block_fifo_t::p_first, block_t::p_next, block_fifo_t::pp_last, vlc_cleanup_pop, vlc_cond_broadcast(), vlc_cond_wait(), vlc_mutex_lock(), vlc_mutex_unlock(), vlc_testcancel(), block_fifo_t::wait, and block_fifo_t::wait_room.
Referenced by DecoderThread(), DStreamPeek(), DStreamRead(), and VoutDisplayEventKeyDispatch().
| block_fifo_t* block_FifoNew | ( | void | ) |
References block_fifo_t::b_force_wake, block_fifo_t::i_depth, block_fifo_t::i_size, block_fifo_t::lock, block_fifo_t::p_first, block_fifo_t::pp_last, vlc_cond_init(), vlc_mutex_init(), block_fifo_t::wait, and block_fifo_t::wait_room.
Referenced by CreateDecoder(), sout_MuxAddStream(), stream_DemuxNew(), and VoutDisplayEventKey().
| void block_FifoPace | ( | block_fifo_t * | fifo, | |
| size_t | max_depth, | |||
| size_t | max_size | |||
| ) |
Wait until the FIFO gets below a certain size (if needed).
Note that if more than one thread writes to the FIFO, you cannot assume that the FIFO is actually below the requested size upon return (since another thread could have refilled it already). This is typically not an issue, as this function is meant for (relaxed) congestion control.
This function may be a cancellation point and it is cancel-safe.
| fifo | queue to wait on | |
| max_depth | wait until the queue has no more than this many blocks (use SIZE_MAX to ignore this constraint) | |
| max_size | wait until the queue has no more than this many bytes (use SIZE_MAX to ignore this constraint) |
References block_fifo_t::i_depth, block_fifo_t::i_size, block_fifo_t::lock, mutex_cleanup_push, vlc_cleanup_pop, vlc_cond_wait(), vlc_mutex_lock(), vlc_mutex_unlock(), vlc_testcancel(), and block_fifo_t::wait_room.
Referenced by input_DecoderDecode().
| size_t block_FifoPut | ( | block_fifo_t * | p_fifo, | |
| block_t * | p_block | |||
| ) |
Immediately queue one block at the end of a FIFO.
| fifo | queue | |
| block | head of a block list to queue (may be NULL) |
References block_t::i_buffer, block_fifo_t::i_depth, block_fifo_t::i_size, block_fifo_t::lock, block_t::p_next, block_fifo_t::pp_last, vlc_cond_signal(), vlc_mutex_lock(), vlc_mutex_unlock(), and block_fifo_t::wait.
Referenced by DStreamDelete(), input_DecoderDecode(), sout_MuxSendBuffer(), stream_DemuxSend(), and VoutDisplayEventKey().
| void block_FifoRelease | ( | block_fifo_t * | p_fifo | ) |
| block_t* block_FifoShow | ( | block_fifo_t * | p_fifo | ) |
Peeks the first block in the FIFO.
If necessary, wait until there is one block. This function is (always) a cancellation point.
References block_fifo_t::lock, mutex_cleanup_push, block_fifo_t::p_first, vlc_cleanup_run, vlc_cond_wait(), vlc_mutex_lock(), vlc_testcancel(), and block_fifo_t::wait.
Referenced by sout_MuxGetStream().
| size_t block_FifoSize | ( | const block_fifo_t * | p_fifo | ) |
References block_fifo_t::i_size.
Referenced by input_DecoderDecode(), and input_DecoderGetFifoSize().
| void block_FifoWake | ( | block_fifo_t * | p_fifo | ) |
References block_fifo_t::b_force_wake, block_fifo_t::lock, block_fifo_t::p_first, vlc_cond_broadcast(), vlc_mutex_lock(), vlc_mutex_unlock(), and block_fifo_t::wait.
Referenced by input_DecoderWaitBuffering().
| block_t* block_File | ( | int | fd | ) |
Loads a file into a block of memory.
If possible a private file mapping is created. Otherwise, the file is read normally. On 32-bits platforms, this function will not work for very large files, due to memory space constraints. Cancellation point.
| fd | file descriptor to load from |
References block_Alloc(), block_cleanup_push, block_mmap_Alloc(), block_Release(), block_t::p_buffer, pread(), S_TYPEISSHM, and vlc_cleanup_pop.
Referenced by test_block_File().
| block_t* block_heap_Alloc | ( | void * | addr, | |
| size_t | length | |||
| ) |
Creates a block from a heap allocation.
This is provided by LibVLC so that manually heap-allocated blocks can safely be deallocated even after the origin plugin has been unloaded from memory.
When block_Release() is called, VLC will free() the specified pointer.
| ptr | base address of the heap allocation (will be free()'d) | |
| length | bytes length of the heap allocation |
References block_Init(), and block_t::pf_release.
| static void block_heap_Release | ( | block_t * | block | ) | [static] |
References block_Invalidate(), and block_t::p_start.
| void block_Init | ( | block_t *restrict | b, | |
| void * | buf, | |||
| size_t | size | |||
| ) |
Referenced by block_Alloc(), and block_heap_Alloc().
| static void block_Invalidate | ( | block_t * | block | ) | [static] |
References barrier(), block_Check(), block_t::p_next, and block_t::pf_release.
Referenced by block_heap_Release(), and BlockRelease().
| block_t* block_mmap_Alloc | ( | void * | addr, | |
| size_t | length | |||
| ) |
Referenced by block_File().
References block_Alloc(), block_Check(), block_Release(), BLOCK_WASTE_SIZE, BlockMetaCopy(), block_t::i_buffer, block_t::i_size, block_t::p_buffer, and block_t::p_start.
Referenced by stream_BlockRemaining(), and test_block().
References block_t::i_dts, block_t::i_flags, block_t::i_length, block_t::i_nb_samples, block_t::i_pts, and block_t::p_next.
Referenced by block_Realloc().
| static void BlockNoRelease | ( | block_t * | b | ) | [static] |
Referenced by block_Check().
| static void BlockRelease | ( | block_t * | block | ) | [static] |
References block_Invalidate().
| static ssize_t pread | ( | int | fd, | |
| const void * | buf, | |||
| size_t | size, | |||
| off_t | offset | |||
| ) | [static] |
Referenced by block_File().
| static ssize_t pwrite | ( | int | fd, | |
| const void * | buf, | |||
| size_t | size, | |||
| off_t | offset | |||
| ) | [static] |
1.7.1