forked from ab2022/morpheus
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmorpheus_main.cpp
More file actions
63 lines (45 loc) · 1.57 KB
/
morpheus_main.cpp
File metadata and controls
63 lines (45 loc) · 1.57 KB
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
60
61
#include <iostream>
#include "cxxopts.hpp"
#ifdef __cplusplus
extern "C" {
#endif
using namespace std;
void morph_process(const char* encmpd, const char* drmconf, const char* iframesmpd);
int main (int argc, char *argv[]) {
string inmpd_o, drmconf_o, iframesmpd_o;
try
{
cxxopts::Options options(argv[0], "morpheus VOD stand-alone tool");
options.set_width(80).add_options()
("n", "encoder mpd file", cxxopts::value<string>())
("i", "iframes track mpd file", cxxopts::value<string>())
("d", "ckm encrypt context response xml file", cxxopts::value<string>())
("h,help", "Print this help")
;
auto result = options.parse(argc, argv);
if ( result.count("help") || argc == 1 )
{
cout << options.help() << endl;
exit(0);
}
if (result.count("n"))
inmpd_o = result["n"].as<string>();
if (result.count("i"))
iframesmpd_o = result["i"].as<string>().c_str();
if (result.count("d"))
drmconf_o = result["d"].as<string>().c_str();
}
catch (const cxxopts::OptionException& e)
{
cout << "error parsing options: " << e.what() << endl;
exit(1);
}
const char* inmpd = inmpd_o.length() ? inmpd_o.c_str() : NULL;
const char* drmconf = drmconf_o.length() ? drmconf_o.c_str() : NULL;
const char* iframesmpd = iframesmpd_o.length() ? iframesmpd_o.c_str() : NULL;
morph_process(inmpd, drmconf, iframesmpd);
return EXIT_SUCCESS;
}
#ifdef __cplusplus
}
#endif