Add building via meson, remove outdated options
Co-authored-by: Thulinma <jaron@vietors.com> Change-Id: I2a620c8d98aca7203f6742c66c3f82afe91b5c3c
This commit is contained in:
parent
ca9724f1f8
commit
529adbfaf6
23 changed files with 855 additions and 82 deletions
40
src/analysers/meson.build
Normal file
40
src/analysers/meson.build
Normal file
|
@ -0,0 +1,40 @@
|
|||
|
||||
analysers = [
|
||||
{'name': 'RTMP', 'format': 'rtmp'},
|
||||
{'name': 'FLV', 'format': 'flv'},
|
||||
{'name': 'DTSC', 'format': 'dtsc'},
|
||||
{'name': 'OGG', 'format': 'ogg'},
|
||||
{'name': 'EBML', 'format': 'ebml'},
|
||||
{'name': 'TS', 'format': 'ts'},
|
||||
{'name': 'MP4', 'format': 'mp4'},
|
||||
{'name': 'H264', 'format': 'h264'},
|
||||
{'name': 'HLS', 'format': 'hls'},
|
||||
{'name': 'RIFF', 'format': 'riff'},
|
||||
{'name': 'RTSP', 'format': 'rtsp'},
|
||||
]
|
||||
|
||||
foreach analyser : analysers
|
||||
executables += { 'name': 'MistAnalyser'+analyser.get('name'),
|
||||
'sources' : [
|
||||
files('mist_analyse.cpp',
|
||||
'analyser.cpp',
|
||||
'analyser_'+analyser.get('format')+'.cpp'),
|
||||
header_tgts,
|
||||
],
|
||||
'link': libmist,
|
||||
'defines': [
|
||||
string_opt.format('ANALYSERHEADER', 'analyser_'+analyser.get('format')+'.h'),
|
||||
'-DANALYSERTYPE=Analyser'+analyser.get('name')
|
||||
],
|
||||
'deps': []
|
||||
}
|
||||
endforeach
|
||||
|
||||
executables += {
|
||||
'name': 'MistTranslateH264',
|
||||
'sources' : [files('h264_translate.cpp'), header_tgts],
|
||||
'link': libmist,
|
||||
'defines': [],
|
||||
'deps' : []
|
||||
}
|
||||
|
|
@ -3,14 +3,6 @@
|
|||
#include <mist/json.h>
|
||||
#include <string>
|
||||
|
||||
/*LTS-START*/
|
||||
#ifdef GEOIP
|
||||
#include <GeoIP.h>
|
||||
#define GEOIPV4 "/usr/share/GeoIP/GeoIP.dat"
|
||||
#define GEOIPV6 "/usr/share/GeoIP/GeoIPv6.dat"
|
||||
#endif
|
||||
/*LTS-END*/
|
||||
|
||||
namespace Controller{
|
||||
void checkStreamLimits(std::string streamName, long long currentKbps, long long connectedUsers);
|
||||
void checkServerLimits();
|
||||
|
|
22
src/controller/meson.build
Normal file
22
src/controller/meson.build
Normal file
|
@ -0,0 +1,22 @@
|
|||
|
||||
executables += {
|
||||
'name': 'MistController',
|
||||
'sources' : [
|
||||
files( 'controller.cpp',
|
||||
'controller_updater.cpp',
|
||||
'controller_streams.cpp',
|
||||
'controller_storage.cpp',
|
||||
'controller_connectors.cpp',
|
||||
'controller_statistics.cpp',
|
||||
'controller_limits.cpp',
|
||||
'controller_capabilities.cpp',
|
||||
'controller_uplink.cpp',
|
||||
'controller_api.cpp',
|
||||
'controller_push.cpp'),
|
||||
header_tgts,
|
||||
server_html],
|
||||
'link': libmist,
|
||||
'defines': [],
|
||||
'deps' : []
|
||||
}
|
||||
|
86
src/input/meson.build
Normal file
86
src/input/meson.build
Normal file
|
@ -0,0 +1,86 @@
|
|||
inputs = [
|
||||
{'name' : 'HLS', 'format' : 'hls'},
|
||||
{'name' : 'DTSC', 'format' : 'dtsc'},
|
||||
{'name' : 'MP3', 'format' : 'mp3'},
|
||||
{'name' : 'FLV', 'format' : 'flv'},
|
||||
{'name' : 'OGG', 'format' : 'ogg'},
|
||||
{'name' : 'Buffer', 'format' : 'buffer'},
|
||||
{'name' : 'H264', 'format' : 'h264'},
|
||||
{'name' : 'EBML', 'format' : 'ebml'},
|
||||
{'name' : 'ISMV', 'format' : 'ismv'},
|
||||
{'name' : 'MP4', 'format' : 'mp4'},
|
||||
{'name' : 'TS', 'format' : 'ts'},
|
||||
{'name' : 'Folder', 'format' : 'folder'},
|
||||
{'name' : 'Playlist', 'format' : 'playlist'},
|
||||
{'name' : 'Balancer', 'format' : 'balancer'},
|
||||
{'name' : 'RTSP', 'format' : 'rtsp'},
|
||||
{'name' : 'SRT', 'format' : 'srt'},
|
||||
{'name' : 'SDP', 'format' : 'sdp'},
|
||||
{'name' : 'AAC', 'format' : 'aac'},
|
||||
]
|
||||
|
||||
#Referenced by process targets
|
||||
input_ebml_cpp = files('input_ebml.cpp')
|
||||
input_cpp = files('input.cpp')
|
||||
|
||||
if have_librist
|
||||
inputs += {'name' : 'TSRIST', 'format' : 'tsrist', 'extra' : 'with_rist'}
|
||||
endif
|
||||
|
||||
if have_srt
|
||||
inputs += {'name' : 'TSSRT', 'format' : 'tssrt', 'extra' : 'with_srt'}
|
||||
endif
|
||||
|
||||
av_libs = []
|
||||
|
||||
if get_option('WITH_AV')
|
||||
inputs += {'name' : 'AV', 'format' : 'av'}
|
||||
av_libs = [
|
||||
dependency('libavformat'),
|
||||
dependency('libavcodec'),
|
||||
dependency('libavutil'),
|
||||
]
|
||||
endif
|
||||
|
||||
inputs_tgts = []
|
||||
|
||||
foreach input : inputs
|
||||
link_libs = [libmist]
|
||||
deps = []
|
||||
|
||||
if input.has_key('extra')
|
||||
if input.get('extra').contains('with_rist')
|
||||
deps += librist
|
||||
endif
|
||||
if input.get('extra').contains('with_srt')
|
||||
link_libs += libmist_srt
|
||||
deps += libsrt
|
||||
endif
|
||||
endif
|
||||
if input.get('name').contains('AV')
|
||||
deps += av_libs
|
||||
endif
|
||||
if input.get('name').contains('HLS')
|
||||
deps += ssl_deps
|
||||
endif
|
||||
|
||||
executables += {
|
||||
'name' : 'MistIn'+input.get('name'),
|
||||
'sources' : [
|
||||
files(
|
||||
'mist_in.cpp',
|
||||
'input.cpp',
|
||||
'input_'+input.get('format')+'.cpp',
|
||||
),
|
||||
io_cpp,
|
||||
header_tgts
|
||||
],
|
||||
'link' : link_libs,
|
||||
'deps' : deps,
|
||||
'inc': [],
|
||||
'defines': [
|
||||
string_opt.format('INPUTTYPE', 'input_'+input.get('format')+'.h')
|
||||
]
|
||||
}
|
||||
endforeach
|
||||
|
40
src/make_html.cpp
Normal file
40
src/make_html.cpp
Normal file
|
@ -0,0 +1,40 @@
|
|||
#include <cstdlib>
|
||||
#include <ios>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <ostream>
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
if (argc < 6) {
|
||||
std::cerr << "ERROR EXPECTED MORE FILES" << std::endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
std::ofstream output(argv[1]);
|
||||
|
||||
std::ifstream header(argv[2]);
|
||||
std::ifstream css(argv[3]);
|
||||
std::ifstream footer(argv[4]);
|
||||
|
||||
if (!header.is_open() || !css.is_open() || !footer.is_open()) {
|
||||
std::cerr << "ERROR Couldn't open file" << std::endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
output << header.rdbuf();
|
||||
output << "<script>";
|
||||
for (int i = 5; i < argc; i++) {
|
||||
std::ifstream script(argv[i]);
|
||||
if (!script.is_open()) {
|
||||
std::cerr << "ERROR Couldn't open file" << std::endl;
|
||||
return 1;
|
||||
}
|
||||
output << script.rdbuf();
|
||||
}
|
||||
output << "</script>";
|
||||
output << "<style>" << css.rdbuf() << "</style>";
|
||||
output << footer.rdbuf();
|
||||
std::flush(output);
|
||||
return 0;
|
||||
}
|
||||
|
17
src/meson.build
Normal file
17
src/meson.build
Normal file
|
@ -0,0 +1,17 @@
|
|||
io_cpp = files('io.cpp')
|
||||
|
||||
subdir('analysers')
|
||||
subdir('utils')
|
||||
subdir('input')
|
||||
subdir('output')
|
||||
subdir('process')
|
||||
subdir('controller')
|
||||
|
||||
executables += {
|
||||
'name': 'MistSession',
|
||||
'sources' : [files('session.cpp'), header_tgts],
|
||||
'link': libmist,
|
||||
'defines': [],
|
||||
'deps' : []
|
||||
}
|
||||
|
133
src/output/meson.build
Normal file
133
src/output/meson.build
Normal file
|
@ -0,0 +1,133 @@
|
|||
outputs = [
|
||||
{'name' : 'RTMP', 'format' : 'rtmp'},
|
||||
{'name' : 'DTSC', 'format' : 'dtsc'},
|
||||
{'name' : 'OGG', 'format' : 'ogg', 'extra': ['http']},
|
||||
{'name' : 'FLV', 'format' : 'flv', 'extra': ['http'] },
|
||||
{'name' : 'HTTPMinimalServer', 'format' : 'http_minimalserver', 'extra': ['http']},
|
||||
{'name' : 'MP4', 'format' : 'mp4', 'extra': ['http']},
|
||||
{'name' : 'AAC', 'format' : 'aac', 'extra': ['http']},
|
||||
{'name' : 'MP3', 'format' : 'mp3', 'extra': ['http']},
|
||||
{'name' : 'H264', 'format' : 'h264', 'extra': ['http']},
|
||||
{'name' : 'HDS', 'format' : 'hds', 'extra': ['http']},
|
||||
{'name' : 'SRT', 'format' : 'srt', 'extra': ['http']},
|
||||
{'name' : 'JSON', 'format' : 'json', 'extra': ['http']},
|
||||
{'name' : 'TS', 'format' : 'ts', 'extra': ['ts']},
|
||||
{'name' : 'HTTPTS', 'format' : 'httpts', 'extra': ['http', 'ts']},
|
||||
{'name' : 'HLS', 'format' : 'hls', 'extra': ['http', 'ts']},
|
||||
{'name' : 'CMAF', 'format' : 'cmaf', 'extra': ['http']},
|
||||
{'name' : 'EBML', 'format' : 'ebml', 'extra': ['http']},
|
||||
{'name' : 'RTSP', 'format' : 'rtsp'},
|
||||
{'name' : 'WAV', 'format' : 'wav', 'extra': ['http']},
|
||||
{'name' : 'SDP', 'format' : 'sdp', 'extra': ['http']},
|
||||
]
|
||||
|
||||
if usessl
|
||||
outputs += [
|
||||
{'name' : 'HTTPS', 'format' : 'https'},
|
||||
{'name' : 'WebRTC', 'format' : 'webrtc', 'extra': ['http','jpg']}
|
||||
]
|
||||
endif
|
||||
|
||||
if have_librist
|
||||
outputs += {'name' : 'TSRIST', 'format' : 'tsrist', 'extra': ['ts', 'debased', 'with_rist']}
|
||||
endif
|
||||
|
||||
if have_srt
|
||||
outputs += {'name' : 'TSSRT', 'format' : 'tssrt', 'extra': ['ts', 'debased', 'with_srt']}
|
||||
endif
|
||||
|
||||
if get_option('WITH_JPG')
|
||||
outputs += {'name' : 'JPG', 'format' : 'jpg', 'extra': ['http','jpg']}
|
||||
endif
|
||||
|
||||
if get_option('WITH_SANITY')
|
||||
outputs += {'name' : 'SanityCheck', 'format' : 'sanitycheck'}
|
||||
endif
|
||||
|
||||
#Referenced by targets in process
|
||||
output_ebml_cpp = files('output_ebml.cpp')
|
||||
output_http_cpp = files('output_http.cpp')
|
||||
output_ts_base_cpp = files('output_ts_base.cpp')
|
||||
output_cpp = files('output.cpp')
|
||||
|
||||
outputs_tgts = []
|
||||
|
||||
foreach output : outputs
|
||||
link_libs = [libmist]
|
||||
deps = []
|
||||
base = files('mist_out.cpp')
|
||||
tsBaseClass = 'Output'
|
||||
extra_tgt_dep = []
|
||||
|
||||
sources = [
|
||||
files('output.cpp',
|
||||
'output_'+output.get('format')+'.cpp'),
|
||||
io_cpp
|
||||
]
|
||||
|
||||
if output.has_key('extra')
|
||||
extra = output.get('extra')
|
||||
if not extra.contains('debased')
|
||||
sources += base
|
||||
endif
|
||||
if extra.contains('http')
|
||||
sources += files('output_http.cpp')
|
||||
if extra.contains('ts')
|
||||
tsBaseClass = 'HTTPOutput'
|
||||
endif
|
||||
endif
|
||||
if extra.contains('jpg')
|
||||
extra_tgt_dep = embed_tgts
|
||||
endif
|
||||
if extra.contains('ts')
|
||||
sources += files('output_ts_base.cpp')
|
||||
endif
|
||||
if extra.contains('with_rist')
|
||||
deps += librist
|
||||
endif
|
||||
if extra.contains('with_srt')
|
||||
link_libs += libmist_srt
|
||||
deps += libsrt
|
||||
endif
|
||||
else
|
||||
sources += base
|
||||
endif
|
||||
if output.get('name').contains('HTTPS')
|
||||
deps += ssl_deps
|
||||
endif
|
||||
|
||||
executables += {
|
||||
'name': 'MistOut'+output.get('name'),
|
||||
'sources' : [
|
||||
sources,
|
||||
extra_tgt_dep,
|
||||
header_tgts
|
||||
],
|
||||
'link' : link_libs,
|
||||
'deps' : deps,
|
||||
'defines' : [
|
||||
string_opt.format('OUTPUTTYPE', 'output_'+output.get('format')+'.h'),
|
||||
'-DTS_BASECLASS='+tsBaseClass
|
||||
]
|
||||
}
|
||||
endforeach
|
||||
|
||||
executables += {
|
||||
'name' : 'MistOutHTTP',
|
||||
'sources' : [
|
||||
files(
|
||||
'mist_out.cpp',
|
||||
'output.cpp',
|
||||
'output_http.cpp',
|
||||
'output_http_internal.cpp',
|
||||
),
|
||||
io_cpp,
|
||||
header_tgts,
|
||||
embed_tgts,
|
||||
],
|
||||
'link' : libmist,
|
||||
'defines' :[
|
||||
string_opt.format('OUTPUTTYPE', 'output_http_internal.h')
|
||||
],
|
||||
'deps' : []
|
||||
}
|
50
src/process/meson.build
Normal file
50
src/process/meson.build
Normal file
|
@ -0,0 +1,50 @@
|
|||
process_common = static_library('mist_process_common',
|
||||
output_ebml_cpp,
|
||||
input_ebml_cpp,
|
||||
input_cpp,
|
||||
output_http_cpp,
|
||||
output_cpp,
|
||||
io_cpp,
|
||||
header_tgts,
|
||||
include_directories: incroot,
|
||||
install: false,
|
||||
)
|
||||
|
||||
executables += {
|
||||
'name' : 'MistProcFFMPEG',
|
||||
'sources' : [
|
||||
files('process_ffmpeg.cpp'),
|
||||
header_tgts
|
||||
],
|
||||
'link' : [libmist, process_common],
|
||||
'deps' :[],
|
||||
'defines': [],
|
||||
}
|
||||
|
||||
executables += {
|
||||
'name' : 'MistProcMKVExec',
|
||||
'sources' : [
|
||||
files('process_exec.cpp'),
|
||||
header_tgts
|
||||
],
|
||||
'link' : [libmist, process_common],
|
||||
'deps' :[],
|
||||
'defines': [],
|
||||
}
|
||||
|
||||
executables += {
|
||||
'name' : 'MistProcLivepeer',
|
||||
'sources' : [
|
||||
files('process_livepeer.cpp'),
|
||||
input_cpp,
|
||||
output_http_cpp,
|
||||
output_ts_base_cpp,
|
||||
output_cpp,
|
||||
io_cpp,
|
||||
header_tgts
|
||||
],
|
||||
'link' : [libmist],
|
||||
'deps' :[],
|
||||
'defines': [],
|
||||
}
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
#include <mist/defines.h>
|
||||
#include <mist/util.h>
|
||||
|
||||
#include <iostream>
|
||||
|
||||
int main(){
|
||||
char storage[5000000]; // 5mb
|
||||
Util::RelAccX tmp(storage, false);
|
||||
|
||||
tmp.addField("vod", RAX_UINT);
|
||||
tmp.addField("live", RAX_UINT);
|
||||
tmp.addField("source", RAX_STRING, 512);
|
||||
tmp.addField("bufferwindow", RAX_64UINT);
|
||||
tmp.addField("bootmsoffset", RAX_64UINT);
|
||||
tmp.setRCount(1);
|
||||
tmp.setReady();
|
||||
|
||||
std::cout << tmp.toPrettyString() << std::endl;
|
||||
|
||||
return 0;
|
||||
}
|
29
src/utils/meson.build
Normal file
29
src/utils/meson.build
Normal file
|
@ -0,0 +1,29 @@
|
|||
|
||||
utils = [
|
||||
# {'name': 'Stats', 'file': 'stats'},
|
||||
{'name': 'META', 'file': 'meta'},
|
||||
{'name': 'RAX', 'file': 'rax'},
|
||||
{'name': 'AMF', 'file': 'amf'},
|
||||
{'name': 'Certbot', 'file': 'certbot'},
|
||||
{'name': 'Nuke', 'file': 'nuke'},
|
||||
]
|
||||
|
||||
if get_option('LOAD_BALANCE')
|
||||
utils += {'name': 'Load', 'file': 'load'}
|
||||
endif
|
||||
|
||||
utils_tgts = []
|
||||
|
||||
foreach util : utils
|
||||
executables += {
|
||||
'name': 'MistUtil'+util.get('name'),
|
||||
'sources' : [
|
||||
files('util_'+util.get('file')+'.cpp'),
|
||||
header_tgts
|
||||
],
|
||||
'link' : libmist,
|
||||
'deps' : [],
|
||||
'defines' :[],
|
||||
}
|
||||
endforeach
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue