Compare commits

...

55 Commits

Author SHA1 Message Date
winlin
398620d52c Edge: Fix RTMP late-join missing sequence headers. v6.0.186 (#4678)
Backport of the RTMP late-join fix from v8.0.2 / v7.0.150 to the 6.0
release line. The HTTP-FLV inverted-guard bug from that fix does not
apply to v6 (the lazy edge-mount mechanism that introduced it does not
exist on this branch).

RTMP players that join an edge stream after the first player fail to
decode. After v6.0.179 (#4512) stopped creating SrsOriginHub on edge,
the hub_active gate in SrsLiveSource::consumer_dumps() always evaluated
false on edge. That gate guards the dump of cached onMetaData + AVC
sequence header + AAC sequence header + GOP cache to a new consumer.
Result: the first player attaches before the edge-pull starts and gets
headers via the live fan-out, but every subsequent player gets coded
payload with no codec config and ffmpeg aborts with `dimensions not set`
/ `Could not write header`. Fall back to the meta cache state when hub
is NULL, so the dump path runs once the edge-pull has populated the
cache. (trunk/src/app/srs_app_source.cpp)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-19 11:33:42 -04:00
Jacob Su
480d6d5f5a
TCP|UDP Listener: Fix coroutine exit when err happens (#4613) (#4615)
Try to fix #4613
2026-01-24 07:16:49 -05:00
Jacob Su
1316ceb7e9
DVR: Fix HEVC mp4 recording error. v6.0.185 (#4605) (#4605)
When recording HEVC streams to MP4, DVR fails with error "doesn't support
hvcC change" (ERROR_MP4_HVCC_CHANGE).

The root cause is in video_avc_demux(): the SrsVideoFrame object is reused
across frames, and its initialize() method does not reset avc_packet_type.
When a sequence header is processed, avc_packet_type is set to 0 
(SrsVideoAvcFrameTraitSequenceHeader). When the next video info frame
arrives (which only appears in HEVC streams), the function returns early
without assigning video->avc_packet_type, so it retains the value 0 from
the previous sequence header frame.

When DVR processes this video info frame, it checks avc_packet_type and
incorrectly identifies it as a sequence header. Since the real HEVC sequence
header was already recorded, DVR returns the "hvcC change" error.

The fix assigns video->avc_packet_type = packet_type before returning
early for VideoInfoFrame, ensuring DVR correctly identifies the frame
type.

Fix #4603 for 6.0release

---------

Co-authored-by: OSSRS-AI <winlinam@gmail.com>
2025-12-06 18:32:58 -05:00
winlin
9f8670b2a8 Release v6.0-r0, 6.0 release0, v6.0.184, 170962 lines. 2025-12-03 09:44:39 -05:00
winlin
63edbef908 RTMP: Ignore FMLE start packet after flash publish. v6.0.184 (#4588) 2025-12-03 09:35:26 -05:00
winlin
0a4be9749d Release v6.0-b3, 6.0 beta3, v6.0.183, 170957 lines. 2025-11-03 10:35:45 -05:00
OSSRS-AI
e82dc112e7 Bridge: Fix heap-use-after-free in SrsCompositeBridge iterator. v6.0.183 (#4535) 2025-10-21 07:35:44 -04:00
Haibo Chen(陈海博)
fcb2992230 HLS: Fix a iterator bug in hls_ctx cleanup function. v6.0.182 (#4534)
Co-authored-by: OSSRS-AI <winlinam@gmail.com>
2025-10-17 07:20:42 -04:00
winlin
54f5048c2a Relase v6.0-b2, 6.0 beta2, v6.0.181, 170948 lines. 2025-10-16 10:20:12 -04:00
winlin
22e71a39e7 Disable sanitizer by default to fix memory leak. #4364 2025-10-14 20:30:28 -04:00
Winlin
ac868852e4
SRT: Support configurable default_streamid option. v6.0.180 (#4515)
Add a new default_streamid configuration option for the SRT server to
allow customization of the default streamid used when SRT clients
connect without setting the SRTO_STREAMID socket option.

When SRT clients (like VLC) connect without properly setting the
SRTO_STREAMID socket option, SRS previously used a hardcoded default
value of "#!::r=live/livestream,m=publish". This caused conflicts when:

1. A publisher connects without setting streamid (uses default publish
mode)
2. A player tries to connect without setting streamid (also uses default
publish mode)
3. The player gets a "Stream already exists or busy" error because both
are trying to publish

Start SRS with default stream id as viewer:

```bash
./objs/srs -c conf/srt.vlc.conf
```

Publish SRT stream by FFmpeg:

```bash
ffmpeg -re -i ./doc/source.flv -c copy -pes_payload_size 0 -f mpegts \
  'srt://127.0.0.1:10080?streamid=#!::r=live/livestream,m=publish'
```

Play SRT stream by ffplay:

```bash
ffplay 'srt://127.0.0.1:10080?streamid=#!::r=live/livestream,m=request'
```

Play SRT stream by VLC:

```
 Correct - Use simple URL without streamid parameter:
srt://127.0.0.1:10080

 Wrong - VLC doesn't support streamid parameter:
srt://127.0.0.1:10080?streamid=#!::r=live/livestream,m=request
```

---
Co-authored-by: OSSRS-AI <winlinam@gmail.com>
2025-10-01 21:25:39 -04:00
Winlin
32f78845fe
For Edge, only support RTMP or HTTP-FLV. 6.0.179 (#4512) 2025-09-27 18:19:12 -04:00
winlin
31c0ff8815 Fix WHIP source state with transcoding bug. v6.0.179 (#4495) 2025-09-21 08:14:11 -04:00
winlin
f22a5db38a Fix WHIP with transcoding bug. v6.0.178 (#4495) 2025-09-20 22:22:34 -04:00
winlin
e325eec008 Make 6.0 as stable release. 2025-09-16 07:10:44 -04:00
winlin
4da2f3b52c Remove windows/cygwin64 binary from release. 2025-09-15 20:59:39 -04:00
winlin
3a390f0498 SRS 6 is stable now. 2025-09-15 11:10:51 -04:00
winlin
a591827ef6 Release v6.0-b1, 6.0 beta1, v6.0.177, 170611 lines. 2025-09-15 11:07:42 -04:00
Winlin
3c80544958
RTC2RTMP: Fix sequence number wraparound assertion crashes. v6.0.177 (#4491)
The issue occurred when srs_rtp_seq_distance(start, end) + 1 resulted in
values <= 0
due to sequence number wraparound (e.g., when end < start). This caused
assertion
failures and server crashes.

SrsRtcFrameBuilder::check_frame_complete(): Added validation to return
false
  for invalid sequence ranges instead of asserting.

However, it maybe cause converting RTC to RTMP stream failure, because
this issue
should be caused by the problem of sequence number of RTP, which means
there potentially
be stream problem in RTC stream. Even so, changing assert to warning
logs is better,
because SRS should not crash when stream is corrupt.

---------

Co-authored-by: OSSRS-AI <winlinam@gmail.com>
2025-09-15 10:55:09 -04:00
winlin
c20bce9870 RTX: Fix race condition for timer. v6.0.176 (#4470) (#4474) 2025-09-05 10:03:39 -04:00
Jacob Su
c1a8a5f753
RTC: Fix null pointer crash in RTC2RTMP when start packet is missing. v6.0.175 (#4451)
Try to fix #4450 

## Cause

The SRS transcode rtp packets, whose sequence number in range [start,
end], to one rtmp packet, but when the first rtp packet is empty, then
this crash happens.

check #4450 for details.

## Impact

5.0release and 6.0release branch.
develop branch already has its own solution.

So this PR is targeting to **6.0release**.

## Solution

find the first not empty rtp packet in seq range [start, end].

---------

Co-authored-by: OSSRS-AI <winlinam@gmail.com>
Co-authored-by: winlin <winlinvip@gmail.com>
2025-08-26 18:42:50 -04:00
Jacob Su
2ab3937a68 fix err memory leak in rtc to rtmp bridge. v6.0.174 (#4441)
1. print the error messages before dismiss it;
2. free the err to avoid memory leak;

found this issue when research #4434 .

 1. develop
 2. 5.0release
 3. 6.0release

---------

Co-authored-by: winlin <winlinvip@gmail.com>
2025-08-16 07:58:29 -06:00
Jacob Su
ebc9821ac9 Fix: Remove redundant enabled checks in HLS/DASH cleanup to prevent resource leaks. v6.0.173 (#4161)
HLS and DASH components had redundant `enabled` flag checks in their
`cycle()` and `cleanup_delay()` methods that prevented proper cleanup of
files when components were disabled. This created a race condition
where:

1. Stream stops publishing and HLS/DASH components get disabled
2. `cycle()` returns early without performing disposal operations
3. `cleanup_delay()` returns 0 instead of configured disposal timeout
4. Source cleanup doesn't wait long enough for file disposal
5. HLS/DASH files remain on disk without proper cleanup

The `enabled` flag should control processing of **new incoming
streams**, but should NOT prevent **cleanup of existing files** from
previously enabled streams.

Remove redundant `enabled` checks from:
- `SrsHls::cycle()` and `SrsDash::cycle()` - Allow disposal logic to run
even when disabled
- `SrsHls::cleanup_delay()` and `SrsDash::cleanup_delay()` - Always
return proper disposal timeout

---------

Co-authored-by: winlin <winlinvip@gmail.com>
2025-08-14 06:56:59 -06:00
winlin
1a9b506c45 Relase v6.0-b0, 6.0 beta0, v6.0.172, 170417 lines. 2025-08-12 10:47:09 -04:00
Jacob Su
8e573644c1 MP4 DVR: Fix audio/video synchronization issues in WebRTC recordings. v6.0.172 (#4230)
Fixes #3993 - WebRTC streams recorded to MP4 via DVR exhibit audio/video
synchronization issues, with audio typically ahead of video. **Note:
This issue is specific to MP4 format; FLV recordings are not affected.**

When WebRTC streams are converted to RTMP and then muxed to MP4, the
audio and video tracks may start at different timestamps. The MP4 muxer
was not accounting for this timing offset between the first audio and
video samples in the STTS (Sample Time-to-Sample) table, causing the
tracks to be misaligned in the final MP4 file.

Introduces `SrsMp4DvrJitter` class specifically for MP4 audio/video
synchronization:

- **Timestamp Tracking**: Records the DTS of the first audio and video
samples
- **Offset Calculation**: Computes the timing difference between track
start times
- **MP4 STTS Correction**: Sets appropriate `sample_delta` values in the
MP4 STTS table to maintain proper A/V sync

- Added `SrsMp4DvrJitter` class in `srs_kernel_mp4.hpp/cpp`
- Integrated jitter correction into `SrsMp4SampleManager::write_track()`
for MP4 format only
- Added comprehensive unit tests covering various timing scenarios
- **Scope**: Changes are isolated to MP4 kernel code and do not affect
FLV processing

This fix ensures that MP4 DVR recordings from WebRTC streams maintain
proper audio/video synchronization regardless of the relative timing of
the first audio and video frames, while leaving FLV format processing
unchanged.

---------

Co-authored-by: Haibo Chen <495810242@qq.com>
Co-authored-by: john <hondaxiao@tencent.com>
Co-authored-by: winlin <winlinvip@gmail.com>
Co-authored-by: OSSRS-AI <winlinam@gmail.com>
2025-08-12 09:58:40 -04:00
Winlin
02952f25a2 AI: HTTP-FLV: Fix heap-use-after-free crash during stream unmount. v6.0.171 (#4432)
Fixes a critical heap-use-after-free crash in HTTP-FLV streaming that
occurs when a client requests a stream while it's being unmounted
asynchronously.

- **Issue**: #4429 - Heap-use-after-free crash in
`SrsLiveStream::serve_http()`
- **Root Cause**: Race condition between coroutines in single-threaded
SRS server:
1. **Coroutine A**: HTTP client requests FLV stream → `serve_http()`
starts
2. **Coroutine B**: RTMP publisher disconnects → triggers async stream
destruction
3. **Async Worker**: Destroys `SrsLiveStream` object while Coroutine A
is yielded
  4. **Coroutine A**: Resumes and accesses freed memory → **CRASH**

1. **Early viewer registration**: Add HTTP connection to `viewers_` list
immediately in `serve_http()` before any I/O operations that could yield
2. **Lifecycle protection**: Split `serve_http()` into wrapper and
implementation to ensure proper viewer management
3. **Stream availability checks**: Add fast checks for stream disposal
state before critical operations
4. **Improved error handling**: Convert warnings to fatal errors when
trying to free alive streams

- **`SrsLiveStream::serve_http()`**: Now immediately registers viewer
and delegates to `serve_http_impl()`
- **`SrsLiveStream::serve_http_impl()`**: Contains the actual HTTP
serving logic
- **`SrsHttpStreamDestroy::call()`**: Enhanced error handling and longer
wait timeout
- **Stream state validation**: Added checks for `entry->enabled` before
proceeding with stream operations

Fixes #4429
2025-08-11 18:59:52 -04:00
Shengming Yuan
aeca022165 Allow Forward to be configured with Env Var. v6.0.170 (#4245)
Allow Env Var to control forwarding function.

By AI:

* [AI: Add utests for
PR.](1b978d19a5)

---------

Co-authored-by: Haibo Chen <495810242@qq.com>
Co-authored-by: chundonglinlin <chundonglinlin@163.com>
Co-authored-by: winlin <winlinvip@gmail.com>
2025-07-28 08:39:32 -04:00
Haibo Chen(陈海博)
45090ce4fc Fix H.264 B-frame detection logic to comply with specification. v6.0.169 (#4414)
For H.264, only when the NAL Type is 1, 2, 3, or 4 is it possible for
B-frames to be present; that is, non-IDR pictures and slice data.

The current `SrsVideoFrame::parse_avc_bframe()` function uses incorrect
logic to determine if a NALU can contain B-frames. The original
implementation only checked for specific NALU types (IDR, SPS, PPS) to
mark as non-B-frames, but this approach misses many other NALU types
that cannot contain B-frames according to the H.264 specification.

According to H.264 specification (ISO_IEC_14496-10-AVC-2012.pdf, Table
7-1), B-frames can **only** exist in these specific NALU types:
- Type 1: Non-IDR coded slice (`SrsAvcNaluTypeNonIDR`)
- Type 2: Coded slice data partition A (`SrsAvcNaluTypeDataPartitionA`)
- Type 3: Coded slice data partition B (`SrsAvcNaluTypeDataPartitionB`)
- Type 4: Coded slice data partition C (`SrsAvcNaluTypeDataPartitionC`)

All other NALU types (IDR=5, SEI=6, SPS=7, PPS=8, AUD=9, etc.) cannot
contain B-frames by definition.

---------

Co-authored-by: Jacob Su <suzp1984@gmail.com>
Co-authored-by: winlin <winlinvip@gmail.com>
2025-07-10 09:33:42 -04:00
Haibo Chen(陈海博)
014812ea9b Transcode: Bugfix: Fix loop transcoding with host. #3516. v6.0.168 (#4325)
for issue: https://github.com/ossrs/srs/issues/3516
https://github.com/ossrs/srs/issues/4055
https://github.com/ossrs/srs/pull/3618

The issue arises from a mismatch between the `input` and `output`
formats within the
[`SrsEncoder::initialize_ffmpeg`](https://github.com/ossrs/srs/pull/4325/files#diff-a3dd7c498fc26d36def2e8c2c3b7edfe1bf78f0620b1a838aefa70ba119cad03L241-L254)
function.

For example:
Input: `rtmp://127.0.0.1:1935/live?vhost=__defaultVhost__/livestream_ff`
Output:
`rtmp://127.0.0.1:1935/live/livestream_ff?vhost=__defaultVhost__`

This may result in the failure of the [code
segment](https://github.com/ossrs/srs/pull/4325/files#diff-a3dd7c498fc26d36def2e8c2c3b7edfe1bf78f0620b1a838aefa70ba119cad03L292-L298)
responsible for determining whether to loop.

It simply involves modifying the order of `stream` and `vhost`.

The commit introducing this bug is:
7d47017a00
The order of [parameters in the configuration
file](7d47017a00 (diff-428de168925d659dae72bb49273c3b048ed2800906c6848560badae854250126L26-R26))
has been modified to address the `ingest` issue.

Please note that this PR does not entirely resolve the issue; for
example, modifying the `output` format in configuration still results in
exceptions. To comprehensively address this problem, extensive code
modifications would be required.

However, strictly adhering to the configuration file format can
effectively prevent this issue.

---------

Co-authored-by: Jacob Su <suzp1984@gmail.com>
Co-authored-by: john <hondaxiao@tencent.com>
Co-authored-by: winlin <winlinvip@gmail.com>
2025-06-04 10:20:22 -04:00
pengzhixiang
51d26f26b7 RTMP: Use extended timestamp as delta when chunk fmt=1/2. v6.0.167 (#4356)
1. When the chunk message header employs type 1 and type 2, the extended
timestamp denotes the time delta.
2. When the DTS (Decoding Time Stamp) experiences a jump and exceeds
16777215, there can be errors in DTS calculation, and if the audio and
video delta differs, it may result in audio-video synchronization
issues.

---------

`TRANS_BY_GPT4`

---------

Co-authored-by: 彭治湘 <zuolengchan@douyu.tv>
Co-authored-by: Haibo Chen(陈海博) <495810242@qq.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: winlin <winlinvip@gmail.com>
2025-05-29 14:24:40 -04:00
winlin
4b64c5c5be Upgrade actions worlflow image to Ubuntu 22.04 2025-04-26 00:13:48 -04:00
john
2a7f0090b5 replace values with enums. v6.0.166 (#4303)
---------

Co-authored-by: Haibo Chen <495810242@qq.com>
Co-authored-by: john <hondaxiao@tencent.com>
Co-authored-by: winlin <winlinvip@gmail.com>

---------

Co-authored-by: Haibo Chen(陈海博) <495810242@qq.com>
Co-authored-by: john <hondaxiao@tencent.com>
2025-03-21 19:12:41 +08:00
john
64e5658f17 free sample to prevent memory leak. v5.0.222 v6.0.164 (#4305)
修复`SrsRtpRawPayload::copy()`方法中sample_覆盖的问题。

---------

Co-authored-by: chundonglinlin <chundonglinlin@163.com>
Co-authored-by: winlin <winlinvip@gmail.com>

---------

Co-authored-by: john <hondaxiao@tencent.com>
2025-03-21 10:38:55 +08:00
john
2b5c1ad06d update geekyeggo/delete-artifact to 5.0.0. v5.0.221 v6.0.163 v7.0.25 (#4302)
>
https://github.com/marketplace/actions/delete-artifact?version=v5.0.0#-compatibility

The current version of `actions/upload-artifact` is `v4`, and the
corresponding version for `delete-artifact` should be `v5`.

---------

`TRANS_BY_GPT4`

---------

Co-authored-by: chundonglinlin <chundonglinlin@163.com>
Co-authored-by: winlin <winlinvip@gmail.com>

---------

Co-authored-by: john <hondaxiao@tencent.com>
2025-03-18 08:27:08 +08:00
john
2b89f7e7e8 Dvr: support h265 flv fragments. v6.0.162 v7.0.24 (#4296)
1. Issue
When segmenting H.265 encoded FLV files using a DVR, the system does not
create FLV segments at regular intervals as specified by the
`dvr_wait_keyframe` configuration.

2. Configure dvr.segment.conf
```config

listen              1935;
max_connections     1000;
daemon              off;
srs_log_tank        console;
vhost __defaultVhost__ {
    dvr {
        enabled      on;
        dvr_path     ./objs/nginx/html/[app]/[stream].[timestamp].flv;
        dvr_plan     segment;
        dvr_duration    30;
        dvr_wait_keyframe       on;
    }
}
```

3. Stream Push Testing
Domestic FFmpeg version (codecId=12)
```sh
hevc-12-ffmpeg -stream_loop -1 -re -i 264_aac.flv -c:v libx265 -preset fast -b:v 2000k -maxrate 2000k -bufsize 4000k -bf 0 -c:a aac -b:a 128k -ar 44100 -ac 2 -f flv rtmp://localhost/live/livestream
```
FFmpeg version 6.0 or higher (supports `enhanced RTMP`)
```sh
ffmpeg -stream_loop -1 -re -i 264_aac.flv -c:v libx265 -preset fast -b:v 2000k -maxrate 2000k -bufsize 4000k -bf 0 -c:a aac -b:a 128k -ar 44100 -ac 2 -f flv rtmp://localhost/live/livestream
```

OBS streaming (version 30.0 or above supports `enhanced RTMP`)

![image](https://github.com/user-attachments/assets/fd2806c3-b0e3-44c4-a2d5-e04e6e5386ff)

![image](https://github.com/user-attachments/assets/15ef9c45-e15a-426e-b70c-d4bdd5dc8055)

SRS player (supports both `enhanced RTMP` and `codec=12 FLV`)
```
http://127.0.0.1:8080/players/srs_player.html
```
Domestic ffplay (supports `codec=12 FLV`)
```
hevc-12-ffplay http://127.0.0.1:8080/live/livestream.1740311867638.flv
```
ffplay (versions above ffmpeg 6.0 support `enhanced RTMP`)
```
ffplay http://127.0.0.1:8080/live/livestream.1740311867638.flv
```

![image](https://github.com/user-attachments/assets/711a4182-418c-4134-934f-cba41a08e06f)

---------

`TRANS_BY_GPT4`

---------

Co-authored-by: Haibo Chen <495810242@qq.com>
Co-authored-by: john <hondaxiao@tencent.com>
Co-authored-by: winlin <winlinvip@gmail.com>

---------

Co-authored-by: john <hondaxiao@tencent.com>
2025-03-18 07:36:46 +08:00
john
b1185d588f fix typo about heartbeat. v6.0.161 (#4253)
---------

Co-authored-by: Haibo Chen <495810242@qq.com>
Co-authored-by: john <hondaxiao@tencent.com>
Co-authored-by: winlin <winlinvip@gmail.com>

---------

Co-authored-by: john <hondaxiao@tencent.com>
2025-02-24 21:03:17 +08:00
john
2ce08750e7 fix ci error. v6.0.160 (#4291)
Starting January 30th, 2025, GitHub Actions customers will no longer be
able to use v3 of
[actions/upload-artifact](https://github.com/actions/upload-artifact) or
[actions/download-artifact](https://github.com/actions/download-artifact).
Customers should update workflows to begin using [v4 of the artifact
actions](https://github.blog/2024-02-12-get-started-with-v4-of-github-actions-artifacts/).
Learn more:
https://github.blog/changelog/2024-04-16-deprecation-notice-v3-of-the-artifact-actions/

---------

Co-authored-by: john <hondaxiao@tencent.com>
Co-authored-by: winlin <winlinvip@gmail.com>

---------

Co-authored-by: john <hondaxiao@tencent.com>
2025-02-24 19:39:20 +08:00
john
02c6e60e3a update copyright to 2025. v6.0.159 (#4271)
update copyright to 2025

---------

Co-authored-by: john <hondaxiao@tencent.com>
Co-authored-by: winlin <winlinvip@gmail.com>
2025-02-24 19:34:34 +08:00
Haibo Chen
c2d75ca395 HLS: Fix error when stream has extension. #4215 v5.0.217 v6.0.158 (#4216)
---------

Co-authored-by: Jacob Su <suzp1984@gmail.com>
Co-authored-by: winlin <winlinvip@gmail.com>
2024-10-31 18:01:32 +08:00
Jacob Su
364bec264e RTC2RTMP: Fix screen sharing stutter caused by packet loss. v6.0.157 (#4160)
1. Refer this commit, which contains the web demo to capture screen as
video stream through RTC.
2. Copy the `trunk/research/players/whip.html` and
`trunk/research/players/js/srs.sdk.js` to replace the `develop` branch
source code.
3. `./configure && make`
4. `./objs/srs -c conf/rtc2rtmp.conf`
5. open `http://localhost:8080/players/whip.html?schema=http`
6. check `Screen` radio option.
7. click `publish`, then check the screen to share.
8. play the rtmp live stream: `rtmp://localhost/live/livestream`
9. check the video stuttering.

When capture screen by the chrome web browser, which send RTP packet
with empty payload frequently, then all the cached RTP packets are
dropped before next key frame arrive in this case.

The OBS screen stream and camera stream do not have such problem.

><img width="581" alt="Screenshot 2024-08-28 at 2 49 46 PM"
src="https://github.com/user-attachments/assets/9557dbd2-c799-4dfd-b336-5bbf2e4f8fb8">

---------

Co-authored-by: winlin <winlinvip@gmail.com>
2024-10-15 19:46:33 +08:00
Winlin
b830d688be Heartbeat: Report ports for proxy server. v6.0.156 (#4171)
The heartbeat of SRS is a timer that requests an HTTP URL. We can use
this heartbeat to report the necessary information for registering the
backend server with the proxy server.

```text
SRS(backend) --heartbeat---> Proxy server
```

A proxy server is a specialized load balancer for media servers. It
operates at the application level rather than the TCP level. For more
information about the proxy server, see issue #4158.

Note that we will merge this PR into SRS 5.0+, allowing the use of SRS
5.0+ as the backend server, not limited to SRS 7.0. However, the proxy
server is introduced in SRS 7.0.

It's also possible to implement a registration service, allowing you to
use other media servers as backend servers. For example, if you gather
information about an nginx-rtmp server and register it with the proxy
server, the proxy will forward RTMP streams to nginx-rtmp. The backend
server is not limited to SRS.

---------

Co-authored-by: Jacob Su <suzp1984@gmail.com>
2024-09-09 10:40:46 +08:00
winlin
1bd65f3386 Refine release action. 2024-09-01 17:02:21 +08:00
winlin
dd2cc93421 Release v6.0-a1, 6.0 alpha1, v6.0.155, 169636 lines. 2024-09-01 15:57:55 +08:00
Winlin
96f89c58ee FLV: Refine source and http handler. v6.0.155 (#4165)
1. Do not create a source when mounting FLV because it may not unmount
FLV when freeing the source. If you access the FLV stream without any
publisher, then wait for source cleanup and review the FLV stream again,
there is an annoying warning message.

```bash
HTTP #0 127.0.0.1:58026 GET http://localhost:8080/live/livestream.flv, content-length=-1
new live source, stream_url=/live/livestream
http: mount flv stream for sid=/live/livestream, mount=/live/livestream.flv

client disconnect peer. ret=1007
Live: cleanup die source, id=[], total=1

HTTP #0 127.0.0.1:58040 GET http://localhost:8080/live/livestream.flv, content-length=-1
serve error code=1097(NoSource)(No source found) : process request=0 : cors serve : serve http : no source for /live/livestream
serve_http() [srs_app_http_stream.cpp:641]
```

> Note: There is an inconsistency. The first time, you can access the
FLV stream and wait for the publisher, but the next time, you cannot.

2. Create a source when starting to serve the FLV client. We do not need
to create the source when creating the HTTP handler. Instead, we should
try to create the source in the cache or stream. Because the source
cleanup does not unmount the HTTP handler, the handler remains after the
source is destroyed. The next time you access the FLV stream, the source
is not found.

```cpp
srs_error_t SrsHttpStreamServer::hijack(ISrsHttpMessage* request, ISrsHttpHandler** ph) {
    SrsSharedPtr<SrsLiveSource> live_source;
    if ((err = _srs_sources->fetch_or_create(r.get(), server, live_source)) != srs_success) { }
    if ((err = http_mount(r.get())) != srs_success) { }

srs_error_t SrsBufferCache::cycle() {
    SrsSharedPtr<SrsLiveSource> live_source = _srs_sources->fetch(req);
    if (!live_source.get()) {
        return srs_error_new(ERROR_NO_SOURCE, "no source for %s", req->get_stream_url().c_str());
    }

srs_error_t SrsLiveStream::serve_http(ISrsHttpResponseWriter* w, ISrsHttpMessage* r) {
    SrsSharedPtr<SrsLiveSource> live_source = _srs_sources->fetch(req);
    if (!live_source.get()) {
        return srs_error_new(ERROR_NO_SOURCE, "no source for %s", req->get_stream_url().c_str());
    }
```

> Note: We should not create the source in hijack, instead, we create it
in cache or stream:

```cpp
srs_error_t SrsHttpStreamServer::hijack(ISrsHttpMessage* request, ISrsHttpHandler** ph) {
    if ((err = http_mount(r.get())) != srs_success) { }

srs_error_t SrsBufferCache::cycle() {
    SrsSharedPtr<SrsLiveSource> live_source;
    if ((err = _srs_sources->fetch_or_create(req, server_, live_source)) != srs_success) { }

srs_error_t SrsLiveStream::serve_http(ISrsHttpResponseWriter* w, ISrsHttpMessage* r) {
    SrsSharedPtr<SrsLiveSource> live_source;
    if ((err = _srs_sources->fetch_or_create(req, server_, live_source)) != srs_success) { }
```

> Note: This fixes the failure and annoying warning message, and
maintains consistency by always waiting for the stream to be ready if
there is no publisher.

3. Fail the http request if the HTTP handler is disposing, and also keep
the handler entry when disposing the stream, because we should dispose
the handler entry and stream at the same time.

```cpp
srs_error_t SrsHttpStreamServer::http_mount(SrsRequest* r) {
        entry = streamHandlers[sid];
        if (entry->disposing) {
            return srs_error_new(ERROR_STREAM_DISPOSING, "stream is disposing");
        }

void SrsHttpStreamServer::http_unmount(SrsRequest* r) {
    std::map<std::string, SrsLiveEntry*>::iterator it = streamHandlers.find(sid);
    SrsUniquePtr<SrsLiveEntry> entry(it->second);
    entry->disposing = true;
```

> Note: If the disposal process takes a long time, this will prevent
unexpected behavior or access to the resource that is being disposed of.

4. In edge mode, the edge ingester will unpublish the source when the
last consumer quits, which is actually triggered by the HTTP stream.
While it also waits for the stream to quit when the HTTP unmounts, there
is a self-destruction risk: the HTTP live stream object destroys itself.

```cpp
srs_error_t SrsLiveStream::serve_http(ISrsHttpResponseWriter* w, ISrsHttpMessage* r) {
    SrsUniquePtr<SrsLiveConsumer> consumer(consumer_raw); // Trigger destroy.

void SrsHttpStreamServer::http_unmount(SrsRequest* r) {
    for (;;) { if (!cache->alive() && !stream->alive()) { break; } // A circle reference.
    mux.unhandle(entry->mount, stream.get()); // Free the SrsLiveStream itself.
```

> Note: It also introduces a circular reference in the object
relationships, the stream reference to itself when unmount:

```text
SrsLiveStream::serve_http
    -> SrsLiveConsumer::~SrsLiveConsumer -> SrsEdgeIngester::stop
    -> SrsLiveSource::on_unpublish -> SrsHttpStreamServer::http_unmount
        -> SrsLiveStream::alive
```

> Note: We should use an asynchronous worker to perform the cleanup to
avoid the stream destroying itself and to prevent self-referencing.

```cpp
void SrsHttpStreamServer::http_unmount(SrsRequest* r) {
    entry->disposing = true;
    if ((err = async_->execute(new SrsHttpStreamDestroy(&mux, &streamHandlers, sid))) != srs_success) { }
```

> Note: This also ensures there are no circular references and no
self-destruction.

---------

Co-authored-by: Jacob Su <suzp1984@gmail.com>
2024-09-01 13:03:50 +08:00
Winlin
920f87cd38 Edge: Fix flv edge crash when http unmount. v6.0.154 (#4166)
Edge FLV is not working because it is stuck in an infinite loop waiting.
Previously, there was no need to wait for exit since resources were not
being cleaned up. Now, since resources need to be cleaned up, it must
wait for all active connections to exit, which causes this issue.

To reproduce the issue, start SRS edge, run the bellow command and press
`CTRL+C` to stop the request:

```bash
curl http://localhost:8080/live/livestream.flv -v >/dev/null
```

It will cause edge to fetch stream from origin, and free the consumer
when client quit. When `SrsLiveStream::do_serve_http` return, it will
free the consumer:

```cpp
srs_error_t SrsLiveStream::do_serve_http(ISrsHttpResponseWriter* w, ISrsHttpMessage* r) {
    SrsUniquePtr<SrsLiveConsumer> consumer(consumer_raw);
```

Keep in mind that in this moment, the stream is alive, because only set
to not alive after this function return:

```cpp
    alive_viewers_++;
    err = do_serve_http(w, r); // Free 'this' alive stream.
    alive_viewers_--; // Crash here, because 'this' is freed.
```

When freeing the consumer, it will cause the source to unpublish and
attempt to free the HTTP handler, which ultimately waits for the stream
not to be alive:

```cpp
SrsLiveConsumer::~SrsLiveConsumer() {
    source_->on_consumer_destroy(this);

void SrsLiveSource::on_consumer_destroy(SrsLiveConsumer* consumer) {
    if (consumers.empty()) {
        play_edge->on_all_client_stop();

void SrsLiveSource::on_unpublish() {
    handler->on_unpublish(req);

void SrsHttpStreamServer::http_unmount(SrsRequest* r) {
    if (stream->entry) stream->entry->enabled = false;

    for (; i < 1024; i++) {
        if (!cache->alive() && !stream->alive()) {
            break;
        }
        srs_usleep(100 * SRS_UTIME_MILLISECONDS);
    }
```

After 120 seconds, it will free the stream and cause SRS to crash
because the stream is still active. In order to track this potential
issue, also add an important warning log:

```cpp
srs_warn("http: try to free a alive stream, cache=%d, stream=%d", cache->alive(), stream->alive());
```

SRS may crash if got this log.

---------

Co-authored-by: Jacob Su <suzp1984@gmail.com>
2024-09-01 06:45:38 +08:00
Winlin
0bac21df6e Fix #3767: RTMP: Do not response empty data packet. v6.0.153 (#4162)
If SRS responds with this empty data packet, FFmpeg will receive an
empty stream, like `Stream #0:0: Data: none` in following logs:

```bash
ffmpeg -i rtmp://localhost:11935/live/livestream
```

This won't cause the player to fail, but it will inconvenience the user
significantly. It may also cause FFmpeg slower to analysis the stream,
see #3767

---------

Co-authored-by: Jacob Su <suzp1984@gmail.com>
2024-09-01 06:41:20 +08:00
Winlin
d27e530f84 HTTP-FLV: Notify connection to expire when unpublishing. v6.0.152 (#4164)
When stopping the stream, it will wait for the HTTP Streaming to exit.
If the HTTP Streaming goroutine hangs, it will not exit automatically.

```cpp
void SrsHttpStreamServer::http_unmount(SrsRequest* r)
{
    SrsUniquePtr<SrsLiveStream> stream(entry->stream);
    if (stream->entry) stream->entry->enabled = false;
    srs_usleep(...); // Wait for about 120s.
    mux.unhandle(entry->mount, stream.get()); // Free stream.
}

srs_error_t SrsLiveStream::serve_http(ISrsHttpResponseWriter* w, ISrsHttpMessage* r)
{
    err = do_serve_http(w, r); // If stuck in here for 120s+
    alive_viewers_--; // Crash at here, because stream has been deleted.
```

We should notify http stream connection to interrupt(expire):

```cpp
void SrsHttpStreamServer::http_unmount(SrsRequest* r)
{
    SrsUniquePtr<SrsLiveStream> stream(entry->stream);
    if (stream->entry) stream->entry->enabled = false;
    stream->expire(); // Notify http stream to interrupt.
```

Note that we should notify all viewers pulling stream from this http
stream.

Note that we have tried to fix this issue, but only try to wait for all
viewers to quit, without interrupting the viewers, see
https://github.com/ossrs/srs/pull/4144

---------

Co-authored-by: Jacob Su <suzp1984@gmail.com>
2024-08-31 23:17:07 +08:00
Winlin
da5683e478 Fix crash when quiting. v6.0.151 (#4157)
1. Remove the srs_global_dispose, which causes the crash when still
publishing when quit.
2. Always call _srs_thread_pool->initialize for single thread.
3. Support `--signal-api` to send signal by HTTP API, because CLion
eliminate the signals.

---

Co-authored-by: Jacob Su <suzp1984@gmail.com>
2024-08-24 22:41:21 +08:00
Jacob Su
b05f7b4452 Build: Fix srs_mp4_parser compiling error. v6.0.150 (#4156)
`SrsAutoFree` moved to `srs_core_deprecated.hpp`.

---------

Co-authored-by: winlin <winlinvip@gmail.com>
2024-08-24 21:49:32 +08:00
Winlin
41b3623296 API: Support new HTTP API for VALGRIND. v6.0.149 (#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:59 +08:00
Bahamut
3917422a07 HTTP-FLV: Crash when multiple viewers. v6.0.148 (#4144)
I did some preliminary code inspection. The two playback endpoints share
the same `SrsLiveStream` instance. After the first one disconnects,
`alive_` is set to false.
```
  alive_ = true;
  err = do_serve_http(w, r);
  alive_ = false;
```

In the `SrsHttpStreamServer::http_unmount(SrsRequest* r)` function,
`stream->alive()` is already false, so `mux.unhandle` will free the
`SrsLiveStream`. This causes the other connection coroutine to return to
its execution environment after the `SrsLiveStream` instance has already
been freed.
```
    // Wait for cache and stream to stop.
    int i = 0;
    for (; i < 1024; i++) {
        if (!cache->alive() && !stream->alive()) {
            break;
        }
        srs_usleep(100 * SRS_UTIME_MILLISECONDS);
    }

    // Unmount the HTTP handler, which will free the entry. Note that we must free it after cache and
    // stream stopped for it uses it.
    mux.unhandle(entry->mount, stream.get());
```

`alive_` was changed from a `bool` to an `int` to ensure that
`mux.unhandle` is only executed after each connection's `serve_http` has
exited.

---------

Co-authored-by: liumengte <liumengte@visionular.com>
Co-authored-by: winlin <winlinvip@gmail.com>
2024-08-15 12:13:16 +08:00
Jacob Su
133a39a81d Config: Add more utest for env config. v6.0.147 (#4142)
1. don't use static variable to store the result;
2. add more UT to handle the multi value and values with whitespaces;

related to #4092

16e569d823/trunk/src/app/srs_app_config.cpp (L71-L82)

`static SrsConfDirective* dir` removed, this static var here is to avoid
the memory leak, I add the `SrsConfDirective` instance to the `env_dirs`
directive container, which will destroy itself inside `SrsConfig`
destructor.

---------

Co-authored-by: winlin <winlinvip@gmail.com>
2024-08-15 11:13:00 +08:00
Bahamut
957140db51 Live: Crash for invalid live stream state when unmount HTTP. v6.0.146 (#4141)
When unpublishing, the handler callback that will stop the coroutine:

```cpp
_can_publish = true;
handler->on_unpublish(req);
```

In this handler, the `http_unmount` will be called:

```cpp
void SrsHttpStreamServer::http_unmount(SrsRequest* r)
    cache->stop();
```

In this `http_unmount` function, there could be context switching. In
such a situation, a new connection might publish the stream while the
unpublish process is freeing the stream, leading to a crash.

To prevent a new publisher, we should change the state only after all
handlers and hooks are completed.

---------

Co-authored-by: liumengte <liumengte@visionular.com>
Co-authored-by: winlin <winlinvip@gmail.com>
2024-08-15 10:43:59 +08:00
Jacob Su
fa3dc3bf69 Config: Improve env config to support multi values. v6.0.146 (#4092)
1. add on_connect & on_close directives to conf/full.conf;
2. let http_hooks env overwrite support multi values; e.g.
SRS_VHOST_HTTP_HOOKS_ON_CONNECT="http://127.0.0.1/api/connect
http://localhost/api/connect"

related to
https://github.com/ossrs/srs/issues/1222#issuecomment-2170424703
Above comments said `http_hook` env may not works as expected, as I
found there are still has some issue in `http_hooks` env configuration,
but this PR may not target above problem.

---------

Co-authored-by: winlin <winlinvip@gmail.com>
2024-08-13 11:26:23 +08:00
winlin
1e9133181f Switch to 6.0 release header. 2024-07-27 11:40:10 +08:00
358 changed files with 3228 additions and 1127 deletions

View File

@ -9,7 +9,7 @@ permissions: write-all
jobs: jobs:
analyze: analyze:
name: actions-codeql-analyze name: actions-codeql-analyze
runs-on: ubuntu-20.04 runs-on: ubuntu-22.04
strategy: strategy:
fail-fast: false fail-fast: false

View File

@ -47,7 +47,7 @@ jobs:
SRS_VERSION: ${{ env.SRS_VERSION }} SRS_VERSION: ${{ env.SRS_VERSION }}
SRS_MAJOR: ${{ env.SRS_MAJOR }} SRS_MAJOR: ${{ env.SRS_MAJOR }}
SRS_XYZ: ${{ env.SRS_XYZ }} SRS_XYZ: ${{ env.SRS_XYZ }}
runs-on: ubuntu-20.04 runs-on: ubuntu-22.04
test: test:
name: test name: test
@ -77,7 +77,7 @@ jobs:
docker run --rm srs:test bash -c 'make && \ docker run --rm srs:test bash -c 'make && \
./objs/srs -c conf/regression-test.conf && \ ./objs/srs -c conf/regression-test.conf && \
cd 3rdparty/srs-bench && make && ./objs/srs_test -test.v' cd 3rdparty/srs-bench && make && ./objs/srs_test -test.v'
runs-on: ubuntu-20.04 runs-on: ubuntu-22.04
draft: draft:
name: draft name: draft
@ -93,81 +93,11 @@ jobs:
allowUpdates: true allowUpdates: true
tag: ${{ github.ref }} tag: ${{ github.ref }}
draft: true draft: true
prerelease: true prerelease: false
# Map a step output to a job output, see https://docs.github.com/en/actions/using-jobs/defining-outputs-for-jobs # Map a step output to a job output, see https://docs.github.com/en/actions/using-jobs/defining-outputs-for-jobs
outputs: outputs:
SRS_RELEASE_ID: ${{ steps.create_draft.outputs.id }} SRS_RELEASE_ID: ${{ steps.create_draft.outputs.id }}
runs-on: ubuntu-20.04 runs-on: ubuntu-22.04
cygwin64:
name: cygwin64
needs:
- envs
- draft
steps:
# See https://github.com/cygwin/cygwin-install-action#parameters
# Note that https://github.com/egor-tensin/setup-cygwin fails to install packages.
- name: Setup Cygwin
uses: cygwin/cygwin-install-action@006ad0b0946ca6d0a3ea2d4437677fa767392401 # master
with:
platform: x86_64
packages: bash make gcc-g++ cmake automake patch pkg-config tcl unzip
install-dir: C:\cygwin64
##################################################################################################################
- name: Checkout repository
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
##################################################################################################################
- name: Covert output to env
env:
SHELLOPTS: igncr
shell: C:\cygwin64\bin\bash.exe --login '{0}'
run: |
echo "SRS_TAG=${{ needs.envs.outputs.SRS_TAG }}" >> $GITHUB_ENV
echo "SRS_VERSION=${{ needs.envs.outputs.SRS_VERSION }}" >> $GITHUB_ENV
echo "SRS_MAJOR=${{ needs.envs.outputs.SRS_MAJOR }}" >> $GITHUB_ENV
echo "SRS_RELEASE_ID=${{ needs.draft.outputs.SRS_RELEASE_ID }}" >> $GITHUB_ENV
##################################################################################################################
- name: Build SRS
env:
SHELLOPTS: igncr
SRS_WORKSPACE: ${{ github.workspace }}
shell: C:\cygwin64\bin\bash.exe --login '{0}'
run: |
export PATH=/usr/bin:/usr/local/bin &&
which make gcc g++ patch cmake pkg-config uname grep sed &&
(make --version; gcc --version; patch --version; cmake --version; pkg-config --version) &&
(aclocal --version; autoconf --version; automake --version; uname -a) &&
cd $(cygpath -u $SRS_WORKSPACE)/trunk && ./configure --gb28181=on --h265=on && make
##################################################################################################################
- name: Package SRS
env:
SHELLOPTS: igncr
SRS_WORKSPACE: ${{ github.workspace }}
shell: C:\cygwin64\bin\bash.exe --login '{0}'
run: |
cd $(cygpath -u $SRS_WORKSPACE) &&
if [[ $(echo $SRS_TAG |grep -qE '^v' && echo YES) != YES ]]; then
SRS_VERSION=$(./trunk/objs/srs -v 2>&1); echo "Change version to ${SRS_VERSION}";
fi &&
"/cygdrive/c/Program Files (x86)/NSIS/makensis.exe" /DSRS_VERSION=${SRS_VERSION} \
/DCYGWIN_DIR="C:\cygwin64" trunk/packaging/nsis/srs.nsi &&
mv trunk/packaging/nsis/SRS-Windows-x86_64-${SRS_VERSION}-setup.exe . && ls -lh *.exe &&
echo "SRS_CYGWIN_TAR=SRS-Windows-x86_64-${SRS_VERSION}-setup.exe" >> $GITHUB_ENV &&
echo "SRS_CYGWIN_MD5=$(md5sum SRS-Windows-x86_64-${SRS_VERSION}-setup.exe| awk '{print $1}')" >> $GITHUB_ENV
##################################################################################################################
- name: Upload Release Assets Cygwin
id: upload-release-assets-cygwin
uses: dwenegar/upload-release-assets@5bc3024cf83521df8ebfadf00ad0c4614fd59148 # v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
release_id: ${{ env.SRS_RELEASE_ID }}
assets_path: ${{ env.SRS_CYGWIN_TAR }}
# Map a step output to a job output, see https://docs.github.com/en/actions/using-jobs/defining-outputs-for-jobs
outputs:
SRS_CYGWIN_TAR: ${{ env.SRS_CYGWIN_TAR }}
SRS_CYGWIN_MD5: ${{ env.SRS_CYGWIN_MD5 }}
runs-on: windows-latest
linux: linux:
name: linux name: linux
@ -237,7 +167,7 @@ jobs:
SRS_PACKAGE_MD5: ${{ env.SRS_PACKAGE_MD5 }} SRS_PACKAGE_MD5: ${{ env.SRS_PACKAGE_MD5 }}
SRS_SOURCE_TAR: ${{ env.SRS_SOURCE_TAR }} SRS_SOURCE_TAR: ${{ env.SRS_SOURCE_TAR }}
SRS_SOURCE_MD5: ${{ env.SRS_SOURCE_MD5 }} SRS_SOURCE_MD5: ${{ env.SRS_SOURCE_MD5 }}
runs-on: ubuntu-20.04 runs-on: ubuntu-22.04
docker-srs: docker-srs:
name: docker-srs name: docker-srs
@ -280,7 +210,6 @@ jobs:
--build-arg CONFARGS='--sanitizer=off --gb28181=on' \ --build-arg CONFARGS='--sanitizer=off --gb28181=on' \
-f Dockerfile . -f Dockerfile .
# Docker alias images # Docker alias images
# TODO: FIXME: If stable, please set the latest from 5.0 to 6.0
- name: Docker alias images for ossrs/srs - name: Docker alias images for ossrs/srs
uses: akhilerm/tag-push-action@85bf542f43f5f2060ef76262a67ee3607cb6db37 # v2.1.0 uses: akhilerm/tag-push-action@85bf542f43f5f2060ef76262a67ee3607cb6db37 # v2.1.0
with: with:
@ -291,7 +220,8 @@ jobs:
ossrs/srs:v${{ env.SRS_MAJOR }} ossrs/srs:v${{ env.SRS_MAJOR }}
ossrs/srs:${{ env.SRS_XYZ }} ossrs/srs:${{ env.SRS_XYZ }}
ossrs/srs:v${{ env.SRS_XYZ }} ossrs/srs:v${{ env.SRS_XYZ }}
runs-on: ubuntu-20.04 ossrs/srs:latest
runs-on: ubuntu-22.04
aliyun-srs: aliyun-srs:
name: aliyun-srs name: aliyun-srs
@ -308,7 +238,6 @@ jobs:
echo "SRS_MAJOR=${{ needs.envs.outputs.SRS_MAJOR }}" >> $GITHUB_ENV echo "SRS_MAJOR=${{ needs.envs.outputs.SRS_MAJOR }}" >> $GITHUB_ENV
echo "SRS_XYZ=${{ needs.envs.outputs.SRS_XYZ }}" >> $GITHUB_ENV echo "SRS_XYZ=${{ needs.envs.outputs.SRS_XYZ }}" >> $GITHUB_ENV
# Aliyun ACR # Aliyun ACR
# TODO: FIXME: If stable, please set the latest from 5.0 to 6.0
- name: Login aliyun hub - name: Login aliyun hub
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a # v2.1.0 uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a # v2.1.0
with: with:
@ -326,7 +255,8 @@ jobs:
registry.cn-hangzhou.aliyuncs.com/ossrs/srs:v${{ env.SRS_MAJOR }} registry.cn-hangzhou.aliyuncs.com/ossrs/srs:v${{ env.SRS_MAJOR }}
registry.cn-hangzhou.aliyuncs.com/ossrs/srs:${{ env.SRS_XYZ }} registry.cn-hangzhou.aliyuncs.com/ossrs/srs:${{ env.SRS_XYZ }}
registry.cn-hangzhou.aliyuncs.com/ossrs/srs:v${{ env.SRS_XYZ }} registry.cn-hangzhou.aliyuncs.com/ossrs/srs:v${{ env.SRS_XYZ }}
runs-on: ubuntu-20.04 registry.cn-hangzhou.aliyuncs.com/ossrs/srs:latest
runs-on: ubuntu-22.04
update: update:
name: update name: update
@ -391,7 +321,7 @@ jobs:
docker rmi -f $image docker rmi -f $image
echo "Remove image $image, r0=$?" echo "Remove image $image, r0=$?"
done done
runs-on: ubuntu-20.04 runs-on: ubuntu-22.04
release: release:
name: release name: release
@ -399,7 +329,6 @@ jobs:
- update - update
- envs - envs
- draft - draft
- cygwin64
- linux - linux
steps: steps:
################################################################################################################## ##################################################################################################################
@ -408,20 +337,17 @@ jobs:
echo "SRS_TAG=${{ needs.envs.outputs.SRS_TAG }}" >> $GITHUB_ENV echo "SRS_TAG=${{ needs.envs.outputs.SRS_TAG }}" >> $GITHUB_ENV
echo "SRS_VERSION=${{ needs.envs.outputs.SRS_VERSION }}" >> $GITHUB_ENV echo "SRS_VERSION=${{ needs.envs.outputs.SRS_VERSION }}" >> $GITHUB_ENV
echo "SRS_MAJOR=${{ needs.envs.outputs.SRS_MAJOR }}" >> $GITHUB_ENV echo "SRS_MAJOR=${{ needs.envs.outputs.SRS_MAJOR }}" >> $GITHUB_ENV
echo "SRS_XYZ=${{ needs.envs.outputs.SRS_XYZ }}" >> $GITHUB_ENV
echo "SRS_RELEASE_ID=${{ needs.draft.outputs.SRS_RELEASE_ID }}" >> $GITHUB_ENV echo "SRS_RELEASE_ID=${{ needs.draft.outputs.SRS_RELEASE_ID }}" >> $GITHUB_ENV
echo "SRS_PACKAGE_ZIP=${{ needs.linux.outputs.SRS_PACKAGE_ZIP }}" >> $GITHUB_ENV echo "SRS_PACKAGE_ZIP=${{ needs.linux.outputs.SRS_PACKAGE_ZIP }}" >> $GITHUB_ENV
echo "SRS_PACKAGE_MD5=${{ needs.linux.outputs.SRS_PACKAGE_MD5 }}" >> $GITHUB_ENV echo "SRS_PACKAGE_MD5=${{ needs.linux.outputs.SRS_PACKAGE_MD5 }}" >> $GITHUB_ENV
echo "SRS_SOURCE_TAR=${{ needs.linux.outputs.SRS_SOURCE_TAR }}" >> $GITHUB_ENV echo "SRS_SOURCE_TAR=${{ needs.linux.outputs.SRS_SOURCE_TAR }}" >> $GITHUB_ENV
echo "SRS_SOURCE_MD5=${{ needs.linux.outputs.SRS_SOURCE_MD5 }}" >> $GITHUB_ENV echo "SRS_SOURCE_MD5=${{ needs.linux.outputs.SRS_SOURCE_MD5 }}" >> $GITHUB_ENV
echo "SRS_CYGWIN_TAR=${{ needs.cygwin64.outputs.SRS_CYGWIN_TAR }}" >> $GITHUB_ENV
echo "SRS_CYGWIN_MD5=${{ needs.cygwin64.outputs.SRS_CYGWIN_MD5 }}" >> $GITHUB_ENV
################################################################################################################## ##################################################################################################################
# Git checkout # Git checkout
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
# Create release. # Create release.
# TODO: FIXME: Refine the release when 6.0 released
# TODO: FIXME: Change prerelease to false and makeLatest to true when 6.0 released
- name: Update release - name: Update release
id: update_release id: update_release
uses: ncipollo/release-action@a2e71bdd4e7dab70ca26a852f29600c98b33153e # v1.12.0 uses: ncipollo/release-action@a2e71bdd4e7dab70ca26a852f29600c98b33153e # v1.12.0
@ -440,39 +366,37 @@ jobs:
## Resource ## Resource
* Source: ${{ env.SRS_SOURCE_MD5 }} [${{ env.SRS_SOURCE_TAR }}](https://github.com/ossrs/srs/releases/download/${{ env.SRS_TAG }}/${{ env.SRS_SOURCE_TAR }}) * Source: ${{ env.SRS_SOURCE_MD5 }} [${{ env.SRS_SOURCE_TAR }}](https://github.com/ossrs/srs/releases/download/${{ env.SRS_TAG }}/${{ env.SRS_SOURCE_TAR }})
* Binary: ${{ env.SRS_PACKAGE_MD5 }} [${{ env.SRS_PACKAGE_ZIP }}](https://github.com/ossrs/srs/releases/download/${{ env.SRS_TAG }}/${{ env.SRS_PACKAGE_ZIP }}) * Binary: ${{ env.SRS_PACKAGE_MD5 }} [${{ env.SRS_PACKAGE_ZIP }}](https://github.com/ossrs/srs/releases/download/${{ env.SRS_TAG }}/${{ env.SRS_PACKAGE_ZIP }})
* Binary: ${{ env.SRS_CYGWIN_MD5 }} [${{ env.SRS_CYGWIN_TAR }}](https://github.com/ossrs/srs/releases/download/${{ env.SRS_TAG }}/${{ env.SRS_CYGWIN_TAR }})
## Resource Mirror: gitee.com ## Resource Mirror: gitee.com
* Source: ${{ env.SRS_SOURCE_MD5 }} [${{ env.SRS_SOURCE_TAR }}](https://gitee.com/ossrs/srs/releases/download/${{ env.SRS_TAG }}/${{ env.SRS_SOURCE_TAR }}) * Source: ${{ env.SRS_SOURCE_MD5 }} [${{ env.SRS_SOURCE_TAR }}](https://gitee.com/ossrs/srs/releases/download/${{ env.SRS_TAG }}/${{ env.SRS_SOURCE_TAR }})
* Binary: ${{ env.SRS_PACKAGE_MD5 }} [${{ env.SRS_PACKAGE_ZIP }}](https://gitee.com/ossrs/srs/releases/download/${{ env.SRS_TAG }}/${{ env.SRS_PACKAGE_ZIP }}) * Binary: ${{ env.SRS_PACKAGE_MD5 }} [${{ env.SRS_PACKAGE_ZIP }}](https://gitee.com/ossrs/srs/releases/download/${{ env.SRS_TAG }}/${{ env.SRS_PACKAGE_ZIP }})
* Binary: ${{ env.SRS_CYGWIN_MD5 }} [${{ env.SRS_CYGWIN_TAR }}](https://gitee.com/ossrs/srs/releases/download/${{ env.SRS_TAG }}/${{ env.SRS_CYGWIN_TAR }})
## Docker ## Docker
* [docker pull ossrs/srs:${{ env.SRS_MAJOR }}](https://ossrs.io/lts/en-us/docs/v5/doc/getting-started) * [docker pull ossrs/srs:${{ env.SRS_MAJOR }}](https://ossrs.io/lts/en-us/docs/v6/doc/getting-started)
* [docker pull ossrs/srs:${{ env.SRS_TAG }}](https://ossrs.io/lts/en-us/docs/v5/doc/getting-started) * [docker pull ossrs/srs:${{ env.SRS_TAG }}](https://ossrs.io/lts/en-us/docs/v6/doc/getting-started)
* [docker pull ossrs/srs:${{ env.SRS_XYZ }}](https://ossrs.io/lts/en-us/docs/v5/doc/getting-started) * [docker pull ossrs/srs:${{ env.SRS_XYZ }}](https://ossrs.io/lts/en-us/docs/v6/doc/getting-started)
## Docker Mirror: aliyun.com ## Docker Mirror: aliyun.com
* [docker pull registry.cn-hangzhou.aliyuncs.com/ossrs/srs:${{ env.SRS_MAJOR }}](https://ossrs.net/lts/zh-cn/docs/v5/doc/getting-started) * [docker pull registry.cn-hangzhou.aliyuncs.com/ossrs/srs:${{ env.SRS_MAJOR }}](https://ossrs.net/lts/zh-cn/docs/v6/doc/getting-started)
* [docker pull registry.cn-hangzhou.aliyuncs.com/ossrs/srs:${{ env.SRS_TAG }}](https://ossrs.net/lts/zh-cn/docs/v5/doc/getting-started) * [docker pull registry.cn-hangzhou.aliyuncs.com/ossrs/srs:${{ env.SRS_TAG }}](https://ossrs.net/lts/zh-cn/docs/v6/doc/getting-started)
* [docker pull registry.cn-hangzhou.aliyuncs.com/ossrs/srs:${{ env.SRS_XYZ }}](https://ossrs.net/lts/zh-cn/docs/v5/doc/getting-started) * [docker pull registry.cn-hangzhou.aliyuncs.com/ossrs/srs:${{ env.SRS_XYZ }}](https://ossrs.net/lts/zh-cn/docs/v6/doc/getting-started)
## Doc: ossrs.io ## Doc: ossrs.io
* [Getting Started](https://ossrs.io/lts/en-us/docs/v5/doc/getting-started) * [Getting Started](https://ossrs.io/lts/en-us/docs/v6/doc/getting-started)
* [Wiki home](https://ossrs.io/lts/en-us/docs/v5/doc/introduction) * [Wiki home](https://ossrs.io/lts/en-us/docs/v6/doc/introduction)
* [FAQ](https://ossrs.io/lts/en-us/faq), [Features](https://github.com/ossrs/srs/blob/${{ github.sha }}/trunk/doc/Features.md#features) or [ChangeLogs](https://github.com/ossrs/srs/blob/${{ github.sha }}/trunk/doc/CHANGELOG.md#changelog) * [FAQ](https://ossrs.io/lts/en-us/faq), [Features](https://github.com/ossrs/srs/blob/${{ github.sha }}/trunk/doc/Features.md#features) or [ChangeLogs](https://github.com/ossrs/srs/blob/${{ github.sha }}/trunk/doc/CHANGELOG.md#changelog)
## Doc: ossrs.net ## Doc: ossrs.net
* [快速入门](https://ossrs.net/lts/zh-cn/docs/v5/doc/getting-started) * [快速入门](https://ossrs.net/lts/zh-cn/docs/v6/doc/getting-started)
* [中文Wiki首页](https://ossrs.net/lts/zh-cn/docs/v5/doc/introduction) * [中文Wiki首页](https://ossrs.net/lts/zh-cn/docs/v6/doc/introduction)
* [中文FAQ](https://ossrs.net/lts/zh-cn/faq), [功能列表](https://github.com/ossrs/srs/blob/${{ github.sha }}/trunk/doc/Features.md#features) 或 [修订历史](https://github.com/ossrs/srs/blob/${{ github.sha }}/trunk/doc/CHANGELOG.md#changelog) * [中文FAQ](https://ossrs.net/lts/zh-cn/faq), [功能列表](https://github.com/ossrs/srs/blob/${{ github.sha }}/trunk/doc/Features.md#features) 或 [修订历史](https://github.com/ossrs/srs/blob/${{ github.sha }}/trunk/doc/CHANGELOG.md#changelog)
draft: false draft: false
prerelease: true prerelease: false
makeLatest: false makeLatest: true
runs-on: ubuntu-20.04 runs-on: ubuntu-22.04
release-done: release-done:
runs-on: ubuntu-20.04 runs-on: ubuntu-22.04
needs: needs:
- update - update
- release - release

View File

@ -40,12 +40,12 @@ jobs:
bash -c "bash /srs/convert.sh && tar cf /srs/objs.tar.bz2 objs" && bash -c "bash /srs/convert.sh && tar cf /srs/objs.tar.bz2 objs" &&
pwd && du -sh * pwd && du -sh *
################################################################################################################## ##################################################################################################################
- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 - uses: actions/upload-artifact@v4
with: with:
name: srs-cache name: srs-cache
path: objs.tar.bz2 path: objs.tar.bz2
retention-days: 1 retention-days: 1
runs-on: ubuntu-20.04 runs-on: ubuntu-22.04
cygwin64: cygwin64:
name: cygwin64 name: cygwin64
@ -65,10 +65,11 @@ jobs:
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
################################################################################################################## ##################################################################################################################
# Note that we must download artifact after checkout code, because it will change the files in workspace. # Note that we must download artifact after checkout code, because it will change the files in workspace.
- uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 - uses: actions/download-artifact@v4
with: with:
name: srs-cache name: srs-cache
- uses: geekyeggo/delete-artifact@54ab544f12cdb7b71613a16a2b5a37a9ade990af # v2.0.0 # https://github.com/marketplace/actions/delete-artifact?version=v5.0.0#-compatibility
- uses: geekyeggo/delete-artifact@v5.0.0
with: with:
name: srs-cache name: srs-cache
################################################################################################################## ##################################################################################################################
@ -103,7 +104,7 @@ jobs:
run: DOCKER_BUILDKIT=1 docker build -f trunk/Dockerfile.builds --target centos7-no-asm . run: DOCKER_BUILDKIT=1 docker build -f trunk/Dockerfile.builds --target centos7-no-asm .
- name: Build on CentOS7, C++98, no FFmpeg - name: Build on CentOS7, C++98, no FFmpeg
run: DOCKER_BUILDKIT=1 docker build -f trunk/Dockerfile.builds --target centos7-ansi-no-ffmpeg . run: DOCKER_BUILDKIT=1 docker build -f trunk/Dockerfile.builds --target centos7-ansi-no-ffmpeg .
runs-on: ubuntu-20.04 runs-on: ubuntu-22.04
build-ubuntu16: build-ubuntu16:
name: build-ubuntu16 name: build-ubuntu16
@ -117,7 +118,7 @@ jobs:
run: DOCKER_BUILDKIT=1 docker build -f trunk/Dockerfile.builds --target ubuntu16-baseline . run: DOCKER_BUILDKIT=1 docker build -f trunk/Dockerfile.builds --target ubuntu16-baseline .
- name: Build on Ubuntu16, with all features - name: Build on Ubuntu16, with all features
run: DOCKER_BUILDKIT=1 docker build -f trunk/Dockerfile.builds --target ubuntu16-all . run: DOCKER_BUILDKIT=1 docker build -f trunk/Dockerfile.builds --target ubuntu16-all .
runs-on: ubuntu-20.04 runs-on: ubuntu-22.04
build-ubuntu18: build-ubuntu18:
name: build-ubuntu18 name: build-ubuntu18
@ -131,7 +132,7 @@ jobs:
run: DOCKER_BUILDKIT=1 docker build -f trunk/Dockerfile.builds --target ubuntu18-baseline . run: DOCKER_BUILDKIT=1 docker build -f trunk/Dockerfile.builds --target ubuntu18-baseline .
- name: Build on Ubuntu18, with all features - name: Build on Ubuntu18, with all features
run: DOCKER_BUILDKIT=1 docker build -f trunk/Dockerfile.builds --target ubuntu18-all . run: DOCKER_BUILDKIT=1 docker build -f trunk/Dockerfile.builds --target ubuntu18-all .
runs-on: ubuntu-20.04 runs-on: ubuntu-22.04
build-ubuntu20: build-ubuntu20:
name: build-ubuntu20 name: build-ubuntu20
@ -145,7 +146,7 @@ jobs:
run: DOCKER_BUILDKIT=1 docker build -f trunk/Dockerfile.builds --target ubuntu20-baseline . run: DOCKER_BUILDKIT=1 docker build -f trunk/Dockerfile.builds --target ubuntu20-baseline .
- name: Build on Ubuntu20, with all features - name: Build on Ubuntu20, with all features
run: DOCKER_BUILDKIT=1 docker build -f trunk/Dockerfile.builds --target ubuntu20-all . run: DOCKER_BUILDKIT=1 docker build -f trunk/Dockerfile.builds --target ubuntu20-all .
runs-on: ubuntu-20.04 runs-on: ubuntu-22.04
build-cross-arm: build-cross-arm:
name: build-cross-arm name: build-cross-arm
@ -158,7 +159,7 @@ jobs:
run: DOCKER_BUILDKIT=1 docker build -f trunk/Dockerfile.builds --target ubuntu16-cache-cross-armv7 . run: DOCKER_BUILDKIT=1 docker build -f trunk/Dockerfile.builds --target ubuntu16-cache-cross-armv7 .
- name: Cross Build for ARMv7 on Ubuntu20 - name: Cross Build for ARMv7 on Ubuntu20
run: DOCKER_BUILDKIT=1 docker build -f trunk/Dockerfile.builds --target ubuntu20-cache-cross-armv7 . run: DOCKER_BUILDKIT=1 docker build -f trunk/Dockerfile.builds --target ubuntu20-cache-cross-armv7 .
runs-on: ubuntu-20.04 runs-on: ubuntu-22.04
build-cross-aarch64: build-cross-aarch64:
name: build-cross-aarch64 name: build-cross-aarch64
@ -171,7 +172,7 @@ jobs:
run: DOCKER_BUILDKIT=1 docker build -f trunk/Dockerfile.builds --target ubuntu16-cache-cross-aarch64 . run: DOCKER_BUILDKIT=1 docker build -f trunk/Dockerfile.builds --target ubuntu16-cache-cross-aarch64 .
- name: Cross Build for AARCH64 on Ubuntu20 - name: Cross Build for AARCH64 on Ubuntu20
run: DOCKER_BUILDKIT=1 docker build -f trunk/Dockerfile.builds --target ubuntu20-cache-cross-aarch64 . run: DOCKER_BUILDKIT=1 docker build -f trunk/Dockerfile.builds --target ubuntu20-cache-cross-aarch64 .
runs-on: ubuntu-20.04 runs-on: ubuntu-22.04
test: test:
name: utest-regression-blackbox-test name: utest-regression-blackbox-test
@ -200,7 +201,7 @@ jobs:
docker run --rm srs:test bash -c './objs/srs -c conf/regression-test.conf && \ docker run --rm srs:test bash -c './objs/srs -c conf/regression-test.conf && \
cd 3rdparty/srs-bench && (./objs/srs_test -test.v || (cat ../../objs/srs.log && exit 1)) && \ cd 3rdparty/srs-bench && (./objs/srs_test -test.v || (cat ../../objs/srs.log && exit 1)) && \
./objs/srs_gb28181_test -test.v' ./objs/srs_gb28181_test -test.v'
runs-on: ubuntu-20.04 runs-on: ubuntu-22.04
coverage: coverage:
name: coverage name: coverage
@ -233,7 +234,7 @@ jobs:
--env SRS_PR=$SRS_PR --env SRS_SHA=$SRS_SHA --env SRS_PROJECT=$SRS_PROJECT \ --env SRS_PR=$SRS_PR --env SRS_SHA=$SRS_SHA --env SRS_PROJECT=$SRS_PROJECT \
srs:cov bash -c './objs/srs_utest && bash auto/codecov.sh' srs:cov bash -c './objs/srs_utest && bash auto/codecov.sh'
# #
runs-on: ubuntu-20.04 runs-on: ubuntu-22.04
multiple-arch-armv7: multiple-arch-armv7:
name: multiple-arch-armv7 name: multiple-arch-armv7
@ -254,7 +255,7 @@ jobs:
--build-arg IMAGE=ossrs/srs:ubuntu20-cache \ --build-arg IMAGE=ossrs/srs:ubuntu20-cache \
--build-arg INSTALLDEPENDS="NO" \ --build-arg INSTALLDEPENDS="NO" \
-f Dockerfile . -f Dockerfile .
runs-on: ubuntu-20.04 runs-on: ubuntu-22.04
multiple-arch-aarch64: multiple-arch-aarch64:
name: multiple-arch-aarch64 name: multiple-arch-aarch64
@ -275,7 +276,7 @@ jobs:
--build-arg IMAGE=ossrs/srs:ubuntu20-cache \ --build-arg IMAGE=ossrs/srs:ubuntu20-cache \
--build-arg INSTALLDEPENDS="NO" \ --build-arg INSTALLDEPENDS="NO" \
-f Dockerfile . -f Dockerfile .
runs-on: ubuntu-20.04 runs-on: ubuntu-22.04
multiple-arch-amd64: multiple-arch-amd64:
name: multiple-arch-amd64 name: multiple-arch-amd64
@ -297,7 +298,7 @@ jobs:
--output "type=image,push=false" \ --output "type=image,push=false" \
--build-arg IMAGE=ossrs/srs:ubuntu20-cache \ --build-arg IMAGE=ossrs/srs:ubuntu20-cache \
-f Dockerfile . -f Dockerfile .
runs-on: ubuntu-20.04 runs-on: ubuntu-22.04
fast: fast:
name: fast name: fast
@ -305,7 +306,7 @@ jobs:
- cygwin64-cache - cygwin64-cache
steps: steps:
- run: echo 'Start fast jobs' - run: echo 'Start fast jobs'
runs-on: ubuntu-20.04 runs-on: ubuntu-22.04
test-done: test-done:
needs: needs:
@ -321,7 +322,7 @@ jobs:
- multiple-arch-armv7 - multiple-arch-armv7
- multiple-arch-aarch64 - multiple-arch-aarch64
- multiple-arch-amd64 - multiple-arch-amd64
runs-on: ubuntu-20.04 runs-on: ubuntu-22.04
steps: steps:
- run: echo 'All done' - run: echo 'All done'

3
.gitignore vendored
View File

@ -43,3 +43,6 @@ cmake-build-debug
/trunk/ide/srs_clion/cmake_install.cmake /trunk/ide/srs_clion/cmake_install.cmake
/trunk/ide/srs_clion/srs /trunk/ide/srs_clion/srs
/trunk/ide/srs_clion/Testing/ /trunk/ide/srs_clion/Testing/
/proxy
/trunk/ide/vscode-build

View File

@ -1,7 +1,6 @@
<component name="ProjectRunConfigurationManager"> <component name="ProjectRunConfigurationManager">
<configuration default="false" name="private" type="CMakeRunConfiguration" factoryName="Application" PROGRAM_PARAMS="-c console.conf" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" WORKING_DIR="file://$CMakeCurrentBuildDir$/../../../" PASS_PARENT_ENVS_2="true" PROJECT_NAME="srs" TARGET_NAME="srs" CONFIG_NAME="Debug" RUN_TARGET_PROJECT_NAME="srs" RUN_TARGET_NAME="srs"> <configuration default="false" name="private" type="CMakeRunConfiguration" factoryName="Application" PROGRAM_PARAMS="-c console.conf" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" WORKING_DIR="file://$CMakeCurrentBuildDir$/../../../" PASS_PARENT_ENVS_2="true" PROJECT_NAME="srs" TARGET_NAME="srs" CONFIG_NAME="Debug" RUN_TARGET_PROJECT_NAME="srs" RUN_TARGET_NAME="srs">
<envs> <envs>
<env name="SRS_RTC_SERVER_ENABLED" value="on" />
<env name="MallocNanoZone" value="0" /> <env name="MallocNanoZone" value="0" />
</envs> </envs>
<method v="2"> <method v="2">

View File

@ -1,6 +1,6 @@
The MIT License (MIT) The MIT License (MIT)
Copyright (c) 2013-2024 The SRS Authors Copyright (c) 2013-2025 The SRS Authors
Permission is hereby granted, free of charge, to any person obtaining a copy of Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in this software and associated documentation files (the "Software"), to deal in

View File

@ -122,6 +122,12 @@ distributed under their [licenses](https://ossrs.io/lts/en-us/license).
## Releases ## Releases
* 2025-12-03, [Release v6.0-r0](https://github.com/ossrs/srs/releases/tag/v6.0-r0), v6.0-r0, 6.0 release0, v6.0.184, 170962 lines.
* 2025-11-03, [Release v6.0-b3](https://github.com/ossrs/srs/releases/tag/v6.0-b3), v6.0-b3, 6.0 beta3, v6.0.183, 170957 lines.
* 2025-10-16, [Release v6.0-b2](https://github.com/ossrs/srs/releases/tag/v6.0-b2), v6.0-b2, 6.0 beta2, v6.0.181, 170948 lines.
* 2025-09-15, [Release v6.0-b1](https://github.com/ossrs/srs/releases/tag/v6.0-b1), v6.0-b1, 6.0 beta1, v6.0.177, 170611 lines.
* 2025-08-12, [Release v6.0-b0](https://github.com/ossrs/srs/releases/tag/v6.0-b0), v6.0-b0, 6.0 beta0, v6.0.172, 170417 lines.
* 2024-09-01, [Release v6.0-a1](https://github.com/ossrs/srs/releases/tag/v6.0-a1), v6.0-a1, 6.0 alpha1, v6.0.155, 169636 lines.
* 2024-07-27, [Release v6.0-a0](https://github.com/ossrs/srs/releases/tag/v6.0-a0), v6.0-a0, 6.0 alpha0, v6.0.145, 169259 lines. * 2024-07-27, [Release v6.0-a0](https://github.com/ossrs/srs/releases/tag/v6.0-a0), v6.0-a0, 6.0 alpha0, v6.0.145, 169259 lines.
* 2024-07-04, [Release v6.0-d6](https://github.com/ossrs/srs/releases/tag/v6.0-d6), v6.0-d6, 6.0 dev6, v6.0.134, 168904 lines. * 2024-07-04, [Release v6.0-d6](https://github.com/ossrs/srs/releases/tag/v6.0-d6), v6.0-d6, 6.0 dev6, v6.0.134, 168904 lines.
* 2024-06-15, [Release v6.0-d5](https://github.com/ossrs/srs/releases/tag/v6.0-d5), v6.0-d5, 6.0 dev5, v6.0.129, 168454 lines. * 2024-06-15, [Release v6.0-d5](https://github.com/ossrs/srs/releases/tag/v6.0-d5), v6.0-d5, 6.0 dev5, v6.0.129, 168454 lines.

View File

@ -1,7 +1,7 @@
/* /*
The MIT License (MIT) The MIT License (MIT)
Copyright (c) 2019 winlin Copyright (c) 2025 winlin
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -1,7 +1,7 @@
/* /*
The MIT License (MIT) The MIT License (MIT)
Copyright (c) 2019 winlin Copyright (c) 2025 winlin
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -1,7 +1,7 @@
/* /*
The MIT License (MIT) The MIT License (MIT)
Copyright (c) 2019 winlin Copyright (c) 2025 winlin
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -1,6 +1,6 @@
The MIT License (MIT) The MIT License (MIT)
Copyright (c) 2013-2017 winlin Copyright (c) 2013-2025 winlin
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -1,7 +1,7 @@
/* /*
The MIT License (MIT) The MIT License (MIT)
Copyright (c) 2019 winlin Copyright (c) 2025 winlin
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -1,6 +1,6 @@
// The MIT License (MIT) // The MIT License (MIT)
// //
// Copyright (c) 2021 Winlin // Copyright (c) 2025 Winlin
// //
// Permission is hereby granted, free of charge, to any person obtaining a copy of // Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in // this software and associated documentation files (the "Software"), to deal in

View File

@ -1,6 +1,6 @@
The MIT License (MIT) The MIT License (MIT)
Copyright (c) 2013-2017 winlin Copyright (c) 2013-2025 winlin
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -2,7 +2,7 @@
/** /**
* The MIT License (MIT) * The MIT License (MIT)
* *
* Copyright (c) 2013-2021 Winlin * Copyright (c) 2013-2025 Winlin
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in

View File

@ -2,7 +2,7 @@
/** /**
* The MIT License (MIT) * The MIT License (MIT)
* *
* Copyright (c) 2013-2021 Winlin * Copyright (c) 2013-2025 Winlin
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in

View File

@ -1,6 +1,6 @@
The MIT License (MIT) The MIT License (MIT)
Copyright (c) 2021 Winlin Copyright (c) 2025 Winlin
Permission is hereby granted, free of charge, to any person obtaining a copy of Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in this software and associated documentation files (the "Software"), to deal in

View File

@ -1,6 +1,6 @@
// The MIT License (MIT) // The MIT License (MIT)
// //
// # Copyright (c) 2023 Winlin // # Copyright (c) 2025 Winlin
// //
// Permission is hereby granted, free of charge, to any person obtaining a copy of // Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in // this software and associated documentation files (the "Software"), to deal in

View File

@ -1,6 +1,6 @@
// The MIT License (MIT) // The MIT License (MIT)
// //
// # Copyright (c) 2023 Winlin // # Copyright (c) 2025 Winlin
// //
// Permission is hereby granted, free of charge, to any person obtaining a copy of // Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in // this software and associated documentation files (the "Software"), to deal in

View File

@ -1,6 +1,6 @@
// The MIT License (MIT) // The MIT License (MIT)
// //
// # Copyright (c) 2023 Winlin // # Copyright (c) 2025 Winlin
// //
// Permission is hereby granted, free of charge, to any person obtaining a copy of // Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in // this software and associated documentation files (the "Software"), to deal in

View File

@ -1,6 +1,6 @@
// The MIT License (MIT) // The MIT License (MIT)
// //
// # Copyright (c) 2023 Winlin // # Copyright (c) 2025 Winlin
// //
// Permission is hereby granted, free of charge, to any person obtaining a copy of // Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in // this software and associated documentation files (the "Software"), to deal in

View File

@ -1,6 +1,6 @@
// The MIT License (MIT) // The MIT License (MIT)
// //
// # Copyright (c) 2023 Winlin // # Copyright (c) 2025 Winlin
// //
// Permission is hereby granted, free of charge, to any person obtaining a copy of // Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in // this software and associated documentation files (the "Software"), to deal in

View File

@ -1,6 +1,6 @@
// The MIT License (MIT) // The MIT License (MIT)
// //
// # Copyright (c) 2023 Winlin // # Copyright (c) 2025 Winlin
// //
// Permission is hereby granted, free of charge, to any person obtaining a copy of // Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in // this software and associated documentation files (the "Software"), to deal in

View File

@ -1,6 +1,6 @@
// The MIT License (MIT) // The MIT License (MIT)
// //
// # Copyright (c) 2023 Winlin // # Copyright (c) 2025 Winlin
// //
// Permission is hereby granted, free of charge, to any person obtaining a copy of // Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in // this software and associated documentation files (the "Software"), to deal in

View File

@ -1,6 +1,6 @@
// The MIT License (MIT) // The MIT License (MIT)
// //
// # Copyright (c) 2023 Winlin // # Copyright (c) 2025 Winlin
// //
// Permission is hereby granted, free of charge, to any person obtaining a copy of // Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in // this software and associated documentation files (the "Software"), to deal in

View File

@ -1,6 +1,6 @@
// The MIT License (MIT) // The MIT License (MIT)
// //
// # Copyright (c) 2023 Winlin // # Copyright (c) 2025 Winlin
// //
// Permission is hereby granted, free of charge, to any person obtaining a copy of // Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in // this software and associated documentation files (the "Software"), to deal in

View File

@ -1,6 +1,6 @@
// The MIT License (MIT) // The MIT License (MIT)
// //
// # Copyright (c) 2023 Winlin // # Copyright (c) 2025 Winlin
// //
// Permission is hereby granted, free of charge, to any person obtaining a copy of // Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in // this software and associated documentation files (the "Software"), to deal in

View File

@ -1,6 +1,6 @@
// The MIT License (MIT) // The MIT License (MIT)
// //
// # Copyright (c) 2022-2024 Winlin // # Copyright (c) 2022-2025 Winlin
// //
// Permission is hereby granted, free of charge, to any person obtaining a copy of // Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in // this software and associated documentation files (the "Software"), to deal in

View File

@ -1,6 +1,6 @@
// The MIT License (MIT) // The MIT License (MIT)
// //
// # Copyright (c) 2022-2024 Winlin // # Copyright (c) 2022-2025 Winlin
// //
// Permission is hereby granted, free of charge, to any person obtaining a copy of // Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in // this software and associated documentation files (the "Software"), to deal in

View File

@ -1,6 +1,6 @@
// The MIT License (MIT) // The MIT License (MIT)
// //
// # Copyright (c) 2022-2024 Winlin // # Copyright (c) 2022-2025 Winlin
// //
// Permission is hereby granted, free of charge, to any person obtaining a copy of // Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in // this software and associated documentation files (the "Software"), to deal in

View File

@ -1,6 +1,6 @@
// The MIT License (MIT) // The MIT License (MIT)
// //
// # Copyright (c) 2022-2024 Winlin // # Copyright (c) 2022-2025 Winlin
// //
// Permission is hereby granted, free of charge, to any person obtaining a copy of // Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in // this software and associated documentation files (the "Software"), to deal in

View File

@ -1,6 +1,6 @@
// The MIT License (MIT) // The MIT License (MIT)
// //
// # Copyright (c) 2022-2024 Winlin // # Copyright (c) 2022-2025 Winlin
// //
// Permission is hereby granted, free of charge, to any person obtaining a copy of // Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in // this software and associated documentation files (the "Software"), to deal in

View File

@ -1,6 +1,6 @@
// The MIT License (MIT) // The MIT License (MIT)
// //
// # Copyright (c) 2022-2024 Winlin // # Copyright (c) 2022-2025 Winlin
// //
// Permission is hereby granted, free of charge, to any person obtaining a copy of // Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in // this software and associated documentation files (the "Software"), to deal in

View File

@ -1,6 +1,6 @@
// The MIT License (MIT) // The MIT License (MIT)
// //
// # Copyright (c) 2022-2024 Winlin // # Copyright (c) 2022-2025 Winlin
// //
// Permission is hereby granted, free of charge, to any person obtaining a copy of // Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in // this software and associated documentation files (the "Software"), to deal in

View File

@ -1,6 +1,6 @@
// The MIT License (MIT) // The MIT License (MIT)
// //
// # Copyright (c) 2021 Winlin // # Copyright (c) 2025 Winlin
// //
// Permission is hereby granted, free of charge, to any person obtaining a copy of // Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in // this software and associated documentation files (the "Software"), to deal in

View File

@ -1,6 +1,6 @@
// The MIT License (MIT) // The MIT License (MIT)
// //
// # Copyright (c) 2021 Winlin // # Copyright (c) 2025 Winlin
// //
// Permission is hereby granted, free of charge, to any person obtaining a copy of // Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in // this software and associated documentation files (the "Software"), to deal in

View File

@ -1,6 +1,6 @@
// The MIT License (MIT) // The MIT License (MIT)
// //
// # Copyright (c) 2021 Winlin // # Copyright (c) 2025 Winlin
// //
// Permission is hereby granted, free of charge, to any person obtaining a copy of // Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in // this software and associated documentation files (the "Software"), to deal in

View File

@ -1,6 +1,6 @@
// The MIT License (MIT) // The MIT License (MIT)
// //
// # Copyright (c) 2021 Winlin // # Copyright (c) 2025 Winlin
// //
// Permission is hereby granted, free of charge, to any person obtaining a copy of // Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in // this software and associated documentation files (the "Software"), to deal in

View File

@ -1,6 +1,6 @@
// The MIT License (MIT) // The MIT License (MIT)
// //
// # Copyright (c) 2021 Winlin // # Copyright (c) 2025 Winlin
// //
// Permission is hereby granted, free of charge, to any person obtaining a copy of // Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in // this software and associated documentation files (the "Software"), to deal in

View File

@ -1,6 +1,6 @@
// The MIT License (MIT) // The MIT License (MIT)
// //
// # Copyright (c) 2021 Winlin // # Copyright (c) 2025 Winlin
// //
// Permission is hereby granted, free of charge, to any person obtaining a copy of // Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in // this software and associated documentation files (the "Software"), to deal in

View File

@ -1,6 +1,6 @@
// The MIT License (MIT) // The MIT License (MIT)
// //
// # Copyright (c) 2021 Winlin // # Copyright (c) 2025 Winlin
// //
// Permission is hereby granted, free of charge, to any person obtaining a copy of // Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in // this software and associated documentation files (the "Software"), to deal in

View File

@ -1,6 +1,6 @@
// The MIT License (MIT) // The MIT License (MIT)
// //
// # Copyright (c) 2021 Winlin // # Copyright (c) 2025 Winlin
// //
// Permission is hereby granted, free of charge, to any person obtaining a copy of // Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in // this software and associated documentation files (the "Software"), to deal in

View File

@ -1,6 +1,6 @@
// The MIT License (MIT) // The MIT License (MIT)
// //
// # Copyright (c) 2021 Winlin // # Copyright (c) 2025 Winlin
// //
// Permission is hereby granted, free of charge, to any person obtaining a copy of // Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in // this software and associated documentation files (the "Software"), to deal in

View File

@ -1,6 +1,6 @@
// The MIT License (MIT) // The MIT License (MIT)
// //
// # Copyright (c) 2021 Winlin // # Copyright (c) 2025 Winlin
// //
// Permission is hereby granted, free of charge, to any person obtaining a copy of // Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in // this software and associated documentation files (the "Software"), to deal in

View File

@ -1,6 +1,6 @@
// The MIT License (MIT) // The MIT License (MIT)
// //
// # Copyright (c) 2021 Winlin // # Copyright (c) 2025 Winlin
// //
// Permission is hereby granted, free of charge, to any person obtaining a copy of // Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in // this software and associated documentation files (the "Software"), to deal in

View File

@ -1,6 +1,6 @@
// The MIT License (MIT) // The MIT License (MIT)
// //
// # Copyright (c) 2021 Winlin // # Copyright (c) 2025 Winlin
// //
// Permission is hereby granted, free of charge, to any person obtaining a copy of // Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in // this software and associated documentation files (the "Software"), to deal in

View File

@ -1,6 +1,6 @@
// The MIT License (MIT) // The MIT License (MIT)
// //
// # Copyright (c) 2021 Winlin // # Copyright (c) 2025 Winlin
// //
// Permission is hereby granted, free of charge, to any person obtaining a copy of // Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in // this software and associated documentation files (the "Software"), to deal in

View File

@ -1,6 +1,6 @@
// The MIT License (MIT) // The MIT License (MIT)
// //
// # Copyright (c) 2021 Winlin // # Copyright (c) 2025 Winlin
// //
// Permission is hereby granted, free of charge, to any person obtaining a copy of // Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in // this software and associated documentation files (the "Software"), to deal in

View File

@ -1,6 +1,6 @@
// The MIT License (MIT) // The MIT License (MIT)
// //
// # Copyright (c) 2021 Winlin // # Copyright (c) 2025 Winlin
// //
// Permission is hereby granted, free of charge, to any person obtaining a copy of // Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in // this software and associated documentation files (the "Software"), to deal in

View File

@ -1,6 +1,6 @@
// The MIT License (MIT) // The MIT License (MIT)
// //
// # Copyright (c) 2021 Winlin // # Copyright (c) 2025 Winlin
// //
// Permission is hereby granted, free of charge, to any person obtaining a copy of // Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in // this software and associated documentation files (the "Software"), to deal in

View File

@ -1,6 +1,6 @@
// The MIT License (MIT) // The MIT License (MIT)
// //
// # Copyright (c) 2021 Winlin // # Copyright (c) 2025 Winlin
// //
// Permission is hereby granted, free of charge, to any person obtaining a copy of // Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in // this software and associated documentation files (the "Software"), to deal in

View File

@ -1,6 +1,6 @@
// The MIT License (MIT) // The MIT License (MIT)
// //
// # Copyright (c) 2021 Winlin // # Copyright (c) 2025 Winlin
// //
// Permission is hereby granted, free of charge, to any person obtaining a copy of // Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in // this software and associated documentation files (the "Software"), to deal in

View File

@ -1,6 +1,6 @@
// The MIT License (MIT) // The MIT License (MIT)
// //
// # Copyright (c) 2021 Winlin // # Copyright (c) 2025 Winlin
// //
// Permission is hereby granted, free of charge, to any person obtaining a copy of // Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in // this software and associated documentation files (the "Software"), to deal in

View File

@ -1,6 +1,6 @@
// The MIT License (MIT) // The MIT License (MIT)
// //
// # Copyright (c) 2021 Winlin // # Copyright (c) 2025 Winlin
// //
// Permission is hereby granted, free of charge, to any person obtaining a copy of // Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in // this software and associated documentation files (the "Software"), to deal in

View File

@ -1,6 +1,6 @@
// The MIT License (MIT) // The MIT License (MIT)
// //
// # Copyright (c) 2021 Winlin // # Copyright (c) 2025 Winlin
// //
// Permission is hereby granted, free of charge, to any person obtaining a copy of // Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in // this software and associated documentation files (the "Software"), to deal in

View File

@ -1,6 +1,6 @@
// The MIT License (MIT) // The MIT License (MIT)
// //
// # Copyright (c) 2021 Winlin // # Copyright (c) 2025 Winlin
// //
// Permission is hereby granted, free of charge, to any person obtaining a copy of // Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in // this software and associated documentation files (the "Software"), to deal in

View File

@ -1,6 +1,6 @@
// The MIT License (MIT) // The MIT License (MIT)
// //
// # Copyright (c) 2021 Winlin // # Copyright (c) 2025 Winlin
// //
// Permission is hereby granted, free of charge, to any person obtaining a copy of // Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in // this software and associated documentation files (the "Software"), to deal in

View File

@ -1,6 +1,6 @@
The MIT License (MIT) The MIT License (MIT)
Copyright (c) 2013-2017 winlin Copyright (c) 2013-2025 winlin
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -1,6 +1,6 @@
// The MIT License (MIT) // The MIT License (MIT)
// //
// # Copyright (c) 2021 Winlin // # Copyright (c) 2025 Winlin
// //
// Permission is hereby granted, free of charge, to any person obtaining a copy of // Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in // this software and associated documentation files (the "Software"), to deal in

View File

@ -1,6 +1,6 @@
// The MIT License (MIT) // The MIT License (MIT)
// //
// # Copyright (c) 2021 Winlin // # Copyright (c) 2025 Winlin
// //
// Permission is hereby granted, free of charge, to any person obtaining a copy of // Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in // this software and associated documentation files (the "Software"), to deal in

View File

@ -1,5 +1,5 @@
/* SPDX-License-Identifier: MIT */ /* SPDX-License-Identifier: MIT */
/* Copyright (c) 2013-2024 The SRS Authors */ /* Copyright (c) 2013-2025 The SRS Authors */
#ifdef __linux__ #ifdef __linux__
#define _GNU_SOURCE #define _GNU_SOURCE

View File

@ -1,5 +1,5 @@
/* SPDX-License-Identifier: MIT */ /* SPDX-License-Identifier: MIT */
/* Copyright (c) 2013-2024 The SRS Authors */ /* Copyright (c) 2013-2025 The SRS Authors */
#include <stdio.h> #include <stdio.h>

View File

@ -1,5 +1,5 @@
/* SPDX-License-Identifier: MIT */ /* SPDX-License-Identifier: MIT */
/* Copyright (c) 2022 Winlin */ /* Copyright (c) 2025 Winlin */
#include <stdio.h> #include <stdio.h>
#include <setjmp.h> #include <setjmp.h>

View File

@ -1,5 +1,5 @@
/* SPDX-License-Identifier: MIT */ /* SPDX-License-Identifier: MIT */
/* Copyright (c) 2022 Winlin */ /* Copyright (c) 2025 Winlin */
void foo() { void foo() {
} }

View File

@ -1,5 +1,5 @@
/* SPDX-License-Identifier: MIT */ /* SPDX-License-Identifier: MIT */
/* Copyright (c) 2013-2024 The SRS Authors */ /* Copyright (c) 2013-2025 The SRS Authors */
#include <stdio.h> #include <stdio.h>
#include <setjmp.h> #include <setjmp.h>

View File

@ -1,5 +1,5 @@
/* SPDX-License-Identifier: MIT */ /* SPDX-License-Identifier: MIT */
/* Copyright (c) 2022 Winlin */ /* Copyright (c) 2025 Winlin */
long foo() { long foo() {
char c; char c;

View File

@ -1,5 +1,5 @@
/* SPDX-License-Identifier: MIT */ /* SPDX-License-Identifier: MIT */
/* Copyright (c) 2013-2024 The SRS Authors */ /* Copyright (c) 2013-2025 The SRS Authors */
#include <stdio.h> #include <stdio.h>

View File

@ -1,5 +1,5 @@
/* SPDX-License-Identifier: MIT */ /* SPDX-License-Identifier: MIT */
/* Copyright (c) 2013-2024 The SRS Authors */ /* Copyright (c) 2013-2025 The SRS Authors */
#include <st_utest.hpp> #include <st_utest.hpp>

View File

@ -1,5 +1,5 @@
/* SPDX-License-Identifier: MIT */ /* SPDX-License-Identifier: MIT */
/* Copyright (c) 2013-2024 The SRS Authors */ /* Copyright (c) 2013-2025 The SRS Authors */
#ifndef ST_UTEST_PUBLIC_HPP #ifndef ST_UTEST_PUBLIC_HPP
#define ST_UTEST_PUBLIC_HPP #define ST_UTEST_PUBLIC_HPP

View File

@ -1,5 +1,5 @@
/* SPDX-License-Identifier: MIT */ /* SPDX-License-Identifier: MIT */
/* Copyright (c) 2013-2024 The SRS Authors */ /* Copyright (c) 2013-2025 The SRS Authors */
#include <st_utest.hpp> #include <st_utest.hpp>

View File

@ -1,5 +1,5 @@
/* SPDX-License-Identifier: MIT */ /* SPDX-License-Identifier: MIT */
/* Copyright (c) 2013-2024 The SRS Authors */ /* Copyright (c) 2013-2025 The SRS Authors */
#include <st_utest.hpp> #include <st_utest.hpp>

View File

@ -18,7 +18,7 @@ WORKDIR /srs/trunk
# Note that we must enable the gcc7 or link failed. # Note that we must enable the gcc7 or link failed.
# Please note that we must disable the ffmpeg-opus, as it negatively impacts performance. We may consider # Please note that we must disable the ffmpeg-opus, as it negatively impacts performance. We may consider
# enabling it in the future when support for multi-threading transcoding is available. # enabling it in the future when support for multi-threading transcoding is available.
RUN ./configure --srt=on --gb28181=on --srt=on --apm=on --h265=on --utest=on --ffmpeg-opus=off --build-cache=on RUN ./configure --srt=on --gb28181=on --srt=on --apm=on --h265=on --utest=on --sanitizer=on --ffmpeg-opus=off --build-cache=on
RUN make utest ${MAKEARGS} RUN make utest ${MAKEARGS}
# Build benchmark tool. # Build benchmark tool.

View File

@ -171,6 +171,11 @@ if [ $SRS_SANITIZER_LOG == YES ]; then
else else
srs_undefine_macro "SRS_SANITIZER_LOG" $SRS_AUTO_HEADERS_H srs_undefine_macro "SRS_SANITIZER_LOG" $SRS_AUTO_HEADERS_H
fi fi
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
##################################################################################### #####################################################################################
# for embeded. # for embeded.
@ -196,6 +201,11 @@ if [[ $SRS_SINGLE_THREAD == YES ]]; then
else else
srs_undefine_macro "SRS_SINGLE_THREAD" $SRS_AUTO_HEADERS_H srs_undefine_macro "SRS_SINGLE_THREAD" $SRS_AUTO_HEADERS_H
fi fi
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
if [[ $SRS_LOG_LEVEL_V2 == YES ]]; then if [[ $SRS_LOG_LEVEL_V2 == YES ]]; then
srs_define_macro "SRS_LOG_LEVEL_V2" $SRS_AUTO_HEADERS_H srs_define_macro "SRS_LOG_LEVEL_V2" $SRS_AUTO_HEADERS_H
else else

View File

@ -671,6 +671,11 @@ fi
if [[ $SRS_SRT == YES && $SRS_USE_SYS_SRT == NO ]]; then if [[ $SRS_SRT == YES && $SRS_USE_SYS_SRT == NO ]]; then
# Always disable c++11 for libsrt, because only the srt-app requres it. # Always disable c++11 for libsrt, because only the srt-app requres it.
LIBSRT_OPTIONS="--enable-apps=0 --enable-static=1 --enable-c++11=0" LIBSRT_OPTIONS="--enable-apps=0 --enable-static=1 --enable-c++11=0"
CMAKE_VERSION=$(cmake --version | head -n1 | cut -d' ' -f3)
CMAKE_MAJOR=$(echo $CMAKE_VERSION | cut -d'.' -f1)
if [[ $CMAKE_MAJOR -ge 4 ]]; then
LIBSRT_OPTIONS="$LIBSRT_OPTIONS --CMAKE_POLICY_VERSION_MINIMUM=3.5"
fi
if [[ $SRS_SHARED_SRT == YES ]]; then if [[ $SRS_SHARED_SRT == YES ]]; then
LIBSRT_OPTIONS="$LIBSRT_OPTIONS --enable-shared=1" LIBSRT_OPTIONS="$LIBSRT_OPTIONS --enable-shared=1"
else else

View File

@ -85,6 +85,7 @@ SRS_CLEAN=YES # Whether do "make clean" when configure.
SRS_SIMULATOR=NO # Whether enable RTC simulate API. SRS_SIMULATOR=NO # Whether enable RTC simulate API.
SRS_GENERATE_OBJS=NO # Whether generate objs and quit. SRS_GENERATE_OBJS=NO # Whether generate objs and quit.
SRS_SINGLE_THREAD=YES # Whether force single thread mode. SRS_SINGLE_THREAD=YES # Whether force single thread mode.
SRS_SIGNAL_API=NO # Use http API to simulate sending signal to SRS, for debugging.
# #
################################################################ ################################################################
# Performance options. # Performance options.
@ -235,6 +236,7 @@ Experts:
--simulator=on|off RTC: Whether enable network simulator. Default: $(value2switch $SRS_SIMULATOR) --simulator=on|off RTC: Whether enable network simulator. Default: $(value2switch $SRS_SIMULATOR)
--generate-objs=on|off RTC: Whether generate objs and quit. Default: $(value2switch $SRS_GENERATE_OBJS) --generate-objs=on|off RTC: Whether generate objs and quit. Default: $(value2switch $SRS_GENERATE_OBJS)
--single-thread=on|off Whether force single thread mode. Default: $(value2switch $SRS_SINGLE_THREAD) --single-thread=on|off Whether force single thread mode. Default: $(value2switch $SRS_SINGLE_THREAD)
--signal-api=on|off Whether support sending signal by HTTP API. Default: $(value2switch $SRS_SIGNAL_API)
--build-tag=<TAG> Set the build object directory suffix. --build-tag=<TAG> Set the build object directory suffix.
--debug=on|off Whether enable the debug code, may hurt performance. Default: $(value2switch $SRS_DEBUG) --debug=on|off Whether enable the debug code, may hurt performance. Default: $(value2switch $SRS_DEBUG)
--debug-stats=on|off Whether enable the debug stats, may hurt performance. Default: $(value2switch $SRS_DEBUG_STATS) --debug-stats=on|off Whether enable the debug stats, may hurt performance. Default: $(value2switch $SRS_DEBUG_STATS)
@ -339,6 +341,7 @@ function parse_user_option() {
--simulator) SRS_SIMULATOR=$(switch2value $value) ;; --simulator) SRS_SIMULATOR=$(switch2value $value) ;;
--generate-objs) SRS_GENERATE_OBJS=$(switch2value $value) ;; --generate-objs) SRS_GENERATE_OBJS=$(switch2value $value) ;;
--single-thread) SRS_SINGLE_THREAD=$(switch2value $value) ;; --single-thread) SRS_SINGLE_THREAD=$(switch2value $value) ;;
--signal-api) SRS_SIGNAL_API=$(switch2value $value) ;;
--ffmpeg-fit) SRS_FFMPEG_FIT=$(switch2value $value) ;; --ffmpeg-fit) SRS_FFMPEG_FIT=$(switch2value $value) ;;
--ffmpeg-opus) SRS_FFMPEG_OPUS=$(switch2value $value) ;; --ffmpeg-opus) SRS_FFMPEG_OPUS=$(switch2value $value) ;;
--h265) SRS_H265=$(switch2value $value) ;; --h265) SRS_H265=$(switch2value $value) ;;
@ -546,6 +549,10 @@ function apply_auto_options() {
SRS_SANITIZER=YES SRS_SANITIZER=YES
fi fi
if [[ $SRS_SANITIZER == RESERVED && $SRS_UTEST == YES ]]; then
SRS_SANITIZER=YES
fi
# If enable gperf, disable sanitizer. # If enable gperf, disable sanitizer.
if [[ $SRS_GPERF == YES && $SRS_SANITIZER == YES ]]; then if [[ $SRS_GPERF == YES && $SRS_SANITIZER == YES ]]; then
echo "Disable sanitizer for gperf" echo "Disable sanitizer for gperf"
@ -681,6 +688,7 @@ function regenerate_options() {
SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --sanitizer-log=$(value2switch $SRS_SANITIZER_LOG)" SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --sanitizer-log=$(value2switch $SRS_SANITIZER_LOG)"
SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --cygwin64=$(value2switch $SRS_CYGWIN64)" SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --cygwin64=$(value2switch $SRS_CYGWIN64)"
SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --single-thread=$(value2switch $SRS_SINGLE_THREAD)" SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --single-thread=$(value2switch $SRS_SINGLE_THREAD)"
SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --signal-api=$(value2switch $SRS_SIGNAL_API)"
SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --generic-linux=$(value2switch $SRS_GENERIC_LINUX)" SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --generic-linux=$(value2switch $SRS_GENERIC_LINUX)"
SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --build-cache=$(value2switch $SRS_BUILD_CACHE)" SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --build-cache=$(value2switch $SRS_BUILD_CACHE)"
if [[ $SRS_CROSS_BUILD_ARCH != "" ]]; then SRS_AUTO_CONFIGURE="$SRS_AUTO_CONFIGURE --arch=$SRS_CROSS_BUILD_ARCH"; fi if [[ $SRS_CROSS_BUILD_ARCH != "" ]]; then SRS_AUTO_CONFIGURE="$SRS_AUTO_CONFIGURE --arch=$SRS_CROSS_BUILD_ARCH"; fi

View File

@ -12,6 +12,26 @@ http_server {
listen 8080; listen 8080;
dir ./objs/nginx/html; dir ./objs/nginx/html;
} }
http_api {
enabled on;
listen 1985;
}
# Edge does not support WebRTC, so even if enabled in config,
# it will be automatically disabled at runtime.
rtc_server {
enabled on;
listen 8000;
candidate $CANDIDATE;
}
# Edge does not support SRT, so even if enabled in config,
# it will be automatically disabled at runtime.
srt_server {
enabled on;
listen 10080;
}
vhost __defaultVhost__ { vhost __defaultVhost__ {
cluster { cluster {
mode remote; mode remote;
@ -21,4 +41,50 @@ vhost __defaultVhost__ {
enabled on; enabled on;
mount [vhost]/[app]/[stream].flv; mount [vhost]/[app]/[stream].flv;
} }
# Edge does not support WebRTC, so even if enabled in config,
# it will be automatically disabled at runtime.
rtc {
enabled on;
rtmp_to_rtc on;
rtc_to_rtmp on;
}
# Edge does not support SRT, so even if enabled in config,
# it will be automatically disabled at runtime.
srt {
enabled on;
srt_to_rtmp on;
}
# Edge does not support HDS, so even if enabled in config,
# it will be automatically disabled at runtime.
hds {
enabled on;
}
# Edge does not support HLS, so even if enabled in config,
# it will be automatically disabled at runtime.
hls {
enabled on;
}
# Edge does not support MPEG-DASH, so even if enabled in config,
# it will be automatically disabled at runtime.
dash {
enabled on;
}
# Edge does not support forwarding, so even if enabled in config,
# it will be automatically disabled at runtime.
forward {
enabled on;
destination 127.0.0.1:19350;
}
# Edge does not support DVR, so even if enabled in config,
# it will be automatically disabled at runtime.
dvr {
enabled on;
}
} }

View File

@ -338,6 +338,12 @@ srt_server {
# Overwrite by env SRS_SRT_SERVER_DEFAULT_APP # Overwrite by env SRS_SRT_SERVER_DEFAULT_APP
# default: live # default: live
default_app live; default_app live;
# Default streamid when client doesn't provide one.
# This is used when SRT client connects without setting SRTO_STREAMID socket option.
# The streamid format follows SRT standard: #!::r=app/stream,m=publish|request
# Overwrite by env SRS_SRT_SERVER_DEFAULT_STREAMID
# default: #!::r=live/livestream,m=publish
default_streamid "#!::r=live/livestream,m=publish";
# The peerlatency is set by the sender side and will notify the receiver side. # The peerlatency is set by the sender side and will notify the receiver side.
# Overwrite by env SRS_SRT_SERVER_PEERLATENCY # Overwrite by env SRS_SRT_SERVER_PEERLATENCY
# default: 0 # default: 0
@ -907,6 +913,14 @@ heartbeat {
# Overwrite by env SRS_HEARTBEAT_SUMMARIES # Overwrite by env SRS_HEARTBEAT_SUMMARIES
# default: off # default: off
summaries off; summaries off;
# Whether report with listen ports.
# if on, request with the ports of SRS:
# {
# "rtmp": ["1935"], "http": ["8080"], "api": ["1985"], "srt": ["10080"], "rtc": ["8000"]
# }
# Overwrite by env SRS_HEARTBEAT_PORTS
# default: off
ports off;
} }
# system statistics section. # system statistics section.

View File

@ -28,6 +28,7 @@ srt_server {
tlpktdrop off; tlpktdrop off;
sendbuf 2000000; sendbuf 2000000;
recvbuf 2000000; recvbuf 2000000;
default_streamid "#!::r=live/livestream,m=publish";
} }
# @doc https://github.com/ossrs/srs/issues/1147#issuecomment-577607026 # @doc https://github.com/ossrs/srs/issues/1147#issuecomment-577607026

54
trunk/conf/srt.vlc.conf Normal file
View File

@ -0,0 +1,54 @@
# SRT config.
listen 1935;
max_connections 1000;
daemon off;
srs_log_tank console;
http_api {
enabled on;
listen 1985;
}
http_server {
enabled on;
listen 8080;
dir ./objs/nginx/html;
}
srt_server {
enabled on;
listen 10080;
maxbw 1000000000;
connect_timeout 4000;
peerlatency 0;
recvlatency 0;
latency 0;
tsbpdmode off;
tlpktdrop off;
sendbuf 2000000;
recvbuf 2000000;
default_streamid "#!::r=live/livestream,m=request";
}
# @doc https://github.com/ossrs/srs/issues/1147#issuecomment-577607026
vhost __defaultVhost__ {
srt {
enabled on;
srt_to_rtmp on;
}
http_remux {
enabled on;
mount [vhost]/[app]/[stream].flv;
}
}
# For SRT to use vhost.
vhost srs.srt.com.cn {
}
stats {
network 0;
disk sda sdb xvda xvdb;
}

2
trunk/configure vendored
View File

@ -268,7 +268,7 @@ fi
MODULE_ID="CORE" MODULE_ID="CORE"
MODULE_DEPENDS=() MODULE_DEPENDS=()
ModuleLibIncs=(${SRS_OBJS}) ModuleLibIncs=(${SRS_OBJS})
MODULE_FILES=("srs_core" "srs_core_version" "srs_core_version5" "srs_core_autofree" "srs_core_performance" MODULE_FILES=("srs_core" "srs_core_version" "srs_core_version6" "srs_core_autofree" "srs_core_performance"
"srs_core_time" "srs_core_platform" "srs_core_deprecated") "srs_core_time" "srs_core_platform" "srs_core_deprecated")
CORE_INCS="src/core"; MODULE_DIR=${CORE_INCS} . $SRS_WORKDIR/auto/modules.sh CORE_INCS="src/core"; MODULE_DIR=${CORE_INCS} . $SRS_WORKDIR/auto/modules.sh
CORE_OBJS="${MODULE_OBJS[@]}" CORE_OBJS="${MODULE_OBJS[@]}"

View File

@ -7,6 +7,47 @@ The changelog for SRS.
<a name="v6-changes"></a> <a name="v6-changes"></a>
## SRS 6.0 Changelog ## SRS 6.0 Changelog
* v6.0, 2026-05-19, Merge [#4678](https://github.com/ossrs/srs/pull/4678): Edge: Fix RTMP late-join missing sequence headers. v6.0.186 (#4678)
* v6.0, 2025-12-06, Merge [#4605](https://github.com/ossrs/srs/pull/4605): DVR: Fix HEVC mp4 recording error. v6.0.185 (#4605)
* v6.0, 2025-12-03, Merge [#4588](https://github.com/ossrs/srs/pull/4588): RTMP: Ignore FMLE start packet after flash publish. v6.0.184 (#4588)
* v6.0, 2025-10-21, Merge [#4535](https://github.com/ossrs/srs/issues/4535): Bridge: Fix heap-use-after-free in SrsCompositeBridge iterator. v6.0.183 (#4535)
* v6.0, 2025-10-17, Merge [#4534](https://github.com/ossrs/srs/pull/4534): HLS: Fix a iterator bug in hls_ctx cleanup function. v6.0.182 (#4534)
* v6.0, 2025-10-14, Disable sanitizer by default to fix memory leak. (#4364) v6.0.181
* v6.0, 2025-10-01, SRT: Support configurable default_streamid option. v6.0.180
* v6.0, 2025-09-27, For Edge, only support RTMP or HTTP-FLV. v6.0.179 (#4512)
* v6.0, 2025-09-20, Fix WHIP with transcoding bug. v6.0.178 (#4495)
* v6.0, 2025-09-15, RTC2RTMP: Fix sequence number wraparound assertion crashes. v6.0.177 (#4491)
* v6.0, 2025-09-05, RTX: Fix race condition for timer. v6.0.176 (#4470) (#4474)
* v6.0, 2025-08-26, Merge [#4451](https://github.com/ossrs/srs/pull/4451): RTC: Fix null pointer crash in RTC2RTMP when start packet is missing. v6.0.175 (#4451)
* v6.0, 2025-08-16, Merge [#4441](https://github.com/ossrs/srs/pull/4441): fix err memory leak in rtc to rtmp bridge. v6.0.174 (#4441)
* v6.0, 2025-08-14, Merge [#4161](https://github.com/ossrs/srs/pull/4161): fix hls & dash segments cleanup. v6.0.173 (#4161)
* v6.0, 2025-08-12, Merge [#4230](https://github.com/ossrs/srs/pull/4230): MP4 DVR: Fix audio/video synchronization issues in WebRTC recordings. v6.0.172 (#4230)
* v6.0, 2025-08-11, Merge [#4432](https://github.com/ossrs/srs/pull/4432): AI: HTTP-FLV: Fix heap-use-after-free crash during stream unmount. v6.0.171 (#4432)
* v6.0, 2025-07-28, Merge [#4245](https://github.com/ossrs/srs/pull/4245): Allow Forward to be configured with Env Var. v6.0.170 (#4245)
* v6.0, 2025-07-10, Merge [#4414](https://github.com/ossrs/srs/pull/4414): Fix H.264 B-frame detection logic to comply with specification. v6.0.169 (#4414)
* v6.0, 2025-06-04, Merge [#4325](https://github.com/ossrs/srs/pull/4325): fix bug: loop transcoding #3516. v6.0.168 (#4325)
* v6.0, 2025-05-29, Merge [#4356](https://github.com/ossrs/srs/pull/4356): RTMP: Use extended timestamp as delta when chunk fmt=1/2. v6.0.167 (#4356)
* v6.0, 2025-03-21, Merge [#4303](https://github.com/ossrs/srs/pull/4303): replace values with enums. v6.0.165 (#4303)
* v6.0, 2025-03-20, Merge [#4305](https://github.com/ossrs/srs/pull/4305): free sample to prevent memory leak. v6.0.164 (#4305)
* v6.0, 2025-03-18, Merge [#4302](https://github.com/ossrs/srs/pull/4302): update geekyeggo/delete-artifact to 5.0.0. v6.0.163 (#4302)
* v6.0, 2025-03-06, Merge [#4296](https://github.com/ossrs/srs/pull/4296): Dvr: support h265 flv fragments. v6.0.162 (#4296)
* v6.0, 2025-02-20, Merge [#4253](https://github.com/ossrs/srs/pull/4253): fix typo about heartbeat. v6.0.161 (#4253)
* v6.0, 2025-02-19, Merge [#4291](https://github.com/ossrs/srs/pull/4291): fix ci error. v6.0.160 (#4291)
* v6.0, 2025-01-14, Merge [#4271](https://github.com/ossrs/srs/pull/4271): update copyright to 2025. v6.0.159 (#4271)
* v6.0, 2024-10-31, Merge [#4216](https://github.com/ossrs/srs/pull/4216): fix hls error when stream has extension. v6.0.158 (#4216)
* v6.0, 2024-10-15, Merge [#4160](https://github.com/ossrs/srs/pull/4160): RTC2RTMP: Fix screen sharing stutter caused by packet loss. v6.0.157 (#4160)
* v6.0, 2024-09-09, Merge [#4171](https://github.com/ossrs/srs/pull/4171): Heartbeat: Report ports for proxy server. v6.0.156 (#4171)
* v6.0, 2024-09-01, Merge [#4165](https://github.com/ossrs/srs/pull/4165): FLV: Refine source and http handler. v6.0.155 (#4165)
* v6.0, 2024-09-01, Merge [#4166](https://github.com/ossrs/srs/pull/4166): Edge: Fix flv edge crash when http unmount. v6.0.154 (#4166)
* v6.0, 2024-08-31, Merge [#4162](https://github.com/ossrs/srs/pull/4162): Fix #3767: RTMP: Do not response empty data packet. v6.0.153 (#4162)
* v6.0, 2024-08-31, Merge [#4164](https://github.com/ossrs/srs/pull/4164): HTTP-FLV: Notify connection to expire when unpublishing. v6.0.152 (#4164)
* v6.0, 2024-08-24, Merge [#4157](https://github.com/ossrs/srs/pull/4157): Fix crash when quiting. v6.0.151 (#4157)
* v6.0, 2024-08-24, Merge [#4156](https://github.com/ossrs/srs/pull/4156): Build: Fix srs_mp4_parser compiling error. v6.0.150 (#4156)
* v6.0, 2024-08-21, Merge [#4150](https://github.com/ossrs/srs/pull/4150): API: Support new HTTP API for VALGRIND. v6.0.149 (#4150)
* v6.0, 2024-08-15, Merge [#4144](https://github.com/ossrs/srs/pull/4144): HTTP-FLV: Crash when multiple viewers. v6.0.148 (#4144)
* v6.0, 2024-08-15, Merge [#4142](https://github.com/ossrs/srs/pull/4142): Config: Add more utest for env config. v6.0.147 (#4142)
* v6.0, 2024-08-14, Merge [#4141](https://github.com/ossrs/srs/pull/4141): Live: Crash for invalid live stream state when unmount HTTP. v6.0.146 (#4141)
* v6.0, 2024-08-13, Merge [#4092](https://github.com/ossrs/srs/pull/4092): Config: Improve env config to support multi values. v6.0.146 (#4092)
* v6.0, 2024-07-27, Merge [#4127](https://github.com/ossrs/srs/pull/4127): Transcode: Support video codec such as h264_qsv and libx265. v6.0.145 (#4127) * v6.0, 2024-07-27, Merge [#4127](https://github.com/ossrs/srs/pull/4127): Transcode: Support video codec such as h264_qsv and libx265. v6.0.145 (#4127)
* v6.0, 2024-07-27, Merge [#4101](https://github.com/ossrs/srs/pull/4101): GB28181: Support external SIP server. v6.0.144 (#4101) * v6.0, 2024-07-27, Merge [#4101](https://github.com/ossrs/srs/pull/4101): GB28181: Support external SIP server. v6.0.144 (#4101)
* v6.0, 2024-07-24, Merge [#4115](https://github.com/ossrs/srs/pull/4115): HLS: Add missing newline to end of session manifest. v6.0.143 (#4115) * v6.0, 2024-07-24, Merge [#4115](https://github.com/ossrs/srs/pull/4115): HLS: Add missing newline to end of session manifest. v6.0.143 (#4115)
@ -156,6 +197,16 @@ The changelog for SRS.
<a name="v5-changes"></a> <a name="v5-changes"></a>
## SRS 5.0 Changelog ## SRS 5.0 Changelog
* v5.0, 2025-07-10, Merge [#4414](https://github.com/ossrs/srs/pull/4414): Fix H.264 B-frame detection logic to comply with specification. v5.0.224 (#4414)
* v5.0, 2025-03-21, Merge [#4303](https://github.com/ossrs/srs/pull/4303): replace values with enums. v5.0.223 (#4303)
* v5.0, 2025-03-20, Merge [#4305](https://github.com/ossrs/srs/pull/4305): free sample to prevent memory leak. v5.0.222 (#4305)
* v5.0, 2025-03-18, Merge [#4302](https://github.com/ossrs/srs/pull/4302): update geekyeggo/delete-artifact to 5.0.0. v5.0.221 (#4302)
* v5.0, 2025-02-20, Merge [#4253](https://github.com/ossrs/srs/pull/4253): fix typo about heartbeat. v5.0.220 (#4253)
* v5.0, 2025-02-19, Merge [#4291](https://github.com/ossrs/srs/pull/4291): fix ci error. v5.0.219 (#4291)
* v5.0, 2025-01-14, Merge [#4271](https://github.com/ossrs/srs/pull/4271): update copyright to 2025. v5.0.218 (#4271)
* v5.0, 2024-10-31, Merge [#4216](https://github.com/ossrs/srs/pull/4216): fix hls error when stream has extension. v5.0.217 (#4216)
* v5.0, 2024-10-15, Merge [#4160](https://github.com/ossrs/srs/pull/4160): RTC2RTMP: Fix screen sharing stutter caused by packet loss. v5.0.216 (#4160)
* v5.0, 2024-09-09, Merge [#4171](https://github.com/ossrs/srs/pull/4171): Heartbeat: Report ports for proxy server. v5.0.215 (#4171)
* v5.0, 2024-07-24, Merge [#4126](https://github.com/ossrs/srs/pull/4126): Edge: Improve stability for state and fd closing. v5.0.214 (#4126) * v5.0, 2024-07-24, Merge [#4126](https://github.com/ossrs/srs/pull/4126): Edge: Improve stability for state and fd closing. v5.0.214 (#4126)
* v5.0, 2024-06-03, Merge [#4057](https://github.com/ossrs/srs/pull/4057): RTC: Support dropping h.264 SEI from NALUs. v5.0.213 (#4057) * v5.0, 2024-06-03, Merge [#4057](https://github.com/ossrs/srs/pull/4057): RTC: Support dropping h.264 SEI from NALUs. v5.0.213 (#4057)
* v5.0, 2024-04-23, Merge [#4038](https://github.com/ossrs/srs/pull/4038): RTMP: Do not response publish start message if hooks fail. v5.0.212 (#4038) * v5.0, 2024-04-23, Merge [#4038](https://github.com/ossrs/srs/pull/4038): RTMP: Do not response publish start message if hooks fail. v5.0.212 (#4038)

View File

@ -1,7 +1,7 @@
#!/usr/bin/python #!/usr/bin/python
# #
# Copyright (c) 2013-2021 Winlin # Copyright (c) 2013-2025 Winlin
# #
# SPDX-License-Identifier: MIT # SPDX-License-Identifier: MIT
# #

View File

@ -1,7 +1,7 @@
#!/usr/bin/python #!/usr/bin/python
# #
# Copyright (c) 2013-2021 Winlin # Copyright (c) 2013-2025 Winlin
# #
# SPDX-License-Identifier: MIT # SPDX-License-Identifier: MIT
# #

View File

@ -1,5 +1,5 @@
// //
// Copyright (c) 2013-2021 Winlin // Copyright (c) 2013-2025 Winlin
// //
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
// //

View File

@ -1,5 +1,5 @@
// //
// Copyright (c) 2013-2021 Winlin // Copyright (c) 2013-2025 Winlin
// //
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
// //

View File

@ -1,5 +1,5 @@
// //
// Copyright (c) 2013-2021 Winlin // Copyright (c) 2013-2025 Winlin
// //
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
// //

View File

@ -1,5 +1,5 @@
// //
// Copyright (c) 2013-2021 Winlin // Copyright (c) 2013-2025 Winlin
// //
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
// //

View File

@ -1,5 +1,5 @@
// //
// Copyright (c) 2013-2021 Winlin // Copyright (c) 2013-2025 Winlin
// //
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
// //

View File

@ -1,5 +1,5 @@
// //
// Copyright (c) 2013-2021 Winlin // Copyright (c) 2013-2025 Winlin
// //
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
// //

View File

@ -65,7 +65,7 @@
<p>2. 点击选择 <a id="cnPlayer" href="#">SRS播放器</a></p> <p>2. 点击选择 <a id="cnPlayer" href="#">SRS播放器</a></p>
<p>3. 点击进入 <a id="cnConsole" href="#">SRS控制台</a> (可选) </p> <p>3. 点击进入 <a id="cnConsole" href="#">SRS控制台</a> (可选) </p>
<hr/> <hr/>
<p><a href="https://github.com/ossrs/srs">SRS Team &copy; 2013~2024</a></p> <p><a href="https://github.com/ossrs/srs">SRS Team &copy; 2013~2025</a></p>
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
// Build RTMP url. // Build RTMP url.

View File

@ -1,6 +1,6 @@
// //
// Copyright (c) 2013-2021 Winlin // Copyright (c) 2013-2025 Winlin
// //
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
// //
@ -527,36 +527,56 @@ function SrsRtcWhipWhepAsync() {
// @url The WebRTC url to publish with, for example: // @url The WebRTC url to publish with, for example:
// http://localhost:1985/rtc/v1/whip/?app=live&stream=livestream // http://localhost:1985/rtc/v1/whip/?app=live&stream=livestream
// @options The options to control playing, supports: // @options The options to control playing, supports:
// videoOnly: boolean, whether only play video, default to false. // camera: boolean, whether capture video from camera, default to true.
// audioOnly: boolean, whether only play audio, default to false. // screen: boolean, whether capture video from screen, default to false.
// audio: boolean, whether play audio, default to true.
self.publish = async function (url, options) { self.publish = async function (url, options) {
if (url.indexOf('/whip/') === -1) throw new Error(`invalid WHIP url ${url}`); if (url.indexOf('/whip/') === -1) throw new Error(`invalid WHIP url ${url}`);
if (options?.videoOnly && options?.audioOnly) throw new Error(`The videoOnly and audioOnly in options can't be true at the same time`); const hasAudio = options?.audio ?? true;
const useCamera = options?.camera ?? true;
const useScreen = options?.screen ?? false;
if (!options?.videoOnly) { if (!hasAudio && !useCamera && !useScreen) throw new Error(`The camera, screen and audio can't be false at the same time`);
if (hasAudio) {
self.pc.addTransceiver("audio", {direction: "sendonly"}); self.pc.addTransceiver("audio", {direction: "sendonly"});
} else { } else {
self.constraints.audio = false; self.constraints.audio = false;
} }
if (!options?.audioOnly) { if (useCamera || useScreen) {
self.pc.addTransceiver("video", {direction: "sendonly"}); self.pc.addTransceiver("video", {direction: "sendonly"});
} else { }
if (!useCamera) {
self.constraints.video = false; self.constraints.video = false;
} }
if (!navigator.mediaDevices && window.location.protocol === 'http:' && window.location.hostname !== 'localhost') { if (!navigator.mediaDevices && window.location.protocol === 'http:' && window.location.hostname !== 'localhost') {
throw new SrsError('HttpsRequiredError', `Please use HTTPS or localhost to publish, read https://github.com/ossrs/srs/issues/2762#issuecomment-983147576`); throw new SrsError('HttpsRequiredError', `Please use HTTPS or localhost to publish, read https://github.com/ossrs/srs/issues/2762#issuecomment-983147576`);
} }
var stream = await navigator.mediaDevices.getUserMedia(self.constraints);
// @see https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/addStream#Migrating_to_addTrack if (useScreen) {
stream.getTracks().forEach(function (track) { const displayStream = await navigator.mediaDevices.getDisplayMedia({
self.pc.addTrack(track); video: true
});
// @see https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/addStream#Migrating_to_addTrack
displayStream.getTracks().forEach(function (track) {
self.pc.addTrack(track);
// Notify about local track when stream is ok.
self.ontrack && self.ontrack({track: track});
});
}
// Notify about local track when stream is ok. if (useCamera || hasAudio) {
self.ontrack && self.ontrack({track: track}); const userStream = await navigator.mediaDevices.getUserMedia(self.constraints);
});
userStream.getTracks().forEach(function (track) {
self.pc.addTrack(track);
// Notify about local track when stream is ok.
self.ontrack && self.ontrack({track: track});
});
}
var offer = await self.pc.createOffer(); var offer = await self.pc.createOffer();
await self.pc.setLocalDescription(offer); await self.pc.setLocalDescription(offer);

View File

@ -62,10 +62,16 @@
<div class="form-inline"> <div class="form-inline">
Controls: Controls:
<label> <label>
<input type="checkbox" id="ch_videoonly" style="margin-bottom: 8px"> Video Only <input type="radio" id="ra_camera" name="video" value="Camera" checked style="margin-bottom: 8px"> Camera
</label> </label>
<label> <label>
<input type="checkbox" id="ch_audioonly" style="margin-bottom: 8px"> Audio Only <input type="radio" id="ra_screen" name="video" value="Screen" style="margin-bottom: 8px"> Screen
</label>
<label>
<input type="radio" id="ra_none" name="video" value="None" style="margin-bottom: 8px"> No Video
</label>
<label>
<input type="checkbox" id="ch_audio" checked style="margin-bottom: 8px"> Audio
</label> </label>
</div> </div>
@ -113,8 +119,9 @@ $(function(){
// For example: webrtc://r.ossrs.net/live/livestream // For example: webrtc://r.ossrs.net/live/livestream
var url = $("#txt_url").val(); var url = $("#txt_url").val();
sdk.publish(url, { sdk.publish(url, {
videoOnly: $('#ch_videoonly').prop('checked'), camera: $('#ra_camera').prop('checked'),
audioOnly: $('#ch_audioonly').prop('checked'), screen: $('#ra_screen').prop('checked'),
audio: $('#ch_audio').prop('checked')
}).then(function(session){ }).then(function(session){
$('#sessionid').html(session.sessionid); $('#sessionid').html(session.sessionid);
$('#simulator-drop').attr('href', session.simulator + '?drop=1&username=' + session.sessionid); $('#simulator-drop').attr('href', session.simulator + '?drop=1&username=' + session.sessionid);

View File

@ -1,7 +1,7 @@
#!/usr/bin/python #!/usr/bin/python
# #
# Copyright (c) 2013-2021 Winlin # Copyright (c) 2013-2025 Winlin
# #
# SPDX-License-Identifier: MIT # SPDX-License-Identifier: MIT
# #

View File

@ -1,5 +1,5 @@
// //
// Copyright (c) 2013-2024 The SRS Authors // Copyright (c) 2013-2025 The SRS Authors
// //
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
// //

View File

@ -1,5 +1,5 @@
// //
// Copyright (c) 2013-2024 The SRS Authors // Copyright (c) 2013-2025 The SRS Authors
// //
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
// //

View File

@ -1,5 +1,5 @@
// //
// Copyright (c) 2013-2024 The SRS Authors // Copyright (c) 2013-2025 The SRS Authors
// //
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
// //

View File

@ -1,5 +1,5 @@
// //
// Copyright (c) 2013-2024 The SRS Authors // Copyright (c) 2013-2025 The SRS Authors
// //
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
// //

View File

@ -1,5 +1,5 @@
// //
// Copyright (c) 2013-2024 The SRS Authors // Copyright (c) 2013-2025 The SRS Authors
// //
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
// //
@ -68,15 +68,21 @@ const char* _srs_version = "XCORE-" RTMP_SIG_SRS_SERVER;
#define SRS_OVERWRITE_BY_ENV_MILLISECONDS(key) if (!srs_getenv(key).empty()) return (srs_utime_t)(::atoi(srs_getenv(key).c_str()) * SRS_UTIME_MILLISECONDS) #define SRS_OVERWRITE_BY_ENV_MILLISECONDS(key) if (!srs_getenv(key).empty()) return (srs_utime_t)(::atoi(srs_getenv(key).c_str()) * SRS_UTIME_MILLISECONDS)
#define SRS_OVERWRITE_BY_ENV_FLOAT_SECONDS(key) if (!srs_getenv(key).empty()) return srs_utime_t(::atof(srs_getenv(key).c_str()) * SRS_UTIME_SECONDS) #define SRS_OVERWRITE_BY_ENV_FLOAT_SECONDS(key) if (!srs_getenv(key).empty()) return srs_utime_t(::atof(srs_getenv(key).c_str()) * SRS_UTIME_SECONDS)
#define SRS_OVERWRITE_BY_ENV_FLOAT_MILLISECONDS(key) if (!srs_getenv(key).empty()) return srs_utime_t(::atof(srs_getenv(key).c_str()) * SRS_UTIME_MILLISECONDS) #define SRS_OVERWRITE_BY_ENV_FLOAT_MILLISECONDS(key) if (!srs_getenv(key).empty()) return srs_utime_t(::atof(srs_getenv(key).c_str()) * SRS_UTIME_MILLISECONDS)
#define SRS_OVERWRITE_BY_ENV_DIRECTIVE(key) { \ #define SRS_OVERWRITE_BY_ENV_DIRECTIVE(key) { \
static SrsConfDirective* dir = NULL; \ SrsConfDirective* dir = env_cache_->get(key); \
if (!dir && !srs_getenv(key).empty()) { \ if (!dir && !srs_getenv(key).empty()) { \
string v = srs_getenv(key); \ std::vector<string> vec = srs_string_split(srs_getenv(key), " "); \
dir = new SrsConfDirective(); \ dir = new SrsConfDirective(); \
dir->name = key; \ dir->name = key; \
dir->args.push_back(v); \ for (size_t i = 0; i < vec.size(); ++i) { \
} \ std::string value = vec[i]; \
if (dir) return dir; \ if (!value.empty()) { \
dir->args.push_back(value); \
} \
} \
env_cache_->directives.push_back(dir); \
} \
if (dir) return dir; \
} }
/** /**
@ -1343,11 +1349,15 @@ SrsConfig::SrsConfig()
root = new SrsConfDirective(); root = new SrsConfDirective();
root->conf_line = 0; root->conf_line = 0;
root->name = "root"; root->name = "root";
env_cache_ = new SrsConfDirective();
env_cache_->name = "env_cache_";
} }
SrsConfig::~SrsConfig() SrsConfig::~SrsConfig()
{ {
srs_freep(root); srs_freep(root);
srs_freep(env_cache_);
} }
void SrsConfig::subscribe(ISrsReloadHandler* handler) void SrsConfig::subscribe(ISrsReloadHandler* handler)
@ -2389,17 +2399,18 @@ srs_error_t SrsConfig::check_normal_config()
&& n != "peerlatency" && n != "connect_timeout" && n != "peer_idle_timeout" && n != "peerlatency" && n != "connect_timeout" && n != "peer_idle_timeout"
&& n != "sendbuf" && n != "recvbuf" && n != "payloadsize" && n != "sendbuf" && n != "recvbuf" && n != "payloadsize"
&& n != "default_app" && n != "sei_filter" && n != "mix_correct" && n != "default_app" && n != "sei_filter" && n != "mix_correct"
&& n != "tlpktdrop" && n != "tsbpdmode" && n != "passphrase" && n != "pbkeylen") { && n != "tlpktdrop" && n != "tsbpdmode" && n != "passphrase" && n != "pbkeylen"
&& n != "default_streamid") {
return srs_error_new(ERROR_SYSTEM_CONFIG_INVALID, "illegal srt_server.%s", n.c_str()); return srs_error_new(ERROR_SYSTEM_CONFIG_INVALID, "illegal srt_server.%s", n.c_str());
} }
} }
} }
if (true) { if (true) {
SrsConfDirective* conf = get_heartbeart(); SrsConfDirective* conf = get_heartbeat();
for (int i = 0; conf && i < (int)conf->directives.size(); i++) { for (int i = 0; conf && i < (int)conf->directives.size(); i++) {
string n = conf->at(i)->name; string n = conf->at(i)->name;
if (n != "enabled" && n != "interval" && n != "url" if (n != "enabled" && n != "interval" && n != "url"
&& n != "device_id" && n != "summaries") { && n != "device_id" && n != "summaries" && n != "ports") {
return srs_error_new(ERROR_SYSTEM_CONFIG_INVALID, "illegal heartbeat.%s", n.c_str()); return srs_error_new(ERROR_SYSTEM_CONFIG_INVALID, "illegal heartbeat.%s", n.c_str());
} }
} }
@ -5556,7 +5567,10 @@ int SrsConfig::get_global_chunk_size()
return ::atoi(conf->arg0().c_str()); return ::atoi(conf->arg0().c_str());
} }
bool SrsConfig::get_forward_enabled(string vhost) { bool SrsConfig::get_forward_enabled(string vhost)
{
SRS_OVERWRITE_BY_ENV_BOOL("srs.vhost.forward.enabled"); // SRS_VHOST_FORWARD_ENABLED
static bool DEFAULT = false; static bool DEFAULT = false;
SrsConfDirective* conf = get_vhost(vhost); SrsConfDirective* conf = get_vhost(vhost);
@ -5569,6 +5583,8 @@ bool SrsConfig::get_forward_enabled(string vhost) {
bool SrsConfig::get_forward_enabled(SrsConfDirective* vhost) bool SrsConfig::get_forward_enabled(SrsConfDirective* vhost)
{ {
SRS_OVERWRITE_BY_ENV_BOOL("srs.vhost.forward.enabled"); // SRS_VHOST_FORWARD_ENABLED
static bool DEFAULT = false; static bool DEFAULT = false;
SrsConfDirective* conf = vhost->get("forward"); SrsConfDirective* conf = vhost->get("forward");
@ -5601,6 +5617,9 @@ SrsConfDirective* SrsConfig::get_forwards(string vhost)
SrsConfDirective* SrsConfig::get_forward_backend(string vhost) SrsConfDirective* SrsConfig::get_forward_backend(string vhost)
{ {
SRS_OVERWRITE_BY_ENV_DIRECTIVE("srs.vhost.forward.backend"); // SRS_VHOST_FORWARD_BACKEND
SrsConfDirective* conf = get_vhost(vhost); SrsConfDirective* conf = get_vhost(vhost);
if (!conf) { if (!conf) {
return NULL; return NULL;
@ -8236,6 +8255,23 @@ string SrsConfig::get_default_app_name()
return conf->arg0(); return conf->arg0();
} }
string SrsConfig::get_srt_default_streamid()
{
SRS_OVERWRITE_BY_ENV_STRING("srs.srt_server.default_streamid"); // SRS_SRT_SERVER_DEFAULT_STREAMID
static string DEFAULT = "#!::r=live/livestream,m=publish";
SrsConfDirective* conf = root->get("srt_server");
if (!conf) {
return DEFAULT;
}
conf = conf->get("default_streamid");
if (!conf || conf->arg0().empty()) {
return DEFAULT;
}
return conf->arg0();
}
SrsConfDirective* SrsConfig::get_srt(std::string vhost) SrsConfDirective* SrsConfig::get_srt(std::string vhost)
{ {
SrsConfDirective* conf = get_vhost(vhost); SrsConfDirective* conf = get_vhost(vhost);
@ -8698,7 +8734,7 @@ string SrsConfig::get_vhost_http_remux_mount(string vhost)
return conf->arg0(); return conf->arg0();
} }
SrsConfDirective* SrsConfig::get_heartbeart() SrsConfDirective* SrsConfig::get_heartbeat()
{ {
return root->get("heartbeat"); return root->get("heartbeat");
} }
@ -8709,7 +8745,7 @@ bool SrsConfig::get_heartbeat_enabled()
static bool DEFAULT = false; static bool DEFAULT = false;
SrsConfDirective* conf = get_heartbeart(); SrsConfDirective* conf = get_heartbeat();
if (!conf) { if (!conf) {
return DEFAULT; return DEFAULT;
} }
@ -8728,7 +8764,7 @@ srs_utime_t SrsConfig::get_heartbeat_interval()
static srs_utime_t DEFAULT = (srs_utime_t)(10 * SRS_UTIME_SECONDS); static srs_utime_t DEFAULT = (srs_utime_t)(10 * SRS_UTIME_SECONDS);
SrsConfDirective* conf = get_heartbeart(); SrsConfDirective* conf = get_heartbeat();
if (!conf) { if (!conf) {
return DEFAULT; return DEFAULT;
} }
@ -8747,7 +8783,7 @@ string SrsConfig::get_heartbeat_url()
static string DEFAULT = "http://" SRS_CONSTS_LOCALHOST ":8085/api/v1/servers"; static string DEFAULT = "http://" SRS_CONSTS_LOCALHOST ":8085/api/v1/servers";
SrsConfDirective* conf = get_heartbeart(); SrsConfDirective* conf = get_heartbeat();
if (!conf) { if (!conf) {
return DEFAULT; return DEFAULT;
} }
@ -8766,7 +8802,7 @@ string SrsConfig::get_heartbeat_device_id()
static string DEFAULT = ""; static string DEFAULT = "";
SrsConfDirective* conf = get_heartbeart(); SrsConfDirective* conf = get_heartbeat();
if (!conf) { if (!conf) {
return DEFAULT; return DEFAULT;
} }
@ -8785,7 +8821,7 @@ bool SrsConfig::get_heartbeat_summaries()
static bool DEFAULT = false; static bool DEFAULT = false;
SrsConfDirective* conf = get_heartbeart(); SrsConfDirective* conf = get_heartbeat();
if (!conf) { if (!conf) {
return DEFAULT; return DEFAULT;
} }
@ -8798,6 +8834,25 @@ bool SrsConfig::get_heartbeat_summaries()
return SRS_CONF_PREFER_FALSE(conf->arg0()); return SRS_CONF_PREFER_FALSE(conf->arg0());
} }
bool SrsConfig::get_heartbeat_ports()
{
SRS_OVERWRITE_BY_ENV_BOOL("srs.heartbeat.ports"); // SRS_HEARTBEAT_PORTS
static bool DEFAULT = false;
SrsConfDirective* conf = get_heartbeat();
if (!conf) {
return DEFAULT;
}
conf = conf->get("ports");
if (!conf || conf->arg0().empty()) {
return DEFAULT;
}
return SRS_CONF_PREFER_FALSE(conf->arg0());
}
SrsConfDirective* SrsConfig::get_stats() SrsConfDirective* SrsConfig::get_stats()
{ {
return root->get("stats"); return root->get("stats");

View File

@ -1,5 +1,5 @@
// //
// Copyright (c) 2013-2024 The SRS Authors // Copyright (c) 2013-2025 The SRS Authors
// //
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
// //
@ -305,6 +305,9 @@ private:
protected: protected:
// The directive root. // The directive root.
SrsConfDirective* root; SrsConfDirective* root;
private:
// The cache for parsing the config from environment variables.
SrsConfDirective* env_cache_;
// Reload section // Reload section
private: private:
// The reload subscribers, when reload, callback all handlers. // The reload subscribers, when reload, callback all handlers.
@ -705,6 +708,8 @@ public:
virtual int get_srto_pbkeylen(); virtual int get_srto_pbkeylen();
// Get the default app. // Get the default app.
virtual std::string get_default_app_name(); virtual std::string get_default_app_name();
// Get the default streamid when client doesn't provide one.
virtual std::string get_srt_default_streamid();
private: private:
SrsConfDirective* get_srt(std::string vhost); SrsConfDirective* get_srt(std::string vhost);
public: public:
@ -1101,10 +1106,10 @@ public:
// Get the http flv live stream mount point for vhost. // Get the http flv live stream mount point for vhost.
// used to generate the flv stream mount path. // used to generate the flv stream mount path.
virtual std::string get_vhost_http_remux_mount(std::string vhost); virtual std::string get_vhost_http_remux_mount(std::string vhost);
// http heartbeart section // http heartbeat section
private: private:
// Get the heartbeat directive. // Get the heartbeat directive.
virtual SrsConfDirective* get_heartbeart(); virtual SrsConfDirective* get_heartbeat();
public: public:
// Whether heartbeat enabled. // Whether heartbeat enabled.
virtual bool get_heartbeat_enabled(); virtual bool get_heartbeat_enabled();
@ -1116,6 +1121,7 @@ public:
virtual std::string get_heartbeat_device_id(); virtual std::string get_heartbeat_device_id();
// Whether report with summaries of http api: /api/v1/summaries. // Whether report with summaries of http api: /api/v1/summaries.
virtual bool get_heartbeat_summaries(); virtual bool get_heartbeat_summaries();
bool get_heartbeat_ports();
// stats section // stats section
private: private:
// Get the stats directive. // Get the stats directive.

View File

@ -1,5 +1,5 @@
// //
// Copyright (c) 2013-2024 The SRS Authors // Copyright (c) 2013-2025 The SRS Authors
// //
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
// //

Some files were not shown because too many files have changed in this diff Show More