int setOsdalpha(simplewidget_screen sws,int x, int y, int w, int h,int a)
{
_simplescreen *scrp = (_simplescreen *) sws;
unsigned short *ptr;
int i;
int j;
int fd;
fd = gOsdFd;
if (!scrp)
return SIMPLEWIDGET_FAILURE;
/* Does the clearing area fit on screen? */
if (y + h > scrp->h || x + w > scrp->w)
{
return SIMPLEWIDGET_FAILURE;
}
ptr = scrp->bufp + y * scrp->w + x;
if(a)
{
/*if(x==0&&w==SCREEN_WIDTH)
{
ptr = scrp->bufp+ y * scrp->w;
memset(ptr, 0xff, w *h* 2);
}
else*/
{
ptr = scrp->bufp + y * scrp->w + x;
for (i = 0; i < h; i++)
{
memset(ptr, 0x80, w * 2);
ptr += scrp->w;
}
}
struct fb_fix_screeninfo fixInfo;
if(ioctl(fd, FBIOGET_FSCREENINFO, &fixInfo) == -1)
{
printf("Failed ioctl FBIOGET_VSCREENINFO on %s\n", OSD_DEVICE);
close(fd);
return FALSE;
}
int s32Ret;
TDE_HANDLE s32Handle;
TDE_SURFACE_S stDst;
TDE_OPT_S stOpt = {0};
/* create a TDE job */
s32Handle = HI_TDE2_BeginJob();
if(HI_ERR_TDE_INVALID_HANDLE == s32Handle)
{
return -1;
}
u8 *pu8PhyAddr[2] = {NULL};
pu8PhyAddr[0] = (u8 *)fixInfo.smem_start;
pu8PhyAddr[1] = pu8PhyAddr[0]+SCREEN_WIDTH*SCREEN_HEIGHT*2;
/* destination bitmap info */
stDst.enColorFmt = TDE_COLOR_FMT_ARGB1555;
stDst.pu8PhyAddr = (u8 *)pu8PhyAddr[workingIdx]+y*SCREEN_WIDTH*2+x*2;
stDst.u16Width = w;
stDst.u16Height = h;
stDst.u16Stride = SCREEN_WIDTH*2;
s32Ret = HI_TDE2_SolidDraw(s32Handle, &stDst, stFillColor, &stOpt);
if(HI_SUCCESS != s32Ret)
{
printf("add soliddraw command failed!\n");
}
else
{
//printf("add soliddraw command success!\n");
}
/* submit the job */
HI_TDE2_EndJob(s32Handle, HI_FALSE, 0);
HI_TDE2_WaitForDone();
}
else
{
/*if(x==0&&w==SCREEN_WIDTH)
{
ptr = scrp->bufp+ y * scrp->w;
memset(ptr, 0, w *h* 2);
}
else*/
{
ptr = scrp->bufp + y * scrp->w + x;
for (i = 0; i < h; i++)
{
memset(ptr, 0, w * 2);
ptr += scrp->w;
}
}
}
return SIMPLEWIDGET_SUCCESS;
}
这是修改后的代码,这是编译器的错误信息
../../common/lib/debug/libui.a(ui.o): In function `setOsdalpha':
ui.c:(.text+0x3a68): undefined reference to `HI_API_TDE_BeginJob'
ui.c:(.text+0x3b10): undefined reference to `HI_API_TDE_SolidDraw'
ui.c:(.text+0x3b28): undefined reference to `HI_API_TDE_EndJob'
ui.c:(.text+0x3b2c): undefined reference to `HI_API_TDE_WaitForDone'
collect2: ld returned 1 exit status
make: *** [tm_ui] 错误 1
欢迎大家踊跃讨论啊,争取解决问题