示例#1
0
	// OnRtpHandler
	virtual void onReceiveEvent(CRTPData::pointer receiveData, DoRtpHandler::pointer pDoRtpHandler, void * rtpParam)
	{
		BOOST_ASSERT (receiveData.get() != 0);
		if (m_commHandler.get() != NULL)
		{
			// ?
			unsigned long destIp = receiveData->destip();
			unsigned int  destPort = receiveData->destport();
			u_long remoteAddrHash = destIp + destPort;

			cgcRemote::pointer pCgcRemote;
			if (!m_mapCgcRemote.find(remoteAddrHash, pCgcRemote, false))
			{
				pCgcRemote = cgcRemote::pointer(new CcgcRemote(destIp, destPort, (CRemoteHandler*)this, m_pDoRtpHandler));
				m_mapCgcRemote.insert(remoteAddrHash, pCgcRemote);
			}else if (pCgcRemote->isInvalidate())
			{
				m_mapCgcRemote.remove(remoteAddrHash);
				pCgcRemote = cgcRemote::pointer(new CcgcRemote(destIp, destPort, (CRemoteHandler*)this, m_pDoRtpHandler));
				m_mapCgcRemote.insert(remoteAddrHash, pCgcRemote);
			}else
			{
				((CcgcRemote*)pCgcRemote.get())->SetRemote(destIp, destPort);
			}
			CRtpRemoteInfo::pointer pEventData = CRtpRemoteInfo::create(CCommEventData::CET_Recv);
			pEventData->setRemote(pCgcRemote);
			pEventData->setRemoteId(pCgcRemote->getRemoteId());
			pEventData->recvdata(receiveData);
			m_listMgr.add(pEventData);
		}
	}
示例#2
0
void CConferenceInfo::setToMemberFront(CLockList<CMemberData::pointer> & destList, CMemberData::pointer memberData) const
{
	BOOST_ASSERT (memberData.get() != 0);

	CLockList<CMemberData::pointer>::iterator iter;
	for (iter=destList.begin(); iter!= destList.end(); iter++)
	{
		//CMemberData::pointer memberDataTemp = *iter;
		if ((*iter)->getRtpParam() == memberData->getRtpParam())
		{
			destList.insert(iter, memberData);
			return;
		}
	}

	destList.add(memberData);
}