VRS
A file format for sensor data.
Loading...
Searching...
No Matches
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
vrs Namespace Reference

Namespaces

namespace  datalayout_conventions
 Name and type conventions used to map ContentBlockReader needs to DataLayout data.
 
namespace  DescriptionRecord
 Helper functions to read & write description records.
 
namespace  FileDetailsCache
 Helper methods to read & write file details in a cache file.
 
namespace  FileFormat
 Namespace for key datastructures of a VRS file.
 
namespace  IndexRecord
 Namespace for index record related classes.
 
namespace  internal
 DataLayout private namespace for internal helper classes & functions.
 
namespace  RecordFileWriter_
 Namespace for RecordFileWriter's private implementation classes.
 
namespace  tag_conventions
 Namespace for tag names following standardized conventions.
 

Classes

class  AlignedBuffer
 
class  AsyncBuffer
 
class  AsyncDiskFileChunk
 
struct  AsyncFileDescriptor
 
class  AtomicDiskFile
 
class  AudioBlockReader
 Specialized version of ContentBlockReader to handle content blocks containing audio data. More...
 
class  AudioContentBlockSpec
 Specification of an audio content block. More...
 
class  AutoDataLayout
 Specialized DataLayout class to declare a DataLayout in struct format. More...
 
class  AutoDataLayoutEnd
 For use within an AutoDataLayout class, to end the AutoDataLayout's construction. More...
 
class  Bool
 Substitute for bool POD type, which can be used safely in DataPiece templates. More...
 
class  CompressedRecordReader
 RecordReader specialized to read compressed records. For VRS internal usage only. More...
 
class  Compressor
 Helper class to compress data using lz4 or zstd presets. More...
 
class  ContentBlock
 Specification of a VRS record content block. More...
 
class  ContentBlockId
 Helper to identify a particular content block within a file. More...
 
class  ContentBlockReader
 Abstract class to handle the interpretation of a record format's content block. More...
 
class  ContentParser
 RecordFormat string parsing helper class. More...
 
struct  CurrentRecord
 Class describing which record is being read. Most fields are really self explanatory. More...
 
class  CustomBlockReader
 Specialized version of ContentBlockReader to handle a content block containing custom data. Custom data is data which format/content is not known to VRS. More...
 
class  CustomContentBlock
 
class  DataLayout
 The DataLayout class describes the data stored inside a DataLayoutContentBlock. More...
 
class  DataLayoutBlockReader
 Specialized version of ContentBlockReader to handle DataLayout blocks. More...
 
struct  DataLayoutChunk
 Class referencing a DataLayout object, and abstracting the interactions for DataSource. More...
 
struct  DataLayoutStruct
 Helper class to include DataLayout structs containing a set of DataPieceXXX and DataLayoutStruct while preserving the required uniqueness of the field names. Embedded DataPiece objects will have a name automatically prefixed with the name of the DataLayoutStruct, with a '/' in between. More...
 
struct  DataLayoutStructArray
 Helper class to include DataLayout structs containing a sliced array of DataPieceXXX and DataLayoutStruct while preserving the required uniqueness of the field names. Embedded DataPiece objects will have a name automatically prefixed with the name of the DataLayoutStruct, with a '/0'... /Size-1' in between. More...
 
class  DataPiece
 Abstract class representing a piece of information part of a DataLayout. More...
 
class  DataPieceArray
 Fixed size array of POD values. More...
 
class  DataPieceEnum
 DataPieceValue specialization class to store enums more conveniently and safely. More...
 
class  DataPieceString
 DataPiece for variable length string. More...
 
class  DataPieceStringMap
 DataPiece map container, with string keys and values of type T. More...
 
class  DataPieceValue
 DataPiece for a single value of type T. The value is stored in DataLayout's fixed size buffer. More...
 
class  DataPieceVector
 Vector of type T and variable size. More...
 
class  DataReference
 Container of data pointers, to tell where to write data when reading a record. More...
 
class  DataSource
 A class referencing data to be captured in a record at creation. More...
 
class  DataSourceChunk
 Elementary part of a DataSource for a simple block of memory. More...
 
class  Decompressor
 Decompressor helper class, to decompresses data at a target location. More...
 
class  DirectWriteRecordData
 Class to hold data that is written directly in the file at the end of a record. Record data held by DataSource is copied in an internal buffer when the record is created, so it might be compressed, and the source buffers, including datalayouts, reused/modified, without risk of corrupting the record's data, at the expense of a memory copy. By using DirectWriteRecordData, you can avoid that copy, with the following limitations: More...
 
class  DiskFileChunk
 
class  DiskFileT
 FileHandler implementation for disk files, with chunked file support. More...
 
class  EmptyBlockReader
 Specialized version of ContentBlockReader to handle an empty content block. More...
 
class  EmptyDataLayout
 When you just need a placeholder for a DataLayout. More...
 
class  FileCache
 Utility class to manage various forms of file caching. Disabled by default. More...
 
class  FileDelegator
 Class to abstract the delegate file open operation for VRS file. More...
 
class  FileHandler
 Class to abstract VRS file system operations, to enable support for alternate storage methods, in particular network/cloud storage implementations. More...
 
class  FileHandlerFactory
 A factory system for FileHandlers, allowing the runtime registration & usage of custom FileHandler implementations. More...
 
struct  FileSpec
 Generalized file descriptor class, allowing the efficient representation of complex file objects, maybe multi-chunks, with additional optional properties. More...
 
class  ImageBlockReader
 Specialized version of ContentBlockReader to handle content blocks containing an image. More...
 
class  ImageContentBlockSpec
 Specification of an image content block. More...
 
struct  JsonFormatProfileSpec
 When printing out a DataLayout as json, this class allows to specify what should be included in the generated json message. More...
 
class  LegacyFormatsProvider
 System to inject record format & data layout definitions for files created without. More...
 
struct  LogEvent
 General purpose telemetry event. More...
 
class  ManualDataLayout
 Specialized DataLayout for programmatic DataLayout generation. More...
 
struct  MatrixND
 Class to represent matrices of 3 and 4 dimensions, each for either int32_t, float or double. More...
 
class  MultiRecordFileReader
 Facilitates reading multiple VRS files simultaneously. Records are sorted by timestamps across all the files, therefore it is essential that *** all the files must have their timestamps in the same time domain. *** Operates in a manner similar to RecordFileReader, but with multiple files. More...
 
class  NewChunkHandler
 Listener to be notified when a new file chunk is finalized. More...
 
class  NewChunkNotifier
 Helper to make new chunks notifications simpler and safer. More...
 
class  NonContiguousChunk
 Class to represent a data chunk composed of multiple smaller chunks that each have fixed offsets from each other in memory. More...
 
struct  OperationContext
 Context description for telemetry events. More...
 
class  OptionalDataPieces
 Helper function to allocate optional fields only when it is enabled. More...
 
struct  PointND
 POD type for of 2, 3 and 4 dimensions points, each for either int32_t, float or double. More...
 
class  ProgressLogger
 ProgressLogger class to be notified of some process' progress. More...
 
class  Record
 Essential VRS class holding a record's details and payload in memory during creation. More...
 
class  Recordable
 Class to override to implement a record producing device, or virtual device. More...
 
class  RecordFileReader
 The class to read VRS files. More...
 
class  RecordFileWriter
 The class to create VRS files. More...
 
class  RecordFormat
 Description of the format of a VRS record as a succession of typed blocks of content. More...
 
struct  RecordFormatReader
 Internal data structure to hold various objects needed to decode a specific RecordFormat. More...
 
class  RecordFormatRegistrar
 Utility class to handle record format registry manipulations. More...
 
class  RecordFormatStreamPlayer
 Specialized StreamPlayer designed to handle records which format is managed by RecordFormat, which are a succession of typed content blocks described by ContentBlock objects. More...
 
class  RecordList
 Helper class pointing to the next record in a device's list of records. This class doesn't not modify the list, simply iterating on it. More...
 
class  RecordManager
 VRS internal class to manage the records of a specific Recordable after their creation. More...
 
class  RecordReader
 Abstract VRS internal helper class to read & (if necessary) uncompress records. More...
 
class  SilentLogger
 Progress logger to ignore all progress notifications. More...
 
class  StreamId
 VRS stream identifier class. More...
 
class  StreamPlayer
 Class designed to receive record data when reading a VRS file. More...
 
struct  StreamTags
 Container for a stream's tags, both user and VRS controlled. More...
 
struct  TagsRecord
 DataLayout definition used in tag records, which is a VRS internal record type. More...
 
class  TagsRecordPlayer
 StreamPlayer to decode the content of VRS tag records. More...
 
class  TelemetryLogger
 TelemetryLogger to report important events. More...
 
class  TemporaryCachingStrategy
 Helper class to temporarily modify a FileHandler's caching strategy. More...
 
class  TemporaryRecordableInstanceIdsResetter
 
struct  TrafficEvent
 Telemetry event specialized to report cloud traffic. More...
 
struct  UnalignedValue
 Template to represent some POD object without memory alignment. More...
 
class  UncompressedRecordReader
 RecordReader specialized to read uncompressed records. For VRS internal usage only. More...
 
class  UnsupportedBlockReader
 Specialized version of ContentBlockReader to handle data that could not be handled by another better suited ContentBlockReader. It's the fallback handler. More...
 
class  WriteFileHandler
 The WriteFileHandler interface adds write operations to the FileHandler interface. More...
 

Typedefs

using AsyncHandle = AsyncFileDescriptor
 
using Point2Dd = PointND< double, 2 >
 2D double point class.
 
using Point2Df = PointND< float, 2 >
 2D float point class.
 
using Point2Di = PointND< int32_t, 2 >
 2D int32_t point class.
 
using Point3Dd = PointND< double, 3 >
 3D double point class.
 
using Point3Df = PointND< float, 3 >
 3D float point class.
 
using Point3Di = PointND< int32_t, 3 >
 3D int32_t point class.
 
using Point4Dd = PointND< double, 4 >
 4D double point class.
 
using Point4Df = PointND< float, 4 >
 4D float point class.
 
using Point4Di = PointND< int32_t, 4 >
 4D int32_t point class.
 
using Matrix2Dd = MatrixND< double, 2 >
 2D double matrix class.
 
using Matrix2Df = MatrixND< float, 2 >
 2D float matrix class.
 
using Matrix2Di = MatrixND< int32_t, 2 >
 2D int32_t matrix class.
 
using Matrix3Dd = MatrixND< double, 3 >
 3D double matrix class.
 
using Matrix3Df = MatrixND< float, 3 >
 3D float matrix class.
 
using Matrix3Di = MatrixND< int32_t, 3 >
 3D int32_t matrix class.
 
using Matrix4Dd = MatrixND< double, 4 >
 4D double matrix class.
 
using Matrix4Df = MatrixND< float, 4 >
 4D float matrix class.
 
