您当前的位置: 首页 > 

qianbo_insist

暂无认证

  • 0浏览

    0关注

    399博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

GB28181 收包方式jrtplib使用方式的差异

qianbo_insist 发布时间:2022-05-18 13:12:49 ,浏览量:0

非thread模式

1 使用非thread和 thread模式对比 在使用正常的情况下,使用jthread 和 比使用 非jthread 模式要节省较多的cpu 以下代码使用自己产生一个线程模式

void RtpServer::run()
{
    Running = true;
    RTPSession sess;
    uint16_t portbase;
    int status;
    RTPUDPv4TransmissionParams transparams;
    RTPSessionParams sessparams;
    sessparams.SetOwnTimestampUnit(1.0 / 9000.0);
    sessparams.SetUsePollThread(true);

    int rtpPort = MEDIASERVER_RTP_PORT;
    portbase = rtpPort;

    transparams.SetRTPReceiveBuffer(1024 * 1024 *100); //100M

    sessparams.SetAcceptOwnPackets(true);
    transparams.SetPortbase(portbase);
    status = sess.Create(sessparams, &transparams);

    if (status             
关注
打赏
1663161521
查看更多评论
0.2271s