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

相关推荐
ShaYQ13 小时前
一个WebRTC 分辨率动态爬升问题记录与解决过程
webrtc·srs·动态分辨率·流媒体技术·分辨率爬升
Icoolkj13 小时前
WebRTC 与 WebSocket 的关联关系
websocket·网络协议·webrtc
红米饭配南瓜汤13 小时前
WebRTC中的几个Rtp*Sender
网络·网络协议·音视频·webrtc·媒体
唯独失去了从容20 小时前
WebRTC源码线程-1
webrtc
eguid_14 天前
WebRTC中sdp多媒体会话协议报文详细解读
音视频·webrtc·实时音视频·sdp·sdp交换·ice协商
superconvert5 天前
最快的流媒体服务器搭建 smart_rtmpd
http·webrtc·rtmp·h264·hls·无人直播·dash·rtsp·gb28181·srt·m3u8·vlc·sfu·obs·flv
_可乐无糖5 天前
AWS WebRTC:获取ICE服务地址(part 2): ICE Agent的作用
服务器·网络·webrtc
lqj_本人6 天前
鸿蒙OS&基于UniApp的WebRTC视频会议系统实践:从0到1的HarmonyOS适配之路#三方框架 #Uniapp
uni-app·webrtc·harmonyos
邪恶的贝利亚6 天前
webrtc初了解
webrtc
_可乐无糖7 天前
AWS WebRTC:获取ICE服务地址(part 3):STUN服务和TURN服务的作用
云计算·webrtc·aws