1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-02-13 11:51:57 +00:00
Commit graph

309 commits

Author SHA1 Message Date
Winlin
5759025e43 WHIP: Add OBS support, ensuring compatibility with a unique SDP. v5.0.158, v6.0.51 (#3581)
1. Ignore SDP GROUP LS.
2. Support ice in global session info.
3. Support audio codec "OPUS" or "opus".

---------

Co-authored-by: Johnny <hellojinqiang@gmail.com>
2023-06-15 12:13:10 +08:00
panda
1e43bb6b9f Fix command injection in api-server for HTTP callback. v5.0.157, v6.0.48 2023-06-05 16:41:19 +08:00
Winlin
900c4cdd97 DTLS: Use bio callback to get fragment packet. v5.0.156, v6.0.47 (#3565)
1. The MTU is effective, with the certificate being split into two DTLS records to comply with the limit.
2. The issue occurs when using BIO_get_mem_data, which retrieves all DTLS packets in a single call, even though each is smaller than the MTU.
3. An alternative callback is available for using BIO_new with BIO_s_mem.
4. Improvements to the MTU setting were made, including adding the DTLS_set_link_mtu function and removing the SSL_set_max_send_fragment function.
5. The handshake process was refined, calling SSL_do_handshake only after ICE completion, and using SSL_read to handle handshake messages.
6. The session close code was improved to enable immediate closure upon receiving an SSL CloseNotify or fatal message.

------

Co-authored-by: chundonglinlin <chundonglinlin@163.com>
2023-06-05 10:54:57 +08:00
chundonglinlin
79fd66d8e6 SSL: Fix SSL_get_error get the error of other coroutine. v5.0.156, v6.0.46 (#3513)
---------

Co-authored-by: john <hondaxiao@tencent.com>
Co-authored-by: winlin <winlin@vip.126.com>
2023-05-29 13:03:59 +08:00
winlin
261bebcad1 Support the publishing of RTP plaintext packets using WHIP. v5.0.155 2023-05-14 12:50:35 +08:00
ChenGH
a570169a27 asan: Fix memory leak in asan by releasing global IPs when run_directly_or_daemon fails. v5.0.154, v6.0.44 (#3541)
- Resolved a memory leak issue in asan when run_directly_or_daemon fails
- Previously, global IP lists were not freed, causing asan to report memory leaks
- Updated the code to always free global IP lists, regardless of whether run_directly_or_daemon fails or succeeds

---------

Co-authored-by: chundonglinlin <chundonglinlin@163.com>
2023-05-14 12:25:48 +08:00
winlin
33db1584bf WHIP: Improve HTTP DELETE for notifying server unpublish event. v5.0.153 2023-05-12 15:27:03 +08:00
Haibo Chen
12f3a31175 API: Support HTTP basic authentication for API. v6.0.4, v5.0.152 (#3458)
PICK 771ae0a1a6

Co-authored-by: winlin <winlin@vip.126.com>
Co-authored-by: john <hondaxiao@tencent.com>
2023-04-01 12:48:33 +08:00
chundonglinlin
41decbae95 WebRTC: Error message carries the SDP when failed. v5.0.151, v6.0.39 (#3450)
PICK 571043ff3d

Co-authored-by: winlin <winlin@vip.126.com>
Co-authored-by: ChenGH <chengh_math@126.com>
2023-03-27 22:28:34 +08:00
yashwardhan-jyani
6b2c6b3274 Remove unneccessary NULL check in srs_freep. v5.0.150, v6.0.38 (#3477)
PICK b574ad1a07

Co-authored-by: winlin <winlin@vip.126.com>
Co-authored-by: john <hondaxiao@tencent.com>
2023-03-25 12:10:17 +08:00
john
cd19667a34 RTC: Call on_play before create session, for it might be freed for timeout. v5.0.149, v6.0.37 (#3455)
PICK d8755711c1

Co-authored-by: winlin <winlin@vip.126.com>
Co-authored-by: ChenGH <chengh_math@126.com>
2023-03-25 11:45:59 +08:00
Winlin
5cc794b22d WHIP: Support DELETE resource for Larix Broadcaster. v5.0.148 v6.0.36 (#3427)
* WHIP: Support DELETE resource.
* Support push by Larix.
* FLV: Disable stash buffer for realtime.
* WHEP: Fix muted issue.

-------

Co-authored-by: chundonglinlin <chundonglinlin@163.com>
Co-authored-by: panda <542638787@qq.com>
2023-03-23 10:22:00 +08:00
Winlin
dfef94411f Support WHIP and WHEP player. v5.0.147 and v6.0.35 (#3460)
PICK c001acaae9

Co-authored-by: chundonglinlin <chundonglinlin@163.com>
Co-authored-by: panda <542638787@qq.com>
2023-03-21 08:51:42 +08:00
Winlin
34c78a74fe WebRTC: Warning if no ideal profile. v6.0.33, v5.0.146 (#3446)
For WebRTC, SRS expect the h.264 codec is:

```
a=rtpmap:106 H264/90000
a=fmtp:106 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f
```

But sometimes, the device does not support the profile, for example only bellow:

```
a=fmtp:123 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e033
a=fmtp:122 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=420033
a=fmtp:121 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=640033
a=fmtp:120 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=4d0033
```

So we should warning user about the profile missmatch, because it might not work.

PICK a7514484a2

----------

Co-authored-by: chundonglinlin <chundonglinlin@163.com>
Co-authored-by: LiPeng <lipeng19811218@gmail.com>
2023-03-07 20:02:05 +08:00
Winlin
47aa42f1e2 Support configure for generic linux. v5.0.145, v6.0.32 (#3445)
If your OS is not CentOS, Ubuntu, macOS, cygwin64, run of configure will fail with:

```
Your OS Linux is not supported.
```

For other linux systems, we should support an option:

```
./configure --generic-linux=on
```

Please note that you might still fail for other issues while configuring or building.

PICK b31940a15a

-------

Co-authored-by: chundonglinlin <chundonglinlin@163.com>
Co-authored-by: ChenGH <chengh_math@126.com>
2023-03-07 19:12:06 +08:00
MarkCao
36a72282e6 Kickoff publisher when stream is idle, which means no players. v6.0.31, v5.0.144 (#3105)
For some use scenario, the publisher is invited when player want to view the stream:

1. Publisher connect to system, but does not publish any stream to SRS yet.
2. Player connect to system and start to request the stream.
3. System notifies publisher to publish stream to SRS.
4. Player play the stream from SRS.

Please notice that `system` means your business system, not SRS.

This is what we called `on-demand-live-streaming`, so when the last player stop to view the stream, what happends?

1. System needs to notify publisher to stop publish.
2. Or, SRS disconnect the publisher when idle(the last player stops playing).

This PR is for the solution 2, so that the cleanup is very simple, your system does not need to notify publisher to stop publish, because SRS has already disconnected the publihser.

PICK 8fde0366fb

---------

Co-authored-by: winlin <winlin@vip.126.com>
Co-authored-by: chundonglinlin <chundonglinlin@163.com>
2023-03-06 09:13:39 +08:00
chundonglinlin
0a0fb23be0 API: Add service_id for http_hooks, which identify the process, v6.0.28, v5.0.142 (#3424)
PICK 733aeaa641

Co-authored-by: Winlin <winlin@vip.126.com>
Co-authored-by: Haibo Chen <495810242@qq.com>
2023-02-25 08:44:59 +08:00
Winlin
7fe0e28dd5 Compatible with legacy RTMP URL. v5.0.142. v6.0.27 (#3429)
For compatibility, transform
  rtmp://ip/app...vhost...VHOST/stream
to typical format:
  rtmp://ip/app/stream?vhost=VHOST

This is used for some legacy devices, which does not
support standard HTTP url query string.

PICK b75668b509

---------

Co-authored-by: chundonglinlin <chundonglinlin@163.com>
Co-authored-by: john <hondaxiao@tencent.com>
2023-02-23 10:13:18 +08:00
john
7839c667af SRT: Reduce latency to 200ms of srt2rtc.conf (#3409)
PICK 64fa116c65

Co-authored-by: winlin <winlin@vip.126.com>
Co-authored-by: chundonglinlin <chundonglinlin@163.com>
2023-02-12 16:23:57 +08:00
chundonglinlin
d1dec927d9 Config: Error when both HLS and HTTP-TS enabled. (#3400)
PICK 5b001fe344

Co-authored-by: winlin <winlin@vip.126.com>
Co-authored-by: john <hondaxiao@tencent.com>
2023-02-08 20:48:42 +08:00
Haibo Chen
a970bfd2a3 HLS: support kick-off hls client (#3371)
* HLS: support kick-off hls client
* Refine error response when reject HLS client.
* Rename SrsM3u8CtxInfo to SrsHlsVirtualConn
* Update release v5.0.139 v6.0.21

PICK 7e83874af0

---------

Co-authored-by: winlin <winlin@vip.126.com>
Co-authored-by: john <hondaxiao@tencent.com>
2023-01-29 11:43:04 +08:00
john
d6477c24d6 RTC: fix rtc publisher pli cid (#3318)
* RTC: fix rtc publisher pli cid
* RTC: log bridge request keyframe
* Update release v6.0.19 v5.0.138

PICK 7922057467

Co-authored-by: Winlin <winlin@vip.126.com>
Co-authored-by: ChenGH <chengh_math@126.com>
2023-01-19 10:55:16 +08:00
panda
9600e495c7 Rewrite research/api-server code by Go, remove Python. (#3382)
* support api-server golang

* Update release to v6.0.18 and v5.0.137

PICK 81566868bf

Co-authored-by: winlin <winlin@vip.126.com>
Co-authored-by: chundonglinlin <chundonglinlin@163.com>
Co-authored-by: ChenGH <chengh_math@126.com>
2023-01-18 13:14:26 +08:00
john
4a31b2ea1f SRT: fix crash when srt_to_rtmp off (#3386)
* SRT: fix crash when srt_to_rtmp off
* Release v5.0.136 v6.0.17

PICK c5ccee1edf

Co-authored-by: chundonglinlin <chundonglinlin@163.com>
2023-01-18 08:54:01 +08:00
chundonglinlin
be8b1b94a6 API: Support server/pid/service label for exporter and api. (#3385)
* Exporter: Support server/pid/service.(#3378)
* API: Support return server/pid/service.(#3378)
* Use 8-length service id.
* Update release v5.0.135 v6.0.16

PICK 02653ce2aa

Co-authored-by: winlin <winlin@vip.126.com>
Co-authored-by: Haibo Chen <495810242@qq.com>
2023-01-18 07:28:25 +08:00
Haibo Chen
9bf45bea01 GB: Fix PSM parsing indicator bug. v5.0.134 (#3383)
PICK a78936f517

Co-authored-by: pengfei.ma <pengfei.ma@ctechm.com>
Co-authored-by: chundonglinlin <chundonglinlin@163.com>
2023-01-17 13:05:35 +08:00
stone
25eb21efe8
Improve file writer performance by fwrite with cache. v5.0.133 (#3308)
* SrsFileWriter leverages libc buffer to boost dvr write speed.

* Refactor SrsFileWriter to use libc file functions mockable

* Add utest and refine code.

Co-authored-by: winlin <winlin@vip.126.com>
2023-01-08 12:05:37 +08:00
Winlin
e655948e96 DVR: Support blackbox test based on hooks. v5.0.132 (#3365) 2023-01-07 21:33:02 +08:00
winlin
a27ce1d50f FFmpeg: Support build with FFmpeg native opus. v5.0.131 (#3140) 2023-01-06 17:44:00 +08:00
winlin
3612473516 CORS: Refine HTTP CORS headers. v5.0.130 2023-01-05 20:25:38 +08:00
winlin
d02b942263 SRS4: Security: Enable CIDR for allow/deny play/publish. (#2914)
PICK 55ca61ec9c
2023-01-03 17:09:47 +08:00
winlin
3b59972a90 Add blackbox test for HLS and MP3 codec. v5.0.129 (#296) (#465) 2023-01-03 16:49:59 +08:00
Winlin
2141d220b4
Test: Support blackbox test by FFmpeg. v5.0.128 (#3355)
1. Enable blackbox test for each PR and push.
2. Refine Makefile and README for srs-bench.
3. Add blackbox using FFmpeg and ffprobe.
4. Add blackbox basic test for RTMP stream.
5. Add blackbox basic test for HTTP-FLV stream.
6. Fix utest rand seed issue.
2023-01-02 15:33:17 +08:00
ChenGH
dd0f398296
Asan: Disable asan for CentOS and use statically link if possible. v5.0.127 (#3347) (#3352)
* Asan: Disable asan for CentOS and use statically link if possible. v5.0.127 (#3347)

1. Disable asan for all CentOS by default, however user could enable it.
2. Link asan statically if possible.

* Update version to v5.0.127

Co-authored-by: winlin <winlin@vip.126.com>
2023-01-02 14:57:47 +08:00
winlin
02a18b328c MP3: Upgrade mpegts.js to support HTTP-TS with mp3. v5.0.126 (#296) 2023-01-01 20:15:00 +08:00
Haibo Chen
3727d0527c
API: Fix duplicated on_stop callback event bug. (#3349)
* fix hls bug:Duplicated on_stop callback

* improve utest

* Refine magic number.

* API: Fix duplicated on_stop callback event bug. v5.0.125

Co-authored-by: winlin <winlin@vip.126.com>
2023-01-01 19:24:50 +08:00
winlin
7750bdae10 GB28181: Enable regression test for gb28181. v5.0.122
1. Build regression test tool for gb28181.
2. Run regression test for gb28181.
3. Format go code and eliminate logs.
4. Change base docker to ubuntu20.
2022-12-31 19:36:49 +08:00
winlin
5559ac25fe Refine configure to guess OS automatically. v5.0.121
1. Guess for macOS and cygwin64.
2. Refine options for configure.
2022-12-31 12:22:06 +08:00
winlin
07a9a005d5 Refine default config file for SRS. v5.0.120
1. Docker use srs.conf and env variables.
2. Show help if run SRS without any options.
3. Do not guess config file, use whatever from user.
2022-12-31 12:21:51 +08:00
winlin
8a0ac8e3a1 FLV: Fix bug for header flag gussing. v5.0.119 (#939) 2022-12-26 17:53:01 +08:00
winlin
37867533cd MP3: Convert RTMP(MP3) to WebRTC(OPUS). v5.0.118 (#296) (#3340) 2022-12-26 13:24:07 +08:00
winlin
95defe6dad MP3: Support dump stream information. v5.0.117 (#296) (#3339) 2022-12-25 21:11:08 +08:00
winlin
f6e0b1c894 MP3: Support mp3 for RTMP/HLS/HTTP-FLV/HTTP-TS/HLS etc. v5.0.116 2022-12-25 15:48:48 +08:00
winlin
05d7400cd5 Merge branch v4.0.269 into 5.0release
1. MP3: Fix bug for TS or HLS with mp3 codec. v4.0.269 (#296) (#3333)
2022-12-25 12:10:03 +08:00
Winlin
577cd299e1
MP3: Fix bug for TS or HLS with mp3 codec. v4.0.269 (#296) (#3333)
* MP3: Fix bug for TS or HLS with mp3 codec. v4.0.269 (#296)

1. Refresh HLS audio codec if changed in stream.
2. Refresh TS audio codec if changed in stream.
3. Fix mp3 demux bug in SrsFormat::audio_mp3_demux.
4. Use 3(MPEG1) not 4(MPEG2) as PMT stream type, follow FFmpeg.
5. MP3: Update utest for mp3 sample parsing.
6. MP3: Ignore empty frame sample.
7. UTest: Fix utest failed, do not copy files.
2022-12-25 11:43:26 +08:00
winlin
5dcd6637e3 Fix #3328: Docker: Avoiding duplicated copy files. v5.0.115 2022-12-24 10:22:42 +08:00
Winlin
6f3d6b9b65
GB: Refine lazy object GC. v5.0.114 (#3321)
* GB: Refine lazy object GC.

1. Remove gc_set_creator_wrapper, pass by resource constructor.
2. Remove SRS_LAZY_WRAPPER_GENERATOR macro, use template directly.
3. Remove interfaces ISrsGbSipConn and ISrsGbSipConnWrapper.
4. Remove ISrsGbMediaConn and ISrsGbMediaConnWrapper.

* GC: Refine wrapper constructor.

* GB: Refine lazy object GC. v5.0.114
2022-12-20 19:54:25 +08:00
ChenGH
7eaee46f1f
Asan: Support parse asan symbol backtrace log. v5.0.113 (#3324)
* asan: support parse asan symbol log

* asan: refine srs_parse_asan_backtrace_symbols error code

* asan: Refine code, extract asan log to error file.

Co-authored-by: winlin <winlin@vip.126.com>
2022-12-18 21:14:11 +08:00
john
09a96175e8
SRT: Fix srt to rtmp crash when sps or pps empty. v5.0.112 (#3323)
* SRT: fix crash when sps/pps empty. v5.0.112

Co-authored-by: winlin <winlin@vip.126.com>
2022-12-18 09:52:20 +08:00
Winlin
56040cab42
GB28181: Fix memory overlap for small packets. v5.0.111 (#3315) 2022-12-17 15:05:10 +08:00