acl/core/compressed_tracks.h¶
#include "acl/core/compressed_tracks.h"
The compressed tracks type.
compressed_tracks¶
class compressed_tracks final
An instance of a compressed tracks. The compressed data immediately follows this instance in memory. The total size of the buffer can be queried with get_size().
compressed_tracks::get_algorithm_type¶
algorithm_type8 get_algorithm_type() const
Returns the algorithm type used to compress the tracks.
compressed_tracks::get_size¶
uint32_t get_size() const
Returns the size in bytes of the compressed tracks. Includes the compressed_tracks instance size.
compressed_tracks::get_hash¶
uint32_t get_hash() const
Returns the hash for the compressed tracks. This is only used for sanity checking in case of memory corruption.
compressed_tracks::get_tag¶
buffer_tag32 get_tag() const
Returns the binary tag for the compressed tracks. This uniquely identifies the buffer as a proper compressed_tracks object.
compressed_tracks::get_version¶
compressed_tracks_version16 get_version() const
Returns the binary format version.
compressed_tracks::get_num_tracks¶
uint32_t get_num_tracks() const
Returns the number of tracks contained.
compressed_tracks::get_num_samples_per_track¶
uint32_t get_num_samples_per_track() const
Returns the number of samples each track contains. This does not account for the repeating first sample when the wrap looping policy is used. See sample_looping_policy for details.
compressed_tracks::get_track_type¶
track_type8 get_track_type() const
Returns the type of the compressed tracks.
compressed_tracks::get_duration¶
float get_duration(
sample_looping_policy looping_policy = sample_looping_policy::as_compressed) const
Returns the duration of each track. Note that when wrap policy is used, an extra repeating first sample is artificially inserted at the end of the clip. This artificial sample maps to the first sample, it only lives once in memory. This allows us to interpolate from the last sample back to the first sample when looping and wrapping during playback. See sample_looping_policy for details.
compressed_tracks::get_finite_duration¶
float get_finite_duration(
sample_looping_policy looping_policy = sample_looping_policy::as_compressed) const
Returns the finite duration of each track. Note that when wrap policy is used, an extra repeating first sample is artificially inserted at the end of the clip. This artificial sample maps to the first sample, it only lives once in memory. This allows us to interpolate from the last sample back to the first sample when looping and wrapping during playback. See sample_looping_policy for details.
compressed_tracks::get_sample_rate¶
float get_sample_rate() const
Returns the sample rate used by each track.
compressed_tracks::has_database¶
bool has_database() const
Returns whether or not this clip is split into a compressed database instance. Only supported with vqv transform tracks.
compressed_tracks::has_trivial_default_values¶
bool has_trivial_default_values() const
Returns whether or not every sub-track's default value is trivial (aka the identity). Non-trivial default values indicate that extra data beyond the clip will be needed at decompression (e.g. bind pose) Only supported with vqv transform tracks.
compressed_tracks::has_stripped_keyframes¶
bool has_stripped_keyframes() const
Returns whether or not this clip has had keyframes stripped. Only supported with vqv transform tracks.
compressed_tracks::get_default_scale¶
int32_t get_default_scale() const
Returns the default scale value used during compression. Depending on the additive type, this value will either be 0 or 1. Only supported with vqv transform tracks.
compressed_tracks::get_looping_policy¶
sample_looping_policy get_looping_policy() const
Returns the looping policy used during compression.
compressed_tracks::get_name¶
const char* get_name() const
Returns the track list name if metadata is present, nullptr otherwise.
compressed_tracks::get_track_name¶
const char* get_track_name(uint32_t track_index) const
Returns the track name for the specified track index if metadata is present, k_invalid_track_index otherwise.
compressed_tracks::get_parent_track_index¶
uint32_t get_parent_track_index(uint32_t track_index) const
Returns the parent track index for the specified track index if metadata is present, nullptr otherwise. Only supported with vqv transform tracks.
compressed_tracks::get_track_description¶
bool get_track_description(
uint32_t track_index,
track_desc_scalarf& out_description) const
bool get_track_description(
uint32_t track_index,
track_desc_transformf& out_description) const
Returns the track description for the specified track index if metadata is present. Returns true on success, false otherwise.
compressed_tracks::is_valid¶
error_result is_valid(bool check_hash) const
Returns true if the compressed tracks are valid and usable. This mainly validates some invariants as well as ensuring that the memory has not been corrupted.
Parameters
check_hash: If true, the compressed tracks hash will also be compared.
make_compressed_tracks¶
const compressed_tracks* make_compressed_tracks(
const void* buffer,
error_result* out_error_result = nullptr)
compressed_tracks* make_compressed_tracks(
void* buffer,
error_result* out_error_result = nullptr)
Create a compressed_tracks instance in place from a raw memory buffer. If the buffer does not contain a valid compressed_tracks instance, nullptr is returned along with an optional error result.