当前位置: 首页 > news >正文

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

http://www.lryc.cn/news/532716.html

相关文章:

  • 【C++】STL——list的使用与底层实现
  • iOS 音频录制、播放与格式转换
  • 【PyTorch】解决Boolean value of Tensor with more than one value is ambiguous报错
  • Jsoup库具体怎么用?
  • python:如何播放 .spx 声音文件
  • HTML学习笔记(6)
  • 走向基于大语言模型的新一代推荐系统:综述与展望
  • 【DeepSeek-R1 +1.5B】2060显卡ollama本地部署+open-webui界面使用
  • 《翻转组件库之发布》
  • 在深度学习中,样本不均衡问题是一个常见的挑战,尤其是在你的老虎机任务中,某些的中奖倍数较高
  • 语言月赛 202311【基因】题解(AC)
  • unity学习26:用Input接口去监测: 鼠标,键盘,虚拟轴,虚拟按键
  • GB/T 43698-2024 《网络安全技术 软件供应链安全要求》标准解读
  • ASP.NET Core与EF Core的集成
  • 【AI大模型】Ubuntu18.04安装deepseek-r1模型+服务器部署+内网访问
  • SpringAI系列 - 使用LangGPT编写高质量的Prompt
  • Github - 记录一次对“不小心包含了密码的PR”的修复
  • 【玩转 Postman 接口测试与开发2_014】第11章:测试现成的 API 接口(下)——自动化接口测试脚本实战演练 + 测试集合共享
  • 前后端通过docker部署笔记
  • 五十天精通硬件设计第四天-场效应管知识及选型
  • 了解 ALV 中的 field catalog (ABAP List Viewer)
  • 【基于SprintBoot+Mybatis+Mysql】电脑商城项目之修改密码和个人资料
  • 十一、CentOS Stream 9 安装 Docker
  • FreeRTOS学习 --- 中断管理
  • 如何在Intellij IDEA中识别一个文件夹下的多个Maven module?
  • 机器学习模型--线性回归、逻辑回归、分类
  • gitlab个别服务无法启动可能原因
  • react的antd表格数据回显在form表单中
  • 深度分析:网站快速收录与网站内容多样性的关系
  • feign 远程调用详解