MCPcopy Create free account
hub / github.com/AgoraIO/API-Examples / getFreeSize

Method getFreeSize

windows/APIExample/APIExample/DirectShow/CircleBuffer.cpp:55–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53}
54
55unsigned int CircleBuffer::getFreeSize()
56{
57 unsigned int iNumBytesFree;
58
59 EnterCriticalSection(&this->m_csCircleBuffer);
60
61 if (this->m_iInternalWriteCursor < this->m_iInternalReadCursor)
62 iNumBytesFree = (this->m_iInternalReadCursor - 1) - this->m_iInternalWriteCursor;
63 else if (this->m_iInternalWriteCursor == this->m_iInternalReadCursor)
64 iNumBytesFree = this->m_iBufferSize;
65 else
66 iNumBytesFree = (this->m_iInternalReadCursor - 1) + (this->m_iBufferSize - this->m_iInternalWriteCursor);
67
68 LeaveCriticalSection(&this->m_csCircleBuffer);
69 return iNumBytesFree;
70}
71
72unsigned int CircleBuffer::getUsedSize()
73{

Callers 1

getUsedSizeMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected