#include <index.h>
Inheritance diagram for IndexManager:
Public Member Functions | |
IndexManager (int PosTableIndex, UInt32 ElementSize) | |
Construct with main stream details. | |
~IndexManager () | |
Free any memory used. | |
void | SetBodySID (UInt32 SID) |
Set the BodySID. | |
void | SetIndexSID (UInt32 SID) |
Set the IndexSID. | |
void | SetEditRate (Rational Rate) |
Set the edit rate from a rational. | |
void | SetEditRate (Int32 Rate_n, Int32 Rate_d) |
Set the edit rate from numerator and denominator. | |
UInt32 | GetBodySID (void) |
Get the BodySID. | |
UInt32 | GetIndexSID (void) |
Get the IndexSID. | |
Rational | GetEditRate (void) |
Get the edit rate. | |
int | AddSubStream (int PosTableIndex, UInt32 ElementSize) |
Add a sub-stream. | |
void | SetPosTableIndex (int StreamID, int PosTableIndex) |
Update the PosTableIndex for a given stream. | |
void | AddEditUnit (int SubStream, Position EditUnit, int KeyOffset=0, int Flags=-1) |
Add an edit unit (of a stream) without a known offset. | |
void | SetOffset (int SubStream, Position EditUnit, UInt64 Offset, int KeyOffset=0, int Flags=-1) |
Set the offset for a particular edit unit of a stream. | |
bool | OfferEditUnit (int SubStream, Position EditUnit, int KeyOffset=0, int Flags=-1) |
Accept or decline an offered edit unit (of a stream) without a known offset. | |
bool | OfferOffset (int SubStream, Position EditUnit, UInt64 Offset, int KeyOffset=0, int Flags=-1) |
Accept or decline an offered offset for a particular edit unit of a stream. | |
void | SetTemporalOffset (Position EditUnit, int Offset) |
Set the temporal offset for a particular edit unit. | |
bool | OfferTemporalOffset (Position EditUnit, int Offset) |
Accept or decline an offered temporal offset for a particular edit unit. | |
void | SetKeyOffset (Position EditUnit, int Offset) |
Set the key-frame offset for a particular edit unit. | |
bool | OfferKeyOffset (Position EditUnit, int Offset) |
Accept or decline an offered key-frame offset for a particular edit unit. | |
Position | AcceptProvisional (void) |
Accept provisional entry. | |
Position | GetLastNewEditUnit (void) |
Read the edit unit of the last entry added (or IndexLowest if none added). | |
void | AcceptNext (void) |
Accept next edit unit offered. | |
int | LogNext (void) |
Log next edit unit offered. | |
int | AcceptLogNext (void) |
Accept the next edit unit offered and log it. | |
Position | ReadLog (int LogID) |
Read the edit unit from a given log slot (or IndexLowest if not available). | |
void | Flush (Position FirstEditUnit, Position LastEditUnit) |
Flush index data to free memory. | |
UInt64 | GetFirstAvailable (void) |
Get the edit unit of the first available entry. | |
UInt64 | GetLastAvailable (void) |
Get the edit unit of the last available entry. | |
IndexTablePtr | MakeIndex (void) |
Generate a CBR index table or empty VBR index table for the managed index. | |
int | AddEntriesToIndex (IndexTablePtr Index, Position FirstEditUnit=IndexTable::IndexLowest, Position LastEditUnit=UINT64_C(0x7fffffffffffffff)) |
Add all complete entries in a range to the supplied index table. | |
int | AddEntriesToIndex (bool UndoReorder, IndexTablePtr Index, Position FirstEditUnit=IndexTable::IndexLowest, Position LastEditUnit=UINT64_C(0x7fffffffffffffff)) |
Add all complete entries in a range to the supplied index table - allow reordering to be undone. | |
void | ForceVBR (void) |
Force an index that appears to be CBR to be treated as VBR. | |
bool | IsCBR (void) |
Access function to read CBR flag. | |
void | SetValueRelativeIndexing (bool Val) |
Set value-relative indexing flag. | |
bool | GetValueRelativeIndexing (void) |
Get value-relative indexing flag. | |
void | SetSubRangeOffset (Position Offset) |
Set the sub-range offset. | |
Protected Member Functions | |
IndexData * | GetArrayEntry (Position EditUnit) |
Access an entry in the managed data array - creating or extending the array as required. | |
void | Log (Position EditUnit) |
Log an edit unit if it is of interest. | |
Protected Attributes | |
bool | UsesReordering |
True if the index table uses reordering. | |
bool | FormatFixed |
True once we have started building an index - can't then change the format. | |
bool | DataIsCBR |
True if the index table will be CBR. | |
int | StreamCount |
Number of streams (including the main stream). | |
int | StreamListSize |
Size of PosTableList and ElementSizeList arrays. | |
int * | PosTableList |
PosTableIndex for each stream. | |
UInt32 * | ElementSizeList |
ElementSize for each stream. | |
int | ManagedDataEntrySize |
Size of each entry in the ManagedData array (depends on number of sub streams). | |
std::map< Position, IndexData * > | ManagedData |
Map of IndexData entries for all recorded edit units. | |
IndexData * | ProvisionalEntry |
Provisional entry, not yet added to ManagedData. | |
Position | ProvisionalEditUnit |
Edit unit of ProvisionalEntry. | |
std::map< Position, int > | UnsatisfiedTemporalOffsets |
Temporal offsets for unknown (possibly future) entries. | |
std::map< Position, int > | UnsatisfiedTemporalDiffs |
Temporal diffs for unknown (possibly future) entries. | |
UInt32 | BodySID |
The BodySID of the data being indexed. | |
UInt32 | IndexSID |
The IndexSID of any index table generated. | |
Rational | EditRate |
The edit rate of the indexed data. | |
std::map< int, Position > | EntryLog |
Log of edit units of entries of interest. | |
int | NextLogID |
Next ID to use for LogEntry. | |
bool | LogWrapped |
True if NextLogID has wrapped back to 0. | |
int | LogNextEntry |
If >= 0 the next entry recorded should be logged with this as the log ID. | |
bool | AcceptNextEntry |
True if next entry should be accepted regardless of other acceptance rules. | |
Position | LastNewEditUnit |
Edit unit of the last entry added. | |
bool | ValueRelativeIndexing |
Flag to allow value-relative indexing. | |
Position | SubRangeOffset |
An offset to apply to correct position if sub-ranging (number of edit units discarded at the start of the essence). | |
Classes | |
struct | IndexData |
IndexManager | ( | int | PosTableIndex, | |
UInt32 | ElementSize | |||
) |
Construct with main stream details.
~IndexManager | ( | ) | [inline] |
Free any memory used.
void SetBodySID | ( | UInt32 | SID | ) | [inline] |
Set the BodySID.
void SetIndexSID | ( | UInt32 | SID | ) | [inline] |
Set the IndexSID.
void SetEditRate | ( | Rational | Rate | ) | [inline] |
Set the edit rate from a rational.
Set the edit rate from numerator and denominator.
UInt32 GetBodySID | ( | void | ) | [inline] |
Get the BodySID.
UInt32 GetIndexSID | ( | void | ) | [inline] |
Get the IndexSID.
Rational GetEditRate | ( | void | ) | [inline] |
Get the edit rate.
int AddSubStream | ( | int | PosTableIndex, | |
UInt32 | ElementSize | |||
) |
Add a sub-stream.
void SetPosTableIndex | ( | int | StreamID, | |
int | PosTableIndex | |||
) | [inline] |
Update the PosTableIndex for a given stream.
void AddEditUnit | ( | int | SubStream, | |
Position | EditUnit, | |||
int | KeyOffset = 0 , |
|||
int | Flags = -1 | |||
) |
Add an edit unit (of a stream) without a known offset.
SubStream | The stream number, 0 = main stream | |
EditUnit | The position of the edit unit being set | |
KeyOffset | The key frame offset for this edit unit (or 0 if not being set by this call) | |
Flags | The flags for this edit unit (or -1 if not being set by this call) |
void SetOffset | ( | int | SubStream, | |
Position | EditUnit, | |||
UInt64 | Offset, | |||
int | KeyOffset = 0 , |
|||
int | Flags = -1 | |||
) |
Set the offset for a particular edit unit of a stream.
SubStream | The stream number, 0 = main stream | |
EditUnit | The position of the edit unit being set | |
Offset | The stream offset of this edit unit | |
KeyOffset | The key frame offset for this edit unit (or 0 if not being set by this call) | |
Flags | The flags for this edit unit (or -1 if not being set by this call) |
bool OfferEditUnit | ( | int | SubStream, | |
Position | EditUnit, | |||
int | KeyOffset = 0 , |
|||
int | Flags = -1 | |||
) |
Accept or decline an offered edit unit (of a stream) without a known offset.
DRAGONS: The EditUnit supplied here is the absolute value from stream start, so will not start at 0 if sub-ranged
bool OfferOffset | ( | int | SubStream, | |
Position | EditUnit, | |||
UInt64 | Offset, | |||
int | KeyOffset = 0 , |
|||
int | Flags = -1 | |||
) |
Accept or decline an offered offset for a particular edit unit of a stream.
DRAGONS: The EditUnit supplied here is relative to the sub-range, so it will start at 0 if sub-ranged (or be -ve for pre-charge)
void SetTemporalOffset | ( | Position | EditUnit, | |
int | Offset | |||
) |
Set the temporal offset for a particular edit unit.
DRAGONS: The EditUnit supplied here is the absolute value from stream start, so will not start at 0 if sub-ranged
bool OfferTemporalOffset | ( | Position | EditUnit, | |
int | Offset | |||
) |
Accept or decline an offered temporal offset for a particular edit unit.
DRAGONS: The EditUnit supplied here is the absolute value from stream start, so will not start at 0 if sub-ranged
void SetKeyOffset | ( | Position | EditUnit, | |
int | Offset | |||
) |
Set the key-frame offset for a particular edit unit.
DRAGONS: The EditUnit supplied here is the absolute value from stream start, so will not start at 0 if sub-ranged
bool OfferKeyOffset | ( | Position | EditUnit, | |
int | Offset | |||
) |
Accept or decline an offered key-frame offset for a particular edit unit.
DRAGONS: The EditUnit supplied here is the absolute value from stream start, so will not start at 0 if sub-ranged
Position AcceptProvisional | ( | void | ) | [inline] |
Accept provisional entry.
Position GetLastNewEditUnit | ( | void | ) | [inline] |
Read the edit unit of the last entry added (or IndexLowest if none added).
void AcceptNext | ( | void | ) | [inline] |
Accept next edit unit offered.
int LogNext | ( | void | ) |
Log next edit unit offered.
The next edit unit stored is recorded in the log.
int AcceptLogNext | ( | void | ) | [inline] |
Accept the next edit unit offered and log it.
Position ReadLog | ( | int | LogID | ) | [inline] |
Read the edit unit from a given log slot (or IndexLowest if not available).
Flush index data to free memory.
UInt64 GetFirstAvailable | ( | void | ) |
Get the edit unit of the first available entry.
UInt64 GetLastAvailable | ( | void | ) |
Get the edit unit of the last available entry.
In a reordered index this returns the last of the contiguous completed entries
IndexTablePtr MakeIndex | ( | void | ) |
Generate a CBR index table or empty VBR index table for the managed index.
int AddEntriesToIndex | ( | IndexTablePtr | Index, | |
Position | FirstEditUnit = IndexTable::IndexLowest , |
|||
Position | LastEditUnit = UINT64_C(0x7fffffffffffffff) | |||
) | [inline] |
Add all complete entries in a range to the supplied index table.
int AddEntriesToIndex | ( | bool | UndoReorder, | |
IndexTablePtr | Index, | |||
Position | FirstEditUnit = IndexTable::IndexLowest , |
|||
Position | LastEditUnit = UINT64_C(0x7fffffffffffffff) | |||
) |
Add all complete entries in a range to the supplied index table - allow reordering to be undone.
void ForceVBR | ( | void | ) | [inline] |
Force an index that appears to be CBR to be treated as VBR.
This allows non-indexed KLVs to cause the essence stream to be VBR in nature
bool IsCBR | ( | void | ) | [inline] |
Access function to read CBR flag.
void SetValueRelativeIndexing | ( | bool | Val | ) | [inline] |
Set value-relative indexing flag.
Value-relative indexing will produce index tables that count from the first byte of the KLV of clip-wrapped essence rather than the key. These tables can be used internally but must not be written to a file as they are not 377M complient
bool GetValueRelativeIndexing | ( | void | ) | [inline] |
Get value-relative indexing flag.
Value-relative indexing will produce index tables that count from the first byte of the KLV of clip-wrapped essence rather than the key. These tables can be used internally but must not be written to a file as they are not 377M complient
void SetSubRangeOffset | ( | Position | Offset | ) | [inline] |
Set the sub-range offset.
Access an entry in the managed data array - creating or extending the array as required.
void Log | ( | Position | EditUnit | ) | [inline, protected] |
Log an edit unit if it is of interest.
bool UsesReordering [protected] |
True if the index table uses reordering.
bool FormatFixed [protected] |
True once we have started building an index - can't then change the format.
DRAGONS: There may be a need to allow changes later...
bool DataIsCBR [protected] |
True if the index table will be CBR.
int StreamCount [protected] |
Number of streams (including the main stream).
int StreamListSize [protected] |
Size of PosTableList and ElementSizeList arrays.
int* PosTableList [protected] |
PosTableIndex for each stream.
UInt32* ElementSizeList [protected] |
ElementSize for each stream.
int ManagedDataEntrySize [protected] |
Size of each entry in the ManagedData array (depends on number of sub streams).
std::map<Position, IndexData*> ManagedData [protected] |
Map of IndexData entries for all recorded edit units.
IndexData* ProvisionalEntry [protected] |
Provisional entry, not yet added to ManagedData.
Position ProvisionalEditUnit [protected] |
Edit unit of ProvisionalEntry.
std::map<Position, int> UnsatisfiedTemporalOffsets [protected] |
Temporal offsets for unknown (possibly future) entries.
std::map<Position, int> UnsatisfiedTemporalDiffs [protected] |
Temporal diffs for unknown (possibly future) entries.
int NextLogID [protected] |
Next ID to use for LogEntry.
bool LogWrapped [protected] |
True if NextLogID has wrapped back to 0.
int LogNextEntry [protected] |
If >= 0 the next entry recorded should be logged with this as the log ID.
bool AcceptNextEntry [protected] |
True if next entry should be accepted regardless of other acceptance rules.
Position LastNewEditUnit [protected] |
Edit unit of the last entry added.
bool ValueRelativeIndexing [protected] |
Flag to allow value-relative indexing.
Position SubRangeOffset [protected] |
An offset to apply to correct position if sub-ranging (number of edit units discarded at the start of the essence).