还请大牛帮我看下问题出在什么地方,找了好久毛病不知道是出在哪里…..
出错信息如下:
[host]********** FULL FEATURE USECASE ********
[host] ********* Entered Tri Streaming usecase – H264 1080p @60fps + H264 D1 @30fps + MJPEG 1080p @5fps ********
[host] 136: MCFW : CPU Revision [ES1.0] !!!
[host] 137: MCFW : Detected [UNKNOWN] Board !!!
[host] 137: MCFW : Base Board Revision [REV A] !!!
[host] wh test a8 the capturePram initialize finished!!!!!!!!!!!!
[m3vpss ] VPS_DCTRL_INST_0 [m3vpss ] IOCTL_VPS_DCTRL_SET_VENC_OUTPUT SYSTEM_DC_VENC_DVO2
[m3vpss ] IOCTL_VPS_DCTRL_SET_VENC_OUTPUT SYSTEM_DC_VENC_HDMI
[m3vpss ] IOCTL_VPS_DCTRL_SET_VENC_OUTPUT SYSTEM_DC_VENC_SD
[m3vpss ] IOCTL_VPS_DCTRL_SET_VENC_OUTPUT SYSTEM_DC_VENC_HDCOMP
[m3vpss ] IOCTL_VPS_DCTRL_SET_VENC_CLK_SRC VPS_DC_VENC_HDMI | VPS_DC_VENC_HDCOMP
[m3vpss ] HDCOMPCLK
[m3vpss ] 2435: CAPTURE: Create in progress !!!
[m3vpss ] 2472: CAPTURE: VIP0 PortA capture mode is [16-bit, Non-mux Discrete Sync – HSYNC_VSYNC] !!! [m3vpss ] wh test 5 Get the matching driver object in FVID2_create for break!!!!!
[m3vpss ] wh test a
[m3vpss ] wh test b
[m3vpss ] wh test c
[m3vpss ] wh test c1 [m3vpss ] wh test c4 [m3vpss ] wh test g
[m3vpss ] 2473: Assertion @ Line: 676 in links_m3vpss/capture/captureLink_drv.c: pInst->captureVipHandle != NULL : failed !!
出错是在这个函数:
pInst->captureVipHandle = FVID2_create(FVID2_VPS_CAPT_VIP_DRV,
pInst->instId,
pVipCreateArgs,
&pInst->createStatus, &pInst->cbPrm);
UTILS_assert(pInst->captureVipHandle != NULL); //wh if()==0 ,printf
追踪了函数内部,一般的FVID2创建成功根据自己加的prinf都是走的a->b->e(包括cameralink的创建), 但是capturelink创建的时候,走的是a->b->c->g;第一个问题是这个回调参数有些问题,if (NULL != cbParams),我强制性的把cbParams参数传递时设置为NULL,,还是会创建失败.无法进入到到if (NULL != drvHandle)中.
FVID2_Handle FVID2_create(UInt32 drvId,
UInt32 instanceId,
Ptr createArgs,
Ptr createStatusArgs,
const FVID2_CbParams *cbParams)
{
UInt32 cnt;
Fdm_Driver *drv = NULL;
Fdrv_Handle drvHandle = NULL;
Fdm_Channel *channel = NULL;
UInt32 cookie;
FVID2_DrvCbParams fdmCbParams, *tempCbParams;
/* Get the matching driver object */
for (cnt = 0u; cnt < FDM_NUM_DRIVER_OBJECTS; cnt++)
{
if (TRUE == gFdmDriverObjects[cnt].isUsed)
{
/* Check for NULL pointers */
GT_assert(FdmTrace, (NULL != gFdmDriverObjects[cnt].drvOps));
if (drvId == gFdmDriverObjects[cnt].drvOps->drvId)
{
drv = &gFdmDriverObjects[cnt];
/* Allocate channel object */
channel = fdmAllocChannelObject();
Vps_printf("wh test 5 Get the matching driver object in FVID2_create for break!!!!!\n"); // wh
break;
}
}
}
if (NULL != channel)
{
Vps_printf("wh test a \n"); // wh
if (NULL != drv->drvOps->create)
{
Vps_printf("wh test b \n");
if (NULL != cbParams)
{
Vps_printf("wh test c \n"); // wh
if (NULL != cbParams->cbFxn)
{
Vps_printf("wh test c1 \n"); // wh
fdmCbParams.fdmCbFxn = fdmDriverCbFxn;
}
else
{
Vps_printf("wh test c2 \n"); // wh
fdmCbParams.fdmCbFxn = NULL;
}
if (NULL != cbParams->errCbFxn)
{
Vps_printf("wh test c3 \n"); fdmCbParams.fdmErrCbFxn = fdmDriverErrCbFxn;
}
else
{
Vps_printf("wh test c4 \n"); fdmCbParams.fdmErrCbFxn = NULL;
}
fdmCbParams.errList = cbParams->errList;
fdmCbParams.fdmData = channel;
fdmCbParams.reserved = cbParams->reserved;
tempCbParams = &fdmCbParams;
}
else
{
tempCbParams = NULL;
}
/* Call the driver's create function */
drvHandle = drv->drvOps->create(
drvId,
instanceId,
createArgs,
createStatusArgs,
tempCbParams);
}
else
{
Vps_printf("wh test d \n"); // wh
GT_0trace(FdmTrace, GT_ERR, "Driver Ops not supported!!\n");
}
if (NULL != drvHandle)
{
Vps_printf("wh test e \n"); // wh
cookie = Hwi_disable(); /* Disable global interrupts */
drv->numOpens++;
Hwi_restore(cookie); /* Restore global interrupts */
channel->drv = drv;
channel->drvHandle = drvHandle;
channel->cbParams.cbFxn = NULL;
channel->cbParams.errCbFxn = NULL;
channel->cbParams.errList = NULL;
channel->cbParams.appData = NULL;
channel->cbParams.reserved = NULL;
if (NULL != cbParams)
{
Vps_printf("wh test f \n"); // wh
channel->cbParams.cbFxn = cbParams->cbFxn;
channel->cbParams.errCbFxn = cbParams->errCbFxn;
channel->cbParams.errList = cbParams->errList;
channel->cbParams.appData = cbParams->appData;
channel->cbParams.reserved = cbParams->reserved;
}
}
else
{
Vps_printf("wh test g \n"); // wh
GT_0trace(FdmTrace, GT_ERR, "Driver create failed!!\n");
/* Free the allocated channel object */
fdmFreeChannelObject(channel);
channel = NULL;
}
}
else
{
Vps_printf("wh test h \n"); // wh
GT_0trace(FdmTrace, GT_ERR,
"EALLOC: Channel object allocation failed!!\n");
}
return (channel);
}
在usecase中capturelink的传入参数为:
capturePram.numVipInst =1; //1个采集口
capturePram.tilerEnable =FALSE;
capturePram.enableSdCrop = FALSE; // wh
capturePram.fakeHdMode = FALSE; //wh
capturePram.doCropInCapture = FALSE;
pCaptureInstPrm = &capturePram.vipInst[0];
pCaptureInstPrm->vipInstId = SYSTEM_CAPTURE_INST_VIP0_PORTA;
pCaptureInstPrm->standard = SYSTEM_STD_1080P_60;
pCaptureInstPrm->inDataFormat = SYSTEM_DF_YUV422SP_UV;
pCaptureInstPrm->videoDecoderId =0; pCaptureInstPrm->numOutput = 1;
pCaptureOutPrm = &pCaptureInstPrm->outParams[0];
pCaptureOutPrm->dataFormat =SYSTEM_DF_YUV422SP_UV;
pCaptureOutPrm->scEnable = FALSE;
pCaptureOutPrm->scOutHeight = 1080;
pCaptureOutPrm->scOutWidth = 1920;
pCaptureOutPrm->outQueId = 0;
capturePram.outQueParams[0].nextLink = 0;
Chris Meng:
你好,
建议你参考一下dvr rdk的相关代码,或hdvpss驱动里的例子。
user5347769:
回复 Chris Meng:
谢谢您的回复,请问hdvpss驱动里的例子怎样运行,我直接运行报段错误.还有请问dvr rdk的源码怎样获取呢?