metaRTC4.0实现webrtc的datachannel通信

概述

DataChannel作为音视频通信外的另一种通信方式,可以用来进行聊天消息的发送、点对点传送文件等,metaRTC4.0新版本增加了对webrtc的datachannel功能的支持。

datachannel使用sctp协议通信,使用了libusrsctp库进行开发。

下载源码

Release metartc4.009 with 3rdparty and runtime · metartc/metaRTC · GitHubWebrtc SDK for pure C. Contribute to metartc/metaRTC development by creating an account on GitHub.https://github.com/metartc/metaRTC/releases/tag/4.0.009https://gitee.com/metartc/metaRTC/releases/4.0.009icon-default.png?t=M3K6https://gitee.com/metartc/metaRTC/releases/4.0.009

参数配置

metaRTC4.0默认开启datachannel通信

编译

下载的linux和windows版本第三方类库等都有已经编译好的,只要搭建好qt环境,只需要解压并用鼠标操作,几分钟就可以编译好。

熟练开发者推荐自己将第三方类库重新编译。

p2p deme工程metap2p4

点击推拉流连接建立成功后,即可点击SendData按钮发送信息。

推流demo工程metapushstream4

目前支持SFU为zlm,期待srs也早日推出支持datachannel版本。

remark:zlm必须为最新版本

  //using datachannel
    if(m_context->avinfo.sys.mediaServer==Yang_Server_Zlm){
        m_context->avinfo.rtc.usingDatachannel=1;
        m_context->channeldataRecv.context=this;
        m_context->channeldataRecv.receiveData=g_qt_push_receiveData;
    }else{
        m_context->avinfo.rtc.usingDatachannel=0;
    }

猜你喜欢

转载自blog.csdn.net/m0_56595685/article/details/124651692