2015-03-07 16:49:21 +08:00
|
|
|
#!/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
|
|
|
|
|
|
2021-08-07 21:35:00 +08:00
|
|
|
echo "#define SRS_PACKAGER \"${SRS_AUTO_PACKAGER}\"" >> $SRS_AUTO_HEADERS_H
|
2020-04-29 20:02:28 +08:00
|
|
|
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
|
2015-03-10 12:50:27 +08:00
|
|
|
echo "" >> $SRS_AUTO_HEADERS_H
|
|
|
|
|
|
2015-09-24 12:15:12 +08:00
|
|
|
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
|
|
|
|
|
}
|
|
|
|
|
|
2015-03-07 16:49:21 +08:00
|
|
|
#####################################################################################
|
|
|
|
|
# generate auto headers file, depends on the finished of options.sh
|
|
|
|
|
#####################################################################################
|
|
|
|
|
# auto headers in depends.
|
2022-11-18 23:02:35 +08:00
|
|
|
if [[ $SRS_HDS == YES ]]; then
|
2020-04-29 20:02:28 +08:00
|
|
|
srs_define_macro "SRS_HDS" $SRS_AUTO_HEADERS_H
|
2015-03-12 11:15:15 +08:00
|
|
|
else
|
2020-04-29 20:02:28 +08:00
|
|
|
srs_undefine_macro "SRS_HDS" $SRS_AUTO_HEADERS_H
|
2015-03-12 11:15:15 +08:00
|
|
|
fi
|
|
|
|
|
|
2025-08-31 17:30:19 -04:00
|
|
|
srs_define_macro "SRS_SRT" $SRS_AUTO_HEADERS_H
|
2020-01-23 14:23:09 +08:00
|
|
|
|
2022-11-18 23:02:35 +08:00
|
|
|
if [[ $SRS_CXX11 == YES ]]; then
|
2020-06-03 19:18:41 +08:00
|
|
|
srs_define_macro "SRS_CXX11" $SRS_AUTO_HEADERS_H
|
|
|
|
|
else
|
|
|
|
|
srs_undefine_macro "SRS_CXX11" $SRS_AUTO_HEADERS_H
|
|
|
|
|
fi
|
|
|
|
|
|
2022-11-18 23:02:35 +08:00
|
|
|
if [[ $SRS_CXX14 == YES ]]; then
|
2020-06-11 17:12:37 +08:00
|
|
|
srs_define_macro "SRS_CXX14" $SRS_AUTO_HEADERS_H
|
|
|
|
|
else
|
|
|
|
|
srs_undefine_macro "SRS_CXX14" $SRS_AUTO_HEADERS_H
|
|
|
|
|
fi
|
|
|
|
|
|
2022-11-18 23:02:35 +08:00
|
|
|
if [[ $SRS_BACKTRACE == YES ]]; then
|
2022-10-21 23:30:43 +08:00
|
|
|
srs_define_macro "SRS_BACKTRACE" $SRS_AUTO_HEADERS_H
|
|
|
|
|
else
|
|
|
|
|
srs_undefine_macro "SRS_BACKTRACE" $SRS_AUTO_HEADERS_H
|
|
|
|
|
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
|
|
|
srs_define_macro "SRS_RTC" $SRS_AUTO_HEADERS_H
|
2020-03-22 18:17:05 +08:00
|
|
|
|
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
|
|
|
|
|
srs_define_macro "SRS_RTSP" $SRS_AUTO_HEADERS_H
|
|
|
|
|
else
|
|
|
|
|
srs_undefine_macro "SRS_RTSP" $SRS_AUTO_HEADERS_H
|
|
|
|
|
fi
|
|
|
|
|
|
2022-11-18 23:02:35 +08:00
|
|
|
if [[ $SRS_FFMPEG_FIT == YES ]]; then
|
2020-06-24 12:44:13 +08:00
|
|
|
srs_define_macro "SRS_FFMPEG_FIT" $SRS_AUTO_HEADERS_H
|
|
|
|
|
else
|
|
|
|
|
srs_undefine_macro "SRS_FFMPEG_FIT" $SRS_AUTO_HEADERS_H
|
|
|
|
|
fi
|
|
|
|
|
|
2023-01-06 17:23:19 +08:00
|
|
|
if [[ $SRS_FFMPEG_OPUS == YES ]]; then
|
|
|
|
|
srs_define_macro "SRS_FFMPEG_OPUS" $SRS_AUTO_HEADERS_H
|
|
|
|
|
else
|
|
|
|
|
srs_undefine_macro "SRS_FFMPEG_OPUS" $SRS_AUTO_HEADERS_H
|
|
|
|
|
fi
|
|
|
|
|
|
2025-07-04 17:26:12 -04:00
|
|
|
# H.265/HEVC support is always enabled
|
|
|
|
|
srs_define_macro "SRS_H265" $SRS_AUTO_HEADERS_H
|
2022-11-23 08:34:13 +08:00
|
|
|
|
2022-11-18 23:02:35 +08:00
|
|
|
if [[ $SRS_SIMULATOR == YES ]]; then
|
2020-05-07 16:29:11 +08:00
|
|
|
srs_define_macro "SRS_SIMULATOR" $SRS_AUTO_HEADERS_H
|
|
|
|
|
else
|
|
|
|
|
srs_undefine_macro "SRS_SIMULATOR" $SRS_AUTO_HEADERS_H
|
|
|
|
|
fi
|
|
|
|
|
|
2022-11-18 23:02:35 +08:00
|
|
|
if [[ $SRS_HTTPS == YES ]]; then
|
2020-11-03 15:45:52 +08:00
|
|
|
srs_define_macro "SRS_HTTPS" $SRS_AUTO_HEADERS_H
|
|
|
|
|
else
|
|
|
|
|
srs_undefine_macro "SRS_HTTPS" $SRS_AUTO_HEADERS_H
|
|
|
|
|
fi
|
|
|
|
|
|
2022-11-18 23:02:35 +08:00
|
|
|
if [[ $SRS_GB28181 == YES ]]; then
|
2022-10-06 17:40:58 +08:00
|
|
|
srs_define_macro "SRS_GB28181" $SRS_AUTO_HEADERS_H
|
|
|
|
|
else
|
|
|
|
|
srs_undefine_macro "SRS_GB28181" $SRS_AUTO_HEADERS_H
|
|
|
|
|
fi
|
|
|
|
|
|
2025-08-28 10:37:57 -04:00
|
|
|
|
2022-12-03 18:35:41 +08:00
|
|
|
|
2022-11-18 23:02:35 +08:00
|
|
|
if [[ $SRS_UTEST == YES ]]; then
|
2020-04-29 20:02:28 +08:00
|
|
|
srs_define_macro "SRS_UTEST" $SRS_AUTO_HEADERS_H
|
2019-04-10 09:07:03 +08:00
|
|
|
else
|
2020-04-29 20:02:28 +08:00
|
|
|
srs_undefine_macro "SRS_UTEST" $SRS_AUTO_HEADERS_H
|
2019-04-10 09:07:03 +08:00
|
|
|
fi
|
|
|
|
|
|
2025-10-13 08:14:41 -04:00
|
|
|
if [[ $SRS_FORCE_PUBLIC4UTEST == YES ]]; then
|
|
|
|
|
srs_define_macro "SRS_FORCE_PUBLIC4UTEST" $SRS_AUTO_HEADERS_H
|
|
|
|
|
else
|
|
|
|
|
srs_undefine_macro "SRS_FORCE_PUBLIC4UTEST" $SRS_AUTO_HEADERS_H
|
|
|
|
|
fi
|
|
|
|
|
|
2015-03-07 16:49:21 +08:00
|
|
|
# whatever the FFMPEG tools, if transcode and ingest specified,
|
|
|
|
|
# srs always compile the FFMPEG tool stub which used to start the FFMPEG process.
|
2022-11-18 23:02:35 +08:00
|
|
|
if [[ $SRS_FFMPEG_STUB == YES ]]; then
|
2020-04-29 20:02:28 +08:00
|
|
|
srs_define_macro "SRS_FFMPEG_STUB" $SRS_AUTO_HEADERS_H
|
2015-03-07 16:49:21 +08:00
|
|
|
else
|
2020-04-29 20:02:28 +08:00
|
|
|
srs_undefine_macro "SRS_FFMPEG_STUB" $SRS_AUTO_HEADERS_H
|
2015-03-07 16:49:21 +08:00
|
|
|
fi
|
|
|
|
|
|
2022-11-18 23:02:35 +08:00
|
|
|
if [[ $SRS_GPERF == YES ]]; then
|
2020-04-29 20:02:28 +08:00
|
|
|
srs_define_macro "SRS_GPERF" $SRS_AUTO_HEADERS_H
|
2015-03-07 16:49:21 +08:00
|
|
|
else
|
2020-04-29 20:02:28 +08:00
|
|
|
srs_undefine_macro "SRS_GPERF" $SRS_AUTO_HEADERS_H
|
2015-03-07 16:49:21 +08:00
|
|
|
fi
|
2022-11-18 23:02:35 +08:00
|
|
|
if [[ $SRS_GPERF_MC == YES ]]; then
|
2020-04-29 20:02:28 +08:00
|
|
|
srs_define_macro "SRS_GPERF_MC" $SRS_AUTO_HEADERS_H
|
2015-03-07 16:49:21 +08:00
|
|
|
else
|
2020-04-29 20:02:28 +08:00
|
|
|
srs_undefine_macro "SRS_GPERF_MC" $SRS_AUTO_HEADERS_H
|
2015-03-07 16:49:21 +08:00
|
|
|
fi
|
2022-11-18 23:02:35 +08:00
|
|
|
if [[ $SRS_GPERF_MD == YES ]]; then
|
2020-04-29 20:02:28 +08:00
|
|
|
srs_define_macro "SRS_GPERF_MD" $SRS_AUTO_HEADERS_H
|
2016-01-08 13:58:19 +08:00
|
|
|
else
|
2020-04-29 20:02:28 +08:00
|
|
|
srs_undefine_macro "SRS_GPERF_MD" $SRS_AUTO_HEADERS_H
|
2016-01-08 13:58:19 +08:00
|
|
|
fi
|
2022-11-18 23:02:35 +08:00
|
|
|
if [[ $SRS_GPERF_MP == YES ]]; then
|
2020-04-29 20:02:28 +08:00
|
|
|
srs_define_macro "SRS_GPERF_MP" $SRS_AUTO_HEADERS_H
|
2015-03-07 16:49:21 +08:00
|
|
|
else
|
2020-04-29 20:02:28 +08:00
|
|
|
srs_undefine_macro "SRS_GPERF_MP" $SRS_AUTO_HEADERS_H
|
2015-03-07 16:49:21 +08:00
|
|
|
fi
|
2022-11-18 23:02:35 +08:00
|
|
|
if [[ $SRS_GPERF_CP == YES ]]; then
|
2020-04-29 20:02:28 +08:00
|
|
|
srs_define_macro "SRS_GPERF_CP" $SRS_AUTO_HEADERS_H
|
2015-03-07 16:49:21 +08:00
|
|
|
else
|
2020-04-29 20:02:28 +08:00
|
|
|
srs_undefine_macro "SRS_GPERF_CP" $SRS_AUTO_HEADERS_H
|
2015-03-07 16:49:21 +08:00
|
|
|
fi
|
2022-12-31 19:27:21 +08:00
|
|
|
if [ $SRS_SANITIZER == YES ]; then
|
|
|
|
|
srs_define_macro "SRS_SANITIZER" $SRS_AUTO_HEADERS_H
|
|
|
|
|
else
|
|
|
|
|
srs_undefine_macro "SRS_SANITIZER" $SRS_AUTO_HEADERS_H
|
|
|
|
|
fi
|
2022-12-04 22:20:59 +08:00
|
|
|
if [ $SRS_SANITIZER_LOG == YES ]; then
|
|
|
|
|
srs_define_macro "SRS_SANITIZER_LOG" $SRS_AUTO_HEADERS_H
|
|
|
|
|
else
|
|
|
|
|
srs_undefine_macro "SRS_SANITIZER_LOG" $SRS_AUTO_HEADERS_H
|
|
|
|
|
fi
|
API: Support new HTTP API for VALGRIND. v6.0.149 v7.0.6 (#4150)
New features for valgrind:
1. ST: Support /api/v1/valgrind for leaking check.
2. ST: Support /api/v1/valgrind?check=full|added|changed|new|quick
To use Valgrind to detect memory leaks in SRS, even though Valgrind
hooks are supported in ST, there are still many false positives. A more
reasonable approach is to have Valgrind report incremental memory leaks.
This way, global and static variables can be avoided, and detection can
be achieved without exiting the program. Follow these steps:
1. Compile SRS with Valgrind support: `./configure --valgrind=on &&
make`
2. Start SRS with memory leak detection enabled: `valgrind
--leak-check=full ./objs/srs -c conf/console.conf`
3. Trigger memory detection by using curl to access the API and generate
calibration data. There will still be many false positives, but these
can be ignored: `curl http://127.0.0.1:1985/api/v1/valgrind?check=added`
4. Perform load testing or test the suspected leaking functionality,
such as RTMP streaming: `ffmpeg -re -i doc/source.flv -c copy -f flv
rtmp://127.0.0.1/live/livestream`
5. Stop streaming and wait for SRS to clean up the Source memory,
approximately 30 seconds.
6. Perform incremental memory leak detection. The reported leaks will be
very accurate at this point: `curl
http://127.0.0.1:1985/api/v1/valgrind?check=added`
> Note: To avoid interference from the HTTP request itself on Valgrind,
SRS uses a separate coroutine to perform periodic checks. Therefore,
after accessing the API, you may need to wait a few seconds for the
detection to be triggered.
---------
Co-authored-by: Jacob Su <suzp1984@gmail.com>
2024-08-21 15:39:01 +08:00
|
|
|
if [ $SRS_VALGRIND == YES ]; then
|
|
|
|
|
srs_define_macro "SRS_VALGRIND" $SRS_AUTO_HEADERS_H
|
|
|
|
|
else
|
|
|
|
|
srs_undefine_macro "SRS_VALGRIND" $SRS_AUTO_HEADERS_H
|
|
|
|
|
fi
|
2015-03-07 16:49:21 +08:00
|
|
|
|
|
|
|
|
#####################################################################################
|
|
|
|
|
# for embeded.
|
|
|
|
|
#####################################################################################
|
|
|
|
|
# for log level compile settings
|
2022-11-18 23:02:35 +08:00
|
|
|
if [[ $SRS_LOG_VERBOSE == YES ]]; then
|
2020-04-29 20:02:28 +08:00
|
|
|
srs_define_macro "SRS_VERBOSE" $SRS_AUTO_HEADERS_H
|
2015-03-07 16:49:21 +08:00
|
|
|
else
|
2020-04-29 20:02:28 +08:00
|
|
|
srs_undefine_macro "SRS_VERBOSE" $SRS_AUTO_HEADERS_H
|
2015-03-07 16:49:21 +08:00
|
|
|
fi
|
2022-11-18 23:02:35 +08:00
|
|
|
if [[ $SRS_LOG_INFO == YES ]]; then
|
2020-04-29 20:02:28 +08:00
|
|
|
srs_define_macro "SRS_INFO" $SRS_AUTO_HEADERS_H
|
2015-03-07 16:49:21 +08:00
|
|
|
else
|
2020-04-29 20:02:28 +08:00
|
|
|
srs_undefine_macro "SRS_INFO" $SRS_AUTO_HEADERS_H
|
2015-03-07 16:49:21 +08:00
|
|
|
fi
|
2022-11-18 23:02:35 +08:00
|
|
|
if [[ $SRS_LOG_TRACE == YES ]]; then
|
2020-04-29 20:02:28 +08:00
|
|
|
srs_define_macro "SRS_TRACE" $SRS_AUTO_HEADERS_H
|
2015-03-07 16:49:21 +08:00
|
|
|
else
|
2020-04-29 20:02:28 +08:00
|
|
|
srs_undefine_macro "SRS_TRACE" $SRS_AUTO_HEADERS_H
|
2015-03-07 16:49:21 +08:00
|
|
|
fi
|
2022-11-19 12:11:03 +08:00
|
|
|
if [[ $SRS_SINGLE_THREAD == YES ]]; then
|
|
|
|
|
srs_define_macro "SRS_SINGLE_THREAD" $SRS_AUTO_HEADERS_H
|
|
|
|
|
else
|
|
|
|
|
srs_undefine_macro "SRS_SINGLE_THREAD" $SRS_AUTO_HEADERS_H
|
|
|
|
|
fi
|
2024-08-24 22:40:39 +08:00
|
|
|
if [[ $SRS_SIGNAL_API == YES ]]; then
|
|
|
|
|
srs_define_macro "SRS_SIGNAL_API" $SRS_AUTO_HEADERS_H
|
|
|
|
|
else
|
|
|
|
|
srs_undefine_macro "SRS_SIGNAL_API" $SRS_AUTO_HEADERS_H
|
|
|
|
|
fi
|
2022-11-18 23:02:35 +08:00
|
|
|
if [[ $SRS_LOG_LEVEL_V2 == YES ]]; then
|
2022-10-26 21:23:03 +08:00
|
|
|
srs_define_macro "SRS_LOG_LEVEL_V2" $SRS_AUTO_HEADERS_H
|
|
|
|
|
else
|
|
|
|
|
srs_undefine_macro "SRS_LOG_LEVEL_V2" $SRS_AUTO_HEADERS_H
|
|
|
|
|
fi
|
2022-11-18 23:02:35 +08:00
|
|
|
if [[ $SRS_CROSS_BUILD == YES ]]; then
|
2020-04-29 20:02:28 +08:00
|
|
|
srs_define_macro "SRS_CROSSBUILD" $SRS_AUTO_HEADERS_H
|
2020-01-21 13:59:43 +08:00
|
|
|
else
|
2020-04-29 20:02:28 +08:00
|
|
|
srs_undefine_macro "SRS_CROSSBUILD" $SRS_AUTO_HEADERS_H
|
2020-01-21 13:59:43 +08:00
|
|
|
fi
|
2022-11-20 12:29:57 +08:00
|
|
|
if [[ $SRS_CYGWIN64 == YES ]]; then
|
|
|
|
|
srs_define_macro "SRS_CYGWIN64" $SRS_AUTO_HEADERS_H
|
|
|
|
|
else
|
|
|
|
|
srs_undefine_macro "SRS_CYGWIN64" $SRS_AUTO_HEADERS_H
|
|
|
|
|
fi
|
2022-11-18 23:02:35 +08:00
|
|
|
if [[ $SRS_OSX == YES ]]; then
|
2020-04-29 20:02:28 +08:00
|
|
|
srs_define_macro "SRS_OSX" $SRS_AUTO_HEADERS_H
|
2020-03-28 17:20:40 +08:00
|
|
|
else
|
2020-04-29 20:02:28 +08:00
|
|
|
srs_undefine_macro "SRS_OSX" $SRS_AUTO_HEADERS_H
|
2020-03-28 17:20:40 +08:00
|
|
|
fi
|
2015-03-07 16:49:21 +08:00
|
|
|
|
2022-11-18 23:02:35 +08:00
|
|
|
if [[ $SRS_DEBUG == YES ]]; then
|
2020-04-29 20:02:28 +08:00
|
|
|
srs_define_macro "SRS_DEBUG" $SRS_AUTO_HEADERS_H
|
2020-04-14 20:12:33 +08:00
|
|
|
else
|
2020-04-29 20:02:28 +08:00
|
|
|
srs_undefine_macro "SRS_DEBUG" $SRS_AUTO_HEADERS_H
|
2020-04-14 20:12:33 +08:00
|
|
|
fi
|
|
|
|
|
|
2022-11-18 23:02:35 +08:00
|
|
|
if [[ $SRS_DEBUG_STATS == YES ]]; then
|
2021-02-15 13:09:13 +08:00
|
|
|
srs_define_macro "SRS_DEBUG_STATS" $SRS_AUTO_HEADERS_H
|
|
|
|
|
else
|
|
|
|
|
srs_undefine_macro "SRS_DEBUG_STATS" $SRS_AUTO_HEADERS_H
|
|
|
|
|
fi
|
|
|
|
|
|
2025-06-15 09:23:55 -04:00
|
|
|
if [[ $SRS_DEBUG_NACK_DROP == YES ]]; then
|
|
|
|
|
srs_define_macro "SRS_DEBUG_NACK_DROP" $SRS_AUTO_HEADERS_H
|
|
|
|
|
else
|
|
|
|
|
srs_undefine_macro "SRS_DEBUG_NACK_DROP" $SRS_AUTO_HEADERS_H
|
|
|
|
|
fi
|
|
|
|
|
|
2015-03-07 16:49:21 +08:00
|
|
|
# prefix
|
|
|
|
|
echo "" >> $SRS_AUTO_HEADERS_H
|
2020-04-29 20:02:28 +08:00
|
|
|
echo "#define SRS_PREFIX \"${SRS_PREFIX}\"" >> $SRS_AUTO_HEADERS_H
|
2022-01-13 18:26:28 +08:00
|
|
|
echo "#define SRS_DEFAULT_CONFIG \"${SRS_DEFAULT_CONFIG}\"" >> $SRS_AUTO_HEADERS_H
|
2015-03-07 16:49:21 +08:00
|
|
|
|
|
|
|
|
echo "" >> $SRS_AUTO_HEADERS_H
|
|
|
|
|
|
|
|
|
|
#####################################################################################
|
|
|
|
|
# generated the contributors from AUTHORS.txt
|
|
|
|
|
#####################################################################################
|
2021-07-09 09:00:35 +08:00
|
|
|
if [[ -f AUTHORS.md ]]; then
|
|
|
|
|
RTMP_SIG_SRS_AUTHORS=$(cat AUTHORS.md|grep "^-"|awk -F '`' '{print $2}')
|
2021-07-08 14:30:47 +08:00
|
|
|
echo "#define RTMP_SIG_SRS_AUTHORS \"\\" >> $SRS_AUTO_HEADERS_H
|
|
|
|
|
for CONTRIBUTOR in $RTMP_SIG_SRS_AUTHORS; do
|
2019-05-05 07:55:55 +08:00
|
|
|
echo "${CONTRIBUTOR} \\" >> $SRS_AUTO_HEADERS_H
|
|
|
|
|
done
|
|
|
|
|
echo "\"" >> $SRS_AUTO_HEADERS_H
|
|
|
|
|
else
|
2021-07-08 14:30:47 +08:00
|
|
|
echo "#define RTMP_SIG_SRS_AUTHORS \"ossrs\"" >> $SRS_AUTO_HEADERS_H
|
2019-05-05 07:55:55 +08:00
|
|
|
fi
|
2015-03-07 16:49:21 +08:00
|
|
|
|
|
|
|
|
# new empty line to auto headers file.
|
|
|
|
|
echo "" >> $SRS_AUTO_HEADERS_H
|
|
|
|
|
|
2015-09-17 11:57:17 +08:00
|
|
|
#####################################################################################
|
2015-03-07 16:49:21 +08:00
|
|
|
# auto header EOF.
|
2015-09-17 11:57:17 +08:00
|
|
|
#####################################################################################
|
2015-03-07 16:49:21 +08:00
|
|
|
echo "#endif" >> $SRS_AUTO_HEADERS_H
|
|
|
|
|
echo "" >> $SRS_AUTO_HEADERS_H
|
|
|
|
|
|