vlc_picture_fifo.h 2.74 KB
Newer Older
1 2 3
/*****************************************************************************
 * vlc_picture_fifo.h: picture fifo definitions
 *****************************************************************************
Jean-Baptiste Kempf's avatar
LGPL  
Jean-Baptiste Kempf committed
4
 * Copyright (C) 2009 VLC authors and VideoLAN
5 6 7 8
 * $Id$
 *
 * Authors: Laurent Aimar <fenrir _AT_ videolan _DOT_ org>
 *
Jean-Baptiste Kempf's avatar
LGPL  
Jean-Baptiste Kempf committed
9 10 11
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation; either version 2.1 of the License, or
12 13 14 15
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Jean-Baptiste Kempf's avatar
LGPL  
Jean-Baptiste Kempf committed
16 17
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU Lesser General Public License for more details.
18
 *
Jean-Baptiste Kempf's avatar
LGPL  
Jean-Baptiste Kempf committed
19 20 21
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
 *****************************************************************************/

#ifndef VLC_PICTURE_FIFO_H
#define VLC_PICTURE_FIFO_H 1

/**
 * \file
 * This file defines picture fifo structures and functions in vlc
 */

#include <vlc_picture.h>

/**
 * Picture fifo handle
 *
 * It is thread safe (push/pop).
 */
typedef struct picture_fifo_t picture_fifo_t;

/**
 * It creates an empty picture_fifo_t.
 */
44
VLC_API picture_fifo_t * picture_fifo_New( void ) VLC_USED;
45 46 47 48 49 50

/**
 * It destroys a fifo created by picture_fifo_New.
 *
 * All pictures inside the fifo will be released by picture_Release.
 */
51
VLC_API void picture_fifo_Delete( picture_fifo_t * );
52 53 54 55 56 57

/**
 * It retreives a picture_t from the fifo.
 *
 * If the fifo is empty, it return NULL without waiting.
 */
58
VLC_API picture_t * picture_fifo_Pop( picture_fifo_t * ) VLC_USED;
59 60 61 62 63 64 65 66

/**
 * It returns the first picture_t pointer from the fifo but does not
 * remove it. The picture returned has been hold for you so you
 * must call picture_Release on it.
 *
 * If the fifo is empty, it return NULL without waiting.
 */
67
VLC_API picture_t * picture_fifo_Peek( picture_fifo_t * ) VLC_USED;
68 69 70 71

/**
 * It saves a picture_t into the fifo.
 */
72
VLC_API void picture_fifo_Push( picture_fifo_t *, picture_t * );
73 74 75

/**
 * It release all picture inside the fifo that have a lower or equal date
76
 * if flush_before or higher or equal to if not flush_before than the given one.
77 78 79
 *
 * All pictures inside the fifo will be released by picture_Release.
 */
80
VLC_API void picture_fifo_Flush( picture_fifo_t *, mtime_t date, bool flush_before );
81 82 83 84

/**
 * It applies a delta on all the picture timestamp.
 */
85
VLC_API void picture_fifo_OffsetDate( picture_fifo_t *, mtime_t delta );
86 87 88 89


#endif /* VLC_PICTURE_FIFO_H */