Tag Parser 12.5.0
C++ library for reading and writing MP4 (iTunes), ID3, Vorbis, Opus, FLAC and Matroska tags
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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
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:
21 ~Mp4Container() override;
22
23 bool supportsTrackModifications() const override;
24 bool isFragmented() const;
25 void reset() override;
28
29 static const CppUtilities::DateTime epoch;
30
31protected:
32 void internalParseHeader(Diagnostics &diag, AbortableProgressFeedback &progress) override;
33 void internalParseTags(Diagnostics &diag, AbortableProgressFeedback &progress) override;
34 void internalParseTracks(Diagnostics &diag, AbortableProgressFeedback &progress) override;
35 void internalMakeFile(Diagnostics &diag, AbortableProgressFeedback &progress) override;
36
37private:
38 void updateOffsets(const std::vector<std::int64_t> &oldMdatOffsets, const std::vector<std::int64_t> &newMdatOffsets, Diagnostics &diag,
40
41 bool m_fragmented;
42};
43
45{
46 return true;
47}
48
53inline bool Mp4Container::isFragmented() const
54{
55 return m_fragmented;
56}
57
58} // namespace TagParser
59
60#endif // TAG_PARSER_MP4CONTAINER_H
The AbortableProgressFeedback class provides feedback about an ongoing operation via callbacks.
std::uint64_t startOffset() const
Returns the start offset in the related stream.
The Diagnostics class is a container for DiagMessage.
GenericContainer(MediaFileInfo &fileInfo, std::uint64_t startOffset)
The MediaFileInfo class allows to read and write tag information providing a container/tag format ind...
ElementPosition determineIndexPosition(Diagnostics &diag) const override
Determines the position of the index.
bool supportsTrackModifications() const override
Returns whether the implementation supports adding or removing of tracks.
ElementPosition determineTagPosition(Diagnostics &diag) const override
Determines the position of the tags inside the file.
static const CppUtilities::DateTime epoch
Dates within MP4 tracks are expressed as the number of seconds since this date.
void reset() override
Discards all parsing results.
Mp4Container(MediaFileInfo &fileInfo, std::uint64_t startOffset)
Constructs a new container for the specified fileInfo at the specified startOffset.
void internalParseHeader(Diagnostics &diag, AbortableProgressFeedback &progress) override
Internally called to parse the header.
bool isFragmented() const
Returns whether the file is fragmented.
void internalParseTags(Diagnostics &diag, AbortableProgressFeedback &progress) override
Internally called to parse the tags.
void internalParseTracks(Diagnostics &diag, AbortableProgressFeedback &progress) override
Internally called to parse the tracks.
void internalMakeFile(Diagnostics &diag, AbortableProgressFeedback &progress) override
Internally called to make the file.
#define TAG_PARSER_EXPORT
Marks the symbol to be exported by the tagparser library.
Definition global.h:14
Contains all classes and functions of the TagInfo library.
Definition aaccodebook.h:10
ElementPosition
Definition settings.h:13