VRS
A file format for sensor data.
Loading...
Searching...
No Matches
Public Member Functions | List of all members
vrs_sample_apps::AudioStream Class Reference

Sample fake device showing how to produce records containing audio data (no metadata). More...

Inheritance diagram for vrs_sample_apps::AudioStream:
vrs::Recordable

Public Member Functions

const RecordcreateConfigurationRecord () override
 
const RecordcreateStateRecord () override
 
void createDataRecords (size_t blockIndex)
 
- Public Member Functions inherited from vrs::Recordable
string getRecordableName () const
 
RecordableTypeId getRecordableTypeId () const
 
uint16_t getRecordableInstanceId () const
 
StreamId getStreamId () const
 
void setRecordableIsActive (bool isActive)
 
bool isRecordableActive () const
 
void setCompression (CompressionPreset preset)
 
bool addRecordFormat (Record::Type recordType, uint32_t formatVersion, const RecordFormat &format, const vector< const DataLayout * > &layouts={})
 
void setCreateRecordDelegate (CreateRecordDelegate delegate)
 
void setTag (const string &tagName, const string &tagValue)
 
void addTags (const map< string, string > &newTags)
 
void addTags (const StreamTags &tags)
 
const map< string, string > & getTags () const
 
const StreamTagsgetStreamTags () const
 
const string & getSerialNumber () const
 
RecordManagergetRecordManager ()
 

Additional Inherited Members

- Public Types inherited from vrs::Recordable
using CreateRecordDelegate = std::function< const Record *(StreamId streamId, double timestamp, Record::Type recordType, uint32_t recordFormatVersion, const DataSource &data)>
 
- Static Public Member Functions inherited from vrs::Recordable
static const string & getOriginalNameTagName ()
 
static const string & getFlavorTagName ()
 
static const string & getSerialNumberTagName ()
 Get the name of the VRS tag used to store the stream's serial number.
 
static void resetNewInstanceIds ()
 
- Protected Member Functions inherited from vrs::Recordable
 Recordable (RecordableTypeId typeId, const string &flavor={})
 
const RecordcreateRecord (double timestampSec, Record::Type recordType, uint32_t formatVersion, const DataSource &data=DataSource())
 
const RecordcreateUncompressedRecord (double timestampSec, Record::Type recordType, uint32_t formatVersion, const DataSource &data, std::unique_ptr< DirectWriteRecordData > &&directWriteRecordData)
 
map< string, string > & getVRSTags ()
 When direct edits of VRS tags is convenient (record filters)
 

Detailed Description

Sample fake device showing how to produce records containing audio data (no metadata).

Stream of audio blocks. Because audio samples can come at a high frequency, we collect in blocks that we save in records. Note that the size of these blocks may vary from record to record, even though in this sample, the records are always of the same size. This sample stream doesn't use any configuration record, but we coud easily add one if needed.

Member Function Documentation

◆ createConfigurationRecord()

const Record * vrs_sample_apps::AudioStream::createConfigurationRecord ( )
inlineoverridevirtual

Configuration records describe how the device recorded is configured/setup. The configuration of a recordable is probably not changed by data flowing through. A framerate, a resolution, are probably part of the configuration. An exposure setting as well, unless it is automatically adjusted as data flows through. The RecordFileWriter will call this method to make sure a configuration record is captured, when a record file is created asynchronously.

Implements vrs::Recordable.

◆ createStateRecord()

const Record * vrs_sample_apps::AudioStream::createStateRecord ( )
inlineoverridevirtual

State records describe the internal state of the device, if it's stateful. It is probably the result of previous calculation/processing of data.

State records should not to be confused with the configuration of the device. A position tracking algorithm probably has a state: the last position it determined, which will be used to calculate the next state when the next data come in. State data typically changes as data flows, according to that data. A camera probably has no state, but probably has a configuration. The RecordFileWriter will call this method to make sure a configuration record is captured, when a record file is created asynchronously.

Implements vrs::Recordable.


The documentation for this class was generated from the following file: