feat: 真实连接链路、移除虚拟数据、全量打包脚本
This commit is contained in:
1 parent
31b9a52eb4
commit
34340f4126
16 files changed
+601
-204
No files matched your search
@@ -58,6 +58,23 @@ fn demo_server_handshake_control_and_media_roundtrip() {
|
||||
assert_eq!(pong.sequence(), 1);
|
||||
assert!(matches!(pong.kind, ControlEventKind::Pong(1234)));
|
||||
|
||||
// 主控端主动下发一个 Ping,被控端应能解密并识别。
|
||||
demo_server::send_control(ControlEvent::new(
|
||||
99,
|
||||
ControlEventKind::Ping(4321),
|
||||
))
|
||||
.expect("下发控制帧");
|
||||
let mut downlink = [0u8; 512];
|
||||
let downlink_size = control
|
||||
.read(&mut downlink)
|
||||
.expect("读取主控端下发的控制帧");
|
||||
let (downlink_event, _) = channel
|
||||
.decode(&downlink[..downlink_size])
|
||||
.expect("解密下发控制帧")
|
||||
.expect("完整的下发控制帧");
|
||||
assert_eq!(downlink_event.sequence(), 99);
|
||||
assert!(matches!(downlink_event.kind, ControlEventKind::Ping(4321)));
|
||||
|
||||
let video = UdpSocket::bind("127.0.0.1:0").expect("创建视频 UDP");
|
||||
let video_packet = encode_media_packet(
|
||||
&MediaPacket {
|
||||
|
||||
Reference in new issue
Block a user