void CConferenceInfo::doAudioProc(void) { bool bGetTempMember = false; CLockMap<CConferenceMember*, CMemberData::pointer> toSendMembers; CLockList<CMemberData::pointer> memberTemps; while (!m_killed) { CMemberData::pointer memberData; if (bGetTempMember) { if (!memberTemps.front(memberData, true)) { bGetTempMember = false; continue; } }else if (!m_datasa.front(memberData, true)) { #ifdef WIN32 Sleep(20); #else usleep(20000); #endif continue; } CConferenceMember * pDataConferenceMember = (CConferenceMember*)memberData->getRtpParam(); if (pDataConferenceMember->getClosed() || pDataConferenceMember->getAudioHandler() == 0 || pDataConferenceMember->getVideoHandler() == 0) { continue; } BOOST_ASSERT (pDataConferenceMember->getAudioHandler().get() == memberData->getDoRtpHandler().get()); if (toSendMembers.exist(pDataConferenceMember)) { if (toSendMembers.size() < (unsigned int)countAudioMember()) { setToMemberFront(memberTemps, memberData); bGetTempMember = false; continue; } sendAudioFrame(toSendMembers); toSendMembers.clear(false); } toSendMembers.insert(pDataConferenceMember, memberData); bGetTempMember = !memberTemps.empty(); } }
// cgcOnTimerHandler virtual void OnTimeout(unsigned int nIDEvent, const void * pvParam) { if (++m_nDoCommEventCouter > 120000) { if (!eraseIsInvalidated()) { m_nDoCommEventCouter = 0; } } if (m_commHandler.get() == NULL) return; CRtpRemoteInfo::pointer pCommEventData; if (!m_listMgr.front(pCommEventData)) return; BOOST_ASSERT (pCommEventData->recvdata() != 0); switch (pCommEventData->getCommEventType()) { case CCommEventData::CET_Recv: m_commHandler->onRecvData(pCommEventData->getRemote(), pCommEventData->recvdata()->data(), pCommEventData->recvdata()->size()); break; default: break; } }