A thread-safe dynamic memory stream for online data (e.g. voice chat or network audio). New data can be uploaded at runtime while the cursor reads from it.
More...
#include <Stream/COnlineMemoryStream.h>
|
| virtual IStreamCursor * | createCursor () |
| | Create a new online cursor.
|
| unsigned char * | getDataBuffer () |
| | Get pointer to the underlying buffer.
|
| int | getDataBufferSize () |
| | Get total size of available data.
|
| virtual void | uploadData (unsigned char *buffer, int size) |
| | Append new data to the stream. Thread-safe.
|
| IMutex * | getMutex () |
| | Get the internal synchronization mutex.
|
| void | setFullData (bool b) |
| | Mark the stream as finished (no more data will be uploaded).
|
| bool | isFullData () |
| | Check if the stream is marked as complete.
|
| bool | isStopStream () |
| | Check if the stream has been stopped.
|
| void | setStopStream (bool b) |
| | Stop the stream.
|
| virtual void | trim (int position) |
| | Remove data before the specified position.
|
| virtual void | stopStream () |
| | Stop the stream and clear all buffers.
|
|
virtual void | grab () |
| | Increment reference count.
|
| virtual bool | drop () |
| | Decrement reference count and delete if zero.
|
| int | getSampleRate () |
| | Get expected sample rate (for recorder/procedural streams).
|
| int | getChannels () |
| | Get number of channels (for recorder/procedural streams).
|
| void | setStreamAudio (int sampleRate, int channels) |
| | Set stream audio properties.
|
|
|
unsigned char * | m_buffer |
|
int | m_size |
|
int | m_allocSize |
|
IMutex * | m_mutex |
|
bool | m_fullDataStream |
|
bool | m_stopStream |
|
int | m_referenceCount |
|
int | m_sampleRate |
|
int | m_channels |
A thread-safe dynamic memory stream for online data (e.g. voice chat or network audio). New data can be uploaded at runtime while the cursor reads from it.
◆ createCursor()
| virtual IStreamCursor * Skylicht::Audio::COnlineMemoryStream::createCursor |
( |
| ) |
|
|
virtual |
◆ getDataBuffer()
| unsigned char * Skylicht::Audio::COnlineMemoryStream::getDataBuffer |
( |
| ) |
|
Get pointer to the underlying buffer.
- Note
- Must lock the stream mutex before access.
- Returns
- Pointer to unsigned char buffer
◆ getDataBufferSize()
| int Skylicht::Audio::COnlineMemoryStream::getDataBufferSize |
( |
| ) |
|
Get total size of available data.
- Note
- Must lock the stream mutex before access.
- Returns
- Size in bytes
◆ getMutex()
| IMutex * Skylicht::Audio::COnlineMemoryStream::getMutex |
( |
| ) |
|
|
inline |
Get the internal synchronization mutex.
- Returns
- Pointer to IMutex
◆ isFullData()
| bool Skylicht::Audio::COnlineMemoryStream::isFullData |
( |
| ) |
|
|
inline |
Check if the stream is marked as complete.
- Returns
- True if complete
◆ isStopStream()
| bool Skylicht::Audio::COnlineMemoryStream::isStopStream |
( |
| ) |
|
|
inline |
Check if the stream has been stopped.
- Returns
- True if stopped
◆ setFullData()
| void Skylicht::Audio::COnlineMemoryStream::setFullData |
( |
bool | b | ) |
|
|
inline |
Mark the stream as finished (no more data will be uploaded).
- Parameters
-
| b | True if the stream is complete |
◆ setStopStream()
| void Skylicht::Audio::COnlineMemoryStream::setStopStream |
( |
bool | b | ) |
|
|
inline |
Stop the stream.
- Parameters
-
◆ stopStream()
| virtual void Skylicht::Audio::COnlineMemoryStream::stopStream |
( |
| ) |
|
|
virtual |
◆ trim()
| virtual void Skylicht::Audio::COnlineMemoryStream::trim |
( |
int | position | ) |
|
|
virtual |
Remove data before the specified position.
- Parameters
-
| position | Number of bytes to trim from the start |
◆ uploadData()
| virtual void Skylicht::Audio::COnlineMemoryStream::uploadData |
( |
unsigned char * | buffer, |
|
|
int | size ) |
|
virtual |
Append new data to the stream. Thread-safe.
- Parameters
-
| buffer | Data to upload |
| size | Size in bytes |
Reimplemented from Skylicht::Audio::IStream.
The documentation for this class was generated from the following file: