2013-10-17 20:58:04 +08:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
2014-02-28 13:17:31 +08:00
|
|
|
#####################################################################################
|
|
|
|
|
# the main output dir, all configure and make output are in this dir.
|
|
|
|
|
#####################################################################################
|
2022-11-18 23:02:35 +08:00
|
|
|
# Configure SRS from other directory, for example:
|
|
|
|
|
# env SRS_WORKDIR=~/git/srs/trunk ./configure
|
|
|
|
|
if [[ -z $SRS_WORKDIR ]]; then SRS_WORKDIR="."; fi
|
|
|
|
|
# Set the objs to other directory, for example:
|
|
|
|
|
# env SRS_OUTPUT=$(pwd) ./configure
|
|
|
|
|
if [[ -z $SRS_OUTPUT ]]; then
|
|
|
|
|
SRS_OBJS="${SRS_WORKDIR}/objs" && SRS_MAKEFILE=${SRS_WORKDIR}/Makefile
|
|
|
|
|
else
|
|
|
|
|
SRS_OBJS="${SRS_OUTPUT}/objs" && SRS_MAKEFILE=${SRS_OUTPUT}/Makefile
|
|
|
|
|
fi
|
2013-10-17 20:58:04 +08:00
|
|
|
|
2014-03-04 11:09:41 +08:00
|
|
|
# linux shell color support.
|
2015-03-10 12:50:27 +08:00
|
|
|
RED="\\033[31m"
|
|
|
|
|
GREEN="\\033[32m"
|
|
|
|
|
YELLOW="\\033[33m"
|
|
|
|
|
BLACK="\\033[0m"
|
2014-03-04 11:09:41 +08:00
|
|
|
|
2015-03-14 09:52:47 +08:00
|
|
|
#####################################################################################
|
|
|
|
|
# parse user options, set the variables like:
|
2019-12-25 18:29:07 +08:00
|
|
|
# srs features: SRS_SSL/SRS_HLS/SRS_HTTP_CALLBACK/......
|
2015-03-14 09:52:47 +08:00
|
|
|
# build options: SRS_JOBS
|
|
|
|
|
#####################################################################################
|
|
|
|
|
# parse options, exit with error when parse options invalid.
|
2022-11-18 23:02:35 +08:00
|
|
|
. $SRS_WORKDIR/auto/options.sh
|
2015-03-14 09:52:47 +08:00
|
|
|
|
2015-09-23 11:54:53 +08:00
|
|
|
# setup variables when options parsed.
|
2022-11-18 23:02:35 +08:00
|
|
|
. $SRS_WORKDIR/auto/setup_variables.sh
|
2015-09-23 11:54:53 +08:00
|
|
|
|
2020-03-29 00:09:17 +08:00
|
|
|
# We don't need to cleanup the exists files.
|
2022-11-18 23:02:35 +08:00
|
|
|
rm -f ${SRS_MAKEFILE}
|
2015-03-10 13:13:31 +08:00
|
|
|
|
2022-08-08 21:39:42 +08:00
|
|
|
# Create objs and platform directories.
|
2020-03-29 00:09:17 +08:00
|
|
|
mkdir -p ${SRS_OBJS}/${SRS_PLATFORM}
|
2022-08-08 21:39:42 +08:00
|
|
|
# If only generate objs directory, quit without error.
|
|
|
|
|
if [[ $SRS_GENERATE_OBJS == YES ]]; then exit 0; fi
|
2015-03-10 18:07:43 +08:00
|
|
|
|
2013-11-27 22:41:58 +08:00
|
|
|
# apply user options.
|
2022-11-18 23:02:35 +08:00
|
|
|
. $SRS_WORKDIR/auto/depends.sh
|
2013-11-27 22:41:58 +08:00
|
|
|
|
2015-03-07 16:33:06 +08:00
|
|
|
# the auto generated variables.
|
2022-11-18 23:02:35 +08:00
|
|
|
. $SRS_WORKDIR/auto/auto_headers.sh
|
2014-03-19 11:24:25 +08:00
|
|
|
|
2013-10-17 20:58:04 +08:00
|
|
|
#####################################################################################
|
|
|
|
|
# generate Makefile.
|
|
|
|
|
#####################################################################################
|
2014-03-15 19:44:06 +08:00
|
|
|
# ubuntu echo in Makefile cannot display color, use bash instead
|
|
|
|
|
SRS_BUILD_SUMMARY="_srs_build_summary.sh"
|
2013-10-17 20:58:04 +08:00
|
|
|
|
2014-03-03 18:28:50 +08:00
|
|
|
# utest make entry, (cd utest; make)
|
2014-03-04 14:01:43 +08:00
|
|
|
SrsUtestMakeEntry="@echo -e \"ignore utest for it's disabled\""
|
2022-11-18 23:02:35 +08:00
|
|
|
if [[ $SRS_UTEST == YES ]]; then SrsUtestMakeEntry="\$(MAKE)\$(JOBS) -C ${SRS_OBJS}/${SRS_PLATFORM}/utest"; fi
|
2014-03-03 18:28:50 +08:00
|
|
|
|
2019-12-19 14:30:34 +08:00
|
|
|
# generate extra phony for each modules.
|
2022-11-18 23:02:35 +08:00
|
|
|
cat << END > ${SRS_OBJS}/Makefile
|
2019-12-19 14:30:34 +08:00
|
|
|
|
|
|
|
|
.PHONY: $__mphonys
|
|
|
|
|
|
|
|
|
|
END
|
|
|
|
|
|
2015-03-07 16:37:29 +08:00
|
|
|
#####################################################################################
|
|
|
|
|
# build tools or compiler args.
|
|
|
|
|
# enable gdb debug
|
|
|
|
|
GDBDebug=" -g -O0"
|
|
|
|
|
# the warning level.
|
2022-10-12 20:21:23 +08:00
|
|
|
WarnLevel=" -Wall"
|
2015-03-07 16:37:29 +08:00
|
|
|
# the compile standard.
|
|
|
|
|
CppStd="-ansi"
|
2020-06-03 19:18:41 +08:00
|
|
|
if [[ $SRS_CXX11 == YES ]]; then
|
2020-01-23 14:22:22 +08:00
|
|
|
CppStd="-std=c++11"
|
|
|
|
|
fi
|
2020-06-11 17:12:37 +08:00
|
|
|
if [[ $SRS_CXX14 == YES ]]; then
|
|
|
|
|
CppStd="-std=c++14"
|
|
|
|
|
fi
|
2015-03-07 16:37:29 +08:00
|
|
|
# performance of gprof
|
2022-11-18 23:02:35 +08:00
|
|
|
SrsGprof=""; SrsGprofLink=""; if [[ $SRS_GPROF == YES ]]; then SrsGprof=" -pg -lc_p"; SrsGprofLink=" -pg"; fi
|
2015-03-07 16:37:29 +08:00
|
|
|
# performance of gperf
|
2022-11-18 23:02:35 +08:00
|
|
|
SrsGperf=""; SrsGperfLink=""; if [[ $SRS_GPERF == YES ]]; then SrsGperfLink=" -lpthread"; fi
|
2015-03-07 16:37:29 +08:00
|
|
|
# the cxx flag generated.
|
2018-01-01 22:57:44 +08:00
|
|
|
CXXFLAGS="${CXXFLAGS} ${CppStd}${WarnLevel}${GDBDebug}${LibraryCompile}${SrsGprof}"
|
2022-11-18 23:02:35 +08:00
|
|
|
if [[ $SRS_GPERF == YES ]]; then
|
2018-12-22 20:08:42 +08:00
|
|
|
CXXFLAGS="${CXXFLAGS} -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free";
|
|
|
|
|
fi
|
2019-02-02 21:42:03 +08:00
|
|
|
# For coverage.
|
|
|
|
|
if [[ $SRS_GCOV == YES ]]; then
|
2019-02-03 09:27:08 +08:00
|
|
|
SrsGcov="-fprofile-arcs -ftest-coverage"
|
|
|
|
|
fi
|
|
|
|
|
if [[ $SRS_GCOV == YES ]]; then
|
|
|
|
|
CXXFLAGS="${CXXFLAGS} ${SrsGcov}";
|
2019-02-02 21:42:03 +08:00
|
|
|
fi
|
2019-12-25 15:46:58 +08:00
|
|
|
# User configed options.
|
2020-01-21 10:28:25 +08:00
|
|
|
if [[ $SRS_EXTRA_FLAGS != '' ]]; then
|
|
|
|
|
CXXFLAGS="${CXXFLAGS} $SRS_EXTRA_FLAGS";
|
2019-12-25 15:46:58 +08:00
|
|
|
fi
|
2022-10-23 07:21:15 +08:00
|
|
|
|
|
|
|
|
# For Sanitizer
|
|
|
|
|
# @doc: https://github.com/google/sanitizers/wiki/AddressSanitizer
|
2024-08-22 17:12:39 +08:00
|
|
|
if [[ $SRS_SANITIZER == YES ]]; then
|
2022-10-23 07:21:15 +08:00
|
|
|
CXXFLAGS="${CXXFLAGS} -fsanitize=address -fno-omit-frame-pointer";
|
|
|
|
|
fi
|
|
|
|
|
|
2017-03-01 09:21:20 +08:00
|
|
|
# Start to generate the Makefile.
|
2022-11-18 23:02:35 +08:00
|
|
|
cat << END >> ${SRS_OBJS}/Makefile
|
2024-08-22 11:28:25 +08:00
|
|
|
CC = ${SRS_TOOL_CC}
|
2020-01-21 10:28:25 +08:00
|
|
|
CXX = ${SRS_TOOL_CXX}
|
|
|
|
|
AR = ${SRS_TOOL_AR}
|
|
|
|
|
LINK = ${SRS_TOOL_CXX}
|
2015-03-07 16:37:29 +08:00
|
|
|
CXXFLAGS = ${CXXFLAGS}
|
|
|
|
|
|
2020-05-29 17:00:06 +08:00
|
|
|
.PHONY: default srs srs_ingest_hls
|
2015-03-07 16:37:29 +08:00
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
|
|
|
|
|
END
|
|
|
|
|
|
|
|
|
|
#####################################################################################
|
|
|
|
|
# Libraries, external library to build in srs,
|
|
|
|
|
# header(.h): add to ModuleLibIncs if need the specified library. for example, LibSTRoot
|
|
|
|
|
# library(.a): add to ModuleLibFiles if binary need the specifeid library. for example, LibSTfile
|
|
|
|
|
#
|
2023-11-15 17:43:29 +08:00
|
|
|
|
|
|
|
|
# the link options, always use static link
|
|
|
|
|
SrsLinkOptions="-ldl -lpthread";
|
|
|
|
|
|
2015-03-07 16:37:29 +08:00
|
|
|
# st(state-threads) the basic network library for SRS.
|
2022-11-18 23:02:35 +08:00
|
|
|
LibSTRoot="${SRS_OBJS}/st"; LibSTfile="${LibSTRoot}/libst.a"
|
2021-04-26 08:01:49 +08:00
|
|
|
if [[ $SRS_SHARED_ST == YES ]]; then LibSTfile="-L${LibSTRoot} -lst"; fi
|
2020-06-24 13:36:18 +08:00
|
|
|
|
2020-03-06 23:01:48 +08:00
|
|
|
# srtp
|
AI: Remove cygwin64, always enable WebRTC, and enforce C++98 compatibility. v7.0.60 (#4447)
This PR makes WebRTC a core feature of SRS and enforces C++98
compatibility by:
1. Always Enable WebRTC Support
- Remove `--rtc=on|off` configuration option - WebRTC is now always
enabled
- Eliminate all `#ifdef SRS_RTC` conditional compilation blocks
- Include WebRTC-related modules (RTC, SRTP, DTLS) in all builds
- Update build scripts to always link WebRTC dependencies
2. Enforce C++98 Compatibility
- Remove `--cxx11=on|off` and `--cxx14=on|off` configuration options
- Force `SRS_CXX11=NO` and `SRS_CXX14=NO` in build system
- Move these options to deprecated section with warnings
- Ensure codebase maintains C++98 standard compatibility
3. Remove Windows/Cygwin Support
- Remove all Windows and Cygwin64 conditional compilation blocks (#ifdef
_WIN32, #ifdef CYGWIN64)
- Delete Cygwin64 build configurations from build scripts (
auto/options.sh, auto/depends.sh, configure)
- Remove Cygwin64 assembly files and State Threads platform support (
md_cygwin64.S)
- Eliminate Windows-specific GitHub Actions workflows and CI/CD jobs
- Remove NSIS packaging files and Windows installer generation
- Delete Windows documentation and update feature lists to mark support
as removed in v7.0
- Simplify OS detection to only support Unix-like systems (Linux, macOS)
4. Code Cleanup
- Remove conditional WebRTC code blocks throughout the codebase
- Simplify build configuration by removing WebRTC-related conditionals
- Update constructor delegation patterns to be C++98 compatible
- Fix vector initialization to use C++98 syntax
- Eliminate Windows-specific implementations for file operations, time
handling, and networking
- Unified platform handling with consistent POSIX API usage
---------
Co-authored-by: OSSRS-AI <winlinam@gmail.com>
2025-08-21 10:03:38 -06:00
|
|
|
LibSrtpRoot="${SRS_OBJS}/srtp2/include"; LibSrtpFile="${SRS_OBJS}/srtp2/lib/libsrtp2.a"
|
|
|
|
|
if [[ $SRS_USE_SYS_SRTP == YES ]]; then
|
|
|
|
|
LibSrtpRoot=""; LibSrtpFile="libsrtp2.a"
|
|
|
|
|
if [[ $SRS_SHARED_SRTP == YES ]]; then
|
|
|
|
|
LibSrtpFile="";
|
|
|
|
|
SrsLinkOptions="${SrsLinkOptions} -lsrtp2";
|
|
|
|
|
fi
|
2020-03-22 18:17:05 +08:00
|
|
|
fi
|
2020-06-24 13:36:18 +08:00
|
|
|
|
2020-03-22 18:17:05 +08:00
|
|
|
# FFMPEG for WebRTC transcoding, such as aac to opus.
|
2020-06-24 12:44:13 +08:00
|
|
|
if [[ $SRS_FFMPEG_FIT == YES ]]; then
|
2023-01-06 17:23:19 +08:00
|
|
|
LibFfmpegRoot="${SRS_OBJS}/ffmpeg/include"
|
|
|
|
|
LibFfmpegFile="${SRS_OBJS}/ffmpeg/lib/libavcodec.a ${SRS_OBJS}/ffmpeg/lib/libswresample.a ${SRS_OBJS}/ffmpeg/lib/libavutil.a"
|
|
|
|
|
if [[ $SRS_FFMPEG_OPUS != YES ]]; then
|
2022-11-18 23:02:35 +08:00
|
|
|
LibFfmpegFile="${LibFfmpegFile} ${SRS_OBJS}/opus/lib/libopus.a"
|
2022-08-09 18:31:55 +08:00
|
|
|
fi
|
2023-01-06 17:23:19 +08:00
|
|
|
if [[ $SRS_SHARED_FFMPEG == YES ]]; then
|
|
|
|
|
LibFfmpegFile="-L${SRS_OBJS}/ffmpeg/lib -lavcodec -lswresample -lavutil";
|
|
|
|
|
if [[ $SRS_FFMPEG_OPUS != YES ]]; then
|
|
|
|
|
LibFfmpegFile="$LibFfmpegFile -L${SRS_OBJS}/opus/lib -lopus"
|
|
|
|
|
fi
|
|
|
|
|
fi
|
2023-10-20 22:32:11 +08:00
|
|
|
if [[ $SRS_USE_SYS_FFMPEG == YES ]]; then
|
|
|
|
|
LibFfmpegRoot=""
|
|
|
|
|
LibFfmpegFile="libavcodec.a libswresample.a libavutil.a libopus.a";
|
|
|
|
|
if [[ $SRS_SHARED_FFMPEG == YES ]]; then
|
2023-11-15 17:43:29 +08:00
|
|
|
LibFfmpegFile=""
|
|
|
|
|
SrsLinkOptions="${SrsLinkOptions} -lavcodec -lswresample -lavutil -lopus";
|
2023-10-20 22:32:11 +08:00
|
|
|
fi
|
|
|
|
|
fi
|
2020-03-22 18:17:05 +08:00
|
|
|
fi
|
2020-06-24 13:36:18 +08:00
|
|
|
|
2017-02-25 12:06:39 +08:00
|
|
|
# openssl-1.1.0e, for the RTMP complex handshake.
|
2015-03-07 16:37:29 +08:00
|
|
|
LibSSLRoot="";LibSSLfile=""
|
2018-12-22 20:23:39 +08:00
|
|
|
if [[ $SRS_SSL == YES && $SRS_USE_SYS_SSL == NO ]]; then
|
2022-11-18 23:02:35 +08:00
|
|
|
LibSSLRoot="${SRS_OBJS}/openssl/include"; LibSSLfile="${SRS_OBJS}/openssl/lib/libssl.a ${SRS_OBJS}/openssl/lib/libcrypto.a";
|
2018-12-22 20:08:42 +08:00
|
|
|
fi
|
2020-06-24 13:36:18 +08:00
|
|
|
|
2015-03-07 16:37:29 +08:00
|
|
|
# gperftools-2.1, for mem check and mem/cpu profile
|
|
|
|
|
LibGperfRoot=""; LibGperfFile=""
|
2022-11-18 23:02:35 +08:00
|
|
|
if [[ $SRS_GPERF == YES ]]; then
|
|
|
|
|
LibGperfRoot="${SRS_OBJS}/gperf/include"; LibGperfFile="${SRS_OBJS}/gperf/lib/libtcmalloc_and_profiler.a";
|
2018-12-22 20:08:42 +08:00
|
|
|
fi
|
2022-11-18 23:02:35 +08:00
|
|
|
if [[ $SRS_GPERF_MD == YES ]]; then
|
|
|
|
|
LibGperfFile="${SRS_OBJS}/gperf/lib/libtcmalloc_debug.a";
|
2018-12-22 20:08:42 +08:00
|
|
|
fi
|
2020-06-24 13:36:18 +08:00
|
|
|
|
2020-01-23 12:15:02 +08:00
|
|
|
# srt code path
|
2020-01-23 14:22:22 +08:00
|
|
|
if [[ $SRS_SRT == YES ]]; then
|
2022-11-18 23:02:35 +08:00
|
|
|
LibSRTRoot="${SRS_OBJS}/srt/include"; LibSRTfile="${SRS_OBJS}/srt/lib/libsrt.a"
|
|
|
|
|
if [[ $SRS_SHARED_SRT == YES ]]; then LibSRTfile="-L${SRS_OBJS}/srt/lib -lsrt"; fi
|
2023-10-20 22:32:11 +08:00
|
|
|
if [[ $SRS_USE_SYS_SRT == YES ]]; then
|
|
|
|
|
LibSRTRoot=""; LibSRTfile="libsrt.a"
|
2023-11-15 17:43:29 +08:00
|
|
|
if [[ $SRS_SHARED_SRT == YES ]]; then
|
|
|
|
|
LibSRTfile="";
|
|
|
|
|
SrsLinkOptions="${SrsLinkOptions} -lsrt";
|
|
|
|
|
fi
|
2023-10-20 22:32:11 +08:00
|
|
|
fi
|
2020-01-23 14:22:22 +08:00
|
|
|
fi
|
2020-06-24 13:36:18 +08:00
|
|
|
|
2018-12-22 20:23:39 +08:00
|
|
|
if [[ $SRS_SSL == YES && $SRS_USE_SYS_SSL == YES ]]; then
|
2018-12-22 20:08:42 +08:00
|
|
|
SrsLinkOptions="${SrsLinkOptions} -lssl -lcrypto";
|
|
|
|
|
fi
|
2020-06-24 13:36:18 +08:00
|
|
|
|
|
|
|
|
# Static link the c++ libraries, for user who build SRS by a new version of gcc,
|
|
|
|
|
# so we need to link the c++ libraries staticly but not all.
|
|
|
|
|
# @see https://stackoverflow.com/a/26107550
|
2022-11-18 23:02:35 +08:00
|
|
|
if [[ $SRS_STATIC == YES ]]; then
|
2020-06-24 13:36:18 +08:00
|
|
|
SrsLinkOptions="${SrsLinkOptions} -static-libstdc++";
|
2018-12-22 20:08:42 +08:00
|
|
|
fi
|
2020-06-24 13:36:18 +08:00
|
|
|
|
2019-02-02 21:42:03 +08:00
|
|
|
# For coverage.
|
|
|
|
|
if [[ $SRS_GCOV == YES ]]; then
|
2019-02-03 09:27:08 +08:00
|
|
|
SrsLinkOptions="${SrsLinkOptions} ${SrsGcov}";
|
2019-02-02 21:42:03 +08:00
|
|
|
fi
|
2020-06-24 13:36:18 +08:00
|
|
|
|
2021-03-04 10:41:23 +08:00
|
|
|
# For FFMPEG/RTC on Linux.
|
AI: Remove cygwin64, always enable WebRTC, and enforce C++98 compatibility. v7.0.60 (#4447)
This PR makes WebRTC a core feature of SRS and enforces C++98
compatibility by:
1. Always Enable WebRTC Support
- Remove `--rtc=on|off` configuration option - WebRTC is now always
enabled
- Eliminate all `#ifdef SRS_RTC` conditional compilation blocks
- Include WebRTC-related modules (RTC, SRTP, DTLS) in all builds
- Update build scripts to always link WebRTC dependencies
2. Enforce C++98 Compatibility
- Remove `--cxx11=on|off` and `--cxx14=on|off` configuration options
- Force `SRS_CXX11=NO` and `SRS_CXX14=NO` in build system
- Move these options to deprecated section with warnings
- Ensure codebase maintains C++98 standard compatibility
3. Remove Windows/Cygwin Support
- Remove all Windows and Cygwin64 conditional compilation blocks (#ifdef
_WIN32, #ifdef CYGWIN64)
- Delete Cygwin64 build configurations from build scripts (
auto/options.sh, auto/depends.sh, configure)
- Remove Cygwin64 assembly files and State Threads platform support (
md_cygwin64.S)
- Eliminate Windows-specific GitHub Actions workflows and CI/CD jobs
- Remove NSIS packaging files and Windows installer generation
- Delete Windows documentation and update feature lists to mark support
as removed in v7.0
- Simplify OS detection to only support Unix-like systems (Linux, macOS)
4. Code Cleanup
- Remove conditional WebRTC code blocks throughout the codebase
- Simplify build configuration by removing WebRTC-related conditionals
- Update constructor delegation patterns to be C++98 compatible
- Fix vector initialization to use C++98 syntax
- Eliminate Windows-specific implementations for file operations, time
handling, and networking
- Unified platform handling with consistent POSIX API usage
---------
Co-authored-by: OSSRS-AI <winlinam@gmail.com>
2025-08-21 10:03:38 -06:00
|
|
|
if [[ $SRS_OSX != YES && $SRS_FFMPEG_FIT == YES ]]; then
|
2020-03-22 19:46:56 +08:00
|
|
|
SrsLinkOptions="${SrsLinkOptions} -lrt";
|
|
|
|
|
fi
|
2015-03-07 16:37:29 +08:00
|
|
|
|
2022-10-21 23:30:43 +08:00
|
|
|
# The backtrace symbol option.
|
|
|
|
|
if [[ $SRS_BACKTRACE == YES ]]; then
|
|
|
|
|
SrsLinkOptions="${SrsLinkOptions} -rdynamic";
|
|
|
|
|
fi
|
|
|
|
|
|
2022-10-23 07:21:15 +08:00
|
|
|
# For address sanitizer
|
|
|
|
|
# @doc: https://github.com/google/sanitizers/wiki/AddressSanitizer
|
2024-08-22 17:12:39 +08:00
|
|
|
if [[ $SRS_SANITIZER == YES ]]; then
|
2022-10-23 07:21:15 +08:00
|
|
|
SrsLinkOptions="${SrsLinkOptions} -fsanitize=address -fno-omit-frame-pointer";
|
|
|
|
|
if [[ $SRS_SANITIZER_STATIC == YES ]]; then
|
|
|
|
|
SrsLinkOptions="${SrsLinkOptions} -static-libasan";
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
|
AI: Remove cygwin64, always enable WebRTC, and enforce C++98 compatibility. v7.0.60 (#4447)
This PR makes WebRTC a core feature of SRS and enforces C++98
compatibility by:
1. Always Enable WebRTC Support
- Remove `--rtc=on|off` configuration option - WebRTC is now always
enabled
- Eliminate all `#ifdef SRS_RTC` conditional compilation blocks
- Include WebRTC-related modules (RTC, SRTP, DTLS) in all builds
- Update build scripts to always link WebRTC dependencies
2. Enforce C++98 Compatibility
- Remove `--cxx11=on|off` and `--cxx14=on|off` configuration options
- Force `SRS_CXX11=NO` and `SRS_CXX14=NO` in build system
- Move these options to deprecated section with warnings
- Ensure codebase maintains C++98 standard compatibility
3. Remove Windows/Cygwin Support
- Remove all Windows and Cygwin64 conditional compilation blocks (#ifdef
_WIN32, #ifdef CYGWIN64)
- Delete Cygwin64 build configurations from build scripts (
auto/options.sh, auto/depends.sh, configure)
- Remove Cygwin64 assembly files and State Threads platform support (
md_cygwin64.S)
- Eliminate Windows-specific GitHub Actions workflows and CI/CD jobs
- Remove NSIS packaging files and Windows installer generation
- Delete Windows documentation and update feature lists to mark support
as removed in v7.0
- Simplify OS detection to only support Unix-like systems (Linux, macOS)
4. Code Cleanup
- Remove conditional WebRTC code blocks throughout the codebase
- Simplify build configuration by removing WebRTC-related conditionals
- Update constructor delegation patterns to be C++98 compatible
- Fix vector initialization to use C++98 syntax
- Eliminate Windows-specific implementations for file operations, time
handling, and networking
- Unified platform handling with consistent POSIX API usage
---------
Co-authored-by: OSSRS-AI <winlinam@gmail.com>
2025-08-21 10:03:38 -06:00
|
|
|
|
2022-11-20 12:29:57 +08:00
|
|
|
|
2023-11-15 17:43:29 +08:00
|
|
|
# User configed options.
|
|
|
|
|
if [[ $SRS_EXTRA_LDFLAGS != '' ]]; then
|
|
|
|
|
SrsLinkOptions="${SrsLinkOptions} $SRS_EXTRA_LDFLAGS";
|
|
|
|
|
fi
|
|
|
|
|
|
2015-03-07 16:37:29 +08:00
|
|
|
#####################################################################################
|
|
|
|
|
# Modules, compile each module, then link to binary
|
|
|
|
|
#
|
|
|
|
|
#Core, depends only on system apis.
|
|
|
|
|
MODULE_ID="CORE"
|
|
|
|
|
MODULE_DEPENDS=()
|
2022-11-18 23:02:35 +08:00
|
|
|
ModuleLibIncs=(${SRS_OBJS})
|
2024-07-27 11:43:09 +08:00
|
|
|
MODULE_FILES=("srs_core" "srs_core_version" "srs_core_version7" "srs_core_autofree" "srs_core_performance"
|
2024-07-09 10:29:36 +08:00
|
|
|
"srs_core_time" "srs_core_platform" "srs_core_deprecated")
|
2022-11-18 23:02:35 +08:00
|
|
|
CORE_INCS="src/core"; MODULE_DIR=${CORE_INCS} . $SRS_WORKDIR/auto/modules.sh
|
2015-03-07 16:37:29 +08:00
|
|
|
CORE_OBJS="${MODULE_OBJS[@]}"
|
|
|
|
|
#
|
|
|
|
|
#Kernel, depends on core, provides error/log/config, nothing about stream information.
|
|
|
|
|
MODULE_ID="KERNEL"
|
|
|
|
|
MODULE_DEPENDS=("CORE")
|
2022-11-18 23:02:35 +08:00
|
|
|
ModuleLibIncs=(${SRS_OBJS} ${LibSSLRoot})
|
2015-09-22 08:48:55 +08:00
|
|
|
MODULE_FILES=("srs_kernel_error" "srs_kernel_log" "srs_kernel_buffer"
|
2020-03-22 18:17:05 +08:00
|
|
|
"srs_kernel_utility" "srs_kernel_flv" "srs_kernel_codec" "srs_kernel_io"
|
2022-10-06 17:40:58 +08:00
|
|
|
"srs_kernel_consts" "srs_kernel_aac" "srs_kernel_mp3" "srs_kernel_ts" "srs_kernel_ps"
|
2021-02-25 13:46:52 +08:00
|
|
|
"srs_kernel_stream" "srs_kernel_balance" "srs_kernel_mp4" "srs_kernel_file"
|
AI: Remove cygwin64, always enable WebRTC, and enforce C++98 compatibility. v7.0.60 (#4447)
This PR makes WebRTC a core feature of SRS and enforces C++98
compatibility by:
1. Always Enable WebRTC Support
- Remove `--rtc=on|off` configuration option - WebRTC is now always
enabled
- Eliminate all `#ifdef SRS_RTC` conditional compilation blocks
- Include WebRTC-related modules (RTC, SRTP, DTLS) in all builds
- Update build scripts to always link WebRTC dependencies
2. Enforce C++98 Compatibility
- Remove `--cxx11=on|off` and `--cxx14=on|off` configuration options
- Force `SRS_CXX11=NO` and `SRS_CXX14=NO` in build system
- Move these options to deprecated section with warnings
- Ensure codebase maintains C++98 standard compatibility
3. Remove Windows/Cygwin Support
- Remove all Windows and Cygwin64 conditional compilation blocks (#ifdef
_WIN32, #ifdef CYGWIN64)
- Delete Cygwin64 build configurations from build scripts (
auto/options.sh, auto/depends.sh, configure)
- Remove Cygwin64 assembly files and State Threads platform support (
md_cygwin64.S)
- Eliminate Windows-specific GitHub Actions workflows and CI/CD jobs
- Remove NSIS packaging files and Windows installer generation
- Delete Windows documentation and update feature lists to mark support
as removed in v7.0
- Simplify OS detection to only support Unix-like systems (Linux, macOS)
4. Code Cleanup
- Remove conditional WebRTC code blocks throughout the codebase
- Simplify build configuration by removing WebRTC-related conditionals
- Update constructor delegation patterns to be C++98 compatible
- Fix vector initialization to use C++98 syntax
- Eliminate Windows-specific implementations for file operations, time
handling, and networking
- Unified platform handling with consistent POSIX API usage
---------
Co-authored-by: OSSRS-AI <winlinam@gmail.com>
2025-08-21 10:03:38 -06:00
|
|
|
"srs_kernel_kbps" "srs_kernel_rtc_rtp" "srs_kernel_rtc_rtcp")
|
2022-11-18 23:02:35 +08:00
|
|
|
KERNEL_INCS="src/kernel"; MODULE_DIR=${KERNEL_INCS} . $SRS_WORKDIR/auto/modules.sh
|
2015-03-07 16:37:29 +08:00
|
|
|
KERNEL_OBJS="${MODULE_OBJS[@]}"
|
|
|
|
|
#
|
2015-05-24 18:56:52 +08:00
|
|
|
#RTMP/HTTP/Raw Protocol, depends on core/kernel, provides rtmp/htttp protocol features.
|
2015-05-23 09:59:24 +08:00
|
|
|
MODULE_ID="PROTOCOL"
|
2015-03-07 16:37:29 +08:00
|
|
|
MODULE_DEPENDS=("CORE" "KERNEL")
|
2022-11-18 23:02:35 +08:00
|
|
|
ModuleLibIncs=(${SRS_OBJS} ${LibSTRoot} ${LibSSLRoot})
|
2022-06-09 20:32:45 +08:00
|
|
|
MODULE_FILES=("srs_protocol_amf0" "srs_protocol_io" "srs_protocol_conn" "srs_protocol_rtmp_handshake"
|
2022-06-09 20:11:52 +08:00
|
|
|
"srs_protocol_rtmp_stack" "srs_protocol_utility" "srs_protocol_rtmp_msg_array" "srs_protocol_stream"
|
2022-09-16 21:54:34 +08:00
|
|
|
"srs_protocol_raw_avc" "srs_protocol_http_stack" "srs_protocol_kbps" "srs_protocol_json"
|
2022-06-09 19:59:51 +08:00
|
|
|
"srs_protocol_format" "srs_protocol_log" "srs_protocol_st" "srs_protocol_http_client"
|
2022-08-26 18:46:26 +08:00
|
|
|
"srs_protocol_http_conn" "srs_protocol_rtmp_conn" "srs_protocol_protobuf")
|
2022-04-15 13:54:24 +08:00
|
|
|
if [[ $SRS_SRT == YES ]]; then
|
2022-06-07 19:44:26 +08:00
|
|
|
MODULE_FILES+=("srs_protocol_srt")
|
2022-04-15 13:54:24 +08:00
|
|
|
ModuleLibIncs+=(${LibSRTRoot})
|
|
|
|
|
fi
|
AI: Remove cygwin64, always enable WebRTC, and enforce C++98 compatibility. v7.0.60 (#4447)
This PR makes WebRTC a core feature of SRS and enforces C++98
compatibility by:
1. Always Enable WebRTC Support
- Remove `--rtc=on|off` configuration option - WebRTC is now always
enabled
- Eliminate all `#ifdef SRS_RTC` conditional compilation blocks
- Include WebRTC-related modules (RTC, SRTP, DTLS) in all builds
- Update build scripts to always link WebRTC dependencies
2. Enforce C++98 Compatibility
- Remove `--cxx11=on|off` and `--cxx14=on|off` configuration options
- Force `SRS_CXX11=NO` and `SRS_CXX14=NO` in build system
- Move these options to deprecated section with warnings
- Ensure codebase maintains C++98 standard compatibility
3. Remove Windows/Cygwin Support
- Remove all Windows and Cygwin64 conditional compilation blocks (#ifdef
_WIN32, #ifdef CYGWIN64)
- Delete Cygwin64 build configurations from build scripts (
auto/options.sh, auto/depends.sh, configure)
- Remove Cygwin64 assembly files and State Threads platform support (
md_cygwin64.S)
- Eliminate Windows-specific GitHub Actions workflows and CI/CD jobs
- Remove NSIS packaging files and Windows installer generation
- Delete Windows documentation and update feature lists to mark support
as removed in v7.0
- Simplify OS detection to only support Unix-like systems (Linux, macOS)
4. Code Cleanup
- Remove conditional WebRTC code blocks throughout the codebase
- Simplify build configuration by removing WebRTC-related conditionals
- Update constructor delegation patterns to be C++98 compatible
- Fix vector initialization to use C++98 syntax
- Eliminate Windows-specific implementations for file operations, time
handling, and networking
- Unified platform handling with consistent POSIX API usage
---------
Co-authored-by: OSSRS-AI <winlinam@gmail.com>
2025-08-21 10:03:38 -06:00
|
|
|
MODULE_FILES+=("srs_protocol_rtc_stun" "srs_protocol_rtp")
|
NEW PROTOCOL: Support viewing stream over RTSP. v7.0.47 (#4333)
## Introduce
This PR adds support for viewing streams via the RTSP protocol. Note
that it only supports viewing streams, not publishing streams via RTSP.
Currently, only publishing via RTMP is supported, which is then
converted to RTSP. Further work is needed to support publishing RTC/SRT
streams and converting them to RTSP.
## Usage
Build and run SRS with RTSP support:
```
cd srs/trunk && ./configure --rtsp=on && make -j16
./objs/srs -c conf/rtsp.conf
```
Push stream via RTMP by FFmpeg:
```
ffmpeg -re -i doc/source.flv -c copy -f flv rtmp://localhost/live/livestream
```
View the stream via RTSP protocol, try UDP first, then use TCP:
```
ffplay -i rtsp://localhost:8554/live/livestream
```
Or specify the transport protocol with TCP:
```
ffplay -rtsp_transport tcp -i rtsp://localhost:8554/live/livestream
```
## Unit Test
Run utest for RTSP:
```
./configure --utest=on & make utest -j16
./objs/srs_utest
```
## Regression Test
You need to start SRS for regression testing.
```
./objs/srs -c conf/regression-test-for-clion.conf
```
Then run regression tests for RTSP.
```
cd srs/trunk/3rdparty/srs-bench
go test ./srs -mod=vendor -v -count=1 -run=TestRtmpPublish_RtspPlay
```
## Blackbox Test
For blackbox testing, SRS will be started by utest, so there is no need
to start SRS manually.
```
cd srs/trunk/3rdparty/srs-bench
go test ./blackbox -mod=vendor -v -count=1 -run=TestFast_RtmpPublish_RtspPlay_Basic
```
## UDP Transport
As UDP requires port allocation, this PR doesn't support delivering
media stream via UDP transport, so it will fail if you try to use UDP as
transport:
```
ffplay -rtsp_transport udp -i rtsp://localhost:8554/live/livestream
[rtsp @ 0x7fbc99a14880] method SETUP failed: 461 Unsupported Transport
rtsp://localhost:8554/live/livestream: Protocol not supported
[2025-07-05 21:30:52.738][WARN][14916][7d7gf623][35] RTSP: setup failed: code=2057
(RtspTransportNotSupported) : UDP transport not supported, only TCP/interleaved mode is supported
```
There are no plans to support UDP transport for RTSP. In the real world,
UDP is rarely used; the vast majority of RTSP traffic uses TCP.
## Play Before Publish
RTSP supports audio with AAC and OPUS codecs, which is significantly
different from RTMP or WebRTC.
RTSP uses commands to exchange SDP and specify the audio track to play,
unlike WHEP or HTTP-FLV, which use the query string of the URL. RTSP
depends on the player’s behavior, making it very difficult to use and
describe.
Considering the feature that allows playing the stream before publishing
it, it requires generating some default parameters in the SDP. For OPUS,
the sample rate is 48 kHz with 2 channels, while AAC is more complex,
especially regarding the sample rate, which may be 44.1 kHz, 32 kHz, or
48 kHz.
Therefore, for RTSP, we cannot support play-then-publish. Instead, there
must already be a stream when playing it, so that the audio codec is
determined.
## Opus Codec
No Opus codec support for RTSP, because for RTC2RTSP, it always converts
RTC to RTMP frames, then converts them to RTSP packets. Therefore, the
audio codec is always AAC after converting RTC to RTMP.
This means the bridge architecture needs some changes. We need a new
bridge that binds to the target protocol. For example, RTC2RTMP converts
the audio codec, but RTC2RTSP keeps the original audio codec.
Furthermore, the RTC2RTMP bridge should also support bypassing the Opus
codec if we use enhanced-RTMP, which supports the Opus audio codec. I
think it should be configurable to either transcode or bypass the audio
codec. However, this is not relevant to RTSP.
## AI Contributor
Below commits are contributed by AI:
* [AI: Remove support for media transport via
UDP.](https://github.com/ossrs/srs/pull/4333/commits/755686229f0d3910f058e6f75993112a68c5f60a)
* [AI: Add crutial logs for each RTSP
stage.](https://github.com/ossrs/srs/pull/4333/commits/9c8cbe7bdefda19087f87fdb5e041a8934e4db1d)
* [AI: Support AAC doec for
RTSP.](https://github.com/ossrs/srs/pull/4333/commits/7d7cc12bae269850011d4757eae635a61de99f36)
* [AI: Add option --rtsp for
RTSP.](https://github.com/ossrs/srs/pull/4333/commits/f67414d9ee98da39cda1f7d47cdf793c0e5a8412)
* [AI: Extract SrsRtpVideoBuilder for RTC and
RTSP.](https://github.com/ossrs/srs/pull/4333/commits/562e76b90469a1b016857eb23b090e8e45b52de3)
---------
Co-authored-by: Jacob Su <suzp1984@gmail.com>
Co-authored-by: winlin <winlinvip@gmail.com>
2025-07-11 20:18:40 +08:00
|
|
|
if [[ $SRS_RTSP == YES ]]; then
|
|
|
|
|
MODULE_FILES+=("srs_protocol_rtsp_stack")
|
2020-03-22 18:17:05 +08:00
|
|
|
fi
|
2022-11-18 23:02:35 +08:00
|
|
|
PROTOCOL_INCS="src/protocol"; MODULE_DIR=${PROTOCOL_INCS} . $SRS_WORKDIR/auto/modules.sh
|
2015-05-24 18:56:52 +08:00
|
|
|
PROTOCOL_OBJS="${MODULE_OBJS[@]}"
|
2020-01-22 10:59:50 +08:00
|
|
|
|
2017-03-26 10:16:21 +08:00
|
|
|
#
|
|
|
|
|
#App Module, for SRS server only.
|
2020-05-27 14:20:40 +08:00
|
|
|
MODULE_ID="APP"
|
2020-06-02 15:02:59 +08:00
|
|
|
MODULE_DEPENDS=("CORE" "KERNEL" "PROTOCOL")
|
AI: Remove cygwin64, always enable WebRTC, and enforce C++98 compatibility. v7.0.60 (#4447)
This PR makes WebRTC a core feature of SRS and enforces C++98
compatibility by:
1. Always Enable WebRTC Support
- Remove `--rtc=on|off` configuration option - WebRTC is now always
enabled
- Eliminate all `#ifdef SRS_RTC` conditional compilation blocks
- Include WebRTC-related modules (RTC, SRTP, DTLS) in all builds
- Update build scripts to always link WebRTC dependencies
2. Enforce C++98 Compatibility
- Remove `--cxx11=on|off` and `--cxx14=on|off` configuration options
- Force `SRS_CXX11=NO` and `SRS_CXX14=NO` in build system
- Move these options to deprecated section with warnings
- Ensure codebase maintains C++98 standard compatibility
3. Remove Windows/Cygwin Support
- Remove all Windows and Cygwin64 conditional compilation blocks (#ifdef
_WIN32, #ifdef CYGWIN64)
- Delete Cygwin64 build configurations from build scripts (
auto/options.sh, auto/depends.sh, configure)
- Remove Cygwin64 assembly files and State Threads platform support (
md_cygwin64.S)
- Eliminate Windows-specific GitHub Actions workflows and CI/CD jobs
- Remove NSIS packaging files and Windows installer generation
- Delete Windows documentation and update feature lists to mark support
as removed in v7.0
- Simplify OS detection to only support Unix-like systems (Linux, macOS)
4. Code Cleanup
- Remove conditional WebRTC code blocks throughout the codebase
- Simplify build configuration by removing WebRTC-related conditionals
- Update constructor delegation patterns to be C++98 compatible
- Fix vector initialization to use C++98 syntax
- Eliminate Windows-specific implementations for file operations, time
handling, and networking
- Unified platform handling with consistent POSIX API usage
---------
Co-authored-by: OSSRS-AI <winlinam@gmail.com>
2025-08-21 10:03:38 -06:00
|
|
|
ModuleLibIncs=(${SRS_OBJS} ${LibSSLRoot} ${LibSrtpRoot})
|
2022-11-18 23:02:35 +08:00
|
|
|
if [[ $SRS_GPERF == YES ]]; then
|
2020-06-02 16:43:07 +08:00
|
|
|
ModuleLibIncs+=(${LibGperfRoot})
|
|
|
|
|
fi
|
2020-06-24 12:44:13 +08:00
|
|
|
if [[ $SRS_FFMPEG_FIT == YES ]]; then
|
|
|
|
|
ModuleLibIncs+=("${LibFfmpegRoot[*]}")
|
2020-05-27 14:20:40 +08:00
|
|
|
fi
|
|
|
|
|
MODULE_FILES=("srs_app_server" "srs_app_conn" "srs_app_rtmp_conn" "srs_app_source"
|
|
|
|
|
"srs_app_refer" "srs_app_hls" "srs_app_forward" "srs_app_encoder" "srs_app_http_stream"
|
2023-04-01 21:34:59 +08:00
|
|
|
"srs_app_st" "srs_app_log" "srs_app_config" "srs_app_stream_bridge"
|
2020-05-27 14:20:40 +08:00
|
|
|
"srs_app_pithy_print" "srs_app_reload" "srs_app_http_api" "srs_app_http_conn" "srs_app_http_hooks"
|
|
|
|
|
"srs_app_ingest" "srs_app_ffmpeg" "srs_app_utility" "srs_app_edge"
|
|
|
|
|
"srs_app_heartbeat" "srs_app_empty" "srs_app_http_client" "srs_app_http_static"
|
|
|
|
|
"srs_app_recv_thread" "srs_app_security" "srs_app_statistic" "srs_app_hds"
|
2022-09-03 11:52:11 +08:00
|
|
|
"srs_app_mpegts_udp" "srs_app_listener" "srs_app_async_call"
|
2021-08-06 22:02:31 +08:00
|
|
|
"srs_app_caster_flv" "srs_app_latest_version" "srs_app_uuid" "srs_app_process" "srs_app_ng_exec"
|
2020-05-27 14:20:40 +08:00
|
|
|
"srs_app_hourglass" "srs_app_dash" "srs_app_fragment" "srs_app_dvr"
|
2025-08-31 08:58:37 -04:00
|
|
|
"srs_app_coworkers" "srs_app_circuit_breaker"
|
2025-08-26 10:27:53 -04:00
|
|
|
"srs_app_stream_token")
|
2022-04-15 13:54:24 +08:00
|
|
|
if [[ $SRS_SRT == YES ]]; then
|
|
|
|
|
MODULE_FILES+=("srs_app_srt_server" "srs_app_srt_listener" "srs_app_srt_conn" "srs_app_srt_utility" "srs_app_srt_source")
|
|
|
|
|
fi
|
AI: Remove cygwin64, always enable WebRTC, and enforce C++98 compatibility. v7.0.60 (#4447)
This PR makes WebRTC a core feature of SRS and enforces C++98
compatibility by:
1. Always Enable WebRTC Support
- Remove `--rtc=on|off` configuration option - WebRTC is now always
enabled
- Eliminate all `#ifdef SRS_RTC` conditional compilation blocks
- Include WebRTC-related modules (RTC, SRTP, DTLS) in all builds
- Update build scripts to always link WebRTC dependencies
2. Enforce C++98 Compatibility
- Remove `--cxx11=on|off` and `--cxx14=on|off` configuration options
- Force `SRS_CXX11=NO` and `SRS_CXX14=NO` in build system
- Move these options to deprecated section with warnings
- Ensure codebase maintains C++98 standard compatibility
3. Remove Windows/Cygwin Support
- Remove all Windows and Cygwin64 conditional compilation blocks (#ifdef
_WIN32, #ifdef CYGWIN64)
- Delete Cygwin64 build configurations from build scripts (
auto/options.sh, auto/depends.sh, configure)
- Remove Cygwin64 assembly files and State Threads platform support (
md_cygwin64.S)
- Eliminate Windows-specific GitHub Actions workflows and CI/CD jobs
- Remove NSIS packaging files and Windows installer generation
- Delete Windows documentation and update feature lists to mark support
as removed in v7.0
- Simplify OS detection to only support Unix-like systems (Linux, macOS)
4. Code Cleanup
- Remove conditional WebRTC code blocks throughout the codebase
- Simplify build configuration by removing WebRTC-related conditionals
- Update constructor delegation patterns to be C++98 compatible
- Fix vector initialization to use C++98 syntax
- Eliminate Windows-specific implementations for file operations, time
handling, and networking
- Unified platform handling with consistent POSIX API usage
---------
Co-authored-by: OSSRS-AI <winlinam@gmail.com>
2025-08-21 10:03:38 -06:00
|
|
|
MODULE_FILES+=("srs_app_rtc_conn" "srs_app_rtc_dtls" "srs_app_rtc_sdp" "srs_app_rtc_network"
|
|
|
|
|
"srs_app_rtc_queue" "srs_app_rtc_server" "srs_app_rtc_source" "srs_app_rtc_api")
|
NEW PROTOCOL: Support viewing stream over RTSP. v7.0.47 (#4333)
## Introduce
This PR adds support for viewing streams via the RTSP protocol. Note
that it only supports viewing streams, not publishing streams via RTSP.
Currently, only publishing via RTMP is supported, which is then
converted to RTSP. Further work is needed to support publishing RTC/SRT
streams and converting them to RTSP.
## Usage
Build and run SRS with RTSP support:
```
cd srs/trunk && ./configure --rtsp=on && make -j16
./objs/srs -c conf/rtsp.conf
```
Push stream via RTMP by FFmpeg:
```
ffmpeg -re -i doc/source.flv -c copy -f flv rtmp://localhost/live/livestream
```
View the stream via RTSP protocol, try UDP first, then use TCP:
```
ffplay -i rtsp://localhost:8554/live/livestream
```
Or specify the transport protocol with TCP:
```
ffplay -rtsp_transport tcp -i rtsp://localhost:8554/live/livestream
```
## Unit Test
Run utest for RTSP:
```
./configure --utest=on & make utest -j16
./objs/srs_utest
```
## Regression Test
You need to start SRS for regression testing.
```
./objs/srs -c conf/regression-test-for-clion.conf
```
Then run regression tests for RTSP.
```
cd srs/trunk/3rdparty/srs-bench
go test ./srs -mod=vendor -v -count=1 -run=TestRtmpPublish_RtspPlay
```
## Blackbox Test
For blackbox testing, SRS will be started by utest, so there is no need
to start SRS manually.
```
cd srs/trunk/3rdparty/srs-bench
go test ./blackbox -mod=vendor -v -count=1 -run=TestFast_RtmpPublish_RtspPlay_Basic
```
## UDP Transport
As UDP requires port allocation, this PR doesn't support delivering
media stream via UDP transport, so it will fail if you try to use UDP as
transport:
```
ffplay -rtsp_transport udp -i rtsp://localhost:8554/live/livestream
[rtsp @ 0x7fbc99a14880] method SETUP failed: 461 Unsupported Transport
rtsp://localhost:8554/live/livestream: Protocol not supported
[2025-07-05 21:30:52.738][WARN][14916][7d7gf623][35] RTSP: setup failed: code=2057
(RtspTransportNotSupported) : UDP transport not supported, only TCP/interleaved mode is supported
```
There are no plans to support UDP transport for RTSP. In the real world,
UDP is rarely used; the vast majority of RTSP traffic uses TCP.
## Play Before Publish
RTSP supports audio with AAC and OPUS codecs, which is significantly
different from RTMP or WebRTC.
RTSP uses commands to exchange SDP and specify the audio track to play,
unlike WHEP or HTTP-FLV, which use the query string of the URL. RTSP
depends on the player’s behavior, making it very difficult to use and
describe.
Considering the feature that allows playing the stream before publishing
it, it requires generating some default parameters in the SDP. For OPUS,
the sample rate is 48 kHz with 2 channels, while AAC is more complex,
especially regarding the sample rate, which may be 44.1 kHz, 32 kHz, or
48 kHz.
Therefore, for RTSP, we cannot support play-then-publish. Instead, there
must already be a stream when playing it, so that the audio codec is
determined.
## Opus Codec
No Opus codec support for RTSP, because for RTC2RTSP, it always converts
RTC to RTMP frames, then converts them to RTSP packets. Therefore, the
audio codec is always AAC after converting RTC to RTMP.
This means the bridge architecture needs some changes. We need a new
bridge that binds to the target protocol. For example, RTC2RTMP converts
the audio codec, but RTC2RTSP keeps the original audio codec.
Furthermore, the RTC2RTMP bridge should also support bypassing the Opus
codec if we use enhanced-RTMP, which supports the Opus audio codec. I
think it should be configurable to either transcode or bypass the audio
codec. However, this is not relevant to RTSP.
## AI Contributor
Below commits are contributed by AI:
* [AI: Remove support for media transport via
UDP.](https://github.com/ossrs/srs/pull/4333/commits/755686229f0d3910f058e6f75993112a68c5f60a)
* [AI: Add crutial logs for each RTSP
stage.](https://github.com/ossrs/srs/pull/4333/commits/9c8cbe7bdefda19087f87fdb5e041a8934e4db1d)
* [AI: Support AAC doec for
RTSP.](https://github.com/ossrs/srs/pull/4333/commits/7d7cc12bae269850011d4757eae635a61de99f36)
* [AI: Add option --rtsp for
RTSP.](https://github.com/ossrs/srs/pull/4333/commits/f67414d9ee98da39cda1f7d47cdf793c0e5a8412)
* [AI: Extract SrsRtpVideoBuilder for RTC and
RTSP.](https://github.com/ossrs/srs/pull/4333/commits/562e76b90469a1b016857eb23b090e8e45b52de3)
---------
Co-authored-by: Jacob Su <suzp1984@gmail.com>
Co-authored-by: winlin <winlinvip@gmail.com>
2025-07-11 20:18:40 +08:00
|
|
|
if [[ $SRS_RTSP == YES ]]; then
|
|
|
|
|
MODULE_FILES+=("srs_app_rtsp_source" "srs_app_rtsp_conn")
|
|
|
|
|
fi
|
2025-08-28 10:37:57 -04:00
|
|
|
|
2020-06-24 12:44:13 +08:00
|
|
|
if [[ $SRS_FFMPEG_FIT == YES ]]; then
|
|
|
|
|
MODULE_FILES+=("srs_app_rtc_codec")
|
|
|
|
|
fi
|
2022-10-06 17:40:58 +08:00
|
|
|
if [[ $SRS_GB28181 == YES ]]; then
|
|
|
|
|
MODULE_FILES+=("srs_app_gb28181")
|
|
|
|
|
fi
|
2021-02-18 21:51:49 +08:00
|
|
|
|
2020-05-27 14:20:40 +08:00
|
|
|
DEFINES=""
|
|
|
|
|
# add each modules for app
|
2022-11-18 23:02:35 +08:00
|
|
|
APP_INCS="src/app"; MODULE_DIR=${APP_INCS} . $SRS_WORKDIR/auto/modules.sh
|
2020-05-27 14:20:40 +08:00
|
|
|
APP_OBJS="${MODULE_OBJS[@]}"
|
2015-03-07 16:37:29 +08:00
|
|
|
#
|
2017-03-26 17:05:50 +08:00
|
|
|
#Server Module, for SRS only.
|
2020-05-27 14:20:40 +08:00
|
|
|
MODULE_ID="SERVER"
|
2020-06-02 15:02:59 +08:00
|
|
|
MODULE_DEPENDS=("CORE" "KERNEL" "PROTOCOL" "APP")
|
AI: Remove cygwin64, always enable WebRTC, and enforce C++98 compatibility. v7.0.60 (#4447)
This PR makes WebRTC a core feature of SRS and enforces C++98
compatibility by:
1. Always Enable WebRTC Support
- Remove `--rtc=on|off` configuration option - WebRTC is now always
enabled
- Eliminate all `#ifdef SRS_RTC` conditional compilation blocks
- Include WebRTC-related modules (RTC, SRTP, DTLS) in all builds
- Update build scripts to always link WebRTC dependencies
2. Enforce C++98 Compatibility
- Remove `--cxx11=on|off` and `--cxx14=on|off` configuration options
- Force `SRS_CXX11=NO` and `SRS_CXX14=NO` in build system
- Move these options to deprecated section with warnings
- Ensure codebase maintains C++98 standard compatibility
3. Remove Windows/Cygwin Support
- Remove all Windows and Cygwin64 conditional compilation blocks (#ifdef
_WIN32, #ifdef CYGWIN64)
- Delete Cygwin64 build configurations from build scripts (
auto/options.sh, auto/depends.sh, configure)
- Remove Cygwin64 assembly files and State Threads platform support (
md_cygwin64.S)
- Eliminate Windows-specific GitHub Actions workflows and CI/CD jobs
- Remove NSIS packaging files and Windows installer generation
- Delete Windows documentation and update feature lists to mark support
as removed in v7.0
- Simplify OS detection to only support Unix-like systems (Linux, macOS)
4. Code Cleanup
- Remove conditional WebRTC code blocks throughout the codebase
- Simplify build configuration by removing WebRTC-related conditionals
- Update constructor delegation patterns to be C++98 compatible
- Fix vector initialization to use C++98 syntax
- Eliminate Windows-specific implementations for file operations, time
handling, and networking
- Unified platform handling with consistent POSIX API usage
---------
Co-authored-by: OSSRS-AI <winlinam@gmail.com>
2025-08-21 10:03:38 -06:00
|
|
|
ModuleLibIncs=(${SRS_OBJS} ${LibGperfRoot} ${LibSSLRoot} ${LibSrtpRoot})
|
2020-06-24 12:44:13 +08:00
|
|
|
if [[ $SRS_FFMPEG_FIT == YES ]]; then
|
|
|
|
|
ModuleLibIncs+=("${LibFfmpegRoot[*]}")
|
2020-05-27 14:20:40 +08:00
|
|
|
fi
|
|
|
|
|
MODULE_FILES=("srs_main_server")
|
2022-11-18 23:02:35 +08:00
|
|
|
SERVER_INCS="src/main"; MODULE_DIR=${SERVER_INCS} . $SRS_WORKDIR/auto/modules.sh
|
2020-05-27 14:20:40 +08:00
|
|
|
SERVER_OBJS="${MODULE_OBJS[@]}"
|
2015-03-07 16:37:29 +08:00
|
|
|
|
|
|
|
|
#####################################################################################
|
|
|
|
|
# Binaries, main entrances, link the module and its depends modules,
|
|
|
|
|
# then link to a binary, for example, objs/srs
|
|
|
|
|
#
|
2020-05-27 14:20:40 +08:00
|
|
|
# all main entrances
|
|
|
|
|
MAIN_ENTRANCES=("srs_main_server")
|
|
|
|
|
#
|
|
|
|
|
# all depends libraries
|
AI: Remove cygwin64, always enable WebRTC, and enforce C++98 compatibility. v7.0.60 (#4447)
This PR makes WebRTC a core feature of SRS and enforces C++98
compatibility by:
1. Always Enable WebRTC Support
- Remove `--rtc=on|off` configuration option - WebRTC is now always
enabled
- Eliminate all `#ifdef SRS_RTC` conditional compilation blocks
- Include WebRTC-related modules (RTC, SRTP, DTLS) in all builds
- Update build scripts to always link WebRTC dependencies
2. Enforce C++98 Compatibility
- Remove `--cxx11=on|off` and `--cxx14=on|off` configuration options
- Force `SRS_CXX11=NO` and `SRS_CXX14=NO` in build system
- Move these options to deprecated section with warnings
- Ensure codebase maintains C++98 standard compatibility
3. Remove Windows/Cygwin Support
- Remove all Windows and Cygwin64 conditional compilation blocks (#ifdef
_WIN32, #ifdef CYGWIN64)
- Delete Cygwin64 build configurations from build scripts (
auto/options.sh, auto/depends.sh, configure)
- Remove Cygwin64 assembly files and State Threads platform support (
md_cygwin64.S)
- Eliminate Windows-specific GitHub Actions workflows and CI/CD jobs
- Remove NSIS packaging files and Windows installer generation
- Delete Windows documentation and update feature lists to mark support
as removed in v7.0
- Simplify OS detection to only support Unix-like systems (Linux, macOS)
4. Code Cleanup
- Remove conditional WebRTC code blocks throughout the codebase
- Simplify build configuration by removing WebRTC-related conditionals
- Update constructor delegation patterns to be C++98 compatible
- Fix vector initialization to use C++98 syntax
- Eliminate Windows-specific implementations for file operations, time
handling, and networking
- Unified platform handling with consistent POSIX API usage
---------
Co-authored-by: OSSRS-AI <winlinam@gmail.com>
2025-08-21 10:03:38 -06:00
|
|
|
ModuleLibFiles=(${LibSTfile} ${LibSSLfile} ${LibGperfFile} ${LibSrtpFile})
|
2020-06-24 12:44:13 +08:00
|
|
|
if [[ $SRS_FFMPEG_FIT == YES ]]; then
|
|
|
|
|
ModuleLibFiles+=("${LibFfmpegFile[*]}")
|
2020-05-27 14:20:40 +08:00
|
|
|
fi
|
|
|
|
|
if [[ $SRS_SRT == YES ]]; then
|
|
|
|
|
ModuleLibFiles+=("${LibSRTfile[*]}")
|
2015-03-07 16:37:29 +08:00
|
|
|
fi
|
2020-05-27 14:20:40 +08:00
|
|
|
# all depends objects
|
2020-06-02 15:02:59 +08:00
|
|
|
MODULE_OBJS="${CORE_OBJS[@]} ${KERNEL_OBJS[@]} ${PROTOCOL_OBJS[@]} ${APP_OBJS[@]} ${SERVER_OBJS[@]}"
|
AI: Remove cygwin64, always enable WebRTC, and enforce C++98 compatibility. v7.0.60 (#4447)
This PR makes WebRTC a core feature of SRS and enforces C++98
compatibility by:
1. Always Enable WebRTC Support
- Remove `--rtc=on|off` configuration option - WebRTC is now always
enabled
- Eliminate all `#ifdef SRS_RTC` conditional compilation blocks
- Include WebRTC-related modules (RTC, SRTP, DTLS) in all builds
- Update build scripts to always link WebRTC dependencies
2. Enforce C++98 Compatibility
- Remove `--cxx11=on|off` and `--cxx14=on|off` configuration options
- Force `SRS_CXX11=NO` and `SRS_CXX14=NO` in build system
- Move these options to deprecated section with warnings
- Ensure codebase maintains C++98 standard compatibility
3. Remove Windows/Cygwin Support
- Remove all Windows and Cygwin64 conditional compilation blocks (#ifdef
_WIN32, #ifdef CYGWIN64)
- Delete Cygwin64 build configurations from build scripts (
auto/options.sh, auto/depends.sh, configure)
- Remove Cygwin64 assembly files and State Threads platform support (
md_cygwin64.S)
- Eliminate Windows-specific GitHub Actions workflows and CI/CD jobs
- Remove NSIS packaging files and Windows installer generation
- Delete Windows documentation and update feature lists to mark support
as removed in v7.0
- Simplify OS detection to only support Unix-like systems (Linux, macOS)
4. Code Cleanup
- Remove conditional WebRTC code blocks throughout the codebase
- Simplify build configuration by removing WebRTC-related conditionals
- Update constructor delegation patterns to be C++98 compatible
- Fix vector initialization to use C++98 syntax
- Eliminate Windows-specific implementations for file operations, time
handling, and networking
- Unified platform handling with consistent POSIX API usage
---------
Co-authored-by: OSSRS-AI <winlinam@gmail.com>
2025-08-21 10:03:38 -06:00
|
|
|
ModuleLibIncs=(${SRS_OBJS} ${LibSTRoot} ${LibGperfRoot} ${LibSSLRoot} ${LibSrtpRoot})
|
2020-06-24 12:44:13 +08:00
|
|
|
if [[ $SRS_FFMPEG_FIT == YES ]]; then
|
|
|
|
|
ModuleLibIncs+=("${LibFfmpegRoot[*]}")
|
2020-05-27 14:20:40 +08:00
|
|
|
fi
|
|
|
|
|
if [[ $SRS_SRT == YES ]]; then
|
2021-05-16 16:14:00 +08:00
|
|
|
ModuleLibIncs+=(${LibSRTRoot})
|
2020-05-27 14:20:40 +08:00
|
|
|
MODULE_OBJS="${MODULE_OBJS} ${SRT_OBJS[@]}"
|
|
|
|
|
fi
|
2023-11-15 17:43:29 +08:00
|
|
|
LINK_OPTIONS="${LDFLAGS} ${SrsLinkOptions}${SrsGprofLink}${SrsGperfLink}"
|
2020-05-27 14:20:40 +08:00
|
|
|
#
|
|
|
|
|
# srs: srs(simple rtmp server) over st(state-threads)
|
2022-11-18 23:02:35 +08:00
|
|
|
BUILD_KEY="srs" APP_MAIN="srs_main_server" APP_NAME="srs" . $SRS_WORKDIR/auto/apps.sh
|
2020-05-27 14:20:40 +08:00
|
|
|
#
|
2021-04-21 11:18:35 +08:00
|
|
|
# For modules, with the app module.
|
2021-04-21 11:03:37 +08:00
|
|
|
MODULE_OBJS="${CORE_OBJS[@]} ${KERNEL_OBJS[@]} ${PROTOCOL_OBJS[@]} ${APP_OBJS[@]} ${MAIN_OBJS[@]}"
|
AI: Remove cygwin64, always enable WebRTC, and enforce C++98 compatibility. v7.0.60 (#4447)
This PR makes WebRTC a core feature of SRS and enforces C++98
compatibility by:
1. Always Enable WebRTC Support
- Remove `--rtc=on|off` configuration option - WebRTC is now always
enabled
- Eliminate all `#ifdef SRS_RTC` conditional compilation blocks
- Include WebRTC-related modules (RTC, SRTP, DTLS) in all builds
- Update build scripts to always link WebRTC dependencies
2. Enforce C++98 Compatibility
- Remove `--cxx11=on|off` and `--cxx14=on|off` configuration options
- Force `SRS_CXX11=NO` and `SRS_CXX14=NO` in build system
- Move these options to deprecated section with warnings
- Ensure codebase maintains C++98 standard compatibility
3. Remove Windows/Cygwin Support
- Remove all Windows and Cygwin64 conditional compilation blocks (#ifdef
_WIN32, #ifdef CYGWIN64)
- Delete Cygwin64 build configurations from build scripts (
auto/options.sh, auto/depends.sh, configure)
- Remove Cygwin64 assembly files and State Threads platform support (
md_cygwin64.S)
- Eliminate Windows-specific GitHub Actions workflows and CI/CD jobs
- Remove NSIS packaging files and Windows installer generation
- Delete Windows documentation and update feature lists to mark support
as removed in v7.0
- Simplify OS detection to only support Unix-like systems (Linux, macOS)
4. Code Cleanup
- Remove conditional WebRTC code blocks throughout the codebase
- Simplify build configuration by removing WebRTC-related conditionals
- Update constructor delegation patterns to be C++98 compatible
- Fix vector initialization to use C++98 syntax
- Eliminate Windows-specific implementations for file operations, time
handling, and networking
- Unified platform handling with consistent POSIX API usage
---------
Co-authored-by: OSSRS-AI <winlinam@gmail.com>
2025-08-21 10:03:38 -06:00
|
|
|
ModuleLibFiles=(${LibSTfile} ${LibSSLfile} ${LibGperfFile} ${LibSrtpFile})
|
2020-06-24 12:44:13 +08:00
|
|
|
if [[ $SRS_FFMPEG_FIT == YES ]]; then
|
|
|
|
|
ModuleLibFiles+=("${LibFfmpegFile[*]}")
|
2020-05-27 14:20:40 +08:00
|
|
|
fi
|
2022-08-09 18:31:55 +08:00
|
|
|
if [[ $SRS_SRT == YES ]]; then
|
|
|
|
|
ModuleLibFiles+=("${LibSRTfile[*]}")
|
|
|
|
|
fi
|
2020-03-29 17:29:09 +08:00
|
|
|
# For utest on mac.
|
|
|
|
|
# @see https://github.com/protocolbuffers/protobuf/issues/51#issuecomment-111044468
|
|
|
|
|
if [[ $SRS_OSX == YES ]]; then
|
2020-03-29 18:01:46 +08:00
|
|
|
UTEST_EXTRA_DEFINES="-DGTEST_USE_OWN_TR1_TUPLE=1"
|
2020-03-29 17:29:09 +08:00
|
|
|
fi
|
2015-03-07 16:37:29 +08:00
|
|
|
#
|
|
|
|
|
# utest, the unit-test cases of srs, base on gtest1.6
|
2022-11-18 23:02:35 +08:00
|
|
|
if [[ $SRS_UTEST == YES ]]; then
|
2022-08-30 17:37:54 +08:00
|
|
|
MODULE_FILES=("srs_utest" "srs_utest_amf0" "srs_utest_kernel" "srs_utest_core"
|
2019-12-18 15:50:17 +08:00
|
|
|
"srs_utest_config" "srs_utest_rtmp" "srs_utest_http" "srs_utest_avc" "srs_utest_reload"
|
Support include empty config file. v5.0.173 v6.0.68 (#3768)
SRS supports including another configuration in the include package.
When generating configurations, we can only generate the changed
configurations, while the unchanged configurations are in the fixed
files, for example:
```nginx
listen 1935;
include server.conf;
```
In `server.conf`, we can manage the changing configurations with the
program:
```nginx
http_api { enabled on; }
```
However, during system initialization, we often create an empty
`server.conf`, and the content is generated only after the program
starts, so `server.conf` might be an empty file. This also makes it
convenient to use a script to confirm the existence of this file:
```bash
touch server.conf
```
Currently, SRS does not support empty configurations and will report an
error. This PR is to solve this problem, making it more convenient to
use include.
`TRANS_BY_GPT4`
---------
Co-authored-by: Haibo Chen <495810242@qq.com>
2023-08-28 10:28:23 +08:00
|
|
|
"srs_utest_mp4" "srs_utest_service" "srs_utest_app" "srs_utest_rtc" "srs_utest_config2"
|
rtc2rtmp: Support RTC-to-RTMP remuxing with HEVC. v7.0.43 (#4349)
**Introduce**
This pull request builds upon the foundation laid in
https://github.com/ossrs/srs/pull/4289 . While the previous work solely
implemented unidirectional HEVC support from RTMP to RTC, this
submission further enhances it by introducing support for the RTC to
RTMP direction.
**Usage**
Launch SRS with `rtc2rtmp.conf`
```bash
./objs/srs -c conf/rtc2rtmp.conf
```
**Push with WebRTC**
Upgrade browser to Chrome(136+) or Safari(18+), then open [WHIP
encoder](http://localhost:8080/players/whip.html?schema=http&&codec=hevc),
push stream with URL that enables HEVC by query string `codec=hevc`:
```bash
http://localhost:1985/rtc/v1/whip/?app=live&stream=livestream&codec=hevc
```
This query string `codec=hevc` is used to select the video codec, and
generate lines in the answer SDP.
```
m=video 9 UDP/TLS/RTP/SAVPF 49 123
a=rtpmap:49 H265/90000
```
The encoder log also show the codec:
```
Audio: opus, 48000HZ, channels: 2, pt: 111
Video: H265, 90000HZ, pt: 49
```
**Play with RTMP**
Play HEVC stream via RTMP.
```bash
ffplay -i rtmp://localhost/live/livestream
```
You will see the codec in logs:
```
Stream #0:0: Audio: aac (LC), 48000 Hz, stereo, fltp
Stream #0:1: Video: hevc (Main), yuv420p(tv, bt709), 320x240, 30 fps, 30 tbr, 1k tbn
```
You can also use [WHEP
player](http://localhost:8080/players/whep.html?schema=http&&codec=hevc)
to play the stream.
Important refactor with AI:
* [AI: Refactor packet cache for RTC frame
builder.](https://github.com/ossrs/srs/pull/4349/commits/b8ffa1630e31d5f4505e349167d94eac2ce0cc45)
* [AI: Refactor the packet copy and free for
SrsRtcFrameBuilder](https://github.com/ossrs/srs/pull/4349/commits/f3487b45d7804074bff92d54bcda91570682205c)
* [AI: Refactor the frame detector for
SrsRtcFrameBuilder](https://github.com/ossrs/srs/pull/4349/commits/4ffc1526b9083143744a4e0aca735e02ef295b44)
* [AI: Refactor the packet_video_rtmp for
SrsRtcFrameBuilder](https://github.com/ossrs/srs/pull/4349/commits/81f6aef4edcd8a052083e12929a419bf75d036bb)
* [AI: Add utests for
SrsCodecPayload.codec](https://github.com/ossrs/srs/pull/4349/commits/61eb1c0bfc28ec53e4a9f67739c9b0038cebea7a)
* [AI: Add utests for VideoPacketCache in
SrsRtcFrameBuilder.](https://github.com/ossrs/srs/pull/4349/commits/fd25480dfa2ee6a1edcbe9ba6d69fe796bd7ecfe)
* [AI: Add utests for VideoFrameDetector in
SrsRtcFrameBuilder.](https://github.com/ossrs/srs/pull/4349/commits/b4aa977bbd4118af0ffe5b99ce9fc8ed7875866e)
* [AI: Add regression test for RTC2RTMP with
HEVC.](https://github.com/ossrs/srs/pull/4349/commits/5259a2aac3bcf52fa99b89ed1d764fb747c82776)
---------
Co-authored-by: Jacob Su <suzp1984@gmail.com>
Co-authored-by: winlin <winlinvip@gmail.com>
2025-07-03 20:24:42 +08:00
|
|
|
"srs_utest_protocol" "srs_utest_protocol2" "srs_utest_kernel2" "srs_utest_protocol3"
|
2025-08-26 10:27:53 -04:00
|
|
|
"srs_utest_st" "srs_utest_rtc2" "srs_utest_rtc3" "srs_utest_fmp4" "srs_utest_source_lock"
|
|
|
|
|
"srs_utest_stream_token")
|
2022-06-09 20:32:45 +08:00
|
|
|
if [[ $SRS_SRT == YES ]]; then
|
|
|
|
|
MODULE_FILES+=("srs_utest_srt")
|
|
|
|
|
fi
|
2022-10-06 17:40:58 +08:00
|
|
|
if [[ $SRS_GB28181 == YES ]]; then
|
|
|
|
|
MODULE_FILES+=("srs_utest_gb28181")
|
|
|
|
|
fi
|
AI: Remove cygwin64, always enable WebRTC, and enforce C++98 compatibility. v7.0.60 (#4447)
This PR makes WebRTC a core feature of SRS and enforces C++98
compatibility by:
1. Always Enable WebRTC Support
- Remove `--rtc=on|off` configuration option - WebRTC is now always
enabled
- Eliminate all `#ifdef SRS_RTC` conditional compilation blocks
- Include WebRTC-related modules (RTC, SRTP, DTLS) in all builds
- Update build scripts to always link WebRTC dependencies
2. Enforce C++98 Compatibility
- Remove `--cxx11=on|off` and `--cxx14=on|off` configuration options
- Force `SRS_CXX11=NO` and `SRS_CXX14=NO` in build system
- Move these options to deprecated section with warnings
- Ensure codebase maintains C++98 standard compatibility
3. Remove Windows/Cygwin Support
- Remove all Windows and Cygwin64 conditional compilation blocks (#ifdef
_WIN32, #ifdef CYGWIN64)
- Delete Cygwin64 build configurations from build scripts (
auto/options.sh, auto/depends.sh, configure)
- Remove Cygwin64 assembly files and State Threads platform support (
md_cygwin64.S)
- Eliminate Windows-specific GitHub Actions workflows and CI/CD jobs
- Remove NSIS packaging files and Windows installer generation
- Delete Windows documentation and update feature lists to mark support
as removed in v7.0
- Simplify OS detection to only support Unix-like systems (Linux, macOS)
4. Code Cleanup
- Remove conditional WebRTC code blocks throughout the codebase
- Simplify build configuration by removing WebRTC-related conditionals
- Update constructor delegation patterns to be C++98 compatible
- Fix vector initialization to use C++98 syntax
- Eliminate Windows-specific implementations for file operations, time
handling, and networking
- Unified platform handling with consistent POSIX API usage
---------
Co-authored-by: OSSRS-AI <winlinam@gmail.com>
2025-08-21 10:03:38 -06:00
|
|
|
ModuleLibIncs=(${SRS_OBJS} ${LibSTRoot} ${LibSSLRoot} ${LibSrtpRoot})
|
2020-06-24 12:44:13 +08:00
|
|
|
if [[ $SRS_FFMPEG_FIT == YES ]]; then
|
|
|
|
|
ModuleLibIncs+=("${LibFfmpegRoot[*]}")
|
2020-03-22 18:17:05 +08:00
|
|
|
fi
|
2020-01-23 14:22:22 +08:00
|
|
|
if [[ $SRS_SRT == YES ]]; then
|
2022-04-15 13:54:24 +08:00
|
|
|
ModuleLibIncs+=("${LibSRTRoot[*]}")
|
2020-01-23 14:22:22 +08:00
|
|
|
fi
|
AI: Remove cygwin64, always enable WebRTC, and enforce C++98 compatibility. v7.0.60 (#4447)
This PR makes WebRTC a core feature of SRS and enforces C++98
compatibility by:
1. Always Enable WebRTC Support
- Remove `--rtc=on|off` configuration option - WebRTC is now always
enabled
- Eliminate all `#ifdef SRS_RTC` conditional compilation blocks
- Include WebRTC-related modules (RTC, SRTP, DTLS) in all builds
- Update build scripts to always link WebRTC dependencies
2. Enforce C++98 Compatibility
- Remove `--cxx11=on|off` and `--cxx14=on|off` configuration options
- Force `SRS_CXX11=NO` and `SRS_CXX14=NO` in build system
- Move these options to deprecated section with warnings
- Ensure codebase maintains C++98 standard compatibility
3. Remove Windows/Cygwin Support
- Remove all Windows and Cygwin64 conditional compilation blocks (#ifdef
_WIN32, #ifdef CYGWIN64)
- Delete Cygwin64 build configurations from build scripts (
auto/options.sh, auto/depends.sh, configure)
- Remove Cygwin64 assembly files and State Threads platform support (
md_cygwin64.S)
- Eliminate Windows-specific GitHub Actions workflows and CI/CD jobs
- Remove NSIS packaging files and Windows installer generation
- Delete Windows documentation and update feature lists to mark support
as removed in v7.0
- Simplify OS detection to only support Unix-like systems (Linux, macOS)
4. Code Cleanup
- Remove conditional WebRTC code blocks throughout the codebase
- Simplify build configuration by removing WebRTC-related conditionals
- Update constructor delegation patterns to be C++98 compatible
- Fix vector initialization to use C++98 syntax
- Eliminate Windows-specific implementations for file operations, time
handling, and networking
- Unified platform handling with consistent POSIX API usage
---------
Co-authored-by: OSSRS-AI <winlinam@gmail.com>
2025-08-21 10:03:38 -06:00
|
|
|
ModuleLibFiles=(${LibSTfile} ${LibSSLfile} ${LibSrtpFile})
|
2020-06-24 12:44:13 +08:00
|
|
|
if [[ $SRS_FFMPEG_FIT == YES ]]; then
|
|
|
|
|
ModuleLibFiles+=("${LibFfmpegFile[*]}")
|
2020-03-22 18:17:05 +08:00
|
|
|
fi
|
2020-01-24 07:06:30 +08:00
|
|
|
if [[ $SRS_SRT == YES ]]; then
|
|
|
|
|
ModuleLibFiles+=("${LibSRTfile[*]}")
|
|
|
|
|
fi
|
2020-06-02 15:02:59 +08:00
|
|
|
MODULE_DEPENDS=("CORE" "KERNEL" "PROTOCOL" "APP")
|
|
|
|
|
MODULE_OBJS="${CORE_OBJS[@]} ${KERNEL_OBJS[@]} ${PROTOCOL_OBJS[@]} ${APP_OBJS[@]} ${SRT_OBJS[@]}"
|
2023-11-15 17:43:29 +08:00
|
|
|
LINK_OPTIONS="${LDFLAGS} -lpthread ${SrsLinkOptions}" MODULE_DIR="src/utest" APP_NAME="srs_utest" . $SRS_WORKDIR/auto/utest.sh
|
2015-03-07 16:37:29 +08:00
|
|
|
fi
|
|
|
|
|
|
2014-03-04 11:09:41 +08:00
|
|
|
#####################################################################################
|
2014-11-08 15:31:21 +08:00
|
|
|
# generate colorful summary script
|
2022-11-18 23:02:35 +08:00
|
|
|
. $SRS_WORKDIR/auto/summary.sh
|
2014-03-04 11:09:41 +08:00
|
|
|
|
|
|
|
|
#####################################################################################
|
2014-03-02 11:31:31 +08:00
|
|
|
# makefile
|
2016-12-07 12:09:39 +08:00
|
|
|
echo "Generate Makefile"
|
2015-03-07 16:39:05 +08:00
|
|
|
|
|
|
|
|
# backup old makefile.
|
2022-11-18 23:02:35 +08:00
|
|
|
rm -f ${SRS_MAKEFILE}.bk &&
|
|
|
|
|
mv ${SRS_MAKEFILE} ${SRS_MAKEFILE}.bk
|
2015-03-07 16:39:05 +08:00
|
|
|
|
|
|
|
|
# generate phony header
|
2022-11-18 23:02:35 +08:00
|
|
|
cat << END > ${SRS_MAKEFILE}
|
2024-03-26 16:26:12 +08:00
|
|
|
.PHONY: default all _default install help clean destroy server utest _prepare_dir $__mphonys
|
2025-08-31 08:58:37 -04:00
|
|
|
.PHONY: clean_srs clean_openssl clean_srtp2 clean_opus clean_ffmpeg clean_st
|
2020-03-29 21:30:32 +08:00
|
|
|
.PHONY: st ffmpeg
|
2014-03-22 22:07:14 +08:00
|
|
|
|
2024-08-22 11:28:25 +08:00
|
|
|
CC = ${SRS_TOOL_CC}
|
2021-06-22 07:49:48 +08:00
|
|
|
CXX = ${SRS_TOOL_CXX}
|
|
|
|
|
AR = ${SRS_TOOL_AR}
|
|
|
|
|
LINK = ${SRS_TOOL_LD}
|
|
|
|
|
RANDLIB = ${SRS_TOOL_RANDLIB}
|
|
|
|
|
CXXFLAGS = ${CXXFLAGS}
|
2023-11-15 17:43:29 +08:00
|
|
|
LDFLAGS = ${LDFLAGS}
|
2021-06-22 07:49:48 +08:00
|
|
|
|
2014-03-22 22:07:14 +08:00
|
|
|
# install prefix.
|
|
|
|
|
SRS_PREFIX=${SRS_PREFIX}
|
2022-01-13 18:26:28 +08:00
|
|
|
SRS_DEFAULT_CONFIG=${SRS_DEFAULT_CONFIG}
|
2014-05-12 12:56:58 +08:00
|
|
|
__REAL_INSTALL=\$(DESTDIR)\$(SRS_PREFIX)
|
2014-03-02 09:00:49 +08:00
|
|
|
|
2022-12-25 17:00:07 +08:00
|
|
|
SRS_FORCE_MAKE_JOBS=${SRS_FORCE_MAKE_JOBS}
|
|
|
|
|
END
|
2014-03-02 09:00:49 +08:00
|
|
|
|
2022-12-25 17:00:07 +08:00
|
|
|
if [[ $SRS_FORCE_MAKE_JOBS == YES ]]; then
|
|
|
|
|
cat << END >> ${SRS_MAKEFILE}
|
|
|
|
|
JOBS=\$(shell echo \$(MAKEFLAGS)| grep -qE '\-j[0-9]+' || echo " ${SRS_JOBS}")
|
2014-03-17 11:52:23 +08:00
|
|
|
END
|
2022-12-25 17:00:07 +08:00
|
|
|
fi
|
2014-03-17 11:52:23 +08:00
|
|
|
|
2014-11-08 15:31:21 +08:00
|
|
|
# the real entry for all platform:
|
2022-11-18 23:02:35 +08:00
|
|
|
cat << END >> ${SRS_MAKEFILE}
|
2022-12-25 17:00:07 +08:00
|
|
|
|
|
|
|
|
default: server
|
|
|
|
|
|
|
|
|
|
all: _default
|
|
|
|
|
|
2025-08-31 08:58:37 -04:00
|
|
|
_default: server utest
|
2013-10-17 20:58:04 +08:00
|
|
|
|
|
|
|
|
help:
|
2021-04-24 19:45:05 +08:00
|
|
|
@echo "Usage: make <help>|<clean>|<destroy>|<server>|<utest>|<install>|<uninstall>"
|
2020-03-29 21:36:41 +08:00
|
|
|
@echo " help Display this help menu"
|
|
|
|
|
@echo " clean Cleanup project and all depends"
|
2022-11-18 23:02:35 +08:00
|
|
|
@echo " destroy Cleanup all files for this platform in ${SRS_OBJS}/${SRS_PLATFORM}"
|
2020-03-29 21:36:41 +08:00
|
|
|
@echo " server Build the srs and other modules in main"
|
|
|
|
|
@echo " utest Build the utest for srs"
|
|
|
|
|
@echo " install Install srs to the prefix path"
|
|
|
|
|
@echo " uninstall Uninstall srs from prefix path"
|
2020-03-29 21:30:32 +08:00
|
|
|
@echo "To rebuild special module:"
|
2022-11-18 23:02:35 +08:00
|
|
|
@echo " st Rebuild st-srs in ${SRS_OBJS}/${SRS_PLATFORM}/st-srs"
|
2020-03-29 21:36:41 +08:00
|
|
|
@echo " ffmpeg Rebuild ffmpeg in ${SRS_OBJS}/${SRS_PLATFORM}/ffmpeg-4.2-fit"
|
2020-04-04 20:24:24 +08:00
|
|
|
@echo "To reconfigure special depends:"
|
|
|
|
|
@echo " clean_openssl Remove the openssl cache."
|
|
|
|
|
@echo " clean_srtp2 Remove the libsrtp2 cache."
|
|
|
|
|
@echo " clean_opus Remove the opus cache."
|
2020-04-10 08:55:04 +08:00
|
|
|
@echo " clean_ffmpeg Remove the FFmpeg cache."
|
|
|
|
|
@echo " clean_st Remove the ST cache."
|
2015-03-07 16:39:05 +08:00
|
|
|
@echo "For example:"
|
|
|
|
|
@echo " make"
|
|
|
|
|
@echo " make help"
|
2013-10-17 20:58:04 +08:00
|
|
|
|
2020-03-29 00:09:17 +08:00
|
|
|
doclean:
|
2022-11-21 14:32:26 +08:00
|
|
|
(cd ${SRS_OBJS} && rm -rf srs srs_utest srs.exe srs_utest.exe $__mcleanups)
|
2022-11-18 23:02:35 +08:00
|
|
|
(cd ${SRS_OBJS} && rm -rf src/* include lib)
|
|
|
|
|
(mkdir -p ${SRS_OBJS}/utest && cd ${SRS_OBJS}/utest && rm -rf *.o *.a)
|
2013-10-17 20:58:04 +08:00
|
|
|
|
2025-08-31 08:58:37 -04:00
|
|
|
clean: clean_srs
|
2020-03-29 00:09:17 +08:00
|
|
|
|
2020-03-29 21:30:32 +08:00
|
|
|
destroy:
|
2022-11-18 23:02:35 +08:00
|
|
|
(cd ${SRS_OBJS} && rm -rf ${SRS_PLATFORM})
|
2020-03-29 15:23:40 +08:00
|
|
|
|
|
|
|
|
clean_srs:
|
2022-11-18 23:02:35 +08:00
|
|
|
@(cd ${SRS_OBJS} && rm -rf srs srs_utest src/* utest/*)
|
2020-03-29 15:23:40 +08:00
|
|
|
|
|
|
|
|
clean_openssl:
|
2023-07-09 21:47:25 +08:00
|
|
|
@rm -rf ${SRS_OBJS}/${SRS_PLATFORM}/3rdparty/openssl
|
2020-04-04 20:24:24 +08:00
|
|
|
@echo "Please rebuild openssl by: ./configure"
|
2020-03-29 15:23:40 +08:00
|
|
|
|
2020-03-29 17:54:27 +08:00
|
|
|
clean_srtp2:
|
2023-07-09 21:47:25 +08:00
|
|
|
@rm -rf ${SRS_OBJS}/${SRS_PLATFORM}/3rdparty/srtp2
|
2020-04-04 20:24:24 +08:00
|
|
|
@echo "Please rebuild libsrtp2 by: ./configure"
|
2020-03-29 17:54:27 +08:00
|
|
|
|
|
|
|
|
clean_opus:
|
2023-07-09 21:47:25 +08:00
|
|
|
@rm -rf ${SRS_OBJS}/${SRS_PLATFORM}/3rdparty/opus
|
2020-04-04 20:24:24 +08:00
|
|
|
@echo "Please rebuild opus by: ./configure"
|
2020-03-29 17:54:27 +08:00
|
|
|
|
2020-04-10 08:55:04 +08:00
|
|
|
clean_ffmpeg:
|
2023-07-09 21:47:25 +08:00
|
|
|
@rm -rf ${SRS_OBJS}/${SRS_PLATFORM}/3rdparty/ffmpeg
|
2020-04-10 08:55:04 +08:00
|
|
|
@echo "Please rebuild FFmpeg by: ./configure"
|
|
|
|
|
|
|
|
|
|
clean_st:
|
2023-07-09 21:47:25 +08:00
|
|
|
@rm -rf ${SRS_OBJS}/${SRS_PLATFORM}/3rdparty/st
|
2020-04-10 08:55:04 +08:00
|
|
|
@echo "Please rebuild ST by: ./configure"
|
|
|
|
|
|
2020-03-29 21:30:32 +08:00
|
|
|
st:
|
2022-11-18 23:02:35 +08:00
|
|
|
@rm -f ${SRS_OBJS}/srs srs_utest
|
2022-11-20 12:29:57 +08:00
|
|
|
@\$(MAKE)\$(JOBS) -C ${SRS_OBJS}/${SRS_PLATFORM}/st-srs clean
|
2024-08-22 11:28:25 +08:00
|
|
|
@env EXTRA_CFLAGS="${_ST_EXTRA_CFLAGS}" \$(MAKE)\$(JOBS) -C ${SRS_OBJS}/${SRS_PLATFORM}/st-srs ${_ST_MAKE_ARGS} CC=\$(CC) CXX=\$(CXX) AR=\$(AR) LD=\$(LINK) RANDLIB=\$(RANDLIB)
|
2022-11-18 23:02:35 +08:00
|
|
|
@echo "Please rebuild srs by: make"
|
2020-03-29 21:30:32 +08:00
|
|
|
|
|
|
|
|
ffmpeg:
|
2022-11-18 23:02:35 +08:00
|
|
|
@rm -f ${SRS_OBJS}/srs srs_utest
|
|
|
|
|
\$(MAKE)\$(JOBS) -C ${SRS_OBJS}/${SRS_PLATFORM}/ffmpeg-4.2-fit
|
|
|
|
|
\$(MAKE)\$(JOBS) -C ${SRS_OBJS}/${SRS_PLATFORM}/ffmpeg-4.2-fit install-libs
|
|
|
|
|
@echo "Please rebuild srs by: make"
|
2020-03-29 21:30:32 +08:00
|
|
|
|
2014-11-08 15:31:21 +08:00
|
|
|
END
|
|
|
|
|
|
2022-12-31 19:27:21 +08:00
|
|
|
# Generate Makefile entry for srs-server.
|
2022-11-18 23:02:35 +08:00
|
|
|
cat << END >> ${SRS_MAKEFILE}
|
2013-10-17 20:58:04 +08:00
|
|
|
server: _prepare_dir
|
2022-12-25 17:00:07 +08:00
|
|
|
@echo "Build the SRS server, JOBS=\${JOBS}, FORCE_MAKE_JOBS=${SRS_FORCE_MAKE_JOBS}"
|
2022-11-18 23:02:35 +08:00
|
|
|
\$(MAKE)\$(JOBS) -f ${SRS_OBJS}/Makefile srs
|
2022-08-05 18:32:05 +08:00
|
|
|
@bash objs/_srs_build_summary.sh
|
2013-10-17 20:58:04 +08:00
|
|
|
|
2014-03-07 19:07:38 +08:00
|
|
|
END
|
2022-12-31 19:27:21 +08:00
|
|
|
|
2020-05-29 17:00:06 +08:00
|
|
|
# install entry
|
2022-11-18 23:02:35 +08:00
|
|
|
cat << END >> ${SRS_MAKEFILE}
|
2014-03-22 22:07:14 +08:00
|
|
|
uninstall:
|
|
|
|
|
@echo "rmdir \$(SRS_PREFIX)"
|
|
|
|
|
@rm -rf \$(SRS_PREFIX)
|
|
|
|
|
|
|
|
|
|
install:
|
2016-12-07 12:09:39 +08:00
|
|
|
@echo "Now mkdir \$(__REAL_INSTALL)"
|
2014-05-12 12:56:58 +08:00
|
|
|
@mkdir -p \$(__REAL_INSTALL)
|
2016-12-07 12:09:39 +08:00
|
|
|
@echo "Now make the http root dir"
|
2014-05-12 12:56:58 +08:00
|
|
|
@mkdir -p \$(__REAL_INSTALL)/objs/nginx/html
|
Upgrade hls.js and set in low latency mode. v6.0.112 (#3924)
HLS typically has a delay of around 30 seconds, roughly comprising three
segments, each lasting 10 seconds. We can reduce the delay to about 5
seconds by lowering the segment duration to 2 seconds and starting
playback from the last segment, achieving a stable delay.
Of course, this requires setting the OBS's GOP to 1 second, and the
profile to baseline, preset to fast, and tune to zerolatency.
Additionally, updating a few configurations in the hls.js player is
necessary, such as setting it to start playback from the last segment,
setting the maximum buffer, and initiating accelerated playback to
reduce latency.
---------
Co-authored-by: chundonglinlin <chundonglinlin@163.com>
Co-authored-by: john <hondaxiao@tencent.com>
2024-02-05 21:37:29 +08:00
|
|
|
@cp -f research/index.html \$(__REAL_INSTALL)/objs/nginx/html
|
|
|
|
|
@cp -f research/favicon.ico \$(__REAL_INSTALL)/objs/nginx/html
|
2021-05-05 13:26:25 +08:00
|
|
|
@cp -Rf research/players \$(__REAL_INSTALL)/objs/nginx/html/
|
|
|
|
|
@cp -Rf research/console \$(__REAL_INSTALL)/objs/nginx/html/
|
|
|
|
|
@cp -Rf 3rdparty/signaling/www/demos \$(__REAL_INSTALL)/objs/nginx/html/
|
2016-12-07 12:09:39 +08:00
|
|
|
@echo "Now copy binary files"
|
2014-05-12 12:56:58 +08:00
|
|
|
@mkdir -p \$(__REAL_INSTALL)/objs
|
2019-10-05 20:33:26 +08:00
|
|
|
@cp -f objs/srs \$(__REAL_INSTALL)/objs
|
2016-12-07 12:09:39 +08:00
|
|
|
@echo "Now copy srs conf files"
|
2014-05-12 12:56:58 +08:00
|
|
|
@mkdir -p \$(__REAL_INSTALL)/conf
|
2019-10-05 20:33:26 +08:00
|
|
|
@cp -f conf/*.conf \$(__REAL_INSTALL)/conf
|
2022-01-11 08:40:05 +08:00
|
|
|
@cp -f conf/server.key conf/server.crt \$(__REAL_INSTALL)/conf
|
2016-12-07 12:09:39 +08:00
|
|
|
@echo "Now copy init.d script files"
|
2014-05-12 12:56:58 +08:00
|
|
|
@mkdir -p \$(__REAL_INSTALL)/etc/init.d
|
2019-10-05 20:33:26 +08:00
|
|
|
@cp -f etc/init.d/srs \$(__REAL_INSTALL)/etc/init.d
|
2014-05-12 12:56:58 +08:00
|
|
|
@sed -i "s|^ROOT=.*|ROOT=\"\$(SRS_PREFIX)\"|g" \$(__REAL_INSTALL)/etc/init.d/srs
|
2022-01-13 18:26:28 +08:00
|
|
|
@sed -i "s|^CONFIG=.*|CONFIG=\"\$(SRS_DEFAULT_CONFIG)\"|g" \$(__REAL_INSTALL)/etc/init.d/srs
|
2019-10-05 20:33:26 +08:00
|
|
|
@echo "Now copy systemctl service files"
|
|
|
|
|
@mkdir -p \$(__REAL_INSTALL)/usr/lib/systemd/system
|
|
|
|
|
@cp -f usr/lib/systemd/system/srs.service \$(__REAL_INSTALL)/usr/lib/systemd/system/srs.service
|
2014-03-23 11:25:42 +08:00
|
|
|
@echo ""
|
2025-03-21 19:15:05 +08:00
|
|
|
@echo "@see: https://ossrs.net/lts/zh-cn/docs/v7/doc/service"
|
2014-03-22 22:07:14 +08:00
|
|
|
|
|
|
|
|
END
|
|
|
|
|
|
2022-11-18 23:02:35 +08:00
|
|
|
if [[ $SRS_UTEST == YES ]]; then
|
|
|
|
|
cat << END >> ${SRS_MAKEFILE}
|
2014-03-04 12:45:41 +08:00
|
|
|
utest: server
|
2016-12-07 12:09:39 +08:00
|
|
|
@echo "Building the utest for srs"
|
2014-03-03 18:28:50 +08:00
|
|
|
${SrsUtestMakeEntry}
|
2016-12-07 12:09:39 +08:00
|
|
|
@echo "The utest is built ok."
|
2014-03-03 18:28:50 +08:00
|
|
|
|
2014-03-07 18:55:15 +08:00
|
|
|
END
|
|
|
|
|
else
|
2022-11-18 23:02:35 +08:00
|
|
|
cat << END >> ${SRS_MAKEFILE}
|
2014-03-07 18:55:15 +08:00
|
|
|
utest: server
|
2016-12-07 12:09:39 +08:00
|
|
|
@echo "Ignore utest for it's disabled."
|
2014-03-07 18:55:15 +08:00
|
|
|
|
|
|
|
|
END
|
|
|
|
|
fi
|
|
|
|
|
|
2022-11-18 23:02:35 +08:00
|
|
|
cat << END >> ${SRS_MAKEFILE}
|
2013-10-17 20:58:04 +08:00
|
|
|
# the ./configure will generate it.
|
|
|
|
|
_prepare_dir:
|
2022-11-18 23:02:35 +08:00
|
|
|
@mkdir -p ${SRS_OBJS}
|
2013-10-17 20:58:04 +08:00
|
|
|
END
|
|
|
|
|
|
2015-03-07 16:39:05 +08:00
|
|
|
# generate makefile ok, append the tails.
|
2022-11-18 23:02:35 +08:00
|
|
|
cat ${SRS_MAKEFILE}.bk >> ${SRS_MAKEFILE} &&
|
|
|
|
|
rm -f ${SRS_MAKEFILE}.bk
|
2015-03-07 16:39:05 +08:00
|
|
|
|
2016-12-07 12:09:39 +08:00
|
|
|
echo 'Configure ok! '
|
2013-10-17 20:58:04 +08:00
|
|
|
|
2014-02-28 21:07:46 +08:00
|
|
|
#####################################################################################
|
|
|
|
|
# when configure success, prepare build
|
|
|
|
|
#####################################################################################
|
|
|
|
|
# create objs/logs for ffmpeg to write log.
|
2020-05-27 14:20:40 +08:00
|
|
|
mkdir -p ${SRS_OBJS}/logs
|
2014-02-28 21:07:46 +08:00
|
|
|
|
2014-02-28 15:10:28 +08:00
|
|
|
#####################################################################################
|
|
|
|
|
# configure summary
|
|
|
|
|
#####################################################################################
|
2013-11-30 14:12:19 +08:00
|
|
|
# summary
|
2020-05-27 14:20:40 +08:00
|
|
|
echo ""
|
|
|
|
|
echo "Configure summary:"
|
|
|
|
|
echo " ${SRS_AUTO_USER_CONFIGURE}"
|
|
|
|
|
echo " ${SRS_AUTO_CONFIGURE}"
|
2022-11-18 23:02:35 +08:00
|
|
|
if [[ $SRS_HLS == YES ]]; then
|
2020-05-27 14:20:40 +08:00
|
|
|
echo -e "${GREEN}HLS is enabled.${BLACK}"
|
|
|
|
|
else
|
|
|
|
|
echo -e "${YELLOW}Warning: HLS is disabled.${BLACK}"
|
|
|
|
|
fi
|
2022-11-18 23:02:35 +08:00
|
|
|
if [[ $SRS_STREAM_CASTER == YES ]]; then
|
2022-10-06 20:59:30 +08:00
|
|
|
echo -e "${YELLOW}Experiment: StreamConverter is enabled.${BLACK}"
|
2020-05-27 14:20:40 +08:00
|
|
|
else
|
2022-10-06 20:59:30 +08:00
|
|
|
echo -e "${GREEN}Note: StreamConverter is disabled.${BLACK}"
|
2020-05-27 14:20:40 +08:00
|
|
|
fi
|
2022-11-18 23:02:35 +08:00
|
|
|
if [[ $SRS_HDS == YES ]]; then
|
2020-05-27 14:20:40 +08:00
|
|
|
echo -e "${YELLOW}Experiment: HDS is enabled.${BLACK}"
|
|
|
|
|
else
|
|
|
|
|
echo -e "${GREEN}Warning: HDS is disabled.${BLACK}"
|
|
|
|
|
fi
|
2022-11-18 23:02:35 +08:00
|
|
|
if [[ $SRS_GB28181 == YES ]]; then
|
2022-10-06 17:40:58 +08:00
|
|
|
echo -e "${YELLOW}Experiment: GB28181 is enabled. https://github.com/ossrs/srs/issues/3176${BLACK}"
|
|
|
|
|
else
|
|
|
|
|
echo -e "${GREEN}Warning: GB28181 is disabled.${BLACK}"
|
|
|
|
|
fi
|
2025-07-04 17:26:12 -04:00
|
|
|
echo -e "${GREEN}Experiment: HEVC/H.265 is enabled. https://github.com/ossrs/srs/issues/465${BLACK}"
|
2022-11-18 23:02:35 +08:00
|
|
|
if [[ $SRS_SRT == YES ]]; then
|
2020-05-27 14:20:40 +08:00
|
|
|
echo -e "${YELLOW}Experiment: SRT is enabled. https://github.com/ossrs/srs/issues/1147${BLACK}"
|
|
|
|
|
else
|
|
|
|
|
echo -e "${GREEN}Warning: SRT is disabled.${BLACK}"
|
|
|
|
|
fi
|
AI: Remove cygwin64, always enable WebRTC, and enforce C++98 compatibility. v7.0.60 (#4447)
This PR makes WebRTC a core feature of SRS and enforces C++98
compatibility by:
1. Always Enable WebRTC Support
- Remove `--rtc=on|off` configuration option - WebRTC is now always
enabled
- Eliminate all `#ifdef SRS_RTC` conditional compilation blocks
- Include WebRTC-related modules (RTC, SRTP, DTLS) in all builds
- Update build scripts to always link WebRTC dependencies
2. Enforce C++98 Compatibility
- Remove `--cxx11=on|off` and `--cxx14=on|off` configuration options
- Force `SRS_CXX11=NO` and `SRS_CXX14=NO` in build system
- Move these options to deprecated section with warnings
- Ensure codebase maintains C++98 standard compatibility
3. Remove Windows/Cygwin Support
- Remove all Windows and Cygwin64 conditional compilation blocks (#ifdef
_WIN32, #ifdef CYGWIN64)
- Delete Cygwin64 build configurations from build scripts (
auto/options.sh, auto/depends.sh, configure)
- Remove Cygwin64 assembly files and State Threads platform support (
md_cygwin64.S)
- Eliminate Windows-specific GitHub Actions workflows and CI/CD jobs
- Remove NSIS packaging files and Windows installer generation
- Delete Windows documentation and update feature lists to mark support
as removed in v7.0
- Simplify OS detection to only support Unix-like systems (Linux, macOS)
4. Code Cleanup
- Remove conditional WebRTC code blocks throughout the codebase
- Simplify build configuration by removing WebRTC-related conditionals
- Update constructor delegation patterns to be C++98 compatible
- Fix vector initialization to use C++98 syntax
- Eliminate Windows-specific implementations for file operations, time
handling, and networking
- Unified platform handling with consistent POSIX API usage
---------
Co-authored-by: OSSRS-AI <winlinam@gmail.com>
2025-08-21 10:03:38 -06:00
|
|
|
echo -e "${YELLOW}Experiment: RTC is enabled. https://github.com/ossrs/srs/issues/307${BLACK}"
|
NEW PROTOCOL: Support viewing stream over RTSP. v7.0.47 (#4333)
## Introduce
This PR adds support for viewing streams via the RTSP protocol. Note
that it only supports viewing streams, not publishing streams via RTSP.
Currently, only publishing via RTMP is supported, which is then
converted to RTSP. Further work is needed to support publishing RTC/SRT
streams and converting them to RTSP.
## Usage
Build and run SRS with RTSP support:
```
cd srs/trunk && ./configure --rtsp=on && make -j16
./objs/srs -c conf/rtsp.conf
```
Push stream via RTMP by FFmpeg:
```
ffmpeg -re -i doc/source.flv -c copy -f flv rtmp://localhost/live/livestream
```
View the stream via RTSP protocol, try UDP first, then use TCP:
```
ffplay -i rtsp://localhost:8554/live/livestream
```
Or specify the transport protocol with TCP:
```
ffplay -rtsp_transport tcp -i rtsp://localhost:8554/live/livestream
```
## Unit Test
Run utest for RTSP:
```
./configure --utest=on & make utest -j16
./objs/srs_utest
```
## Regression Test
You need to start SRS for regression testing.
```
./objs/srs -c conf/regression-test-for-clion.conf
```
Then run regression tests for RTSP.
```
cd srs/trunk/3rdparty/srs-bench
go test ./srs -mod=vendor -v -count=1 -run=TestRtmpPublish_RtspPlay
```
## Blackbox Test
For blackbox testing, SRS will be started by utest, so there is no need
to start SRS manually.
```
cd srs/trunk/3rdparty/srs-bench
go test ./blackbox -mod=vendor -v -count=1 -run=TestFast_RtmpPublish_RtspPlay_Basic
```
## UDP Transport
As UDP requires port allocation, this PR doesn't support delivering
media stream via UDP transport, so it will fail if you try to use UDP as
transport:
```
ffplay -rtsp_transport udp -i rtsp://localhost:8554/live/livestream
[rtsp @ 0x7fbc99a14880] method SETUP failed: 461 Unsupported Transport
rtsp://localhost:8554/live/livestream: Protocol not supported
[2025-07-05 21:30:52.738][WARN][14916][7d7gf623][35] RTSP: setup failed: code=2057
(RtspTransportNotSupported) : UDP transport not supported, only TCP/interleaved mode is supported
```
There are no plans to support UDP transport for RTSP. In the real world,
UDP is rarely used; the vast majority of RTSP traffic uses TCP.
## Play Before Publish
RTSP supports audio with AAC and OPUS codecs, which is significantly
different from RTMP or WebRTC.
RTSP uses commands to exchange SDP and specify the audio track to play,
unlike WHEP or HTTP-FLV, which use the query string of the URL. RTSP
depends on the player’s behavior, making it very difficult to use and
describe.
Considering the feature that allows playing the stream before publishing
it, it requires generating some default parameters in the SDP. For OPUS,
the sample rate is 48 kHz with 2 channels, while AAC is more complex,
especially regarding the sample rate, which may be 44.1 kHz, 32 kHz, or
48 kHz.
Therefore, for RTSP, we cannot support play-then-publish. Instead, there
must already be a stream when playing it, so that the audio codec is
determined.
## Opus Codec
No Opus codec support for RTSP, because for RTC2RTSP, it always converts
RTC to RTMP frames, then converts them to RTSP packets. Therefore, the
audio codec is always AAC after converting RTC to RTMP.
This means the bridge architecture needs some changes. We need a new
bridge that binds to the target protocol. For example, RTC2RTMP converts
the audio codec, but RTC2RTSP keeps the original audio codec.
Furthermore, the RTC2RTMP bridge should also support bypassing the Opus
codec if we use enhanced-RTMP, which supports the Opus audio codec. I
think it should be configurable to either transcode or bypass the audio
codec. However, this is not relevant to RTSP.
## AI Contributor
Below commits are contributed by AI:
* [AI: Remove support for media transport via
UDP.](https://github.com/ossrs/srs/pull/4333/commits/755686229f0d3910f058e6f75993112a68c5f60a)
* [AI: Add crutial logs for each RTSP
stage.](https://github.com/ossrs/srs/pull/4333/commits/9c8cbe7bdefda19087f87fdb5e041a8934e4db1d)
* [AI: Support AAC doec for
RTSP.](https://github.com/ossrs/srs/pull/4333/commits/7d7cc12bae269850011d4757eae635a61de99f36)
* [AI: Add option --rtsp for
RTSP.](https://github.com/ossrs/srs/pull/4333/commits/f67414d9ee98da39cda1f7d47cdf793c0e5a8412)
* [AI: Extract SrsRtpVideoBuilder for RTC and
RTSP.](https://github.com/ossrs/srs/pull/4333/commits/562e76b90469a1b016857eb23b090e8e45b52de3)
---------
Co-authored-by: Jacob Su <suzp1984@gmail.com>
Co-authored-by: winlin <winlinvip@gmail.com>
2025-07-11 20:18:40 +08:00
|
|
|
if [[ $SRS_RTSP == YES ]]; then
|
|
|
|
|
echo -e "${YELLOW}Experiment: RTSP is enabled (requires RTC).${BLACK}"
|
|
|
|
|
else
|
|
|
|
|
echo -e "${GREEN}Warning: RTSP is disabled.${BLACK}"
|
|
|
|
|
fi
|
2022-11-18 23:02:35 +08:00
|
|
|
if [[ $SRS_HTTPS == YES ]]; then
|
2020-11-03 15:45:52 +08:00
|
|
|
echo -e "${YELLOW}Experiment: HTTPS is enabled. https://github.com/ossrs/srs/issues/1657${BLACK}"
|
|
|
|
|
else
|
|
|
|
|
echo -e "${GREEN}Warning: HTTPS is disabled.${BLACK}"
|
|
|
|
|
fi
|
2022-11-18 23:02:35 +08:00
|
|
|
if [[ $SRS_DVR == YES ]]; then
|
2020-05-27 14:20:40 +08:00
|
|
|
echo -e "${GREEN}DVR is enabled.${BLACK}"
|
|
|
|
|
else
|
|
|
|
|
echo -e "${YELLOW}Warning: DVR is disabled.${BLACK}"
|
2014-05-04 18:38:08 +08:00
|
|
|
fi
|
2022-11-18 23:02:35 +08:00
|
|
|
if [[ $SRS_SSL == YES ]]; then
|
2020-05-27 14:20:40 +08:00
|
|
|
echo -e "${GREEN}RTMP complex handshake is enabled${BLACK}"
|
|
|
|
|
else
|
|
|
|
|
echo -e "${YELLOW}Warning: RTMP complex handshake is disabled, flash cann't play h264/aac.${BLACK}"
|
|
|
|
|
fi
|
2021-01-25 22:23:42 +08:00
|
|
|
if [[ $SRS_NASM == YES ]]; then
|
|
|
|
|
echo -e "${GREEN}NASM for HTTPS(openssl) and FFmepg is enabled${BLACK}"
|
|
|
|
|
else
|
|
|
|
|
echo -e "${YELLOW}Warning: NASM for HTTPS(openssl) and FFmepg is disabled${BLACK}"
|
|
|
|
|
fi
|
|
|
|
|
if [[ $SRS_SRTP_ASM == YES ]]; then
|
|
|
|
|
echo -e "${GREEN}SRTP-NASM for WebRTC(openssl) is enabled${BLACK}"
|
|
|
|
|
else
|
|
|
|
|
echo -e "${YELLOW}Warning: SRTP-NASM for WebRTC(openssl) is disabled${BLACK}"
|
|
|
|
|
fi
|
2022-11-18 23:02:35 +08:00
|
|
|
if [[ $SRS_TRANSCODE == YES ]]; then
|
2020-05-27 14:20:40 +08:00
|
|
|
echo -e "${GREEN}The transcoding is enabled${BLACK}"
|
|
|
|
|
else
|
|
|
|
|
echo -e "${YELLOW}Warning: The transcoding is disabled.${BLACK}"
|
|
|
|
|
fi
|
2022-11-18 23:02:35 +08:00
|
|
|
if [[ $SRS_INGEST == YES ]]; then
|
2020-05-27 14:20:40 +08:00
|
|
|
echo -e "${GREEN}The ingesting is enabled.${BLACK}"
|
|
|
|
|
else
|
|
|
|
|
echo -e "${YELLOW}Warning: The ingesting is disabled.${BLACK}"
|
|
|
|
|
fi
|
2022-11-18 23:02:35 +08:00
|
|
|
if [[ $SRS_HTTP_CALLBACK == YES ]]; then
|
2020-05-27 14:20:40 +08:00
|
|
|
echo -e "${GREEN}The http-callback is enabled${BLACK}"
|
|
|
|
|
else
|
|
|
|
|
echo -e "${YELLOW}Warning: The http-callback is disabled.${BLACK}"
|
|
|
|
|
fi
|
2022-11-18 23:02:35 +08:00
|
|
|
if [[ $SRS_HTTP_SERVER == YES ]]; then
|
2020-05-27 14:20:40 +08:00
|
|
|
echo -e "${GREEN}Embeded HTTP server for HTTP-FLV/HLS is enabled.${BLACK}"
|
|
|
|
|
else
|
|
|
|
|
echo -e "${YELLOW}Warning: Embeded HTTP server is disabled, HTTP-FLV is disabled, please use nginx to delivery HLS.${BLACK}"
|
|
|
|
|
fi
|
2022-11-18 23:02:35 +08:00
|
|
|
if [[ $SRS_HTTP_API == YES ]]; then
|
2020-05-27 14:20:40 +08:00
|
|
|
echo -e "${GREEN}The HTTP API is enabled${BLACK}"
|
|
|
|
|
else
|
|
|
|
|
echo -e "${YELLOW}Warning: The HTTP API is disabled.${BLACK}"
|
|
|
|
|
fi
|
2022-11-18 23:02:35 +08:00
|
|
|
if [[ $SRS_UTEST == YES ]]; then
|
2020-05-27 14:20:40 +08:00
|
|
|
echo -e "${GREEN}The utests are enabled.${BLACK}"
|
|
|
|
|
else
|
|
|
|
|
echo -e "${YELLOW}Note: The utests are disabled.${BLACK}"
|
|
|
|
|
fi
|
2022-11-18 23:02:35 +08:00
|
|
|
if [[ $SRS_GPERF == YES ]]; then
|
2020-05-27 14:20:40 +08:00
|
|
|
echo -e "${GREEN}The gperf(tcmalloc) is enabled.${BLACK}"
|
|
|
|
|
else
|
|
|
|
|
echo -e "${GREEN}Note: The gperf(tcmalloc) is disabled.${BLACK}"
|
|
|
|
|
fi
|
2022-11-18 23:02:35 +08:00
|
|
|
if [[ $SRS_GPERF_MC == YES ]]; then
|
2020-05-27 14:20:40 +08:00
|
|
|
echo -e "${YELLOW}The gmc(gperf memory check) is enabled, performance may suffer.${BLACK}"
|
|
|
|
|
else
|
|
|
|
|
echo -e "${GREEN}Note: The gmc(gperf memory check) is disabled.${BLACK}"
|
|
|
|
|
fi
|
2022-11-18 23:02:35 +08:00
|
|
|
if [[ $SRS_GPERF_MD == YES ]]; then
|
2020-05-27 14:20:40 +08:00
|
|
|
echo -e "${YELLOW}The gmd(gperf memory defense) is enabled, performance may suffer.${BLACK}"
|
|
|
|
|
else
|
|
|
|
|
echo -e "${GREEN}Note: The gmd(gperf memory defense) is disabled.${BLACK}"
|
|
|
|
|
fi
|
2022-11-18 23:02:35 +08:00
|
|
|
if [[ $SRS_GPERF_MP == YES ]]; then
|
2020-05-27 14:20:40 +08:00
|
|
|
echo -e "${YELLOW}The gmp(gperf memory profile) is enabled, performance may suffer.${BLACK}"
|
|
|
|
|
else
|
|
|
|
|
echo -e "${GREEN}Note: The gmp(gperf memory profile) is disabled.${BLACK}"
|
|
|
|
|
fi
|
2022-11-18 23:02:35 +08:00
|
|
|
if [[ $SRS_GPERF_CP == YES ]]; then
|
2020-05-27 14:20:40 +08:00
|
|
|
echo -e "${YELLOW}The gcp(gperf cpu profile) is enabled, performance may suffer.${BLACK}"
|
|
|
|
|
else
|
|
|
|
|
echo -e "${GREEN}Note: The gcp(gperf cpu profile) is disabled.${BLACK}"
|
|
|
|
|
fi
|
2022-11-18 23:02:35 +08:00
|
|
|
if [[ $SRS_GPROF == YES ]]; then
|
2020-05-27 14:20:40 +08:00
|
|
|
echo -e "${YELLOW}The gprof(GNU profile tool) is enabled, performance may suffer.${BLACK}"
|
|
|
|
|
else
|
|
|
|
|
echo -e "${GREEN}Note: The gprof(GNU profile tool) is disabled.${BLACK}"
|
|
|
|
|
fi
|
2022-11-18 23:02:35 +08:00
|
|
|
if [[ $SRS_CROSS_BUILD == YES ]]; then
|
2021-05-21 17:14:04 +08:00
|
|
|
echo -e "${YELLOW}The cross-build is enabled.${BLACK}"
|
|
|
|
|
else
|
|
|
|
|
echo -e "${GREEN}Note: The cross-build is disabled.${BLACK}"
|
|
|
|
|
fi
|
2022-11-18 23:02:35 +08:00
|
|
|
if [[ $SRS_VALGRIND == YES ]]; then
|
2020-05-27 14:20:40 +08:00
|
|
|
echo -e "${GREEN}The valgrind is enabled.${BLACK}"
|
|
|
|
|
else
|
|
|
|
|
echo -e "${GREEN}Note: The valgrind is disabled.${BLACK}"
|
|
|
|
|
fi
|
2024-02-05 12:14:22 +08:00
|
|
|
if [[ $SRS_SANITIZER == YES ]]; then
|
|
|
|
|
echo -e "${GREEN}The sanitizer is enabled.${BLACK}"
|
|
|
|
|
else
|
|
|
|
|
echo -e "${GREEN}Note: The sanitizer is disabled.${BLACK}"
|
|
|
|
|
fi
|
|
|
|
|
|
2020-04-04 18:47:12 +08:00
|
|
|
#####################################################################################
|
|
|
|
|
# Do cleanup when configure done.
|
|
|
|
|
#####################################################################################
|
|
|
|
|
if [[ $SRS_CLEAN == YES && -f Makefile ]]; then
|
2021-04-24 19:45:05 +08:00
|
|
|
#echo "Do full cleanup, you can disable it by: --clean=off"
|
2020-04-04 18:47:12 +08:00
|
|
|
make clean
|
|
|
|
|
fi
|
|
|
|
|
|
2014-02-28 15:10:28 +08:00
|
|
|
#####################################################################################
|
|
|
|
|
# next step
|
|
|
|
|
#####################################################################################
|
2020-05-27 14:20:40 +08:00
|
|
|
echo ""
|
|
|
|
|
echo "You can build SRS:"
|
2021-04-24 19:45:05 +08:00
|
|
|
echo "\" make \" to build the SRS server"
|
|
|
|
|
echo "\" make help \" to get some help"
|
2020-05-27 14:20:40 +08:00
|
|
|
|