arduino-audio-tools
Loading...
Searching...
No Matches
Public Member Functions | List of all members
SampleTableStore< T > Class Template Referenceabstract

Sequential-access storage for one MP4 sample table (e.g. stsz sample sizes, stco chunk offsets, or the raw stsc/stts RLE entries). Every real access pattern in DemuxerMP4 is append-only while parsing 'moov', then forward-cursor reads while consuming 'mdat' - this interface intentionally only supports that (no random-access mutation, no delete), which is what keeps all three implementations below simple and correct. More...

#include <SampleTableStore.h>

Inheritance diagram for SampleTableStore< T >:
ChunkedSampleTableStore< T, ChunkSize > RamSampleTableStore< T > SourceSeekSampleTableStore< T > SpoolFileSampleTableStore< T >

Public Member Functions

virtual ~SampleTableStore ()=default
 
virtual void append (T value)=0
 Appends one entry - call in file order, once per table entry.
 
virtual void clear ()=0
 Resets to empty - call once per begin()/track.
 
virtual T get (size_t index)=0
 Reads back entry 'index' - index must be < size().
 
virtual void setNextEntryOffset (uint64_t fileOffset)
 
virtual void setOnDiskEntrySize (size_t bytes)
 
virtual size_t size ()=0
 Number of entries appended so far.
 

Detailed Description

template<typename T>
class audio_tools::SampleTableStore< T >

Sequential-access storage for one MP4 sample table (e.g. stsz sample sizes, stco chunk offsets, or the raw stsc/stts RLE entries). Every real access pattern in DemuxerMP4 is append-only while parsing 'moov', then forward-cursor reads while consuming 'mdat' - this interface intentionally only supports that (no random-access mutation, no delete), which is what keeps all three implementations below simple and correct.

Author
Phil Schatzmann

Constructor & Destructor Documentation

◆ ~SampleTableStore()

template<typename T >
virtual ~SampleTableStore ( )
virtualdefault

Member Function Documentation

◆ append()

template<typename T >
virtual void append ( value)
pure virtual

Appends one entry - call in file order, once per table entry.

Implemented in RamSampleTableStore< T >, ChunkedSampleTableStore< T, ChunkSize >, SpoolFileSampleTableStore< T >, and SourceSeekSampleTableStore< T >.

◆ clear()

template<typename T >
virtual void clear ( )
pure virtual

◆ get()

template<typename T >
virtual T get ( size_t  index)
pure virtual

◆ setNextEntryOffset()

template<typename T >
virtual void setNextEntryOffset ( uint64_t  fileOffset)
inlinevirtual

Only meaningful for SourceSeekSampleTableStore: the absolute byte offset (from the start of the original MP4 file) of the entry about to be appended next. Default no-op - other implementations ignore it, so callers can always call this unconditionally before append() without needing to know which implementation is active.

Reimplemented in SourceSeekSampleTableStore< T >.

◆ setOnDiskEntrySize()

template<typename T >
virtual void setOnDiskEntrySize ( size_t  bytes)
inlinevirtual

Only meaningful for SourceSeekSampleTableStore, and only for tables whose on-disk width isn't a fixed sizeof(T) - see its comment. Default no-op.

Reimplemented in SourceSeekSampleTableStore< T >.

◆ size()

template<typename T >
virtual size_t size ( )
pure virtual

The documentation for this class was generated from the following file: