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; }