using Matrix4Di = MatrixND< int32_t, 4 >
 4D int32_t matrix class.
 
using DiskFile = DiskFileT< DiskFileChunk >
 
using InitCreatedThreadCallback = std::function< void(std::thread &, ThreadRole, int)>
 
using RecordFormatMap = map< pair< Record::Type, uint32_t >, RecordFormat >
 Map a pair of record type/format version to a record format, for a particular stream.
 

Enumerations

enum class  CompressionPreset {
  Undefined = -1 , None = 0 , Lz4Fast , Lz4Tight ,
  ZstdFaster , ZstdFast , ZstdLight , ZstdMedium ,
  ZstdHeavy , ZstdHigh , ZstdTight , ZstdMax ,
  COUNT , FirstLz4Preset = Lz4Fast , LastLz4Preset = Lz4Tight , FirstZstdPreset = ZstdFaster ,
  LastZstdPreset = ZstdMax , CompressedFirst = Lz4Fast , CompressedLast = ZstdMax , Default = ZstdFaster
}
 VRS Compression setting. More...
 
enum class  DataPieceType : uint8_t {
  Undefined = 0 , Value = 1 , Array = 2 , Vector = 3 ,
  String = 4 , StringMap = 5 , COUNT
}
 Specifier for a type of DataPiece. More...
 
enum class  JsonFormatProfile { VrsFormat , ExternalCompact , ExternalPretty , Public }
 Enum for a DataLayout printout json formatting profile. More...
 
enum  ErrorCode : int {
  SUCCESS = 0 , FAILURE = kPlatformUserErrorsStart , NOT_SUPPORTED , NOT_IMPLEMENTED ,
  VRSERROR_INTERNAL_ERROR , NOT_A_VRS_FILE , NO_FILE_OPEN , FILE_ALREADY_OPEN ,
  FILE_NOT_FOUND , INVALID_PARAMETER , INVALID_REQUEST , INVALID_RANGE ,
  INVALID_DISK_DATA , INVALID_FILE_SPEC , INVALID_URI_FORMAT , INVALID_URI_VALUE ,
  READ_ERROR , NOT_ENOUGH_DATA , TOO_MUCH_DATA , UNSUPPORTED_VRS_FILE ,
  UNSUPPORTED_DESCRIPTION_FORMAT_VERSION , UNSUPPORTED_INDEX_FORMAT_VERSION , INDEX_RECORD_ERROR , REINDEXING_ERROR ,
  OPERATION_CANCELLED , REQUESTED_FILE_HANDLER_UNAVAILABLE , REQUESTED_DELEGATOR_UNAVAILABLE , FILE_HANDLER_MISMATCH ,
  FILEPATH_PARSE_ERROR , MULTICHUNKS_NOT_SUPPORTED , DISKFILE_NOT_OPEN , DISKFILE_FILE_NOT_FOUND ,
  DISKFILE_INVALID_OFFSET , DISKFILE_NOT_ENOUGH_DATA , DISKFILE_READ_ONLY , DISKFILE_INVALID_STATE ,
  DISKFILE_PARTIAL_WRITE_ERROR
}
 Enum for regular VRS errors.
 
enum class  ErrorDomain : int {
  Lz4DecompressionErrorDomain , ZstdCompressionErrorDomain , ZstdDecompressionErrorDomain , FbVrsErrorDomain ,
  CustomDomains
}
 Core VRS error domains. More...
 
enum class  CachingStrategy {
  Undefined = 0 , Passive , Streaming , StreamingBidirectional ,
  StreamingBackward , ReleaseAfterRead , COUNT
}
 Caching strategy requests. More...
 
enum class  CompressionType : uint8_t { None = 0 , Lz4 , Zstd , COUNT }
 Type of compression. Used in VRS record headers, so never modify the values. More...
 
enum class  ThreadRole { Writer , Purge , Compression }
 Thread types that are created with the RecordFileWriter interface.
 
enum class  ContentType : uint8_t {
  CUSTOM = 0 , EMPTY , DATA_LAYOUT , IMAGE ,
  AUDIO , COUNT
}
 Type of a record's block. More...
 
enum class  ImageFormat : uint8_t {
  UNDEFINED = 0 , RAW , JPG , PNG ,
  VIDEO , JXL , COUNT
}
 Image format type. More...
 
enum class  PixelFormat : uint8_t {
  UNDEFINED = 0 , GREY8 = 1 , BGR8 , DEPTH32F ,
  RGB8 , YUV_I420_SPLIT , YUV_I420_PLANAR = YUV_I420_SPLIT , RGBA8 ,
  RGB10 , RGB12 , GREY10 , GREY12 ,
  GREY16 , RGB32F , SCALAR64F , YUY2 ,
  RGB_IR_RAW_4X4 , RGBA32F , BAYER8_RGGB , RAW10 ,
  RAW10_BAYER_RGGB , RAW10_BAYER_BGGR , YUV_420_NV21 , YUV_420_NV12 ,
  COUNT
}
 Pixel format type, then the image format is ImageFormat::RAW. More...
 
enum class  AudioFormat : uint8_t { UNDEFINED = 0 , PCM = 1 , OPUS = 2 , COUNT }
 Audio format type. More...
 
enum class  AudioSampleFormat : uint8_t {
  UNDEFINED = 0 , S8 , U8 , A_LAW ,
  MU_LAW , S16_LE , U16_LE , S16_BE ,
  U16_BE , S24_LE , U24_LE , S24_BE ,
  U24_BE , S32_LE , U32_LE , S32_BE ,
  U32_BE , F32_LE , F32_BE , F64_LE ,
  F64_BE , COUNT
}
 Audio sample format, when the audio type is AudioFormat::PCM. More...
 
enum class  RecordableTypeId : uint16_t {
  VRSIndex = 1 , VRSDescription = 2 , ImageStream = 100 , AudioStream = 101 ,
  AnnotationStream = 102 , ArchiveStream = 103 , ForwardCameraRecordableClass = 200 , UpwardCameraRecordableClass = 201 ,
  DownwardCameraRecordableClass = 202 , BackwardCameraRecordableClass = 203 , SidewardCameraRecordableClass = 204 , OutwardCameraRecordableClass = 205 ,
  InwardCameraRecordableClass = 206 , InsideOutCameraRecordableClass = 207 , OutsideInCameraRecordableClass = 208 , DepthCameraRecordableClass = 209 ,
  IRCameraRecordableClass = 210 , EyeCameraRecordableClass = 211 , FaceCameraRecordableClass = 212 , MouthCameraRecordableClass = 213 ,
  RgbCameraRecordableClass = 214 , DisplayObserverCameraRecordableClass = 215 , WorldObserverCameraRecordableClass = 216 , DisparityCameraRecordableClass = 217 ,
  MonoAudioRecordableClass = 230 , StereoAudioRecordableClass = 231 , AmbientAudioRecordableClass = 232 , SensorRecordableClass = 240 ,
  ImuRecordableClass = 241 , AccelerometerRecordableClass = 242 , MagnetometerRecordableClass = 243 , GyroscopeRecordableClass = 244 ,
  LidarRecordableClass = 245 , TemperatureRecordableClass = 246 , BarometerRecordableClass = 247 , PhotoplethysmogramRecordableClass = 248 ,
  EMGRecordableClass = 249 , CapacitiveTouchRecordableClass = 250 , HeartRateRecordableClass = 251 , CaloriesRecordableClass = 252 ,
  CsaRecordableClass = 253 , RadarRecordableClass = 254 , StepCountRecordableClass = 255 , ForceRecordableClass = 256 ,
  DistanceRecordableClass = 257 , ActiveMinutesRecordableClass = 258 , HeadingRecordableClass = 259 , CalibrationRecordableClass = 260 ,
  AlignmentRecordableClass = 261 , SetupRecordableClass = 262 , DiagnosticRecordableClass = 263 , PerformanceRecordableClass = 264 ,
  IlluminationRecordableClass = 265 , DisplayRecordableClass = 266 , SyncRecordableClass = 280 , GpsRecordableClass = 281 ,
  WifiBeaconRecordableClass = 282 , BluetoothBeaconRecordableClass = 283 , UsbRecordableClass = 284 , TimeRecordableClass = 285 ,
  AttentionRecordableClass = 286 , GMSRecordableClass = 287 , InputRecordableClass = 300 , TextInputRecordableClass = 301 ,
  MouseRecordableClass = 302 , TouchInputRecordableClass = 303 , GestureInputRecordableClass = 304 , ControllerRecordableClass = 305 ,
  EventRecordableClass = 320 , CommandRecordableClass = 321 , InstructionRecordableClass = 322 , ScriptRecordableClass = 323 ,
  ControlRecordableClass = 324 , PipelineEventRecordableClass = 325 , GroundTruthRecordableClass = 340 , GroundTruthImuRecordableClass = 341 ,
  GroundTruthAlignmentRecordableClass = 342 , GroundTruthPositionRecordableClass = 343 , GroundTruthOrientationRecordableClass = 344 , GroundTruthDepthRecordableClass = 345 ,
  ResultRecordableClass = 370 , PoseRecordableClass = 371 , MotionRecordableClass = 372 , GazeRecordableClass = 373 ,
  MeshRecordableClass = 374 , MocapRecordableClass = 375 , PointCloudRecordableClass = 376 , MapRecordableClass = 377 ,
  SensorVarianceBiasRecordableClass = 378 , AnchorRecordableClass = 379 , SegmentationRecordableClass = 380 , TextRecordableClass = 381 ,
  EMGGestureRecordableClass = 382 , SpeechRecordableClass = 383 , QuaternionRecordableClass = 384 , UltrasonicRecordableClass = 385 ,
  AnnotationRecordableClass = 400 , AmbientLightRecordableClass = 500 , SampleDeviceRecordableClass = 998 , UnitTestRecordableClass = 999 ,
  FirstRecordableClassId = 200 , LastRecordableClassId = 999 , SlamCameraData = 1201 , SlamImuData = 1202 ,
  SlamMagnetometerData = 1203 , TestDevices = 65500 , UnitTest1 = TestDevices , UnitTest2 ,
  SampleDevice , Undefined = 65535
}
 VRS stream type or class identifier enum. More...
 

Functions

string toString (CompressionPreset preset)
 
template<>
CompressionPreset toEnum< CompressionPreset > (const string &name)
 
std::string toString (CompressionType compressionType)
 
template<>
CompressionType toEnum< CompressionType > (const std::string &compressionTypeName)
 
string toPrettyName (CompressionPreset preset)
 
template<>
CompressionPreset toEnum< CompressionPreset > (const std::string &presetName)
 
template<>
CompressionType toEnum< CompressionType > (const std::string &compressionTypeName)
 
template<class T >
const string & getTypeName ()
 Get the name of the type <T>.
 
template<>
const string & getTypeName< string > ()
 
template<class T >
readUnaligned (const void *ptr)
 Helper to make dereferencing a pointer to read an unaligned POD object safe.
 
