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虚拟摄像头 最好两台电脑跑

相关推荐
YRYDZFtyVKg14 小时前
光伏MPPT仿真之扰动观察法探索
webrtc
Knight_AL5 天前
WebRTC / HLS / HTTP-FLV 的本质区别与选型指南
网络协议·http·webrtc
runner365.git5 天前
webrtc推流能成为直播的主要方案吗?
webrtc
XHW___0017 天前
RTP/RTCP 基本知识
webrtc·rtp/rtcp
runner365.git7 天前
语言接入大模型,websocket还是webrtc?
websocket·网络协议·webrtc
好多渔鱼好多9 天前
【流媒体协议】WebRTC 技术详解
webrtc
txp玩Linux9 天前
webrtc降噪模块NS源码解析(1)
webrtc
鲲鹏混子鱼10 天前
WebRTC P2P信令服务架构设计文档
网络协议·webrtc·p2p
平行云17 天前
实时云渲染支持数字孪生智能工厂:迈向“零原型”制造
人工智能·unity·ue5·云计算·webrtc·制造·实时云渲染
笔夏18 天前
【安卓学习之webRTC】学习相关资料
android·学习·webrtc