非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
关注
打赏