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
55
56
57
58
59
#ifndef METADATAPARSER_H
#define METADATAPARSER_H
#include <QStringList>
#include "nwutils.h"
struct VideoTrack {
int resolutionX;
int resolutionY;
};
struct AudioTrack {
};
struct SubtitleTrack {
};
enum MetaDataTrackType {
video, subtitle, attachment, audio
};
struct MetaDataTrack {
float id;
QString name;
union {
struct VideoTrack video;
struct AudioTrack audio;
struct SubtitleTrack subtitle;
} track;
int type;
};
struct MetaDataChapter {
float start;
float end;
QString title;
};
class MetaData {
public:
MetaData();
int duration;
QList<MetaDataTrack> tracks;
QList<MetaDataChapter> chapters;
QString toJson();
std::pair<int,int> resolution() const;
void describe(nw::Describer *de);
};
class MetaDataParser
{
public:
MetaDataParser();
virtual MetaData parse(QString filename) const = 0;
};
#endif // METADATAPARSER_H