43 virtual void Add(
const char *pData,
int nBytes,
int bLast);
134 return mBuffer.get();
142 std::unique_ptr<char[]> mBuffer;
150 inline void CheckHeads();
The ring buffer the EE streams samples into.
Definition streambuffer.h:17
virtual ~StreamBuffer()
Free the buffer.
virtual void Poll()=0
Let the producer append what it has.
char * AcquireReadRun(int nMaxBytes, int *pnBytes)
Take the next run of bytes, after a Poll().
int mInputDone
Definition streambuffer.h:138
virtual void Add(const char *pData, int nBytes, int bLast)
Append bytes behind the write head, wrapping at the end of the buffer.
int BytesAvailable(int *pbInputDone)
Report the bytes the consumer has not taken yet.
bool IsEmpty()
Report whether the consumer has taken every byte appended so far.
int EmptySpaceForFilling()
Report the room the producer may fill, which keeps mMargin bytes free.
char * GetBuffer() const
Definition streambuffer.h:133
bool IsEof()
Report whether the consumer took every byte and the producer has no more.
void CommitReadRun(char **ppRun)
Release the run AcquireReadRun() handed out, Poll(), and clear the caller's pointer.
virtual void Rewind()
Move both heads back to the start of the buffer.
StreamBuffer(int nSize)
Allocate a cleared buffer.
int GetSize() const
Definition streambuffer.h:128
int g_nAddWasEntered
Non-zero while StreamBuffer::Add() runs.