Tag Parser 10.3.1
C++ library for reading and writing MP4 (iTunes), ID3, Vorbis, Opus, FLAC and Matroska tags
mp4container.h
Go to the documentation of this file.
1#ifndef TAG_PARSER_MP4CONTAINER_H
2#define TAG_PARSER_MP4CONTAINER_H
3
4#include "./mp4atom.h"
5#include "./mp4tag.h"
6#include "./mp4track.h"
7
8#include "../genericcontainer.h"
9
10#include <cstdint>
11#include <memory>
12#include <vector>
13
14namespace TagParser {
15
16class MediaFileInfo;
17
18class TAG_PARSER_EXPORT Mp4Container final : public GenericContainer<MediaFileInfo, Mp4Tag, Mp4Track, Mp4Atom> {
19public:
20 Mp4Container(MediaFileInfo &fileInfo, std::uint64_t startOffset);
21 ~Mp4Container() override;
22
23 bool supportsTrackModifications() const override;
24 bool isFragmented() const;
25 void reset() override;
26 ElementPosition determineTagPosition(Diagnostics &diag) const override;
27 ElementPosition determineIndexPosition(Diagnostics &diag) const override;
28
29protected:
30 void internalParseHeader(Diagnostics &diag, AbortableProgressFeedback &progress) override;
31 void internalParseTags(Diagnostics &diag, AbortableProgressFeedback &progress) override;
32 void internalParseTracks(Diagnostics &diag, AbortableProgressFeedback &progress) override;
33 void internalMakeFile(Diagnostics &diag, AbortableProgressFeedback &progress) override;
34
35private:
36 void updateOffsets(const std::vector<std::int64_t> &oldMdatOffsets, const std::vector<std::int64_t> &newMdatOffsets, Diagnostics &diag,
38
39 bool m_fragmented;
40};
41
43{
44 return true;
45}
46
51inline bool Mp4Container::isFragmented() const
52{
53 return m_fragmented;
54}
55
56} // namespace TagParser
57
58#endif // TAG_PARSER_MP4CONTAINER_H
The AbortableProgressFeedback class provides feedback about an ongoing operation via callbacks.
The Diagnostics class is a container for DiagMessage.
Definition: diagnostics.h:156
The GenericContainer class helps parsing header, track, tag and chapter information of a file.
The MediaFileInfo class allows to read and write tag information providing a container/tag format ind...
Definition: mediafileinfo.h:75
Implementation of GenericContainer<MediaFileInfo, Mp4Tag, Mp4Track, Mp4Atom>.
Definition: mp4container.h:18
bool supportsTrackModifications() const override
Returns whether the implementation supports adding or removing of tracks.
Definition: mp4container.h:42
bool isFragmented() const
Returns whether the file is fragmented.
Definition: mp4container.h:51
#define TAG_PARSER_EXPORT
Marks the symbol to be exported by the tagparser library.
Contains all classes and functions of the TagInfo library.
Definition: aaccodebook.h:10
ElementPosition
Definition: settings.h:13