コード例 #1
0
void CConferenceInfo::sendVideoFrame(CMemberData::pointer memberData)
{
	BOOST_ASSERT (memberData.get() != 0);

	boost::mutex::scoped_lock lock(m_members.mutex());
	CConferenceMember * pDataConferenceMember = (CConferenceMember*)memberData->getRtpParam();
	if (pDataConferenceMember->getClosed()) return;

	BOOST_ASSERT (pDataConferenceMember->getVideoHandler().get() == memberData->getDoRtpHandler().get());
	CLockMap<void*, CConferenceMember::pointer>::iterator iter;
	for (iter=m_members.begin(); iter!= m_members.end(); iter++)
	{
		// don't send to owner
		//if (pDataConferenceMember == iter->second.get())
		//	continue;

		// member don't receive video
		if (!iter->second->getVideoRecv())
			continue;

		// The user don't receive this member video
		if (iter->second->getRecvIndex() != pDataConferenceMember->getIndex()) 
		{
			continue;
		}

		int timestamp = memberData->getRtpData()->timestamp();
		//int timestamp = 0;
		DoRtpHandler::pointer pDoRtpHandler = iter->second->getVideoHandler();
		pDoRtpHandler->doSendData(memberData->getRtpData()->data(), memberData->getRtpData()->size(), timestamp);
	}
}
コード例 #2
0
void CConferenceInfo::sendAudioFrame(const CLockMap<CConferenceMember*, CMemberData::pointer> & audios)
{
	if (audios.empty()) return;

	boost::mutex::scoped_lock lock(m_members.mutex());
	CLockMap<void*, CConferenceMember::pointer>::iterator iter;
	for (iter=m_members.begin(); iter!= m_members.end(); iter++)
	{
		// member don't receive audio
		if (!iter->second->getAudioRecv())
			continue;

		int timestamp = 0;
		if (mix_member_frame(iter->second, audios, timestamp))
		{
			DoRtpHandler::pointer pDoRtpHandler = iter->second->getAudioHandler();

			long sendSize = 0;
			unsigned char * tempBuffer = 0;
			encode_audio(pDoRtpHandler->doGetMediaType(), iter->second->audioBuffer(), &tempBuffer, sendSize);

			//int timestamp = 0;			
			pDoRtpHandler->doSendData(tempBuffer, sendSize, timestamp);
			delete[] tempBuffer;
		}
	}

}
コード例 #3
0
ファイル: CommRtpServer.cpp プロジェクト: mycp/mycp
	virtual int sendData(const unsigned char * data, size_t size)
	{
		BOOST_ASSERT(data != 0);
		if (isInvalidate()) return -1;

		m_pDoRtpHandler->doClearDest();
		m_pDoRtpHandler->doAddDest(m_destIp, m_destPort);
		return m_pDoRtpHandler->doSendData(data, size, 0);
	}