template<class T >
void writeUnaligned (void *ptr, const T &value)
 Helper to make dereferencing a pointer to write an unaligned POD object safe.
 
string errorCodeToMessage (int errorCode)
 
string errorCodeToMessageWithCode (int errorCode)
 
ErrorDomain newErrorDomain (const string &domainName)
 
int domainErrorCode (ErrorDomain errorDomain, int64_t errorCode, const char *errorMessage)
 
constexpr int errorDomainToErrorCodeStart (ErrorDomain errorDomain)
 Conversion of a error domain to an int. For internal & test purposes only.
 
ErrorDomain newErrorDomain (const std::string &domainName)
 
template<class T >
int domainErrorCode (ErrorDomain errorDomain, T errorCode, const char *errorMessage)
 
template<class EC >
const std::map< EC, const char * > & getErrorCodeRegistry ()
 
template<class EC >
ErrorDomain getErrorDomain ()
 
template<class EC >
int domainError (EC errorCode)
 
string toString (CachingStrategy cachingStrategy)
 
template<>
CachingStrategy toEnum (const string &name)
 Convert a record type name into an enum value.
 
template<>
CachingStrategy toEnum (const string &name)
 
char xdigitToChar (char xdigit)
 
string toString (Record::Type recordType)
 Get a record type as a text string.
 
template<>
Record::Type toEnum (const string &name)
 Convert a record type name into an enum value.
 
template<>
Record::Type toEnum (const string &name)
 Convert a record type name into an enum value.
 
const IndexRecord::RecordInfogetNearestRecordByTime (const vector< const IndexRecord::RecordInfo * > &index, double timestamp, double epsilon, Record::Type recordType)
 
const IndexRecord::RecordInfogetNearestRecordByTime (const std::vector< const IndexRecord::RecordInfo * > &index, double timestamp, double epsilon, Record::Type recordType=Record::Type::UNDEFINED)
 
string toString (ContentType contentType)
 
template<>
ContentType toEnum (const string &name)
 Convert a record type name into an enum value.
 
string toString (ImageFormat imageFormat)
 
template<>
ImageFormat toEnum (const string &name)
 Convert a record type name into an enum value.
 
string toString (PixelFormat pixelFormat)
 
template<>
PixelFormat toEnum (const string &name)
 Convert a record type name into an enum value.
 
string toString (AudioFormat audioFormat)
 Convert an AudioFormat to a string.
 
template<>
AudioFormat toEnum (const string &name)
 Convert a record type name into an enum value.
 
string toString (AudioSampleFormat audioSampleFormat)
 Convert an AudioSampleFormat to a string.
 
template<>
AudioSampleFormat toEnum (const string &name)
 Convert a record type name into an enum value.
 
string toString (RecordableTypeId typeId)
 
bool isARecordableClass (RecordableTypeId typeId)
 Tell if an id is that of a "Recordable Class".
 

Variables

constexpr int kMaxFilesOpenCount = 2
 
const int kSimpleVRSErrorsSize = 1000
 
const int kVRSErrorsDomainSize = 100
 
const int kDomainErrorsStart = kPlatformUserErrorsStart + kSimpleVRSErrorsSize
 
constexpr const char * kFailFastOnIncompleteIndex = "fail_fast_on_incomplete_index"
 

Detailed Description

Writing headers to disk, you must control endianness and have no padding so that you can read a file written by any system, using any other system.

The Endian<T> template allows the definition of types stored locally in a endian defined way.

Typedef Documentation

◆ InitCreatedThreadCallback

using vrs::InitCreatedThreadCallback = typedef std::function<void(std::thread&, ThreadRole, int)>

Callback type used to initialize the created threads Arguments are currentThread, ThreadRole, threadIndex (Only used for Compression)

Enumeration Type Documentation

◆ AudioFormat

enum class vrs::AudioFormat : uint8_t
strong

Audio format type.

Enumerator
UNDEFINED 

Unknown/unspecified.

PCM 

Raw PCM audio data.

OPUS 

Audio data compressed using Opus. https://opus-codec.org/.

COUNT 

Count of values in this enum type.

◆ AudioSampleFormat

enum class vrs::AudioSampleFormat : uint8_t
strong

Audio sample format, when the audio type is AudioFormat::PCM.

Enumerator
UNDEFINED 

Unknown/unspecified.

S8 

LPCM, signed, 8 bit.

U8 

LPCM, unsigned, 8 bit.

A_LAW 

a-law PCM, 8 bit.

MU_LAW 

mu-law PCM, 8 bit.

S16_LE 

LPCM, signed, 16 bit little endian.

U16_LE 

LPCM, unsigned, 16 bit little endian.

S16_BE 

LPCM, signed, 16 bit big endian.

U16_BE 

LPCM, unsigned, 16 bit big endian.

S24_LE 

LPCM, signed, 24 bit little endian.

U24_LE 

LPCM, unsigned, 24 bit little endian.

S24_BE 

LPCM, signed, 24 bit big endian.

U24_BE 

LPCM, unsigned, 24 bit big endian.

S32_LE 

LPCM, signed, 32 bit little endian.

U32_LE 

LPCM, unsigned, 32 bit little endian.

S32_BE 

LPCM, signed, 32 bit big endian.

U32_BE 

LPCM, unsigned, 32 bit big endian.

F32_LE 

LPCM, 32 bit float little endian.

F32_BE 

LPCM, 32 bit float big endian.

F64_LE 

LPCM, 64 bit float little endian.

F64_BE 

LPCM, 64 bit float big endian.

