Commit Graph

74 Commits

Author SHA1 Message Date
Miau Lightouch
a9e0e1a81e
fix(webrtc): fix GStreamer WHEP interop (#4720)
Some checks failed
Android / build (push) Has been cancelled
CodeQL / Analyze (cpp) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
Docker / build (push) Has been cancelled
DockerPy / build (push) Has been cancelled
Linux / build (push) Has been cancelled
Linux_Python / build (push) Has been cancelled
macOS / build (push) Has been cancelled
macOS_Python / build (push) Has been cancelled
Windows / build (push) Has been cancelled
Windows_Python / build (push) Has been cancelled
## Summary

This PR fixes GStreamer interoperability issues during WebRTC/WHEP
negotiation with ZLMediaServer.

GStreamer could fail to establish the connection for two separate
reasons:

1. ZLMediaServer generated a non-compliant ICE `ufrag`. The generated
value contained `_`, which is not a valid ICE character, so GStreamer
rejected the SDP.
2. ZLMediaServer did not correctly handle `bundle-only` offers and could
answer an accepted bundled m-line with `port=0`, which caused the later
WHEP negotiation to fail.

## Changes

- Generate ICE `ufrag` values using ICE-compliant characters only.
- Preserve and handle `a=bundle-only` correctly during SDP parsing and
answer generation.
- Return `port=9` instead of `port=0` for accepted bundled m-lines.
- Add regression coverage for `bundle-only` SDP handling.
- URL-encode `delete_webrtc` query parameters in the returned `Location`
header so ICE-safe identifiers remain round-trippable over HTTP.

## Validation

- Built with WebRTC and SCTP enabled.
- Added regression test: `test_webrtc_regression`
- Verified:
  - ICE-safe identifier round-trip through `delete_webrtc`
  - `bundle-only` SDP answer generation
2026-04-21 11:37:08 +08:00
xia-chu
5165ac4f74 初步支持语音双向对讲webrtc插件
Some checks are pending
Android / build (push) Waiting to run
CodeQL / Analyze (cpp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
Docker / build (push) Waiting to run
Linux / build (push) Waiting to run
macOS / build (push) Waiting to run
Windows / build (push) Waiting to run
2025-11-25 22:59:58 +08:00
baigao-X
3fb43c5fef
feat: 增加webrtc代理拉流 (#4389)
Some checks failed
Android / build (push) Has been cancelled
CodeQL / Analyze (cpp) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
Docker / build (push) Has been cancelled
Linux / build (push) Has been cancelled
macOS / build (push) Has been cancelled
Windows / build (push) Has been cancelled
- 增加客户端模式,支持主动拉流、推流:
   - addStreamProxy接口新增支持whep主动拉流,拉流地址目前只兼容zlm的whep url。
   - addStreamPusherProxy接口新增支持whip主动推流,推流地址目前只兼容zlm的whip url。
   - 以上推流url格式为webrtc[s]://server_host:server_port/app/stream_id?key=value, 内部会自动转换为http[s]://server_host:server_port/index/api/[whip/whep]?app=app&stream=stream_id&key=value。

- 增加WebRtc p2p 模式:
  - 增加 ICE FULL模式。
  - 增加STUN/TURN 服务器。
  - 增加websocket 信令。
  - 增加P2P代理拉流。

---------

Co-authored-by: xia-chu <771730766@qq.com>
Co-authored-by: mtdxc <mtdxc@126.com>
Co-authored-by: cqm <cqm@97kid.com>
2025-09-20 16:23:30 +08:00
alex
4152dcd409
AI automatically translates all comments in the code into English (#3917) 2024-09-19 14:53:50 +08:00
xiongziliang
7aaafa18e7 Format code 2024-03-23 23:08:10 +08:00
夏楚
bbe8f4a018
release 8.0 2023-12-09 16:23:51 +08:00
mtdxc
754073918a
Header refactor (#2115)
* 优化MultiMediaSourceMuxer头文件包含

* 将MediaSinkDelegate和Demux移到MediaSink中

* MediaSource头文件重构, 独立出PacketCache.h
精简Frame和Track的头文件

* Rtmp头文件重构

* Rtsp头文件重构

* webrtc头文件重构

* 规范.h头文件包含,并将其移到.cpp中:
- 尽量不包含Common\config.h
- Util\File.h
- Rtsp/RtspPlayer.h
- Rtmp/RtmpPlayer.h

* 删除多余的Stamp.h和Base64包含
2022-11-29 11:07:13 +08:00
ziyue
0b355759de 整理webrtc相关代码命名空间 2022-09-18 21:03:05 +08:00
Dw9
b7ef766701
支持单独的datachannel通道 (#1894)
* 支持单独的datachannel 通道

* 当仅有datachannel时 ,忽略rtp和rtcp超时

* 单独开启datachannel时,通过dtls包维持心跳

Co-authored-by: xiongziliang <771730766@qq.com>
2022-08-20 10:28:19 +08:00
bin-work
2e1a45895a
修改webrtc码率带宽约束字段 (#1771, #1768) 2022-07-07 16:44:42 +08:00
sha-long-ba-si
3a9408bcec
webrtc answer m-lines次序错误 (#1695)
Co-authored-by: james <mrjamesli@126.com>
2022-06-11 12:26:31 +08:00
xiongziliang
b0f0bdb6ae 调整优化webrtc sdp处理相关代码 2022-05-20 22:14:21 +08:00
cqm
2b29e58f71 sdp代码重构, 增加addItem和addAttr 2022-05-18 18:56:09 +08:00
xiongziliang
1ed793fe97 初步实现webrtc datachannel sdp握手 2022-04-03 17:12:23 +08:00
夏楚
c72cf4cbcc
整理命名空间 (#1409)
* feat: remove using namespace mediakit in header files.

(cherry picked from commit d44aeb339a8a0e1f0455be82b21fe4b1b536299f)

* feat: remove using namespace mediakit in FFmpegSource.h

* feat: remove using namespace mediakit in RtpExt.h

* feat: remove using namespace mediakit in header files.

* feat: remove using namespace std in header files.

* feat: remove using namespace std in header files when zltoolkit remove std in header

* 补充命名空间

* 整理命名空间

* 整理命名空间2

* 修复macos ci

* 修复编译问题

* 修复编译问题2

* 修复编译问题3

Co-authored-by: Johnny <hellojinqiang@gmail.com>
Co-authored-by: Xiaofeng Wang <wasphin@gmail.com>
2022-02-02 20:34:50 +08:00
ziyue
fb97c2139a Refine: 优化webrtc sdp处理代码 2021-11-18 21:36:10 +08:00
ziyue
9433a0c383 重写webrtc sdp校验逻辑,确保无有效track时抛异常:#1157 2021-10-16 16:46:05 +08:00
ziyue
b2bec61932 webrtc rtp扩展(extmap)支持方向设定 2021-10-14 16:18:15 +08:00
ziyue
acbe99cb43 整理优化webrtc ssrc与simulcast相关代码 2021-10-12 21:26:01 +08:00
ziyue
fbc5378058 合并webrtc相关pr:#1154 2021-10-12 17:32:22 +08:00
Johnny
0f4289a584 Refine(webrtc/sdp): 函数 WebRtcTransport::onCheckSdp() 拆分为WebRtcTransport::onCheckAnswer() 和 RtcSession::checkSdp() 2021-10-12 16:15:37 +08:00
ziyue
d62cdd81b8 webrtc不支持的mline设置为inactive 2021-07-07 17:58:29 +08:00
ziyue
6220db77e8 修复webrtc纯音频推流时不能注册流的bug:#963 2021-07-07 14:47:41 +08:00
xiongziliang
f6eb84b413 添加ssrc相关方法 2021-05-16 12:28:50 +08:00
xia-chu
d4ce5b0091 添加ssrc相关的方法 2021-05-10 17:35:22 +08:00
xia-chu
985fe310b6 extmap改回vector存放 2021-05-10 10:14:42 +08:00
xiongziliang
47dc661bb2 初步兼容simulcast 2021-05-08 20:27:46 +08:00
xia-chu
e81d91988d 完善sdp对ssrc的处理 2021-05-08 18:43:22 +08:00
xia-chu
c5fff23040 extmap改用map存放 2021-05-07 14:08:43 +08:00
xia-chu
cd96267dc8 extmap相关设置改成枚举 2021-05-07 14:02:03 +08:00
xia-chu
521d9f906b 完善remb相关控制代码 2021-05-06 10:40:21 +08:00
xia-chu
c77c4cfd4d sdp相关特性暴露成常量 2021-04-30 15:15:35 +08:00
xia-chu
dc2c882994 添加remb开关 2021-04-30 15:08:43 +08:00
xia-chu
726e909601 支持remb控制推流比特率 2021-04-28 15:41:36 +08:00
xia-chu
9396270ce2 添加twcc相关api 2021-04-28 15:07:15 +08:00
xia-chu
26cd5660cd sdp返回真实ip和端口 2021-04-27 01:16:01 +08:00
xia-chu
48338af700 完善FCI相关代码 2021-04-23 15:06:55 +08:00
xia-chu
cc5dee0abf 优化sdp fmtp字段处理逻辑 2021-04-15 19:40:17 +08:00
xiongziliang
5b7974a522 添加版权信息 2021-04-09 20:44:47 +08:00
xiongziliang
b5e6c12ee8 H264 profile比对不区分大小写 2021-04-06 23:46:45 +08:00
xiongziliang
a42b56ba94 兼容Firefox 2021-04-06 22:51:16 +08:00
ziyue
8edd093d68 添加bom头 2021-04-06 17:23:13 +08:00
xiongziliang
6070654860 rtc播放时,比对采样率等信息 2021-04-04 23:58:59 +08:00
xiongziliang
8c460bfcff 基本完成rtc转rtsp 2021-04-02 23:01:58 +08:00
ziyue
9a2f2cbf2e 完善rtsp sdp匹配 2021-04-02 18:28:01 +08:00
ziyue
7110dc75ae 整理代码 2021-04-02 17:08:11 +08:00
ziyue
33d2e71368 合并代码,去除冗余代码 2021-04-02 16:23:40 +08:00
ziyue
4853a5af48 完善answer代码 2021-04-01 11:02:09 +08:00
ziyue
83208b0b31 完善 2021-04-01 10:35:31 +08:00
ziyue
868b379a12 完善answer sdp代码 2021-04-01 10:09:50 +08:00