-
Notifications
You must be signed in to change notification settings - Fork 4
/
file.h
54 lines (47 loc) · 1.59 KB
/
file.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
//
// Created by wlanjie on 2018/2/7.
//
#ifndef MP4_FILE_H
#define MP4_FILE_H
#include "atom.h"
#include "atomfactory.h"
#include "ftyp.h"
#include "movie.h"
namespace mp4 {
const UI32 FILE_BRAND_ISOM = ATOM_TYPE('i', 's', 'o', 'm');
const UI32 FILE_BRAND_ISO5 = ATOM_TYPE('i', 's', 'o', '5');
const UI32 FILE_BRAND_ISO6 = ATOM_TYPE('i', 's', 'o', '6');
const UI32 FILE_BRAND_MP41 = ATOM_TYPE('m', 'p', '4', '1');
const UI32 FILE_BRAND_MP42 = ATOM_TYPE('m', 'p', '4', '2');
const UI32 FILE_BRAND_M4A_ = ATOM_TYPE('M', '4', 'A', ' ');
const UI32 FILE_BRAND_AVC1 = ATOM_TYPE('a', 'v', 'c', '1');
const UI32 FILE_BRAND_HVC1 = ATOM_TYPE('h', 'v', 'c', '1');
class File : public AtomParent {
public:
File(Movie* movie = nullptr);
File(ByteStream& stream,
AtomFactory& factory,
bool moovOnly);
File(ByteStream& stream, bool moovOnly = false);
virtual ~File();
List<Atom> &getTopLevelAtoms() { return children; }
Movie* getMovie() { return movie; }
Ftyp *getFileType() { return ftyp; }
Result setFileType(UI32 major_brand,
UI32 minor_version,
UI32 *compatible_brands = nullptr,
Cardinal compatible_brand_count = 0);
bool isMoovBeforeMdat() const { return moovIsBeforeMdat; }
Result write(ByteStream& stream);
private:
// methods
void parseStream(ByteStream &stream,
AtomFactory &factory,
bool moovOnly);
void release(Array<Array<UI64>*> trakChunkOffsetsBackup);
Movie* movie;
Ftyp* ftyp;
bool moovIsBeforeMdat;
};
}
#endif //MP4_FILE_H