其实我刚刚接触3516.
下面给出一个例子,来说明3516如何调用api函数。
HI_S32 hi3516_frame_thresh(HI_U32 PhyAddrSrc,HI_U32 PhyAddrDst,FRAME_SIZE frame_size){
HI_S32 s32Ret = HI_SUCCESS;
IVE_SRC_INFO_S stSrc;
IVE_MEM_INFO_S stDst;
IVE_HANDLE IveHandle;
HI_BOOL bInstant = HI_TRUE;
HI_BOOL bFinish, bBlock;
IVE_THRESH_CTRL_S pstThreshCtrl;
stSrc.enSrcFmt = IVE_SRC_FMT_SINGLE;
stSrc.stSrcMem.u32PhyAddr = PhyAddrSrc;
stSrc.stSrcMem.u32Stride = frame_size.Stride;
stSrc.u32Height = frame_size.Height;
stSrc.u32Width = frame_size.Width;
stDst.u32PhyAddr = PhyAddrDst;
stDst.u32Stride = frame_size.Stride;
pstThreshCtrl.enOutFmt=IVE_THRESH_OUT_FMT_BINARY;
pstThreshCtrl.u32Thresh=30;
pstThreshCtrl.u32MinVal=0;
pstThreshCtrl.u32MaxVal=255;
getstarttime();
s32Ret = HI_MPI_IVE_THRESH(&IveHandle, &stSrc,&stDst, &pstThreshCtrl,bInstant);
//bBlock = HI_FALSE;
bBlock = HI_TRUE;
s32Ret = HI_MPI_IVE_Query(IveHandle, &bFinish, bBlock);
if (HI_SUCCESS == s32Ret){
if(bFinish==HI_TRUE)
printf("Success: %s finished!\n", __FUNCTION__);
else
printf("Success: %s Unfinished!\n", __FUNCTION__);
}
else
printf("Error: %s=%x\n",__FUNCTION__,s32Ret);
getendtime(__FUNCTION__);
return s32Ret;
}
void main()
{
。。。
hi3516_frame_thresh(PhyAddrFilter,PhyAddrThresh,frame_size);
。。。
其中PhyAddrFilter和PyhAddrThresh指向缓存池内存块地址。