示例#1
0
文件: dispatcher.hpp 项目: agom/lsf
    dispatcher(const std::string &file = std::string()) {
        //            |         inputs      |       output          |   node     |
        mdlMap["A"] = {{}                   ,{"data1"}              ,"localhost"};
        mdlMap["B"] = {{"data1"}            ,{"data2"}              ,"localhost"};
        mdlMap["C"] = {{}                   ,{"data3"}              ,"localhost"};
        mdlMap["D"] = {{"data1","data3"}    ,{}                     ,"localhost"};
        mdlMap["E"] = {{"data2"}            ,{"data4","data5"}      ,"localhost"};

        addrMap["data1"] = {{"tcp://*:5563"},{"tcp://" + getDataNode("data1") + ":5563"}};
        addrMap["data2"] = {{"tcp://*:5564"},{"tcp://" + getDataNode("data2") + ":5564"}};
        addrMap["data3"] = {{"tcp://*:5565"},{"tcp://" + getDataNode("data3") + ":5565"}};
        addrMap["data4"] = {{"tcp://*:5566"},{"tcp://" + getDataNode("data3") + ":5566"}};
        addrMap["data5"] = {{"tcp://*:5567"},{"tcp://" + getDataNode("data3") + ":5567"}};
    }
示例#2
0
bool FifoBuffer::read(DhAVFrame* vframe)
{
	EnterCriticalSection(&m_DataAccessLock) ;

	DhAVFrame* item = getDataNode() ;
	if (item == NULL)
	{
		m_bReadNull = true;
		LeaveCriticalSection(&m_DataAccessLock) ;
		return false ;
	}
	m_bReadNull = false;
	vframe->width	= item->width ;
	vframe->height	= item->height ;
	vframe->size	= item->size;
// 	vframe->context = item->context;

	vframe->frameLen  = item->frameLen;
	vframe->frameType = item->frameType; 
	vframe->ivsobjnum = item->ivsobjnum;

	vframe->tIvsPrePos.lInfoSize = 0;

	if ((item->tIvsPrePos.lInfoSize > 0)
		&& (item->tIvsPrePos.pIVSPreposInfo != NULL))
	{
		SAFE_DELETEBUFF(vframe->tIvsPrePos.pIVSPreposInfo);
		vframe->tIvsPrePos.pIVSPreposInfo = new BYTE[item->tIvsPrePos.lInfoSize];
		if (vframe->tIvsPrePos.pIVSPreposInfo != NULL)
		{
			memcpy(vframe->tIvsPrePos.pIVSPreposInfo, 
			item->tIvsPrePos.pIVSPreposInfo, item->tIvsPrePos.lInfoSize);
			vframe->tIvsPrePos.lInfoSize = item->tIvsPrePos.lInfoSize;
		}
		else
		{
			vframe->tIvsPrePos.lInfoSize = 0;
		}		
	}

	if (item->ivsobjnum > 0)
	{
		memcpy(vframe->ivsObjList, item->ivsObjList, sizeof(DH_IVS_OBJ)*vframe->ivsobjnum);
	}

	if (m_chunksize > AUDIOBUFLEN)
	{
		vframe->context = item->context;
		m_dataFrame.context = item->context;
	}
	else
	{
		memcpy(vframe->context, item->context, vframe->size);
	}

	appendToFreeList(item) ;
	
	LeaveCriticalSection(&m_DataAccessLock);

	return true ;
}