您的位置:首页 > 编程语言 > PHP开发

Jrtplib学习分析与记录5.2

2010-12-30 18:35 429 查看
Rtppollthread.cpp

#include "rtppollthread.h"

#ifdef RTP_SUPPORT_THREAD

#include "rtpsession.h"
#include "rtcpscheduler.h"
#include "rtperrors.h"
#include "rtprawpacket.h"
#include <time.h>

#define LOG_TAG "Rtppollthread"

//#ifndef _WIN32_WCE
//	#include <iostream>
//#endif // _WIN32_WCE

#include "rtpdebug.h"

RTPPollThread::RTPPollThread(RTPSession &session,RTCPScheduler &sched):rtpsession(session),rtcpsched(sched)
{
stop = false;
transmitter = 0;
#if (defined(WIN32) || defined(_WIN32_WCE))
timeinit.Dummy();
#endif // WIN32 || _WIN32_WCE
}

RTPPollThread::~RTPPollThread()
{
Stop();
}

int RTPPollThread::Start(RTPTransmitter *trans)
{
if (JThread::IsRunning())
return ERR_RTP_POLLTHREAD_ALREADYRUNNING;

transmitter = trans;
if (!stopmutex.IsInitialized())
{
if (stopmutex.Init() < 0)
return ERR_RTP_POLLTHREAD_CANTINITMUTEX;
}
stop = false;
if (JThread::Start() < 0)
return ERR_RTP_POLLTHREAD_CANTSTARTTHREAD;
return 0;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: