1#ifndef TAG_PARSER_MATROSKACONTAINER_H
2#define TAG_PARSER_MATROSKACONTAINER_H
19class MatroskaSeekInfo;
20class MatroskaEditionEntry;
24class TAG_PARSER_EXPORT MatroskaContainer final :
public GenericContainer<MediaFileInfo, MatroskaTag, MatroskaTrack, EbmlElement> {
26 MatroskaContainer(MediaFileInfo &stream, std::uint64_t startOffset);
27 ~MatroskaContainer()
override;
29 void validateIndex(Diagnostics &diag, AbortableProgressFeedback &progress);
30 std::uint64_t maxIdLength()
const;
31 std::uint64_t maxSizeLength()
const;
32 const std::vector<std::unique_ptr<MatroskaSeekInfo>> &seekInfos()
const;
34 const std::vector<std::unique_ptr<MatroskaEditionEntry>> &editionEntires()
const;
35 MatroskaChapter *chapter(std::size_t index)
override;
36 std::size_t chapterCount()
const override;
37 MatroskaAttachment *createAttachment()
override;
38 MatroskaAttachment *attachment(std::size_t index)
override;
39 std::size_t attachmentCount()
const override;
40 ElementPosition determineElementPosition(std::uint64_t elementId, Diagnostics &diag)
const;
42 ElementPosition determineIndexPosition(Diagnostics &diag)
const override;
44 virtual bool supportsTitle()
const override;
45 virtual std::size_t segmentCount()
const override;
47 void reset()
override;
50 void internalParseHeader(Diagnostics &diag, AbortableProgressFeedback &progress)
override;
51 void internalParseTags(Diagnostics &diag, AbortableProgressFeedback &progress)
override;
52 void internalParseTracks(Diagnostics &diag, AbortableProgressFeedback &progress)
override;
53 void internalParseChapters(Diagnostics &diag, AbortableProgressFeedback &progress)
override;
54 void internalParseAttachments(Diagnostics &diag, AbortableProgressFeedback &progress)
override;
55 void internalMakeFile(Diagnostics &diag, AbortableProgressFeedback &progress)
override;
58 void parseSegmentInfo(Diagnostics &diag);
59 void readTrackStatisticsFromTags(Diagnostics &diag);
61 std::uint64_t m_maxIdLength;
62 std::uint64_t m_maxSizeLength;
64 std::vector<EbmlElement *> m_tracksElements;
65 std::vector<EbmlElement *> m_segmentInfoElements;
66 std::vector<EbmlElement *> m_tagsElements;
67 std::vector<EbmlElement *> m_chaptersElements;
68 std::vector<EbmlElement *> m_attachmentsElements;
69 std::vector<std::unique_ptr<MatroskaSeekInfo>> m_seekInfos;
70 std::vector<std::unique_ptr<MatroskaEditionEntry>> m_editionEntries;
71 std::vector<std::unique_ptr<MatroskaAttachment>> m_attachments;
72 std::size_t m_segmentCount;
88 return m_maxSizeLength;
104 return m_editionEntries;
109 return m_attachments.at(index).get();
114 return m_attachments.size();
124 return m_segmentInfoElements.size();
Implementation of TagParser::AbstractAttachment for the Matroska container.
virtual std::size_t segmentCount() const override
Returns the number of segments.
const std::vector< std::unique_ptr< MatroskaSeekInfo > > & seekInfos() const
Returns seek information read from "SeekHead"-elements when parsing segment info.
std::size_t attachmentCount() const override
Returns the number of attachments the container holds.
const std::vector< std::unique_ptr< MatroskaEditionEntry > > & editionEntires() const
Returns the edition entries.
std::uint64_t maxSizeLength() const
Returns the maximal size length in bytes.
MatroskaAttachment * attachment(std::size_t index) override
Returns the attachment with the specified index.
virtual bool supportsTitle() const override
Returns whether the title property is supported.
std::uint64_t maxIdLength() const
Returns the maximal ID length in bytes.
#define TAG_PARSER_EXPORT
Marks the symbol to be exported by the tagparser library.
Contains all classes and functions of the TagInfo library.