21#include <vrs/DataLayout.h>
22#include <vrs/DataLayoutConventions.h>
23#include <vrs/StreamPlayer.h>
24#include <vrs/VrsExport.h>
40class VRS_API ContentBlockReader {
48 static unique_ptr<ContentBlockReader>
49 build(
const RecordFormat& recordFormat,
size_t blockIndex, unique_ptr<DataLayout>&& blockLayout);
60 ContentBlockReader(
const RecordFormat& recordFormat,
size_t blockIndex)
61 : recordFormat_(recordFormat), blockIndex_(blockIndex) {}
67 const size_t blockIndex_;
68 unique_ptr<datalayout_conventions::NextContentBlockSpec> contentBlockSpec_;
73class VRS_API ImageBlockReader :
public ContentBlockReader {
75 ImageBlockReader(
const RecordFormat& recordFormat,
size_t blockIndex)
76 : ContentBlockReader(recordFormat, blockIndex) {}
85 unique_ptr<datalayout_conventions::VideoFrameSpec> videoFrameSpec_;
90class VRS_API AudioBlockReader :
public ContentBlockReader {
92 AudioBlockReader(
const RecordFormat& recordFormat,
size_t blockIndex)
93 : ContentBlockReader(recordFormat, blockIndex) {}
103 size_t indexUpperLimit,
104 size_t lastIndexToCheck,
105 bool& readNextBlock);
106 bool audioContentFromAudioSpec(
118class VRS_API CustomBlockReader :
public ContentBlockReader {
120 CustomBlockReader(
const RecordFormat& recordFormat,
size_t blockIndex)
121 : ContentBlockReader(recordFormat, blockIndex) {}
129class VRS_API UnsupportedBlockReader :
public ContentBlockReader {
131 UnsupportedBlockReader(
const RecordFormat& recordFormat,
size_t blockIndex)
132 : ContentBlockReader(recordFormat, blockIndex) {}
142class VRS_API EmptyBlockReader :
public ContentBlockReader {
144 EmptyBlockReader(
const RecordFormat& recordFormat,
size_t blockIndex)
145 : ContentBlockReader(recordFormat, blockIndex) {}
152class VRS_API DataLayoutBlockReader :
public ContentBlockReader {
154 DataLayoutBlockReader(
157 unique_ptr<DataLayout>&& blockLayout)
158 : ContentBlockReader(recordFormat, blockIndex), blockLayout_{std::move(blockLayout)} {}
174 unique_ptr<DataLayout> blockLayout_;
bool readBlock(const CurrentRecord &, RecordFormatStreamPlayer &) override
Definition ContentBlockReader.cpp:203
Specification of a VRS record content block.
Definition RecordFormat.h:522
virtual ~ContentBlockReader()
Virtual destructor, since this is an abstract class.
virtual bool readBlock(const CurrentRecord &, RecordFormatStreamPlayer &)=0
static unique_ptr< ContentBlockReader > build(const RecordFormat &recordFormat, size_t blockIndex, unique_ptr< DataLayout > &&blockLayout)
Definition ContentBlockReader.cpp:86
bool readBlock(const CurrentRecord &, RecordFormatStreamPlayer &) override
Definition ContentBlockReader.cpp:407
bool mapToBlockLayout(DataLayout &desiredLayout)
Definition ContentBlockReader.h:165
bool readBlock(const CurrentRecord &, RecordFormatStreamPlayer &) override
Definition ContentBlockReader.cpp:429
The DataLayout class describes the data stored inside a DataLayoutContentBlock.
Definition DataLayout.h:210
bool mapLayout(DataLayout &targetLayout)
Definition DataLayout.cpp:130
bool readBlock(const CurrentRecord &, RecordFormatStreamPlayer &) override
Definition ContentBlockReader.cpp:474
bool readBlock(const CurrentRecord &, RecordFormatStreamPlayer &) override
Definition ContentBlockReader.cpp:320
bool readBlock(const CurrentRecord &, RecordFormatStreamPlayer &) override
Definition ContentBlockReader.cpp:422
DataLayout definitions use to describe what's in an audio content block.
Definition DataLayoutConventions.h:145
DataLayout definitions use to describe what's in an image content block.
Definition DataLayoutConventions.h:65
Definition Compressor.cpp:130
Class describing which record is being read. Most fields are really self explanatory.
Definition StreamPlayer.h:28