xine-lib  1.2.9
lrb.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2001-2009 the xine project
3  *
4  * This file is part of xine, a free video player.
5  *
6  * xine is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * xine is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
19  *
20  * lrb : limited ring buffer
21  * used for temporal buffer, limited to n elements
22  */
23 
24 #ifndef HAVE_LRB_H
25 #define HAVE_LRB_H
26 
27 #include <xine/buffer.h>
28 
29 typedef struct {
30 
33 
34  buf_element_t *newest, *oldest;
36 
37 } lrb_t;
38 
39 
40 lrb_t *lrb_new (int max_num_entries,
41  fifo_buffer_t *fifo) ;
42 
43 void lrb_drop (lrb_t *this) ;
44 
45 void lrb_add (lrb_t *this, buf_element_t *buf) ;
46 
47 void lrb_feedback (lrb_t *this, fifo_buffer_t *fifo) ;
48 
49 void lrb_flush (lrb_t *this) ;
50 
51 #endif
Definition: buffer.h:334
buf_element_t * oldest
Definition: lrb.h:34
int cur_num_entries
Definition: lrb.h:32
Definition: lrb.h:29
lrb_t * lrb_new(int max_num_entries, fifo_buffer_t *fifo)
Definition: lrb.c:28
void lrb_add(lrb_t *this, buf_element_t *buf)
Definition: lrb.c:58
int max_num_entries
Definition: lrb.h:31
fifo_buffer_t * fifo
Definition: lrb.h:35
void lrb_drop(lrb_t *this)
Definition: lrb.c:44
void lrb_flush(lrb_t *this)
Definition: lrb.c:116
Definition: buffer.h:578
void lrb_feedback(lrb_t *this, fifo_buffer_t *fifo)
Definition: lrb.c:83