A memory buffer for storing captured frames, for use by VCS's recording subsystem.More...
|initialize(const size_t frameCapacity=10)|
A memory buffer for storing captured frames, for use by VCS's recording subsystem.
This buffer allocates memory using VCS's memory subsystem for a given fixed number of captured frames, and provides access to the memory via a LIFO-like (last in, first out) queue interface.
The buffer provides the queue-like commands push() and pop(), of which push() marks the next available frame slot in the buffer as being in use and returns a pointer to its memory (which is big enough to hold one captured frame). This memory is available to the caller until it's marked by a call to pop() as no longer being in use, after which it's made available to subsequent push() calls. In LIFO fashion, the slot reserved by the most recent call to push() will be the last to be unreserved by pop().
- Initialize the buffer by calling initialize().
- To add a captured frame into the buffer, call push() to obtain a pointer to the next available frame slot, then copy the frame's pixel data into this memory area. The memory area is large enough to hold the maximum frame size supported by the buffer.
- To retrieve and remove a frame from the buffer in LIFO fashion, call pop() and copy the frame pixel data from the memory to which the function returns a pointer.
- When you no longer need the buffer, release it by calling release().
Returns true if the buffer currently has no frame slots reserved; false otherwise.
Returns true if the buffer is currently at maximum capacity; false otherwise.
Initializes the buffer, allocating memory to hold at most the number of frames given by frameCapacity.
Unreserves a frame slot in the queue and returns a pointer to its memory.
Reserves a frame slot in the buffer and returns a pointer to its memory.
Releases the buffer.
Resets the buffer to an empty state.
Returns as a percentage (0–100) the amount of buffer capacity currently in use.
Specifies the maximum height of frame that the buffer can store.
Specifies the maximum width of frame that the buffer can store.
A convenience mutex for use by the recording subsystem.
Not used by the class itself.
An extra memory buffer for any temporary frame operations the VCS video recording subsystem might need to do.
The buffer has room for one captured frame.
It's likely that this buffer will be removed in a future version of VCS, since it's a bit of a temporary kludge.
This buffer's memory won't be allocated until initialize() is called.