This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TDA2EG-17: VSDK_0307 : Achieve overlay text, pictures, line drawing , use draw2d api or other method (Not by grpx link)

Part Number: TDA2EG-17

Dear all,

I want draw line by draw2D API

andI I use null_src get buffer information for draw2d api (if not by grpx link)

The following is my approach

I know there is a problem

=====================================================================================

void test_drawline(Chains_csi2CalMultiCam_ViewAppObj *pObj)
{

UInt32 bufCnt;
System_Buffer *pBuffer;
System_VideoFrameBuffer *pVideoFrame;
NullSrcLink_GetBufInfoParams getBufInfoPrm;
Draw2D_Handle pHandle;
Draw2D_BufInfo bufInfo;
Draw2D_LinePrm LinePrm;

getBufInfoPrm.chId = 0U;
System_linkControl(
pObj->ucObj.NullSourceLinkID,
NULL_SRC_LINK_CMD_GET_BUF_INFO, 
&getBufInfoPrm,
sizeof(NullSrcLink_GetBufInfoParams),
TRUE);
//=========================create handle=========================
pHandle = NULL;
Draw2D_create(&pHandle);
//=========================set bufinfo=========================
bufInfo.bufWidth = 1280;
bufInfo.bufHeight = 256;
bufInfo.bufPitch[0] = 1280;
bufInfo.dataFormat = SYSTEM_DF_YUV420SP_UV;
bufInfo.transperentColor = DRAW2D_TRANSPARENT_COLOR;
bufInfo.transperentColorFormat = DRAW2D_TRANSPARENT_COLOR_FORMAT;

//=================================================================
for (bufCnt = 0;bufCnt < getBufInfoPrm.numBuf;bufCnt ++)
{
pBuffer = &getBufInfoPrm.buffer[bufCnt];
pVideoFrame = pBuffer->payload;

//set addres !!!!!!!
bufInfo.bufAddr[0] = (UInt32) pVideoFrame->bufAddr[0];

}

Draw2D_setBufInfo(&pHandle, &bufInfo);


//=========================set lineprm=========================

if(pHandle != NULL)
{

LinePrm.lineSize = 10;
LinePrm.lineColor = RGB888_TO_BGRA444(0, 0, 255, 255);
LinePrm.lineColorFormat = SYSTEM_DF_YUV422I_UYVY;
Draw2D_drawLine(pHandle,10,10,1270,246,&LinePrm);

}

}

=====================================================================================

I get memory error

And I want use Draw2D_drawLine

int32_t Draw2D_drawLine ( Draw2D_Handle  pCtx,
uint32_t  startX,
uint32_t  startY,
uint32_t  endX,
uint32_t  endY,
Draw2D_LinePrm  pPrm 
)

Is there a way to get Draw2d_Handle without grax??

or other get Draw2d_Handle method

I want to achieve overlay text, pictures, line drawing (Not by grpx link)

Any suggestions??

Thanks!!

David