webrtc peerconnection_client peerconnection_server 连接失败问题解决 win10 win11

0 常见问题

(1) webrtc peerconnection_client 连接 peerconnection_server 无连接列表

(2)连接导致崩溃debug状态下因为这个断言 RTC_DCHECK_RUN_ON(&capture_checker_);

1 在 peerconnection\client\main.cc 当中

定义类

class CustomSocketServer : public rtc::PhysicalSocketServer {

public:

bool Wait(webrtc::TimeDelta max_wait_duration, bool process_io) override {

if (!process_io)

return true;

return rtc::PhysicalSocketServer::Wait(webrtc::TimeDelta::Zero(),

+process_io);

}

};

2 在 peerconnection\client\main.cc 当中替换rtc::PhysicalSocketServer ss; 为 CustomSocketServer ss;

//rtc::PhysicalSocketServer ss;

CustomSocketServer ss;

3 在 peerconnection\client\main.cc 当中 // Main loop.之前添加一句话

main_thread.Start();//添加这句话

// Main loop.

MSG msg;

BOOL gm;

while ((gm = ::GetMessage(&msg, NULL, 0, 0)) != 0 && gm != -1) {

if (!wnd.PreTranslateMessage(&msg)) {

::TranslateMessage(&msg);

::DispatchMessage(&msg);

}

}

4 在 \src\modules\video_capture\windows\sink_filter_ds.cc

STDMETHODIMP CaptureInputPin::Receive(IMediaSample* media_sample) {

//RTC_DCHECK_RUN_ON(&capture_checker_);

Debug版本这一行会崩溃,主要是webrtc的线程机制会判断capture_checker_是否处于同一线程,不是则会触发断言,暂时的处理方式可通过屏蔽这行解决崩溃问题。

注意

1 localhost 换成 127.0.0.1

2 本机回环要有obs虚拟摄像头 最好两台电脑跑

相关推荐
福大大架构师每日一题1 天前
RustDesk 1.5.0发布:WebRTC、HDR 色调映射、剪贴板同步与百余项修复全面汇总
webrtc
福大大架构师每日一题6 天前
webrtc-rs/webrtc v0.21.0发布:API 可扩展、异步集成、确定性时间、ICE 重启与 SCTP 全面修复
webrtc
智联视频超融合平台7 天前
WebRTC + AI:实时音视频中嵌入神经网络推理的架构设计
人工智能·webrtc·实时音视频
P1Browser7 天前
换了 IP 还是被关联:WebRTC 泄露本地 IP 的三种触发路径
网络协议·tcp/ip·webrtc
福大大架构师每日一题8 天前
pion/webrtc v4.2.22 最新发布:TCP mux 写缓冲区调整至 4 MB,补齐缺失媒体方向处理
tcp/ip·webrtc·媒体
程序员老陆17 天前
WHIP 与 WHEP:WebRTC 直播的标准化入口与出口
ffmpeg·音视频·webrtc·whip·whep
平行云25 天前
国产GPU云渲染适配实战:驱动兼容、编码调优与多路并发
unity·ue5·webrtc·webgl·实时云渲染·云桌面·像素流送
隐擎fox1 个月前
网络传输安全剖析:WebRTC 本地真实 IP 泄漏机制(STUN/TURN)与 Python 防护检测实战
网络·网络协议·tcp/ip·安全·webrtc
福大大架构师每日一题1 个月前
mediamtx v1.21.0 发布:Media-over-QUIC、RTSP、HLS、WebRTC 与安全能力全面升级
安全·webrtc
脏脏a1 个月前
Neko 自托管实战:WebRTC 远程浏览器、多用户权限与公网访问
webrtc