1 #ifndef TORCSEGMENTEDRINGBUFFER_H 2 #define TORCSEGMENTEDRINGBUFFER_H 8 #include <QReadWriteLock> 21 int Write (QByteArray *Data,
int Size);
22 int Write (
const uint8_t *Data,
int Size);
24 int ReadSegment (uint8_t *Data,
int Max,
int SegmentRef,
int Offset = 0);
53 #endif // TORCSEGMENTEDRINGBUFFER_H void InitSegmentReady(void)
int GetHead(void)
Return the number of the segment at the head of the queue (the newest).
QQueue< QPair< int, int > > m_segments
QByteArray GetInitSegment(void)
Return a copy of the MP4 'init' segment.
int m_currentStartPosition
QQueue< int > m_segmentRefs
~TorcSegmentedRingBuffer()
int GetSize(void)
Return the size of the buffer (NOT the number of segments).
int FinishSegment(bool Init)
Finish the current segment and start a new one.
int ReadSegment(uint8_t *Data, int Max, int SegmentRef, int Offset=0)
Copy Max bytes of a segment identified by SegmentRef into the memory pointed to at Dst...
void SegmentReady(int Segment)
void SegmentRemoved(int Segment)
int GetSegmentsAvail(int &TailRef)
Return the number of available segments.
int Write(QByteArray *Data, int Size)
TorcSegmentedRingBuffer(int Size, int MaxSegments)
void SaveInitSegment(void)
Save the MP4 'init' segment.
int GetBytesFree(void)
Return the number of free bytes available for writing.
QByteArray GetSegment(int SegmentRef)
Return a copy of the segment identified by SegmentRef.
QReadWriteLock m_segmentsLock