MediaBuffer.hh:
#ifndef Live555_MediaBuffer_h
#define Live555_MediaBuffer_h
#include <sys/types.h>
//#ifndef _BOOLEAN_HH
//#include "Boolean.hh"
//#endif
#include <pthread.h>
class MediaBuffer{
private:
unsigned char *m_lpData; // the whole buffer
int m_iCapacity; // the total size of the buffer
int m_iWriteOffset; // where the encode begins to write to
int m_iWritableSize; // how many data is available to write
int m_iReadOffset; // where the broadcast begins to read from
int m_iReadableSize; // how many data is available to read
//pthread_mutex_t m_lock; // lock
//pthread_cond_t m_writeCond; // write condition
public:
pthread_mutex_t m_lock; // lock
pthread_cond_t m_readCond; // read condition
public:
MediaBuffer(int iCapacity);
~MediaBuffer();
public:
bool hasAvailableDataToWrite() { return m_iWritableSize > 0; }
bool hasAvail