23#include <vrs/ContentBlockReader.h>
24#include <vrs/DataLayout.h>
25#include <vrs/RecordFormat.h>
26#include <vrs/StreamPlayer.h>
27#include <vrs/os/UndoWindows.h>
38class DataLayoutBlockReader;
39class ImageBlockReader;
40class AudioBlockReader;
42namespace datalayout_conventions {
49 double lastReadRecordTimestamp = std::numeric_limits<double>::max();
51 vector<unique_ptr<ContentBlockReader>> contentReaders;
52 vector<unique_ptr<DataLayout>> expectedDataLayouts;
53 vector<unique_ptr<DataLayout>> legacyDataLayouts;
156 return currentReader_;
163 inline T& getExpectedLayout(
DataLayout& layout,
size_t blockIndex) {
164 return getCachedLayout<T>(currentReader_->expectedDataLayouts, layout, blockIndex);
169 inline T& getLegacyLayout(DataLayout& layout,
size_t blockIndex) {
170 return getCachedLayout<T>(currentReader_->legacyDataLayouts, layout, blockIndex);
174 vector<unique_ptr<DataLayout>>& layoutCache,
177 if (layoutCache.size() <= blockIndex) {
178 layoutCache.resize(blockIndex + 1);
180 if (!layoutCache[blockIndex]) {
181 T* expectedLayout =
new T;
182 layoutCache[blockIndex].reset(expectedLayout);
183 expectedLayout->mapLayout(layout);
185 return reinterpret_cast<T&
>(*layoutCache[blockIndex].get());
188 RecordFileReader* recordFileReader_{};
192 map<tuple<StreamId, Record::Type, uint32_t>, RecordFormatReader> readers_;
193 map<pair<StreamId, Record::Type>, RecordFormatReader*> lastReader_;
194 RecordFormatReader* currentReader_{};
Specification of a VRS record content block.
Definition RecordFormat.h:509
The DataLayout class describes the data stored inside a DataLayoutContentBlock.
Definition DataLayout.h:209
Container of data pointers, to tell where to write data when reading a record.
Definition DataReference.h:59
The class to read VRS files.
Definition RecordFileReader.h:75
Type
Definition Record.h:90
VRS stream identifier class.
Definition StreamId.h:249
Class designed to receive record data when reading a VRS file.
Definition StreamPlayer.h:53
Definition Compressor.cpp:113
Class describing which record is being read. Most fields are really self explanatory.
Definition StreamPlayer.h:27