fifo.h

00001 /*****************************************************************
00002  * gmerlin - a general purpose multimedia framework and applications
00003  *
00004  * Copyright (c) 2001 - 2008 Members of the Gmerlin project
00005  * gmerlin-general@lists.sourceforge.net
00006  * http://gmerlin.sourceforge.net
00007  *
00008  * This program is free software: you can redistribute it and/or modify
00009  * it under the terms of the GNU General Public License as published by
00010  * the Free Software Foundation, either version 2 of the License, or
00011  * (at your option) any later version.
00012  *
00013  * This program is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016  * GNU General Public License for more details.
00017  *
00018  * You should have received a copy of the GNU General Public License
00019  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
00020  * *****************************************************************/
00021 
00022 #ifndef __BG_FIFO_H_
00023 #define __BG_FIFO_H_
00024 
00043 typedef enum
00044   {
00045     BG_FIFO_PLAYING, 
00046     BG_FIFO_STOPPED, 
00047     BG_FIFO_PAUSED,  
00048   } bg_fifo_state_t;
00049 
00055 typedef struct bg_fifo_s bg_fifo_t;
00056 
00064 bg_fifo_t * bg_fifo_create(int num_frames,
00065                            void * (*create_func)(void*), void * data);
00066 
00073 void bg_fifo_destroy(bg_fifo_t * f, void (*destroy_func)(void*, void*), void * data);
00074 
00083 void * bg_fifo_lock_read(bg_fifo_t * f, bg_fifo_state_t * state);
00084 
00092 void * bg_fifo_try_lock_read(bg_fifo_t*f, bg_fifo_state_t * state);
00093 
00097 void   bg_fifo_unlock_read(bg_fifo_t*f);
00098 
00107 void * bg_fifo_lock_write(bg_fifo_t*f, bg_fifo_state_t * state);
00108 
00115 void * bg_fifo_try_lock_write(bg_fifo_t*f, bg_fifo_state_t * state);
00116 
00117 
00123 void   bg_fifo_unlock_write(bg_fifo_t*f, int eof);
00124 
00130 void bg_fifo_set_state(bg_fifo_t * f, bg_fifo_state_t state);
00131 
00141 void bg_fifo_clear(bg_fifo_t *f );
00142 
00146 #endif //  __BG_FIFO_H_

Generated on Thu Dec 18 08:24:29 2008 for gmerlin by  doxygen 1.5.7.1