Commit 887af03f authored by Steve Lhomme's avatar Steve Lhomme
Browse files

picture_fifo: add picture_fifo_Peek

parent d63659ad
......@@ -56,6 +56,13 @@ VLC_API void picture_fifo_Delete( picture_fifo_t * );
*/
VLC_API picture_t * picture_fifo_Pop( picture_fifo_t * ) VLC_USED;
/**
* It peeks the front picture_t of the fifo.
*
* If the fifo is empty, it return NULL without waiting.
*/
VLC_API picture_t * picture_fifo_Peek( picture_fifo_t * ) VLC_USED;
/**
* It returns whether the fifo is empty or not.
*/
......
......@@ -314,6 +314,7 @@ picture_fifo_Delete
picture_fifo_Flush
picture_fifo_New
picture_fifo_IsEmpty
picture_fifo_Peek
picture_fifo_Pop
picture_fifo_Push
picture_New
......
......@@ -67,6 +67,14 @@ picture_t *picture_fifo_Pop(picture_fifo_t *fifo)
return picture;
}
picture_t *picture_fifo_Peek(picture_fifo_t *fifo)
{
vlc_mutex_lock(&fifo->lock);
picture_t *picture = vlc_picture_chain_PeekFront( &fifo->pics );
vlc_mutex_unlock(&fifo->lock);
return picture;
}
bool picture_fifo_IsEmpty(picture_fifo_t *fifo)
{
vlc_mutex_lock(&fifo->lock);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment