1#ifndef TAG_PARSER_MATROSKACUES_H
2#define TAG_PARSER_MATROSKACUES_H
7#include <unordered_map>
14 constexpr std::uint64_t currentValue()
const;
15 void update(std::uint64_t newValue);
16 constexpr std::uint64_t initialValue()
const;
19 std::uint64_t m_initialValue;
20 std::uint64_t m_currentValue;
24 : m_initialValue(initialValue)
25 , m_currentValue(initialValue)
31 return m_currentValue;
36 m_currentValue = newValue;
41 return m_initialValue;
47 constexpr std::uint64_t referenceOffset()
const;
50 std::uint64_t m_referenceOffset;
55 , m_referenceOffset(referenceOffset)
61 return m_referenceOffset;
69 std::uint64_t totalSize()
const;
72 bool updateOffsets(std::uint64_t originalOffset, std::uint64_t newOffset);
73 bool updateRelativeOffsets(std::uint64_t referenceOffset, std::uint64_t originalRelativeOffset, std::uint64_t newRelativeOffset);
79 template <
class T1,
class T2>
inline std::size_t operator()(
const std::pair<T1, T2> &pair)
const
82 seed ^= std::hash<T1>()(pair.first) + 0x9e3779b9;
83 seed ^= std::hash<T2>()(pair.second) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
88 bool updateSize(EbmlElement *element,
int shift);
90 EbmlElement *m_cuesElement;
91 std::unordered_map<EbmlElement *, MatroskaOffsetStates> m_offsets;
92 std::unordered_multimap<std::uint64_t, EbmlElement *> m_cueElementByOriginalOffset;
93 std::unordered_map<EbmlElement *, MatroskaReferenceOffsetPair> m_relativeOffsets;
94 std::unordered_multimap<std::pair<std::uint64_t, std::uint64_t>, EbmlElement *, PairHash> m_cueRelativePositionElementByOriginalOffsets;
95 std::unordered_map<EbmlElement *, std::uint64_t> m_sizes;
104 : m_cuesElement(nullptr)
115 return m_cuesElement;
123 m_cuesElement =
nullptr;
The Diagnostics class is a container for DiagMessage.
The EbmlElement class helps to parse EBML files such as Matroska files.
The MatroskaCuePositionUpdater class helps to rewrite the "Cues"-element with shifted positions.
void clear()
Resets the object to its initial state.
MatroskaCuePositionUpdater()
Creates a new MatroskaCuePositionUpdater.
EbmlElement * cuesElement() const
Returns the "Cues"-element specified when calling the parse() method.
The MatroskaOffsetStates holds an offset within a Matroska file.
void update(std::uint64_t newValue)
constexpr std::uint64_t currentValue() const
constexpr std::uint64_t initialValue() const
constexpr MatroskaOffsetStates(std::uint64_t initialValue)
The MatroskaReferenceOffsetPair holds an offset within a Matroska file plus the reference offset.
constexpr std::uint64_t referenceOffset() const
constexpr MatroskaReferenceOffsetPair(std::uint64_t referenceOffset, std::uint64_t initialValue)
#define TAG_PARSER_EXPORT
Marks the symbol to be exported by the tagparser library.
Contains all classes and functions of the TagInfo library.