|
vdr-plugin-softhddevice-drm-gles 1.5.9-20e15de
|
cSoftHdRingbuffer - RingBuffer class More...
#include <ringbuffer.h>
Public Member Functions | |
| cSoftHdRingbuffer (size_t) | |
| cSoftHdRingbuffer constructor | |
| ~cSoftHdRingbuffer (void) | |
| cSoftHdRingbuffer destructor | |
| void | Reset (void) |
| Reset ring buffer pointers. | |
| size_t | Write (const void *, size_t) |
| Write to a ring buffer. | |
| size_t | GetWritePointer (void **) |
| Get write pointer and free bytes at this position of ring buffer. | |
| size_t | WriteAdvance (size_t) |
| Advance write pointer in ring buffer. | |
| size_t | Read (void *, size_t) |
| Read from a ring buffer. | |
| size_t | GetReadPointer (const void **) |
| Get read pointer and used bytes at this position of ring buffer. | |
| size_t | ReadAdvance (size_t) |
| Advance read pointer in ring buffer. | |
| size_t | FreeBytes (void) |
| Get free bytes in ring buffer. | |
| size_t | UsedBytes (void) |
| Get used bytes in ring buffer. | |
Private Attributes | |
| char * | m_pBuffer |
| ring buffer data | |
| const char * | m_pBufferEnd |
| end of buffer | |
| size_t | m_size |
| bytes in buffer (for faster calc) | |
| const char * | m_pReadPointer |
| only used by reader | |
| char * | m_pWritePointer |
| only used by writer | |
| atomic_t | m_filled |
| how many of the buffer is used | |
cSoftHdRingbuffer - RingBuffer class
Definition at line 42 of file ringbuffer.h.
| cSoftHdRingbuffer::cSoftHdRingbuffer | ( | size_t | size | ) |
cSoftHdRingbuffer constructor
Init a new ring buffer
| size | Size of the ring buffer |
Definition at line 45 of file ringbuffer.cpp.
References atomic_set, LOGFATAL, m_filled, m_pBuffer, m_pBufferEnd, m_pReadPointer, and m_pWritePointer.
| cSoftHdRingbuffer::~cSoftHdRingbuffer | ( | void | ) |
| size_t cSoftHdRingbuffer::FreeBytes | ( | void | ) |
Get free bytes in ring buffer.
Definition at line 290 of file ringbuffer.cpp.
References atomic_read, m_filled, and m_size.
Referenced by cSoftHdAudio::GetFreeBytes(), and cSoftHdAudio::IsBufferFull().
| size_t cSoftHdRingbuffer::GetReadPointer | ( | const void ** | rp | ) |
Get read pointer and used bytes at this position of ring buffer.
| [out] | rp | Read pointer is placed here |
Definition at line 265 of file ringbuffer.cpp.
References atomic_read, m_filled, m_pBufferEnd, and m_pReadPointer.
Referenced by cSoftHdAudio::CyclicCall().
| size_t cSoftHdRingbuffer::GetWritePointer | ( | void ** | wp | ) |
Get write pointer and free bytes at this position of ring buffer.
| [out] | wp | Write pointer is placed here |
Definition at line 160 of file ringbuffer.cpp.
References atomic_read, m_filled, m_pBufferEnd, m_pWritePointer, and m_size.
| size_t cSoftHdRingbuffer::Read | ( | void * | buf, |
| size_t | cnt | ||
| ) |
Read from a ring buffer.
| buf | buffer of cnt bytes to be read |
| cnt | Number of bytes to be read |
Definition at line 224 of file ringbuffer.cpp.
References atomic_read, atomic_sub, m_filled, m_pBuffer, m_pBufferEnd, and m_pReadPointer.
| size_t cSoftHdRingbuffer::ReadAdvance | ( | size_t | cnt | ) |
Advance read pointer in ring buffer.
| cnt | Number of bytes to be advanced |
Definition at line 187 of file ringbuffer.cpp.
References atomic_read, atomic_sub, m_filled, m_pBuffer, m_pBufferEnd, and m_pReadPointer.
Referenced by cSoftHdAudio::CyclicCall(), and cSoftHdAudio::DropSamplesOlderThanPtsMs().
| void cSoftHdRingbuffer::Reset | ( | void | ) |
Reset ring buffer pointers.
Definition at line 68 of file ringbuffer.cpp.
References atomic_set, m_filled, m_pBuffer, m_pReadPointer, and m_pWritePointer.
Referenced by cSoftHdAudio::FlushBuffers().
| size_t cSoftHdRingbuffer::UsedBytes | ( | void | ) |
Get used bytes in ring buffer.
Definition at line 300 of file ringbuffer.cpp.
References atomic_read, and m_filled.
Referenced by cSoftHdAudio::DropSamplesOlderThanPtsMs(), cSoftHdAudio::GetOutputPtsMsInternal(), and cSoftHdAudio::GetUsedBytes().
| size_t cSoftHdRingbuffer::Write | ( | const void * | buf, |
| size_t | cnt | ||
| ) |
Write to a ring buffer.
| buf | buffer of cnt bytes to be written |
| cnt | Number of bytes in buffer |
Definition at line 119 of file ringbuffer.cpp.
References atomic_add, atomic_read, m_filled, m_pBuffer, m_pBufferEnd, m_pWritePointer, and m_size.
Referenced by cSoftHdAudio::Enqueue().
| size_t cSoftHdRingbuffer::WriteAdvance | ( | size_t | cnt | ) |
Advance write pointer in ring buffer.
| cnt | Number of bytes to be adavanced |
Definition at line 82 of file ringbuffer.cpp.
References atomic_add, atomic_read, m_filled, m_pBuffer, m_pBufferEnd, m_pWritePointer, and m_size.
|
private |
how many of the buffer is used
Definition at line 65 of file ringbuffer.h.
Referenced by cSoftHdRingbuffer(), FreeBytes(), GetReadPointer(), GetWritePointer(), Read(), ReadAdvance(), Reset(), UsedBytes(), Write(), and WriteAdvance().
|
private |
ring buffer data
Definition at line 58 of file ringbuffer.h.
Referenced by cSoftHdRingbuffer(), Read(), ReadAdvance(), Reset(), Write(), WriteAdvance(), and ~cSoftHdRingbuffer().
|
private |
end of buffer
Definition at line 59 of file ringbuffer.h.
Referenced by cSoftHdRingbuffer(), GetReadPointer(), GetWritePointer(), Read(), ReadAdvance(), Write(), and WriteAdvance().
|
private |
only used by reader
Definition at line 61 of file ringbuffer.h.
Referenced by cSoftHdRingbuffer(), GetReadPointer(), Read(), ReadAdvance(), and Reset().
|
private |
only used by writer
Definition at line 62 of file ringbuffer.h.
Referenced by cSoftHdRingbuffer(), GetWritePointer(), Reset(), Write(), and WriteAdvance().
|
private |
bytes in buffer (for faster calc)
Definition at line 60 of file ringbuffer.h.
Referenced by FreeBytes(), GetWritePointer(), Write(), and WriteAdvance().