Exemple #1
0
rhkbool allocFrame(page_t *pg, rhkbool isRw,rhkbool isKernel)
{
	if(pg->frame != 0)
	{
		//It means frame is already allocated
		return FALSE;
	}
	else
	{
		uint32_t idx = getFirstFrame();
		
		if(idx == -1)
		{
			//No more frame left
			return FALSE;
		}
		
		setFrame(idx * FRAME_BLOCK_SIZE);
		pg->present = TRUE;
		pg->rw = (isRw)?TRUE:FALSE;
		pg->usermode = (isKernel)?TRUE:FALSE;
		pg->frame = idx;
	}
	return TRUE;
}
TpReceiveTransaction::TpReceiveTransaction(Can *can,/*int transmitDescriptor, int acknowlegmentDescriptor, */QObject *parent) :
    QObject(parent),
    movingFrames (can, parent),
    state (INIT),
    timer()
{
    blockSize = 0;
    consIndex = blockSize;    

    QObject::connect(&movingFrames, SIGNAL(receiveSingleFrame(SingleFrame)), this, SLOT(getSingleFrame(SingleFrame)));
    QObject::connect(&movingFrames, SIGNAL(receiveFirstFrame(FirstFrame)), this, SLOT(getFirstFrame(FirstFrame)));
    QObject::connect(&movingFrames, SIGNAL(receiveConsecutiveFrame(ConsecutiveFrame)), this, SLOT(getConsecutiveFrame(ConsecutiveFrame)));

    QObject::connect(this, SIGNAL(sendFlowControl(FlowControlFrame)), &movingFrames, SLOT(transmitFlowControlFrame(FlowControlFrame)));
    QObject::connect(&timer, SIGNAL(timeout()), this, SLOT(timeout()));
}
void CDirectCamGraphicsView::openVideo(const QString& f_fileName)
{
    m_videoFile = f_fileName;
    getFirstFrame();		
}