|
vdr-plugin-softhddevice-drm-gles 1.4.0
|
cSoftHdRingbuffer - RingBuffer class More...
#include <ringbuffer.h>
Public Member Functions | |
| cSoftHdRingbuffer (size_t) | |
| cSoftHdRingbuffer constructor More... | |
| virtual | ~cSoftHdRingbuffer (void) |
| cSoftHdRingbuffer destructor More... | |
| void | Reset (void) |
| Reset ring buffer pointers. More... | |
| size_t | Write (const void *, size_t) |
| Write to a ring buffer. More... | |
| size_t | GetWritePointer (void **) |
| Get write pointer and free bytes at this position of ring buffer. More... | |
| size_t | WriteAdvance (size_t) |
| Advance write pointer in ring buffer. More... | |
| size_t | Read (void *, size_t) |
| Read from a ring buffer. More... | |
| size_t | GetReadPointer (const void **) |
| Get read pointer and used bytes at this position of ring buffer. More... | |
| size_t | ReadAdvance (size_t) |
| Advance read pointer in ring buffer. More... | |
| size_t | FreeBytes (void) |
| Get free bytes in ring buffer. More... | |
| size_t | UsedBytes (void) |
| Get used bytes in ring buffer. More... | |
Private Attributes | |
| char * | m_pBuffer |
| ring buffer data More... | |
| const char * | m_pBufferEnd |
| end of buffer More... | |
| size_t | m_Size |
| bytes in buffer (for faster calc) More... | |
| const char * | m_pReadPointer |
| only used by reader More... | |
| char * | m_pWritePointer |
| only used by writer More... | |
| atomic_t | m_filled |
| how many of the buffer is used More... | |
cSoftHdRingbuffer - RingBuffer class
Definition at line 34 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 46 of file ringbuffer.cpp.
References atomic_set, LOGFATAL, m_filled, m_pBuffer, m_pBufferEnd, m_pReadPointer, m_pWritePointer, and m_Size.
|
virtual |
| size_t cSoftHdRingbuffer::FreeBytes | ( | void | ) |
Get free bytes in ring buffer.
Definition at line 291 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 266 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 161 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 225 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 188 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 69 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 301 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 120 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 83 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 57 of file ringbuffer.h.
Referenced by cSoftHdRingbuffer(), FreeBytes(), GetReadPointer(), GetWritePointer(), Read(), ReadAdvance(), Reset(), UsedBytes(), Write(), and WriteAdvance().
|
private |
ring buffer data
Definition at line 50 of file ringbuffer.h.
Referenced by cSoftHdRingbuffer(), Read(), ReadAdvance(), Reset(), Write(), WriteAdvance(), and ~cSoftHdRingbuffer().
|
private |
end of buffer
Definition at line 51 of file ringbuffer.h.
Referenced by cSoftHdRingbuffer(), GetReadPointer(), GetWritePointer(), Read(), ReadAdvance(), Write(), and WriteAdvance().
|
private |
only used by reader
Definition at line 53 of file ringbuffer.h.
Referenced by cSoftHdRingbuffer(), GetReadPointer(), Read(), ReadAdvance(), and Reset().
|
private |
only used by writer
Definition at line 54 of file ringbuffer.h.
Referenced by cSoftHdRingbuffer(), GetWritePointer(), Reset(), Write(), and WriteAdvance().
|
private |
bytes in buffer (for faster calc)
Definition at line 52 of file ringbuffer.h.
Referenced by cSoftHdRingbuffer(), FreeBytes(), GetWritePointer(), Write(), and WriteAdvance().