56 using TL_VEC = std::vector<TilePartLength<uint32_t>>;
103 auto result = &(*tilePartLengthsIter_);
114 [[nodiscard]]
bool empty() const noexcept
130 grklog.warn(
"TLM: marker id %d is greater than last marker id %d. Disabling TLM.", markerId,
172 explicit TLMMarker(uint16_t numSignalledTiles);
178 TLMMarker(
const std::string& filePath, uint16_t numSignalledTiles, uint64_t tileStreamStart);
197 bool read(std::span<uint8_t> headerData, uint16_t headerSize);
227 [[nodiscard]]
bool valid() const noexcept;
257 void add(uint16_t tile_index, uint32_t tile_part_size) noexcept;
Manages a collection of TLM markers, assuming strictly increasing marker ids.
Definition TLMMarker.h:51
void push_back(TilePartLength< uint32_t > tilePartLength)
Pushes a TilePartLength.
Definition TLMMarker.h:69
bool valid_
Flag indicating if the manager is valid (i.e., marker ids are strictly increasing).
Definition TLMMarker.h:159
void reset() noexcept
Resets the iterator state for traversing markers.
Definition TLMMarker.h:87
int32_t lastMarkerId_
stores last valid marker id.
Definition TLMMarker.h:154
TLMMarkerManager()
Definition TLMMarker.h:59
TL_VEC::iterator tilePartLengthsIter_
Iterator into the single TLM tile lengths vector.
Definition TLMMarker.h:148
std::vector< TilePartLength< uint32_t > > TL_VEC
vector of TilePartLength stored in sequence as they appear in the code stream
Definition TLMMarker.h:56
TilePartLength< uint32_t > * next(bool peek=false) noexcept
Gets the next tile part length.
Definition TLMMarker.h:98
std::unique_ptr< TL_VEC > tilePartLengths_
Single TL_VEC storing all tile part lengths in order.
Definition TLMMarker.h:143
bool empty() const noexcept
Checks if the manager contains no markers.
Definition TLMMarker.h:114
bool validateMarkerId(uint8_t markerId) noexcept
Validates marker id.
Definition TLMMarker.h:124
Caches tile processors so that repeated decompress calls on the same codec can reuse SOT metadata,...
Definition TileCache.h:108
Stores state of rectangular window of tiles slated for decompression Each tile's slated or completely...
Definition TileWindow.h:34
ResWindow.
Definition CompressedChunkCache.h:36
ILogger & grklog
Definition Logger.cpp:24
std::vector< std::unique_ptr< TPSeq > > TPSEQ_VEC
Definition TPFetchSeq.h:181
std::unique_ptr< TLMMarkerManager > markerManager_
Definition TLMMarker.h:276
bool writeEnd()
Finishes writing TLM marker.
Definition TLMMarker.cpp:424
bool valid_
true if TLM markers are valid
Definition TLMMarker.h:297
void invalidate() noexcept
Marks the object as invalid, in case of corrupt TLM marker.
Definition TLMMarker.cpp:104
void rewind() noexcept
Rewinds state so that tile part lengths can be read.
Definition TLMMarker.cpp:257
bool valid() const noexcept
Checks if the object is valid.
Definition TLMMarker.cpp:99
IStream * stream_
IStream
Definition TLMMarker.h:287
void add(TilePartLength< uint32_t > info)
Adds a new tile part(decompression).
Definition TLMMarker.cpp:109
bool writeBegin(uint32_t numTilePartsTotal)
Prepares to write TLM marker to code stream.
Definition TLMMarker.cpp:372
bool read(std::span< uint8_t > headerData, uint16_t headerSize)
Reads a TLM marker.
Definition TLMMarker.cpp:132
void seekNextSlated(TileWindow *tilesToDecompress, TileCache *tileCache, IStream *stream)
Seeks to next scheduled tile part.
Definition TLMMarker.cpp:322
std::string filePath_
Definition TLMMarker.h:324
TLMMarker(uint16_t numSignalledTiles)
Constructs a TLMMarker.
Definition TLMMarker.cpp:66
bool hasTileIndices_
true if TLM markers store tile indices.
Definition TLMMarker.h:305
uint8_t getNumTileParts(uint16_t tileIndex) const noexcept
Gets the number of tile parts for a given tile index.
Definition TLMMarker.cpp:279
const TPSEQ_VEC & getTileParts(void) const
Definition TLMMarker.cpp:274
~TLMMarker()=default
Destroys a TLMMarker.
TPSEQ_VEC tilePartsPerTile_
stores tile part info sequence for each tile Useful if SOT markers don't store number of tile parts p...
Definition TLMMarker.h:282
TilePartLength< uint32_t > * next(bool peek)
Gets next TilePartLength.
Definition TLMMarker.cpp:295
uint16_t tileCount_
used to track tile index when there are no tile indices stored in markers
Definition TLMMarker.h:311
uint64_t streamStart
cached start of stream before writing TLM markers
Definition TLMMarker.h:292
void readComplete(uint64_t tileStreamStart) noexcept
Completes calculations such as absolute tile part start position for all tile parts in tilePartsPerTi...
Definition TLMMarker.cpp:248
uint64_t tilePartStart_
calculated start position for current tile part parsed from markers
Definition TLMMarker.h:322
uint16_t numSignalledTiles_
number of tiles signalled in main header
Definition TLMMarker.h:316
Stores tile part's length and tile index.
Definition TLMMarker.h:32
uint16_t tileIndex_
Definition TLMMarker.h:40
T length_
Definition TLMMarker.h:42
TilePartLength(uint16_t tileIndex, T len)
Constructs a TilePartLength.
Definition TLMMarker.h:38