fifo.h 816 Bytes
Newer Older
Benoit Steiner's avatar
Benoit Steiner committed
1 2 3 4
 /* VideoLAN VLANbridge: fifo management
 *
 * Definition file
 *
Benoit Steiner's avatar
Benoit Steiner committed
5
 * You need to include "performer.h" before this file
Benoit Steiner's avatar
Benoit Steiner committed
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
*/


#ifndef _FIFO_H
#define _FIFO_H

/* Size of the FIFO */
#define FIFO_SIZE 5

/* Structure used to describe the fifo */
struct s_Fifo
{
  int iSize;
  struct s_Request* asrData[FIFO_SIZE];
  
  /* Pointer to the address of the array where to pull */
  struct s_Request** psrWhereToPull;
  /* Pointer to the addess where to push */
  struct s_Request** psrWhereToPush;

  /* Private signal */
  pthread_cond_t FifoSignal;

  /* Private mutex */
  pthread_mutex_t FifoLock;
};

struct s_Fifo* FifoCreate();
34
int FifoDestroy(struct s_Fifo* psfFifo);
Benoit Steiner's avatar
Benoit Steiner committed
35 36 37 38 39
int FifoPush(struct s_Fifo* psfFifo, struct s_Request* psrToStore);
int FifoPull(struct s_Fifo* psfFifo, struct s_Request** psrRequest);


#endif