acl/decompression/database/null_database_streamer.h¶
#include "acl/decompression/database/null_database_streamer.h"
A database streamer for bulk data that is already in memory.
null_database_streamer¶
class null_database_streamer final : public acl::database_streamer
Implements a null streamer where we simply use the provided bulk data buffer and perform no operations on it as everything is already streamed in. This streamer is the default in-memory streaming implementation. It cannot be shared between multiple tiers.
null_database_streamer::null_database_streamer¶
null_database_streamer(const uint8_t* bulk_data, uint32_t bulk_data_size)
Constructs a streamer for the given bulk data, already in memory. The buffer must stay valid as long as the streamer uses it.
null_database_streamer::is_initialized¶
virtual bool is_initialized() const override
Returns true if the streamer is initialized.
null_database_streamer::get_bulk_data¶
virtual const uint8_t* get_bulk_data(quality_tier tier) const override
Returns a valid pointer to the bulk data used to decompress from for the specified quality tier. Note that the pointer will not be used until after the first successful stream in request is completed. As such, it is safe to allocate the bulk data when the first stream in request happens.
null_database_streamer::stream_in¶
virtual void stream_in(
uint32_t offset,
uint32_t size,
bool can_allocate_bulk_data,
quality_tier tier,
streaming_request_id request_id) override
Called when we request some data to be streamed in. Only one stream in/out request can be in flight at a time per quality tier. Streaming in animation data can be done while animations are decompressing (async).
The offset into the bulk data and the size in bytes to stream in are provided as arguments. On the first stream in request, the bulk data can be allocated but its pointer cannot change with subsequent stream in requests until everything has been streamed out. Once the streaming request has been fulfilled (sync or async), call complete(..) or cancel(..) with the provided request ID.
null_database_streamer::stream_out¶
virtual void stream_out(
uint32_t offset,
uint32_t size,
bool can_deallocate_bulk_data,
quality_tier tier,
streaming_request_id request_id) override
Called when we request some data to be streamed out. Only one stream in/out request can be in flight at a time per quality tier. Streaming out animation data cannot be done while animations are decompressing. Doing so will result in undefined behavior as the data could be in use while we stream it out.
The offset into the bulk data and the size in bytes to stream out are provided as arguments. On the last stream out request, the bulk data can be deallocated. It will be allocated again if the data streams back in. Once the streaming request has been fulfilled (sync or async), call complete(..) or cancel(..) with the provided request ID.
A stream out request CANNOT be canceled!