1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-02-13 11:51:57 +00:00
srs/trunk/auto/auto_headers.sh
Winlin 5a420ece3b
GB28181: Support GB28181-2016 protocol. v5.0.74 (#3201)
01. Support GB config as StreamCaster.
02. Support disable GB by --gb28181=off.
03. Add utests for SIP examples.
04. Wireshark plugin to decode TCP/9000 as rtp.rfc4571
05. Support MPEGPS program stream codec.
06. Add utest for PS stream codec.
07. Decode MPEGPS packet stream.
08. Carry RTP and PS packet as helper in PS message.
09. Support recover from error mode.
10. Support process by a pack of PS/TS messages.
11. Add statistic for recovered and msgs dropped.
12. Recover from err position fastly.
13. Define state machine for GB session.
14. Bind context to GB session.
15. Re-invite when media disconnected.
16. Update GitHub actions with GB28181.
17. Support parse CANDIDATE by env or pip.
18. Support mux GB28181 to RTMP.
19. Support regression test by srs-bench.
2022-10-06 17:40:58 +08:00

212 lines
6.4 KiB
Bash
Executable file

#!/bin/bash
# output variables:
# SRS_AUTO_HEADERS_H: the auto generated header file.
SRS_AUTO_HEADERS_H="${SRS_OBJS}/srs_auto_headers.hpp"
# write user options to headers
echo "// auto generated by configure" > $SRS_AUTO_HEADERS_H
echo "#ifndef SRS_AUTO_HEADER_HPP" >> $SRS_AUTO_HEADERS_H
echo "#define SRS_AUTO_HEADER_HPP" >> $SRS_AUTO_HEADERS_H
echo "" >> $SRS_AUTO_HEADERS_H
echo "#define SRS_PACKAGER \"${SRS_AUTO_PACKAGER}\"" >> $SRS_AUTO_HEADERS_H
echo "#define SRS_BUILD_TS \"`date +%s`\"" >> $SRS_AUTO_HEADERS_H
echo "#define SRS_BUILD_DATE \"`date \"+%Y-%m-%d %H:%M:%S\"`\"" >> $SRS_AUTO_HEADERS_H
echo "#define SRS_UNAME \"`uname -a`\"" >> $SRS_AUTO_HEADERS_H
echo "#define SRS_USER_CONFIGURE \"${SRS_AUTO_USER_CONFIGURE}\"" >> $SRS_AUTO_HEADERS_H
echo "#define SRS_CONFIGURE \"${SRS_AUTO_CONFIGURE}\"" >> $SRS_AUTO_HEADERS_H
echo "" >> $SRS_AUTO_HEADERS_H
function srs_define_macro()
{
macro=$1 && file=$2
echo "#define $macro" >> $file
echo "#define ${macro}_BOOL true" >> $file
}
function srs_define_macro_value()
{
macro=$1 && value=$2 && file=$3
echo "#define $macro $value" >> $file
echo "#define ${macro}_BOOL true" >> $file
}
function srs_undefine_macro()
{
macro=$1 && file=$2
echo "#undef $macro" >> $file
echo "#define ${macro}_BOOL false" >> $file
}
#####################################################################################
# generate auto headers file, depends on the finished of options.sh
#####################################################################################
# auto headers in depends.
if [ $SRS_HDS = YES ]; then
srs_define_macro "SRS_HDS" $SRS_AUTO_HEADERS_H
else
srs_undefine_macro "SRS_HDS" $SRS_AUTO_HEADERS_H
fi
if [ $SRS_SRT = YES ]; then
srs_define_macro "SRS_SRT" $SRS_AUTO_HEADERS_H
else
srs_undefine_macro "SRS_SRT" $SRS_AUTO_HEADERS_H
fi
if [ $SRS_CXX11 = YES ]; then
srs_define_macro "SRS_CXX11" $SRS_AUTO_HEADERS_H
else
srs_undefine_macro "SRS_CXX11" $SRS_AUTO_HEADERS_H
fi
if [ $SRS_CXX14 = YES ]; then
srs_define_macro "SRS_CXX14" $SRS_AUTO_HEADERS_H
else
srs_undefine_macro "SRS_CXX14" $SRS_AUTO_HEADERS_H
fi
if [ $SRS_RTC = YES ]; then
srs_define_macro "SRS_RTC" $SRS_AUTO_HEADERS_H
else
srs_undefine_macro "SRS_RTC" $SRS_AUTO_HEADERS_H
fi
if [ $SRS_FFMPEG_FIT = YES ]; then
srs_define_macro "SRS_FFMPEG_FIT" $SRS_AUTO_HEADERS_H
else
srs_undefine_macro "SRS_FFMPEG_FIT" $SRS_AUTO_HEADERS_H
fi
if [ $SRS_SIMULATOR = YES ]; then
srs_define_macro "SRS_SIMULATOR" $SRS_AUTO_HEADERS_H
else
srs_undefine_macro "SRS_SIMULATOR" $SRS_AUTO_HEADERS_H
fi
if [ $SRS_HTTPS = YES ]; then
srs_define_macro "SRS_HTTPS" $SRS_AUTO_HEADERS_H
else
srs_undefine_macro "SRS_HTTPS" $SRS_AUTO_HEADERS_H
fi
if [ $SRS_GB28181 = YES ]; then
srs_define_macro "SRS_GB28181" $SRS_AUTO_HEADERS_H
else
srs_undefine_macro "SRS_GB28181" $SRS_AUTO_HEADERS_H
fi
if [ $SRS_UTEST = YES ]; then
srs_define_macro "SRS_UTEST" $SRS_AUTO_HEADERS_H
else
srs_undefine_macro "SRS_UTEST" $SRS_AUTO_HEADERS_H
fi
# whatever the FFMPEG tools, if transcode and ingest specified,
# srs always compile the FFMPEG tool stub which used to start the FFMPEG process.
if [ $SRS_FFMPEG_STUB = YES ]; then
srs_define_macro "SRS_FFMPEG_STUB" $SRS_AUTO_HEADERS_H
else
srs_undefine_macro "SRS_FFMPEG_STUB" $SRS_AUTO_HEADERS_H
fi
if [ $SRS_GPERF = YES ]; then
srs_define_macro "SRS_GPERF" $SRS_AUTO_HEADERS_H
else
srs_undefine_macro "SRS_GPERF" $SRS_AUTO_HEADERS_H
fi
if [ $SRS_GPERF_MC = YES ]; then
srs_define_macro "SRS_GPERF_MC" $SRS_AUTO_HEADERS_H
else
srs_undefine_macro "SRS_GPERF_MC" $SRS_AUTO_HEADERS_H
fi
if [ $SRS_GPERF_MD = YES ]; then
srs_define_macro "SRS_GPERF_MD" $SRS_AUTO_HEADERS_H
else
srs_undefine_macro "SRS_GPERF_MD" $SRS_AUTO_HEADERS_H
fi
if [ $SRS_GPERF_MP = YES ]; then
srs_define_macro "SRS_GPERF_MP" $SRS_AUTO_HEADERS_H
else
srs_undefine_macro "SRS_GPERF_MP" $SRS_AUTO_HEADERS_H
fi
if [ $SRS_GPERF_CP = YES ]; then
srs_define_macro "SRS_GPERF_CP" $SRS_AUTO_HEADERS_H
else
srs_undefine_macro "SRS_GPERF_CP" $SRS_AUTO_HEADERS_H
fi
#####################################################################################
# for embeded.
#####################################################################################
# for log level compile settings
if [ $SRS_LOG_VERBOSE = YES ]; then
srs_define_macro "SRS_VERBOSE" $SRS_AUTO_HEADERS_H
else
srs_undefine_macro "SRS_VERBOSE" $SRS_AUTO_HEADERS_H
fi
if [ $SRS_LOG_INFO = YES ]; then
srs_define_macro "SRS_INFO" $SRS_AUTO_HEADERS_H
else
srs_undefine_macro "SRS_INFO" $SRS_AUTO_HEADERS_H
fi
if [ $SRS_LOG_TRACE = YES ]; then
srs_define_macro "SRS_TRACE" $SRS_AUTO_HEADERS_H
else
srs_undefine_macro "SRS_TRACE" $SRS_AUTO_HEADERS_H
fi
if [ $SRS_CROSS_BUILD = YES ]; then
srs_define_macro "SRS_CROSSBUILD" $SRS_AUTO_HEADERS_H
else
srs_undefine_macro "SRS_CROSSBUILD" $SRS_AUTO_HEADERS_H
fi
if [ $SRS_OSX = YES ]; then
srs_define_macro "SRS_OSX" $SRS_AUTO_HEADERS_H
else
srs_undefine_macro "SRS_OSX" $SRS_AUTO_HEADERS_H
fi
if [ $SRS_DEBUG = YES ]; then
srs_define_macro "SRS_DEBUG" $SRS_AUTO_HEADERS_H
else
srs_undefine_macro "SRS_DEBUG" $SRS_AUTO_HEADERS_H
fi
if [ $SRS_DEBUG_STATS = YES ]; then
srs_define_macro "SRS_DEBUG_STATS" $SRS_AUTO_HEADERS_H
else
srs_undefine_macro "SRS_DEBUG_STATS" $SRS_AUTO_HEADERS_H
fi
# prefix
echo "" >> $SRS_AUTO_HEADERS_H
echo "#define SRS_PREFIX \"${SRS_PREFIX}\"" >> $SRS_AUTO_HEADERS_H
echo "#define SRS_DEFAULT_CONFIG \"${SRS_DEFAULT_CONFIG}\"" >> $SRS_AUTO_HEADERS_H
echo "" >> $SRS_AUTO_HEADERS_H
#####################################################################################
# generated the contributors from AUTHORS.txt
#####################################################################################
if [[ -f AUTHORS.md ]]; then
RTMP_SIG_SRS_AUTHORS=$(cat AUTHORS.md|grep "^-"|awk -F '`' '{print $2}')
echo "#define RTMP_SIG_SRS_AUTHORS \"\\" >> $SRS_AUTO_HEADERS_H
for CONTRIBUTOR in $RTMP_SIG_SRS_AUTHORS; do
echo "${CONTRIBUTOR} \\" >> $SRS_AUTO_HEADERS_H
done
echo "\"" >> $SRS_AUTO_HEADERS_H
else
echo "#define RTMP_SIG_SRS_AUTHORS \"ossrs\"" >> $SRS_AUTO_HEADERS_H
fi
# new empty line to auto headers file.
echo "" >> $SRS_AUTO_HEADERS_H
#####################################################################################
# auto header EOF.
#####################################################################################
echo "#endif" >> $SRS_AUTO_HEADERS_H
echo "" >> $SRS_AUTO_HEADERS_H