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>
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;
67 RecordFormatStreamPlayer() =
default;
72 RecordFormatStreamPlayer(
const RecordFormatStreamPlayer&) =
delete;
73 RecordFormatStreamPlayer& operator=(
const RecordFormatStreamPlayer&) =
delete;
74 RecordFormatStreamPlayer(RecordFormatStreamPlayer&&) =
default;
75 RecordFormatStreamPlayer& operator=(RecordFormatStreamPlayer&&) =
default;
76 ~RecordFormatStreamPlayer()
override =
default;
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_{};
Specialized version of ContentBlockReader to handle content blocks containing audio data.
Definition ContentBlockReader.h:90
Specification of a VRS record content block.
Definition RecordFormat.h:522
Specialized version of ContentBlockReader to handle DataLayout blocks.
Definition ContentBlockReader.h:152
The DataLayout class describes the data stored inside a DataLayoutContentBlock.
Definition DataLayout.h:210
Container of data pointers, to tell where to write data when reading a record.
Definition DataReference.h:61
Specialized version of ContentBlockReader to handle content blocks containing an image.
Definition ContentBlockReader.h:73
The class to read VRS files.
Definition RecordFileReader.h:76
Type
Definition Record.h:94
VRS stream identifier class.
Definition StreamId.h:251
Class designed to receive record data when reading a VRS file.
Definition StreamPlayer.h:54
DataLayout definitions use to describe a video image content block.
Definition DataLayoutConventions.h:101
Name and type conventions used to map ContentBlockReader needs to DataLayout data.
Definition DataLayoutConventions.cpp:22
Definition Compressor.cpp:130
Class describing which record is being read. Most fields are really self explanatory.
Definition StreamPlayer.h:28