23#include <vrs/ContentBlockReader.h>
24#include <vrs/DataLayout.h>
25#include <vrs/RecordFormat.h>
26#include <vrs/StreamPlayer.h>
27#include <vrs/VrsExport.h>
28#include <vrs/os/UndoWindows.h>
39class DataLayoutBlockReader;
40class ImageBlockReader;
41class AudioBlockReader;
43namespace datalayout_conventions {
50 double lastReadRecordTimestamp = std::numeric_limits<double>::max();
52 vector<unique_ptr<ContentBlockReader>> contentReaders;
53 vector<unique_ptr<DataLayout>> expectedDataLayouts;
54 vector<unique_ptr<DataLayout>> legacyDataLayouts;
106 return onUnsupportedBlock(record, blockIndex, cb);
119 return onUnsupportedBlock(record, blockIndex, cb);
132 return onUnsupportedBlock(rec, blkIdx, cb);
158 void processRecord(
const CurrentRecord& record, uint32_t readSize)
override;
167 return currentReader_;
174 inline T& getExpectedLayout(
DataLayout& layout,
size_t blockIndex) {
175 return getCachedLayout<T>(currentReader_->expectedDataLayouts, layout, blockIndex);
180 inline T& getLegacyLayout(DataLayout& layout,
size_t blockIndex) {
181 return getCachedLayout<T>(currentReader_->legacyDataLayouts, layout, blockIndex);
185 vector<unique_ptr<DataLayout>>& layoutCache,
188 if (layoutCache.size() <= blockIndex) {
189 layoutCache.resize(blockIndex + 1);
191 if (!layoutCache[blockIndex]) {
192 T* expectedLayout =
new T;
193 layoutCache[blockIndex].reset(expectedLayout);
194 expectedLayout->mapLayout(layout);
196 return reinterpret_cast<T&
>(*layoutCache[blockIndex].get());
199 RecordFileReader* recordFileReader_{};
203 map<tuple<StreamId, Record::Type, uint32_t>, RecordFormatReader> readers_;
204 map<pair<StreamId, Record::Type>, RecordFormatReader*> lastReader_;
205 RecordFormatReader* currentReader_{};
Specification of a VRS record content block.
Definition RecordFormat.h:512
The DataLayout class describes the data stored inside a DataLayoutContentBlock.
Definition DataLayout.h:211
Container of data pointers, to tell where to write data when reading a record.
Definition DataReference.h:61
The class to read VRS files.
Definition RecordFileReader.h:76
Type
Definition Record.h:91
VRS stream identifier class.
Definition StreamId.h:251
Class designed to receive record data when reading a VRS file.
Definition StreamPlayer.h:54
Definition Compressor.cpp:113
Class describing which record is being read. Most fields are really self explanatory.
Definition StreamPlayer.h:28