SASC
DVBSoftCAM

plugin_ringbuf.h

Go to the documentation of this file.
00001 #include <pthread.h>
00002 #include "process_req.h"
00003 #include "list.h"
00004 #include "messages.h"
00005 
00006 #define PLUGIN_RINGBUF 12
00007 
00008 #define TSPacketSIZE 188
00009 //#define RB_RESERVED 100000
00010 //#define RB_BUFSIZE ((2000000 / TSPacketSIZE) * TSPacketSIZE)
00011 //#define RB_BUFSIZE 1024 * TSPacketSIZE
00012 enum {
00013   RB_CLOSED = 0,
00014   RB_CLOSING,
00015   RB_OPEN
00016 };
00017 
00018 struct ringbuffer {
00019   struct list_head list;
00020   int virtfd;
00021   int fd;
00022   unsigned int flags;
00023   unsigned char num;
00024   unsigned char *rdPtr;
00025   unsigned char *wrPtr;
00026   unsigned char *end;
00027   pthread_mutex_t rw_lock;
00028   void (*release)(struct ringbuffer *);
00029   int readok;
00030   int state;
00031   unsigned long reserved;
00032   //buffer MUST be last do to our allocation method
00033   unsigned char *buffer;
00034 };
00035 
00036 void ringbuf_register_callback(int (* cb)(struct ringbuffer *, int));
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines