Hi Group,
I'm currently using the DM 8168 DVR-RDK 04.01.00.02, and there is a problem as follow:
I use Vsys_registerEventHandler() or Vcap_registerBitsCallback(), but there is no event at all.
I refer to the following:
http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/717/p/348348/1224097.aspx#1224097
http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/717/t/311088.aspx
But no effect. I don't know my code is correct or not. Could you help me ?
My code :
VCAP_CALLBACK_S callback;
Int32 status;
UInt32 chId;
Media_G2_Scd_ChInfo *pChInfo;
UInt32 i;
UInt8 *curVirtAddr;
gMedia_G2_SCDCtrl.chIdTrack = 0;
/* As default layout is 4x4 widnows */
gMedia_G2_SCDCtrl.numberOfWindows = MEDIA_G2_SCD_MAX_CHANNELS;
for(chId=0; chId<VENC_CHN_MAX; chId++)
{
pChInfo = &gMedia_G2_SCDCtrl.chInfo[chId];
pChInfo->chOnMosaic = FALSE;
pChInfo->prevFrameObjects = 0;
pChInfo->prevFramePolygons = 0;
pChInfo->scdVaEvent = 0;
pChInfo->updateStaticObj = FALSE;
pChInfo->initialise = FALSE;
pChInfo->prevWinIdTrack = 0xFF;
pChInfo->gridPresent = FALSE;
pChInfo->updateGrid = FALSE;
pChInfo->enableMotionTracking = FALSE;
pChInfo->enableGpxEvntDisplay = FALSE;
for(i = 0; i<MEDIA_G2_SCD_VA_MAX_POLGON; i++)
{
pChInfo->staticObject[i].presentOnDisplay = FALSE;
}
for(i = 0; i<MEDIA_G2_SCD_VA_MAX_OBJECTS; i++)
{
pChInfo->dynamicObject[i].presentOnDisplay = FALSE;
}
}
gMedia_G2_SCDCtrl.exitWrThr = FALSE;
gMedia_G2_SCDCtrl.isWrThrStopDone = FALSE;
gMedia_G2_SCDCtrl.prevNumberOfWindows = gMedia_G2_SCDCtrl.numberOfWindows;
gMedia_G2_SCDCtrl.startChId = 0;
gMedia_G2_SCDCtrl.layoutUpdated = FALSE;
callback.newDataAvailableCb = Media_G2_bitsWriteCbFxn_SCD;
for(i = 0; i < MEDIA_G2_MAX_SCD_VA_EVENT; i++)
{
status = Vsys_allocBuf(MEDIA_G2_SCD_BUF_HEAP_SR_ID, MEDIA_G2_MAX_SCD_VA_EVENT_GPX_DISPLAY_BUF_SIZE, MEDIA_G2_SCD_BUFFER_ALIGNMENT, &gMedia_G2_SCDCtrl.bufInfo[i]);
OSA_assert(status==OSA_SOK);
curVirtAddr = gMedia_G2_SCDCtrl.bufInfo[i].virtAddr;
switch(i)
{
case MEDIA_G2_SCD_VA_EVT_TZ:
OSA_assert(sizeof(gMCFW_gpxTiScdVaTzRgb_186x14_rgb)<=MEDIA_G2_MAX_SCD_VA_EVENT_GPX_DISPLAY_BUF_SIZE);
memcpy(curVirtAddr, gMCFW_gpxTiScdVaTzRgb_186x14_rgb, sizeof(gMCFW_gpxTiScdVaTzRgb_186x14_rgb));
break;
case MEDIA_G2_SCD_VA_EVT_OC:
OSA_assert(sizeof(gMCFW_gpxTiScdVaOcRgb_186x14_rgb)<=MEDIA_G2_MAX_SCD_VA_EVENT_GPX_DISPLAY_BUF_SIZE);
memcpy(curVirtAddr, gMCFW_gpxTiScdVaOcRgb_186x14_rgb, sizeof(gMCFW_gpxTiScdVaOcRgb_186x14_rgb));
break;
case MEDIA_G2_SCD_VA_EVT_TD:
OSA_assert(sizeof(gMCFW_gpxTiScdVaTdRgb_186x14_rgb)<=MEDIA_G2_MAX_SCD_VA_EVENT_GPX_DISPLAY_BUF_SIZE);
memcpy(curVirtAddr, gMCFW_gpxTiScdVaTdRgb_186x14_rgb, sizeof(gMCFW_gpxTiScdVaTdRgb_186x14_rgb));
break;
case MEDIA_G2_SCD_VA_EVT_IMD:
OSA_assert(sizeof(gMCFW_gpxTiScdVaImdRgb_186x14_rgb)<=MEDIA_G2_MAX_SCD_VA_EVENT_GPX_DISPLAY_BUF_SIZE);
memcpy(curVirtAddr, gMCFW_gpxTiScdVaImdRgb_186x14_rgb, sizeof(gMCFW_gpxTiScdVaImdRgb_186x14_rgb));
break;
default:
break;
}
}
Vcap_registerBitsCallback(&callback,
(Ptr)&gMedia_G2_SCDCtrl);
status = OSA_semCreate(&gMedia_G2_SCDCtrl.wrSem, 1, 0);
OSA_assert(status==OSA_SOK);
status = OSA_thrCreate(
&gMedia_G2_SCDCtrl.wrThrHndl,
Media_G2_bitsWriteMain_SCD,
OSA_THR_PRI_DEFAULT,
0,
&gMedia_G2_SCDCtrl
);
OSA_assert(status==OSA_SOK);
OSA_waitMsecs(100); // allow for print to complete
Thanks for your help !