COUNT 

Count of values in this enum type.

◆ CachingStrategy

enum class vrs::CachingStrategy
strong

Caching strategy requests.

Enumerator
Passive 

(default) Read & cache on-demand (don't prefetch).

Streaming 

Automatically download data "forward", using last read-request as a hint.

StreamingBidirectional 

Automatically download data "forward" and "backward", using last read-request as a hint.

StreamingBackward 

Automatically download data "backward", using last read-request as a hint.

ReleaseAfterRead 

Same as "Passive" but release used cache blocks immediately after read.

◆ CompressionPreset

enum class vrs::CompressionPreset
strong

VRS Compression setting.

VRS records are compressed by default, using the LZ4_FAST setting, which is an extremely fast lossless compression.

VRS compression is completely transparent: records are compressed and uncompressed without the need to do anything when writing or reading data. Record sizes are always showing the uncompressed size.

VRS files can easily be recompressed offline using VRStool.

Enumerator
Undefined 

when not set explicitly

None 

No compression.

Lz4Fast 

Fast compression speed, very fast decompression, not great compression ratio.

Lz4Tight 

Slower compression speed, very fast decompression, better compression ratio.

Default 

Default preset.

◆ CompressionType

enum class vrs::CompressionType : uint8_t
strong

Type of compression. Used in VRS record headers, so never modify the values.

Enumerator
None 

No compression.

Lz4 

lz4 compression.

Zstd 

zstd compression.

◆ ContentType

enum class vrs::ContentType : uint8_t
strong

Type of a record's block.

Enumerator
CUSTOM 

Custom format, or unknown/unspecified data format.

EMPTY 

No data (internal).

DATA_LAYOUT 

DataLayout block.

IMAGE 

Image block.

AUDIO 

Audio block.

COUNT 

Count of values in this enum type.

◆ DataPieceType

enum class vrs::DataPieceType : uint8_t
strong

Specifier for a type of DataPiece.

Enumerator
Undefined 

Undefined type.

Value 

Single value.

Array 

Fixed size array.

Vector 

Variable size array of T.

String 

Variable size array of char, null terminated.

StringMap 

Map with string keys, and T values.

COUNT 

Count of enum values.

◆ ErrorDomain

enum class vrs::ErrorDomain : int
strong

Core VRS error domains.

Errors can come from VRS, or a helper library like LZ4, ZSTD, or a file handler's sub-system. There is no telling if these error codes will collide with the OS', VRS' or each other. Error domains create a safe mechanism to report any of these errors as an int, which can then be converted back to a human readable string using vrs::errorCodeToMessage(code). The caveat is that the numeric values themselves may vary from run-to-run. Error domains can be created dynamically, with the limitation that 99 distinct custom errors per domain can be tracked during a single run. In practice, 99 distinct errors per domain should be plenty, and it's safe to generate more errors, but the error messages beyond 99 will not be tracked individually.

◆ ImageFormat

enum class vrs::ImageFormat : uint8_t
strong

Image format type.

Enumerator
UNDEFINED 

Unknown/unspecified.

RAW 

Raw pixel data.

JPG 

JPEG data.

PNG 

PNG data.

VIDEO 

Video codec encoded frame.

JXL 

JPEG-XL data.

COUNT 

Count of values in this enum type.

◆ JsonFormatProfile

enum class vrs::JsonFormatProfile
strong

Enum for a DataLayout printout json formatting profile.

Enumerator
VrsFormat 

for internal VRS usage. (default)

ExternalCompact 

for external tools (VRStools in particular), but compact.

ExternalPretty 

for external tools (VRStools in particular), formatted for readability.

Public 

for public use cases, avoiding VRS internal names

◆ PixelFormat

enum class vrs::PixelFormat : uint8_t
strong

Pixel format type, then the image format is ImageFormat::RAW.

Enumerator
UNDEFINED 

Unknown/unrecognized.

GREY8 

1 uint8_t.

BGR8 

3 uint8_t values, blue + green + red.

DEPTH32F 

1 32 bit float value, representing a depth.

RGB8 

3 uint8_t values, red + green + blue.

YUV_I420_SPLIT 

3 uint8_t values, 4:2:0. The 3 planes are stored separately.

YUV_I420_PLANAR 

same as YUV_I420_SPLIT, but more conventional name.

RGBA8 

4 uint8_t values, red + blue + green + alpha.

RGB10 

uses 16 bit little-endian values. 6 most significant bits are unused and set to 0.

RGB12 

uses 16 bit little-endian values. 4 most significant bits are unused and set to 0.

GREY10 

uses 16 bit little-endian values. 6 most significant bits are unused and set to 0.

GREY12 

uses 16 bit little-endian values. 4 most significant bits are unused and set to 0.

GREY16 

uses 16 bit little-endian values.

RGB32F 

1 32 bit float value.

SCALAR64F 

1 64 bit float value, representing high precision image data.

YUY2 

4 uint8_t values, 4:2:2, single plane.

RGB_IR_RAW_4X4 

As seen on the OV2312, a 4x4 pattern of BGRG GIrGIr RGBG GIrGIr where Ir means infrared.

RGBA32F 

1 32 bit float value.

BAYER8_RGGB 

8 bit per pixel, RGGB bayer pattern.

RAW10 

https://developer.android.com/reference/android/graphics/ImageFormat#RAW10

RAW10_BAYER_RGGB 

10 bit per pixel, RGGB bayer pattern.

RAW10_BAYER_BGGR 

10 bit per pixel, BGGR bayer pattern.

YUV_420_NV21 

Y plane + half width/half height chroma plane with weaved V and U values.

YUV_420_NV12 

Y plane + half width/half height chroma plane with weaved U and V values.

COUNT 

Count of values in this enum type.

◆ RecordableTypeId

enum class vrs::RecordableTypeId : uint16_t
strong

VRS stream type or class identifier enum.

Each stream in a VRS file has a type, represented by RecordableTypeId. RecordableTypeId values represent a class of recordable, a particular logical or virtual recordable, or a hardware specific recordable, using their specific record formats.

Initially, every recordable needed their own enum values. This was non-scalable way to identify unique recordable types, and required every use case to have their own recordable type id in a shared enum definition. This method is now deprecated.

Today, instead of creating new RecordableTypeId values for new devices, use an existing "Recordable Class" ID (values between 200 and 999) along with a flavor to describe the data being recorded in the stream.

Should none of the existing "recordable class" match your use case, please propose new ones.

Meta only: If you can not use a "recordable class" value with a "flavor" without having to refactor a lot of code, you can still create new enum values, even if that's bad practice.

For each enum value, a proper description must be provided in StreamId.cpp

Enumerator
VRSIndex 

Internal, for index records. See IndexRecord.

VRSDescription 

Internal, for description records. See DescriptionRecord.

ImageStream 

Generic image stream. Prefer using "Recordable Class" IDs.

AudioStream 

Generic audio stream. Prefer using "Recordable Class" IDs.

AnnotationStream 

Generic annotation stream. Prefer using "Recordable Class" IDs.

ArchiveStream 

Generic archive stream. Prefer using "Recordable Class" IDs.

ForwardCameraRecordableClass 

For cameras looking forward.

UpwardCameraRecordableClass 

For cameras looking up.

DownwardCameraRecordableClass 

For cameras looking down.

BackwardCameraRecordableClass 

For cameras looking back.

SidewardCameraRecordableClass 

For cameras looking to the side.

OutwardCameraRecordableClass 

For cameras looking outward.

InwardCameraRecordableClass 

For cameras looking inward.

InsideOutCameraRecordableClass 

For inside out cameras.

OutsideInCameraRecordableClass 

For outside in cameras.

DepthCameraRecordableClass 

For depth cameras.

IRCameraRecordableClass 

For infrared cameras.

EyeCameraRecordableClass 

For cameras recording eyes.

FaceCameraRecordableClass 

For cameras recording a face.

MouthCameraRecordableClass 

For cameras recording a mouth.

RgbCameraRecordableClass 

For color cameras.

DisplayObserverCameraRecordableClass 

For display observing cameras.

WorldObserverCameraRecordableClass 

For world observing cameras.

DisparityCameraRecordableClass 

For disparity cameras.

MonoAudioRecordableClass 

For mono microphones.

StereoAudioRecordableClass 

For stereo microphones.

AmbientAudioRecordableClass 

For multichannel microphones.

SensorRecordableClass 

For unspecified sensor data. Use flavors to be specific.

ImuRecordableClass 

For IMU data streams.

AccelerometerRecordableClass 

For accelerometer data streams.

MagnetometerRecordableClass 

For magnetometer data streams.

GyroscopeRecordableClass 

For gyroscope data streams.

LidarRecordableClass 

For Lidar data streams.

TemperatureRecordableClass 

For temperature data streams.

BarometerRecordableClass 

For barometer data streams.

PhotoplethysmogramRecordableClass 

For photoplethysmography data streams.

EMGRecordableClass 

For electromyography data streams.

CapacitiveTouchRecordableClass 

For capacitive touch data streams.

HeartRateRecordableClass 

Heart rate data streams.

CaloriesRecordableClass 

Calories data streams.

CsaRecordableClass 

CSA data streams.

RadarRecordableClass 

Radar data streams.

StepCountRecordableClass 

Step count data streams.

ForceRecordableClass 

Force data streams.

DistanceRecordableClass 

Distance data streams.

ActiveMinutesRecordableClass 

Active minutes data streams.

HeadingRecordableClass 

Heading data streams.

CalibrationRecordableClass 

For calibration data streams.

AlignmentRecordableClass 

For alignment data streams.

SetupRecordableClass 

For setup data streams.

DiagnosticRecordableClass 

For diagnostic data streams.

PerformanceRecordableClass 

For performance data streams.

IlluminationRecordableClass 

For illumination data streams.

DisplayRecordableClass 

For display buffer data streams.

SyncRecordableClass 

For synchronisation data streams.

GpsRecordableClass 

For GPS data streams.

WifiBeaconRecordableClass 

For WIFI beacon data streams.

BluetoothBeaconRecordableClass 

For bluetooth beacon data streams.

UsbRecordableClass 

For USB data streams.

TimeRecordableClass 

For time data streams.

AttentionRecordableClass 

For attention data streams.

GMSRecordableClass 

For GMS location data stream.

InputRecordableClass 

For user input data streams.

TextInputRecordableClass 

For text input data streams.

MouseRecordableClass 

For mouse data streams.

TouchInputRecordableClass 

For touch input data streams.

GestureInputRecordableClass 

For gesture input data streams.

ControllerRecordableClass 

For controller data streams.

EventRecordableClass 

For event data streams.

CommandRecordableClass 

For command data streams.

InstructionRecordableClass 

For instructions data streams.

ScriptRecordableClass 

For script data streams.

ControlRecordableClass 

For control data streams.

PipelineEventRecordableClass 

For EMG pipeline events streams.

GroundTruthRecordableClass 

For ground truth data streams.

GroundTruthImuRecordableClass 

For ground truth IMU data streams.

GroundTruthAlignmentRecordableClass 

For ground truth alignment data streams.

GroundTruthPositionRecordableClass 

For ground truth position data streams.

GroundTruthOrientationRecordableClass 

For ground truth orientation data streams.

GroundTruthDepthRecordableClass 

For ground truth depth data streams.

ResultRecordableClass 

For result streams.

PoseRecordableClass 

For pose streams.

MotionRecordableClass 

For motion data streams.

GazeRecordableClass 

For gaze data streams.

MeshRecordableClass 

For mesh data streams.

MocapRecordableClass 

For motion capture data streams.

PointCloudRecordableClass 

For point cloud data streams.

MapRecordableClass 

For map data streams.

SensorVarianceBiasRecordableClass 

For sensor variance/bias results.

AnchorRecordableClass 

For anchor data streams (i.e. spatial persistence anchors).

SegmentationRecordableClass 

For segmentation data streams.

TextRecordableClass 

For result data streams stored as text.

EMGGestureRecordableClass 

For EMG gesture data streams.

SpeechRecordableClass 

For speech/ASR data streams.

QuaternionRecordableClass 

For quaternion data streams.

UltrasonicRecordableClass 

For ultrasonic data streams.

AnnotationRecordableClass 

For annotation streams.

AmbientLightRecordableClass 

Ambient light data streams.

SampleDeviceRecordableClass 

For sample device streams.

UnitTestRecordableClass 

For unit test streams.

FirstRecordableClassId 

Helper values to test if a type is a recordable class.

LastRecordableClassId 

Helper values to test if a type is a recordable class.

SlamCameraData 

Legacy slam data stream.

SlamImuData 

Legacy IMU data stream.

SlamMagnetometerData 

Legacy magnetometer data stream.

UnitTest1 

For unit tests.

UnitTest2 

For unit tests.

SampleDevice 

For sample code.

Undefined 

Value used for default initializations and marking undefined situations.

Function Documentation

◆ domainErrorCode() [1/2]

int vrs::domainErrorCode ( ErrorDomain  errorDomain,
int64_t  errorCode,
const char *  errorMessage 
)

Create an int error code for a specific error domain and error code within that domain.

Parameters
errorDomainthe error domain of the error code.
errorCodean error code within that domain, which can be any value.
errorMessagean error description for the errorCode.
Returns
A int that can be safely returned by VRS to represent the domain error. The errorMessage is saved, so that future calls to errorCodeToMessage() will return that error message for that int error code.

◆ domainErrorCode() [2/2]

template<class T >
int vrs::domainErrorCode ( ErrorDomain  errorDomain,
errorCode,
const char *  errorMessage 
)

Helper function so that any integer error type (including enums) can be used for domain errors, as this template helper will simply cast that error code to an int64.

◆ errorCodeToMessage()

std::string vrs::errorCodeToMessage ( int  errorCode)

Convert an int error code into a human readable string for logging. This API should work with any int error code returned by any VRS API.

Parameters
errorCodean error code returned by any VRS API.
Returns
A string that describes the error.

◆ errorCodeToMessageWithCode()

std::string vrs::errorCodeToMessageWithCode ( int  errorCode)

Convert an int error code into a human readable string for logging. This API should work with any int error code returned by any VRS API. This version includes the error code's numeric value.

Parameters
errorCodean error code returned by any VRS API.
Returns
A string that describes the error.

◆ getErrorCodeRegistry()

template<class EC >
const std::map< EC, const char * > & vrs::getErrorCodeRegistry ( )

Helper class to define your own error domain.

  • create an enum class for your errors, that you pass to your template.
  • provide a map enum -> to text, to explain each enum. You can then call newErrorCode() to get an int error code that you can return.

◆ getNearestRecordByTime()

const IndexRecord::RecordInfo * vrs::getNearestRecordByTime ( const std::vector< const IndexRecord::RecordInfo * > &  index,
double  timestamp,
double  epsilon,
Record::Type  recordType = Record::Type::UNDEFINED 
)

The method to search the nearest record from the index list. Find the nearest record of a specific stream within the range of (timestamp - epsilon) - (timestamp + epsilon).

Parameters
timestamptimestamp to seek.
epsilonthe threshold we search for the index.
recordTyperecord type to find, or Record::Type::UNDEFINED for any record type.
Returns
Pointer to the record info, or nullptr (timestamp is too big?).

◆ newErrorDomain()

ErrorDomain vrs::newErrorDomain ( const std::string &  domainName)

Create a new error domain, based on a name that's supposed to be unique, such as "CURL"

Parameters
domainNamesome unique domain name.
Returns
A new error domain enum value.

◆ toString()

string vrs::toString ( RecordableTypeId  typeId)

Get an English readable recordable type name for the enum value.

Parameters
typeIdthe recordable type id to describe
Returns
English readable recordable type name.

Note that VRS stores the actual string-name when recording a file, so that you can later tell how the recordable type was called when the recording was made. VRStool will then show both the original and current recordable type names.

Variable Documentation

◆ kFailFastOnIncompleteIndex

constexpr const char* vrs::kFailFastOnIncompleteIndex = "fail_fast_on_incomplete_index"
constexpr

This is a special boolean extra field in FileSpec to make RecordFileReader fail fast on open if the file's index is incomplete or missing, and prevent VRS from rebuilding the index. This is useful when accessing large files in cloud, when we'd rather fail than rebuild the index.