Add building via meson, remove outdated options

Co-authored-by: Thulinma <jaron@vietors.com>
Change-Id: I2a620c8d98aca7203f6742c66c3f82afe91b5c3c
This commit is contained in:
Gijs Peskens 2022-09-20 15:40:08 +02:00 committed by Thulinma
parent ca9724f1f8
commit 529adbfaf6
23 changed files with 855 additions and 82 deletions

View file

@ -309,10 +309,6 @@ bool Util::Config::parseArgs(int &argc, char **&argv){
case 'h':
case '?': printHelp(std::cout);
case 'v': std::cout << "Version: " PACKAGE_VERSION ", release " RELEASE << std::endl;
#ifdef NOCRASHCHECK
std::cout << "- Flag: No crash check. Will not attempt to detect and kill crashed processes."
<< std::endl;
#endif
#ifndef SHM_ENABLED
std::cout << "- Flag: Shared memory disabled. Will use shared files in stead of shared "
"memory as IPC method."
@ -331,7 +327,7 @@ bool Util::Config::parseArgs(int &argc, char **&argv){
}
#endif
#ifndef SSL
std::cout << "- Flag: SSL support disabled. HTTPS/RTMPS are unavailable." << std::endl;
std::cout << "- Flag: SSL support disabled. HTTPS/RTMPS/WebRTC/WebSockets are either unavailable or may not function fully." << std::endl;
#endif
/*LTS-START*/
#ifndef UPDATER
@ -344,11 +340,6 @@ bool Util::Config::parseArgs(int &argc, char **&argv){
"account first. Make sure access to API port isn't public!"
<< std::endl;
#endif
#ifdef KILLONEXIT
std::cout << "- Flag: Kill on exit. All binaries will forcibly shut down all their children "
"on exit. Rolling restart support is disabled."
<< std::endl;
#endif
#ifdef STATS_DELAY
if (STATS_DELAY != 15){
std::cout << "- Setting: Stats delay " << STATS_DELAY << ". Statistics of viewer counts are delayed by "

136
lib/meson.build Normal file
View file

@ -0,0 +1,136 @@
headers = [
'adts.h',
'amf.h',
'auth.h',
'encode.h',
'bitfields.h',
'bitstream.h',
'certificate.h',
'checksum.h',
'cmaf.h',
'comms.h',
'config.h',
'defines.h',
'dtls_srtp_handshake.h',
'dtsc.h',
'encryption.h',
'flv_tag.h',
'h264.h',
'h265.h',
'hls_support.h',
'http_parser.h',
'downloader.h',
'json.h',
'langcodes.h',
'mp4_adobe.h',
'mp4_dash.h',
'mp4_encryption.h',
'mp4_generic.h',
'mp4.h',
'mp4_ms.h',
'mpeg.h',
'nal.h',
'ogg.h',
'procs.h',
'rtmpchunks.h',
'rtp_fec.h',
'rtp.h',
'sdp.h',
'sdp_media.h',
'shared_memory.h',
'socket.h',
'srtp.h',
'stream.h',
'stun.h',
'theora.h',
'timing.h',
'tinythread.h',
'ts_packet.h',
'ts_stream.h',
'util.h',
'vorbis.h',
'triggers.h',
'opus.h',
'riff.h',
'ebml.h',
'ebml_socketglue.h',
'websocket.h',
'url.h',
'urireader.h',
]
if have_srt
headers += 'socket_srt.h'
endif
install_headers(headers, subdir: 'mist')
extra_code = []
if usessl
extra_code += ['dtls_srtp_handshake.cpp', 'stun.cpp', 'certificate.cpp', 'encryption.cpp', 'srtp.cpp',]
endif
libmist = library('mist',
'adts.cpp',
'amf.cpp',
'auth.cpp',
'encode.cpp',
'bitfields.cpp',
'bitstream.cpp',
'cmaf.cpp',
'comms.cpp',
'config.cpp',
'dtsc.cpp',
'flv_tag.cpp',
'h264.cpp',
'h265.cpp',
'hls_support.cpp',
'http_parser.cpp',
'downloader.cpp',
'json.cpp',
'langcodes.cpp',
'mp4_adobe.cpp',
'mp4.cpp',
'mp4_dash.cpp',
'mp4_encryption.cpp',
'mp4_generic.cpp',
'mp4_ms.cpp',
'mpeg.cpp',
'nal.cpp',
'ogg.cpp',
'procs.cpp',
'rtmpchunks.cpp',
'rtp_fec.cpp',
'rtp.cpp',
'sdp.cpp',
'sdp_media.cpp',
'shared_memory.cpp',
'socket.cpp',
'stream.cpp',
'theora.cpp',
'timing.cpp',
'tinythread.cpp',
'ts_packet.cpp',
'ts_stream.cpp',
'util.cpp',
'vorbis.cpp',
'triggers.cpp',
'opus.cpp',
'riff.cpp',
'ebml.cpp',
'ebml_socketglue.cpp',
'url.cpp',
'urireader.cpp',
'websocket.cpp',
extra_code,
include_directories: incroot,
dependencies: ssl_deps,
install: true,
)
if have_srt
libmist_srt = library('mist_srt', 'socket_srt.cpp', include_directories: incroot, link_with: libmist, dependencies: libsrt, install: true)
endif

View file

@ -11,7 +11,7 @@
namespace HTTP{
#ifndef NOSSL
#ifdef SSL
inline bool s3CalculateSignature(std::string& signature, const std::string method, const std::string date, const std::string& requestPath, const std::string& accessKey, const std::string& secret) {
std::string toSign = method + "\n\n\n" + date + "\n" + requestPath;
unsigned char signatureBytes[MBEDTLS_MD_MAX_SIZE];
@ -32,11 +32,11 @@ namespace HTTP{
signature = "AWS " + accessKey + ":" + base64encoded;
return true;
}
#endif // ifndef NOSSL
#endif // ifdef SSL
inline HTTP::URL injectHeaders(const HTTP::URL& url, const std::string & method, HTTP::Downloader & downer) {
#ifndef NOSSL
#ifdef SSL
// Input url == s3+https://s3_key:secret@storage.googleapis.com/alexk-dms-upload-test/testvideo.ts
// Transform to:
// url=https://storage.googleapis.com/alexk-dms-upload-test/testvideo.ts
@ -61,7 +61,7 @@ namespace HTTP{
}
return newUrl;
}
#endif // ifndef NOSSL
#endif // ifdef SSL
return url;
}
@ -154,7 +154,7 @@ namespace HTTP{
}
// prepare for s3 and http
#ifndef NOSSL
#ifdef SSL
// In case of s3 URI we prepare HTTP request with AWS authorization and rely on HTTP logic below
if (myURI.protocol == "s3+https" || myURI.protocol == "s3+http"){
// Check fallback to global credentials in env vars
@ -177,7 +177,7 @@ namespace HTTP{
myURI = injectHeaders(originalUrl, "", downer);
// Do not return, continue to HTTP case
}
#endif // ifndef NOSSL
#endif // ifdef SSL
// HTTP, stream or regular download?
if (myURI.protocol == "http" || myURI.protocol == "https"){