-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
53 lines (37 loc) · 975 Bytes
/
main.cpp
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
#include <fstream>
#include <string>
#include <sstream>
#include <ctime>
#include <algorithm>
#include "Mp4File.h"
class MyObserver : public Mp4FileObserver {
public:
/**
Processes information messages
@param level Log Level (used for filtering message kinds)
@param message Message
*/
virtual void processMessage(Mp4File::LogLevel level, const char* message) {
std::cout << message << std::endl;
};
};
int main (int argc, char** argv) {
MyObserver obs;
Mp4File& parser = Mp4File::create();
parser.setObserver(&obs);
if (argc < 1) {
std::cout << "mp4parser file.mp4" << std::endl;
return 1;
}
if (!Mp4File::isMp4File(argv[1]) ) {
std::cout << "Not an Mp4 File" << std::endl;
// return 1;
}
std::cout << "file: " << argv[1] << std::endl;
Mp4Source& mp4file = Mp4Source::createFileSource(argv[1]);
parser.parse(mp4file);
std::cout << parser << std::endl;
Mp4File::destroy(parser);
Mp4Source::destroy(mp4file);
return 0;
}