◆ FifoBuffer() [1/2]
oboe::FifoBuffer::FifoBuffer |
( |
uint32_t | bytesPerFrame, |
|
|
uint32_t | capacityInFrames ) |
Construct a FifoBuffer
.
- Parameters
-
bytesPerFrame | amount of bytes for one frame |
capacityInFrames | the capacity of frames in fifo |
◆ FifoBuffer() [2/2]
oboe::FifoBuffer::FifoBuffer |
( |
uint32_t | bytesPerFrame, |
|
|
uint32_t | capacityInFrames, |
|
|
std::atomic< uint64_t > * | readCounterAddress, |
|
|
std::atomic< uint64_t > * | writeCounterAddress, |
|
|
uint8_t * | dataStorageAddress ) |
Construct a FifoBuffer
. To be used if the storage allocation is done outside of FifoBuffer.
- Parameters
-
bytesPerFrame | amount of bytes for one frame |
capacityInFrames | capacity of frames in fifo |
readCounterAddress | address of read counter |
writeCounterAddress | address of write counter |
dataStorageAddress | address of storage |
◆ convertFramesToBytes()
int32_t oboe::FifoBuffer::convertFramesToBytes |
( |
int32_t | frames | ) |
|
Convert a number of frames in bytes.
- Returns
- number of bytes
◆ getBufferCapacityInFrames()
uint32_t oboe::FifoBuffer::getBufferCapacityInFrames |
( |
| ) |
const |
Get the buffer capacity in frames.
- Returns
- number of frames
◆ getBytesPerFrame()
uint32_t oboe::FifoBuffer::getBytesPerFrame |
( |
| ) |
const |
|
inline |
Get the amount of bytes per frame.
- Returns
- number of bytes per frame
◆ getFullFramesAvailable()
uint32_t oboe::FifoBuffer::getFullFramesAvailable |
( |
| ) |
|
|
inline |
Get the number of frames in the fifo.
- Returns
- number of frames actually in the buffer
◆ getReadCounter()
uint64_t oboe::FifoBuffer::getReadCounter |
( |
| ) |
const |
|
inline |
Get the position of read counter.
- Returns
- position of read counter
◆ getWriteCounter()
uint64_t oboe::FifoBuffer::getWriteCounter |
( |
| ) |
|
|
inline |
Get the position of write counter.
- Returns
- position of write counter
◆ read()
int32_t oboe::FifoBuffer::read |
( |
void * | destination, |
|
|
int32_t | framesToRead ) |
Read framesToRead or, if not enough, then read as many as are available.
- Parameters
-
destination | |
framesToRead | number of frames requested |
- Returns
- number of frames actually read
◆ readNow()
int32_t oboe::FifoBuffer::readNow |
( |
void * | destination, |
|
|
int32_t | numFrames ) |
Calls read(). If all of the frames cannot be read then the remainder of the buffer is set to zero.
- Parameters
-
destination | |
framesToRead | number of frames requested |
- Returns
- number of frames actually read
◆ setReadCounter()
void oboe::FifoBuffer::setReadCounter |
( |
uint64_t | n | ) |
|
|
inline |
Set the position of read counter.
- Parameters
-
n | position of read counter |
◆ setWriteCounter()
void oboe::FifoBuffer::setWriteCounter |
( |
uint64_t | n | ) |
|
|
inline |
Set the position of write counter.
- Parameters
-
n | position of write counter |
◆ write()
int32_t oboe::FifoBuffer::write |
( |
const void * | source, |
|
|
int32_t | framesToWrite ) |
Write framesToWrite or, if too enough, then write as many as the fifo are not empty.
- Parameters
-
destination | |
framesToWrite | number of frames requested |
- Returns
- number of frames actually write
The documentation for this class was generated from the following file: