Tag Parser  6.5.0
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 MEDIA_MP4CONTAINER_H
2 #define MEDIA_MP4CONTAINER_H
3 
4 #include "./mp4atom.h"
5 #include "./mp4tag.h"
6 #include "./mp4track.h"
7 
8 #include "../genericcontainer.h"
9 
10 #include <c++utilities/conversion/types.h>
11 
12 #include <memory>
13 #include <vector>
14 
15 namespace Media {
16 
17 class MediaFileInfo;
18 
19 class TAG_PARSER_EXPORT Mp4Container : public GenericContainer<MediaFileInfo, Mp4Tag, Mp4Track, Mp4Atom>
20 {
21 public:
22  Mp4Container(MediaFileInfo &fileInfo, uint64 startOffset);
23  ~Mp4Container();
24 
25  bool supportsTrackModifications() const;
26  bool isFragmented() const;
27  void reset();
28  ElementPosition determineTagPosition() const;
29  ElementPosition determineIndexPosition() const;
30 
31 protected:
32  void internalParseHeader();
33  void internalParseTags();
34  void internalParseTracks();
35  void internalMakeFile();
36 
37 private:
38  void updateOffsets(const std::vector<int64> &oldMdatOffsets, const std::vector<int64> &newMdatOffsets);
39 
40  bool m_fragmented;
41 };
42 
44 {
45  return true;
46 }
47 
52 inline bool Mp4Container::isFragmented() const
53 {
54  return m_fragmented;
55 }
56 
57 }
58 
59 #endif // MEDIA_MP4CONTAINER_H
bool isFragmented() const
Returns whether the file is fragmented.
Definition: mp4container.h:52
The GenericContainer class helps parsing header, track, tag and chapter information of a file...
bool supportsTrackModifications() const
Returns whether the implementation supports adding or removing of tracks.
Definition: mp4container.h:43
Implementation of GenericContainer<MediaFileInfo, Mp4Tag, Mp4Track, Mp4Atom>.
Definition: mp4container.h:19
The MediaFileInfo class allows to read and write tag information providing a container/tag format ind...
Definition: mediafileinfo.h:53
Contains all classes and functions of the TagInfo library.
Definition: exceptions.h:9
#define TAG_PARSER_EXPORT
Marks the symbol to be exported by the tagparser library.