DASH Media Packaging SDK
|
Declaration of class which implements a thread-safe circular buffer. More...
#include <io_cache.h>
Public Member Functions | |
IoCache (uint64_t cache_size) | |
uint64_t | Read (void *buffer, uint64_t size) |
uint64_t | Write (const void *buffer, uint64_t size) |
void | Clear () |
Empties the cache. | |
void | Close () |
bool | closed () |
void | Reopen () |
Reopens the cache. Any data still in the cache will be lost. | |
uint64_t | BytesCached () |
uint64_t | BytesFree () |
void | WaitUntilEmptyOrClosed () |
Waits until the cache is empty or has been closed. | |
Declaration of class which implements a thread-safe circular buffer.
Definition at line 20 of file io_cache.h.
uint64_t shaka::media::IoCache::BytesCached | ( | ) |
Returns the number of bytes in the cache.
Definition at line 127 of file io_cache.cc.
uint64_t shaka::media::IoCache::BytesFree | ( | ) |
Returns the number of free bytes in the cache.
Definition at line 132 of file io_cache.cc.
void shaka::media::IoCache::Close | ( | ) |
Close the cache. This will call any blocking calls to unblock, and the cache won't be usable until Reopened.
Definition at line 111 of file io_cache.cc.
|
inline |
Definition at line 50 of file io_cache.h.
uint64_t shaka::media::IoCache::Read | ( | void * | buffer, |
uint64_t | size | ||
) |
Read data from the cache. This function may block until there is data in the cache.
buffer | is a buffer into which to read the data from the cache. |
size | is the size of buffer. |
Definition at line 40 of file io_cache.cc.
uint64_t shaka::media::IoCache::Write | ( | const void * | buffer, |
uint64_t | size | ||
) |
Write data to the cache. This function may block until there is enough room in the cache.
buffer | is a buffer containing the data to be written to the cache. |
size | is the size of the data to be written to the cache. |
Definition at line 68 of file io_cache.cc.