i want to change the data in OSD, so that i can develop my own Algorithm,but i failed , my code is :
Sw_osd_ti_alg.c
AlgLink_algProcessData(AlgLink_Obj * pObj)---->AlgLink_OsdalgProcessFrame(AlgLink_OsdObj * pObj, FVID2_Frame *pFrame)------>SWOSD_blendWindow(SWOSD_Obj * hndl)-------> SWOSD_TI_algRun(SWOSD_TI_Obj *swOsdObj, SWOSD_Obj *swOsdCtrl)
my formate is YUV422i
int SWOSD_TI_algRun(SWOSD_TI_Obj *swOsdObj, SWOSD_Obj *swOsdCtrl)
{
UInt8 *pInA;
UInt8 *pInB;
UInt8 test;
UInt32 i=0,j=0;
Bool useDmaManualTrigger = FALSE;
if(swOsdCtrl->videoWindowAddr==NULL || swOsdCtrl->graphicsWindowAddr==NULL)
return SWOSD_EFAIL;
if(swOsdCtrl->globalPrm.globalAlpha==0x00)
{
/* zero alpha, no OSD effectively, just return */
return SWOSD_SOK;
}
pInA = swOsdCtrl->videoWindowAddr;
pInB = swOsdCtrl->graphicsWindowAddr;
pInA += (swOsdCtrl->graphicsWindowPrm.startY * swOsdCtrl->videoWindowPrm.lineOffset);
pInA += (swOsdCtrl->graphicsWindowPrm.startX);
if(swOsdCtrl->videoWindowPrm.lineOffset > 0x7FFF || swOsdCtrl->graphicsWindowPrm.lineOffset > 0x7FFF)
{
useDmaManualTrigger = TRUE;
Vps_printf("This is test point in SWOSD_TI_algRun!!! ********useDmaManualTrigger is ture**************************\n");
}
if (swOsdCtrl->globalPrm.globalAlpha >= 0x80)
swOsdCtrl->globalPrm.globalAlpha = 0x7F;
if(swOsdCtrl->globalPrm.globalAlpha>=0x80)
{
/* unity alpha, no blending needed, just copy the buffer */
return SWOSD_TI_algDmaCopy(swOsdObj, swOsdCtrl, pInA, pInB, useDmaManualTrigger);
}
for(i=0;i<1080;i++)
{
for(j=0;j<1920*2;j++)
{
if(j%2!=0)
*(pInA+j)=0x80; // for gray
else
*(pInA+j)=0x80; // for gray
}
pInA += (swOsdCtrl->videoWindowPrm.lineOffset);
}
SWOSD_TI_algBlendFrame
(
swOsdObj,
pInA, pInB, pInA,
swOsdCtrl->graphicsWindowPrm.width,
swOsdCtrl->graphicsWindowPrm.height,
swOsdCtrl->videoWindowPrm.lineOffset,
swOsdCtrl->graphicsWindowPrm.lineOffset,
swOsdCtrl->videoWindowPrm.lineOffset,
useDmaManualTrigger
);
return SWOSD_SOK;
}
my trouble is here
for(i=0;i<1080;i++)
{
for(j=0;j<1920*2;j++)
{
if(j%2!=0)
*(pInA+j)=0x80; // for gray
else
*(pInA+j)=0x80; // for gray
}
pInA += (swOsdCtrl->videoWindowPrm.lineOffset);
}
from above , i can get the right reslut which is all gray.
but when i change it like this
for(i=0;i<1080;i++)
{
for(j=0;j<1920*2;j++)
{
if(j%2!=0)
*(pInA+j)=0x80; // for gray
}
pInA += (swOsdCtrl->videoWindowPrm.lineOffset);
}
trouble is coming , i can not get the gray video ,and there is no video on screen, all screen is black
also i have another try , that i change code like
for(i=0;i<1080;i++)
{
for(j=0;j<1920*2;j++)
{
if(j%2!=0)
*(pInA+j)=0x80; // for gray
else
*(pInA+j)=0x90 ; // for gray
}
pInA += (swOsdCtrl->videoWindowPrm.lineOffset);
}
also there is no video on screen ,all screen is black . it seems that *(pInA+j) in "f(j%2!=0)" and in "else"should be equal , or there is no video on screen , why ?? help me