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

Class designed to receive record data when reading a VRS file. More...

#include <StreamPlayer.h>

Inheritance diagram for vrs::StreamPlayer:
vrs::RecordFormatStreamPlayer vrs::TagsRecordPlayer vrs_sample_apps::AudioStreamPlayer vrs_sample_apps::ImageStreamPlayer vrs_sample_apps::MotionStreamPlayer vrs_sample_code::ImagePlayer vrs_sample_code::MyCameraStreamPlayer vrs_sample_code::StreamPlayerDemo

Public Member Functions

virtual void onAttachedToFileReader (RecordFileReader &, StreamId)
 
virtual bool processRecordHeader (const CurrentRecord &record, DataReference &outDataReference)
 
virtual void processRecord (const CurrentRecord &record, uint32_t readSize)
 
virtual bool processStateHeader (const CurrentRecord &, DataReference &)
 
virtual void processState (const CurrentRecord &, uint32_t)
 
virtual bool processConfigurationHeader (const CurrentRecord &, DataReference &)
 
virtual void processConfiguration (const CurrentRecord &, uint32_t)
 
virtual bool processDataHeader (const CurrentRecord &, DataReference &)
 
virtual void processData (const CurrentRecord &, uint32_t)
 
virtual int recordReadComplete (RecordFileReader &, const IndexRecord::RecordInfo &)
 
virtual void flush ()
 

Detailed Description

Class designed to receive record data when reading a VRS file.

Class to handle data read from records of a VRS file, by attaching an instance to one or more streams of a RecordFileReader. This base class is the bare-bones way to read VRS records. Reading records is now probably better handled by the specialized RecordFormatStreamPlayer.

For each record, the stream player will be presented the record in a callback named processXXXHeader(), which will tell if the record should be read by returning true, in which case the callback is expected to set the provided DataReference to tell where the record's data should be read. Upon completion of the read, the matching processXXX() callback will be invoked, allowing the StreamPlayer to interpret/use the read data.

Member Function Documentation

◆ flush()

virtual void vrs::StreamPlayer::flush ( )
inlinevirtual

A stream player might be queueing read data for asynchronous processing. This method can be called to signal that internal data/queues should be flushed, so processing can be guaranteed to be completed.

◆ onAttachedToFileReader()

virtual void vrs::StreamPlayer::onAttachedToFileReader ( RecordFileReader ,
StreamId   
)
inlinevirtual

Callback called just after the instance was attached to a RecordFileReader.

Parameters
RecordFileReaderThe record file reader the instance was attached to.
StreamIdStream the instance was attached to.

Reimplemented in vrs::RecordFormatStreamPlayer.

◆ processConfiguration()

virtual void vrs::StreamPlayer::processConfiguration ( const CurrentRecord ,
uint32_t   
)
inlinevirtual

Called after processConfigurationHeader() set the DataReference it was given and returned true, and after data was written to memory specified by the DataReference.

Parameters
recordDetails about the record being read.
See also
CurrentRecord.
Parameters
bytesWrittenCountNumber of bytes read and written to the DataReference.

◆ processConfigurationHeader()

virtual bool vrs::StreamPlayer::processConfigurationHeader ( const CurrentRecord ,
DataReference  
)
inlinevirtual

Called when a Configuration record is about to be read.

Parameters
recordDetails about the record being read.
See also
CurrentRecord.
Parameters
outDataReferenceReference to be set, so as to tell where data should be read.
See also
DataReference
Returns
True, if the record should be read.

◆ processData()

virtual void vrs::StreamPlayer::processData ( const CurrentRecord ,
uint32_t   
)
inlinevirtual

Called after processDataHeader() set the DataReference it was given and returned true, and after data was written to memory specified by the DataReference.

Parameters
recordDetails about the record being read.
See also
CurrentRecord.
Parameters
bytesWrittenCountNumber of bytes read and written to the DataReference.

◆ processDataHeader()

virtual bool vrs::StreamPlayer::processDataHeader ( const CurrentRecord ,
DataReference  
)
inlinevirtual

Called when a data record is about to be read.

Parameters
recordDetails about the record being read.
See also
CurrentRecord.
Parameters
outDataReferenceReference to be set, so as to tell where data should be read.
See also
DataReference
Returns
True, if the record should be read.

◆ processRecord()

virtual void vrs::StreamPlayer::processRecord ( const CurrentRecord record,
uint32_t  readSize 
)
inlinevirtual

Called after processRecordHeader() set the DataReference it was given and returned true, and after data was written to memory specified by the DataReference.

Parameters
recordDetails about the record being read.
See also
CurrentRecord.
Parameters
bytesWrittenCountNumber of bytes read and written to the DataReference. The default implementation delegates to the specialized callbacks below.

Reimplemented in vrs::RecordFormatStreamPlayer.

◆ processRecordHeader()

virtual bool vrs::StreamPlayer::processRecordHeader ( const CurrentRecord record,
DataReference outDataReference 
)
inlinevirtual

Callback called when a record of any type is about to be read.

The default implementation delegates to the specialized callbacks below.

Parameters
recordDetails about the record being read.
See also
CurrentRecord.
Parameters
outDataReferenceReference to be set, so as to tell where data should be read.
See also
DataReference
Returns
True, if the record should be read.

Reimplemented in vrs::RecordFormatStreamPlayer.

◆ processState()

virtual void vrs::StreamPlayer::processState ( const CurrentRecord ,
uint32_t   
)
inlinevirtual

Called after processStateHeader() set the DataReference it was given and returned true, and after data was written to memory specified by the DataReference.

Parameters
recordDetails about the record being read.
See also
CurrentRecord.
Parameters
bytesWrittenCountNumber of bytes read and written to the DataReference.

◆ processStateHeader()

virtual bool vrs::StreamPlayer::processStateHeader ( const CurrentRecord ,
DataReference  
)
inlinevirtual

Called when a State record is about to be read.

Parameters
recordDetails about the record being read.
See also
CurrentRecord.
Parameters
outDataReferenceReference to be set, so as to tell where data should be read.
See also
DataReference
Returns
True, if the record should be read.

◆ recordReadComplete()

virtual int vrs::StreamPlayer::recordReadComplete ( RecordFileReader ,
const IndexRecord::RecordInfo  
)
inlinevirtual

Called after a record was read, so maybe a follow-up action can be performed.

Parameters
readerthe VRS file reader used to read the file.
recordInfothe record that was just read.

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