xine-lib: xine-lib-1.2.12/src/xine-engine/lrb.h Source File

xine-lib 1.2.12

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
31 int max_num_entries;
32 int cur_num_entries;
33
34 buf_element_t *newest, *oldest;
35 fifo_buffer_t *fifo;
36
37} lrb_t;
38
39
40 lrb_t *lrb_new (int max_num_entries,
41 fifo_buffer_t *fifo) ;
42
43void lrb_drop (lrb_t *this) ;
44
45void lrb_add (lrb_t *this, buf_element_t *buf) ;
46
47void lrb_feedback (lrb_t *this, fifo_buffer_t *fifo) ;
48
49void lrb_flush (lrb_t *this) ;
50
51#endif
buffer.h
lrb_drop
void lrb_drop(lrb_t *this)
Definition: lrb.c:44
lrb_add
void lrb_add(lrb_t *this, buf_element_t *buf)
Definition: lrb.c:58
lrb_feedback
void lrb_feedback(lrb_t *this, fifo_buffer_t *fifo)
Definition: lrb.c:83
lrb_flush
void lrb_flush(lrb_t *this)
Definition: lrb.c:116
lrb_new
lrb_t * lrb_new(int max_num_entries, fifo_buffer_t *fifo)
Definition: lrb.c:28
buf_element_s
Definition: buffer.h:338
fifo_buffer_s
Definition: buffer.h:593
lrb_t
Definition: lrb.h:29
lrb_t::cur_num_entries
int cur_num_entries
Definition: lrb.h:32
lrb_t::max_num_entries
int max_num_entries
Definition: lrb.h:31
lrb_t::fifo
fifo_buffer_t * fifo
Definition: lrb.h:35
lrb_t::newest
buf_element_t * newest
Definition: lrb.h:34