Shaka Packager SDK
|
#include <offset_byte_queue.h>
Public Member Functions | |
void | PeekAt (int64_t offset, const uint8_t **buf, int *size) |
bool | Trim (int64_t max_offset) |
int64_t | head () |
int64_t | tail () |
These work like their underlying ByteQueue counterparts. | |
void | Reset () |
void | Push (const uint8_t *buf, int size) |
void | Peek (const uint8_t **buf, int *size) |
void | Pop (int count) |
Wrapper around ByteQueue, which encapsulates the notion of a monotonically-increasing byte offset. All buffer access is done by passing these offsets into this class, reducing the proliferation of many different meanings of "offset", "head", etc.
Definition at line 20 of file offset_byte_queue.h.
|
inline |
Definition at line 53 of file offset_byte_queue.h.
void shaka::media::OffsetByteQueue::PeekAt | ( | int64_t | offset, |
const uint8_t ** | buf, | ||
int * | size | ||
) |
Set buf to point at the first buffered byte corresponding to offset, and size to the number of bytes available starting from that offset.
It is an error if the offset is before the current head. It's not an error if the current offset is beyond tail(), but you will of course get back a null buf and a size of zero.
Definition at line 43 of file offset_byte_queue.cc.
|
inline |
Definition at line 56 of file offset_byte_queue.h.
bool shaka::media::OffsetByteQueue::Trim | ( | int64_t | max_offset | ) |
Mark the bytes up to (but not including) max_offset as ready for deletion. This is relatively inexpensive, but will not necessarily reduce the resident buffer size right away (or ever).
Definition at line 53 of file offset_byte_queue.cc.