![]() |
VRS
A file format for sensor data.
|
Helper functions to read & write description records. More...
Enumerations | |
enum | { kLegacyDescriptionFormatVersion = 1 , kDescriptionFormatVersion = 2 } |
Description record format version. More... | |
Functions | |
int | writeDescriptionRecord (WriteFileHandler &file, const map< StreamId, const StreamTags * > &streamTags, const map< string, string > &fileTags, uint32_t &outPreviousRecordSize) |
int | readDescriptionRecord (FileHandler &file, uint32_t recordHeaderSize, uint32_t &outDescriptionRecordSize, map< StreamId, StreamTags > &outStreamTags, map< string, string > &outFileTags) |
void | upgradeStreamTags (map< string, string > &streamTags) |
void | createStreamSerialNumbers (const map< string, string > &inFileTags, map< StreamId, StreamTags > &inOutStreamTags) |
Helper functions to read & write description records.
anonymous enum |
void vrs::DescriptionRecord::createStreamSerialNumbers | ( | const map< string, string > & | inFileTags, |
map< StreamId, StreamTags > & | inOutStreamTags | ||
) |
Streams did not always have a serial number generated at creation. To simplify backward compatibility with existing files, when opening a file, we generate a deterministic serial number for each stream, if there isn't one already. That serial number is a hash of the file tags, that stream's tags, and the stream's type and sequence number, so that reprocessed or split files generate the same serial numbers.
inFileTags | the file's tags. |
inOutStreamTags | stream tags with or without serial numbers. On exit, every stream will have a unique serial number, preserving existing values. |
int vrs::DescriptionRecord::readDescriptionRecord | ( | FileHandler & | file, |
uint32_t | recordHeaderSize, | ||
uint32_t & | outDescriptionRecordSize, | ||
map< StreamId, StreamTags > & | outStreamTags, | ||
map< string, string > & | outFileTags | ||
) |
Read a description record, including both the record's header and the record's body.
void vrs::DescriptionRecord::upgradeStreamTags | ( | map< string, string > & | streamTags | ) |
Tags may need to be upgraded/cleaned-up. Currently, this process consists simply of making sure the original stream's name saved in VRS tags are stripped of a potential instance number, which used to be included. This clean-up is required for checksums compares to work as expected.
int vrs::DescriptionRecord::writeDescriptionRecord | ( | WriteFileHandler & | file, |
const map< StreamId, const StreamTags * > & | streamTags, | ||
const map< string, string > & | fileTags, | ||
uint32_t & | outPreviousRecordSize | ||
) |
Write a description record, including both the record's header and the record's body.