1#ifndef _ONLINE_MEMORY_STREAM_H_
2#define _ONLINE_MEMORY_STREAM_H_
5#include "Thread/IMutex.h"
28 virtual ~COnlineMemoryStreamCursor();
32 virtual int read(
unsigned char* buff,
int len);
48 class COnlineMemoryStream :
public IStream
51 unsigned char* m_buffer;
56 bool m_fullDataStream;
60 COnlineMemoryStream();
61 virtual ~COnlineMemoryStream();
88 virtual void uploadData(
unsigned char* buffer,
int size);
105 m_fullDataStream = b;
114 return m_fullDataStream;
139 virtual void trim(
int position);
virtual int seek(int pos, EOrigin origin)
Move the cursor position.
virtual void trim()
Remove all data before the current cursor position from the stream.
virtual bool endOfStream()
Check if the cursor is at the end of the stream.
virtual int tell()
Get current cursor position.
virtual int size()
Get total size of the stream.
virtual int read(unsigned char *buff, int len)
Read data from the stream.
virtual bool readyReadData(int len)
Check if a certain amount of data is ready to be read.
A thread-safe dynamic memory stream for online data (e.g. voice chat or network audio)....
Definition COnlineMemoryStream.h:49
unsigned char * getDataBuffer()
Get pointer to the underlying buffer.
void setStopStream(bool b)
Stop the stream.
Definition COnlineMemoryStream.h:130
virtual void trim(int position)
Remove data before the specified position.
IMutex * getMutex()
Get the internal synchronization mutex.
Definition COnlineMemoryStream.h:94
bool isFullData()
Check if the stream is marked as complete.
Definition COnlineMemoryStream.h:112
virtual void stopStream()
Stop the stream and clear all buffers.
int getDataBufferSize()
Get total size of available data.
bool isStopStream()
Check if the stream has been stopped.
Definition COnlineMemoryStream.h:121
void setFullData(bool b)
Mark the stream as finished (no more data will be uploaded).
Definition COnlineMemoryStream.h:103
virtual void uploadData(unsigned char *buffer, int size)
Append new data to the stream. Thread-safe.
virtual IStreamCursor * createCursor()
Create a new online cursor.
Interface for a stream cursor, providing seek and read operations on an audio stream.
Definition IStream.h:39
EOrigin
Origin for seek operations.
Definition IStream.h:45
Handles all core audio functionality.
Definition AudioDebugLog.h:31
The foundation for thread and process handling.
Definition CNullMutex.h:32
Everything in the Skylicht Engine. You can start by looking at the topics.
Definition AudioDebugLog.h:29