Hi all,
My environment is rdk 03.50.00.05.
Here is my usecase's data flow:
the program crashed when creating the usecase, here is the full crash log:
and the CCS_CRASH_DUMP_VIDEO-M3.txt:
6840.CCS_CRASH_DUMP_VIDEO-M3.txt
my usecase src file:
#define MULTI_DEI_TEST
#ifdef MULTI_DEI_TEST
#include "mcfw/src_linux/mcfw_api/usecases/multich_common.h"
#include "mcfw/src_linux/mcfw_api/usecases/multich_ipcbits.h"
#define ENABLE_FRAMES_EXPORT
// Keeping TILER disabled for 4D1 usecase
#define TILER_ENABLE TRUE;//FALSE
#define DEI_OUT_MAIN_STRAMER (DEI_LINK_OUT_QUE_DEI_SC)
#define DEI_OUT_SUB_STRAMER (DEI_LINK_OUT_QUE_VIP_SC)
#if(defined(TI_814X_BUILD) || defined(DDR_MEM_256M))
#define NUM_CAPTURE_BUFFERS 8
#define NUM_NSF_BUFFERS 4
#define NUM_ENCODE_D1_BUFFERS 4
#define NUM_ENCODE_CIF_BUFFERS 4
#define NUM_DECODE_BUFFERS 4
#define NUM_IPC_OUT_BUFFERS 4
#define NUM_SWMS_MAX_BUFFERS 8
#else
#define NUM_CAPTURE_BUFFERS 8
#define NUM_NSF_BUFFERS 6
#define NUM_ENCODE_D1_BUFFERS 6
#define NUM_ENCODE_CIF_BUFFERS 6
#define NUM_DECODE_BUFFERS 6
#define NUM_IPC_OUT_BUFFERS 6
#define NUM_SWMS_MAX_BUFFERS 8
#endif
#define DEI_INFRAME_RATE (30) //(30)
#define DEI_OUTFRAME_RATE (30) //(30)
#define DEI_OUTFRAME_RATE_SUB (30) //(30)
#define MAX_DEI_NSF_LINK_CHAIN (3)
static SystemVideo_Ivahd2ChMap_Tbl system_IvaChMapTbl_HDEX1002F =
{
.isPopulated = 1,
.ivaMap[0] =
{
.EncNumCh = 1,
.EncChList = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 , 0, 0},
.DecNumCh = 0,
.DecChList = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 , 0, 0},
},
.ivaMap[1] =
{
.EncNumCh = 2,
.EncChList = {2, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 , 0, 0},
.DecNumCh = 0,
.DecChList = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 , 0, 0},
},
.ivaMap[2] =
{
.EncNumCh = 3,
.EncChList = {1, 3, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 , 0, 0},
.DecNumCh = 0,
.DecChList = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 , 0, 0},
},
};
Void MultiCh_createVcapVenc(Adv7441InputPrm *pAdv7441Inputprm)
{
int i_index;
int j_index;
for (i_index = 0;i_index < 3;i_index++)
{
TRACE_LOG("index %d chid %d inputtype %d\n", i_index, pAdv7441Inputprm[i_index].chId, pAdv7441Inputprm[i_index].inputType);
}
if(gVcapModuleContext.vcapConfig.numChn > MAX_DEI_NSF_LINK_CHAIN)
{
TRACE_ERROR("Current usecase only support %d <= %d\n ",
gVcapModuleContext.vcapConfig.numChn, MAX_DEI_NSF_LINK_CHAIN);
}
int i_dei_nsf_link_num = gVcapModuleContext.vcapConfig.numChn;
CaptureLink_VipInstParams *pCaptureInstPrm;
CaptureLink_OutParams *pCaptureOutPrm
CaptureLink_CreateParams capturePrm;
DeiLink_CreateParams deiPrm[MAX_DEI_LINK];
NsfLink_CreateParams nsfPrm[MAX_NSF_LINK];
MergeLink_CreateParams mergePrm[MAX_MERGE_LINK];
IpcLink_CreateParams ipcOutVpssPrm;
IpcLink_CreateParams ipcInVideoPrm;
EncLink_CreateParams encPrm;
IpcBitsOutLinkRTOS_CreateParams ipcBitsOutVideoPrm;
IpcBitsInLinkHLOS_CreateParams ipcBitsInHostPrm[2];
System_LinkInfo bitsProducerLinkInfo;
#ifdef ENABLE_FRAMES_EXPORT
IpcFramesOutLinkRTOS_CreateParams ipcFramesOutVpssToHostPrm;
IpcFramesInLinkHLOS_CreateParams ipcFramesInHostPrm;
IpcFramesOutLinkHLOS_CreateParams ipcFramesOutHostPrm;
IpcFramesInLinkRTOS_CreateParams ipcFramesInVpssFromHostPrm;
System_LinkInfo framesProducerLinkInfo;
#endif
UInt32 vipInstId;
UInt32 i;
VCAP_ADV7441_OUT_PARAMS_S adv7441_outparams[MAX_DEI_NSF_LINK_CHAIN];
//UInt32 j;
MULTICH_INIT_STRUCT(CaptureLink_CreateParams, capturePrm);
for(i_index=0; i_index<i_dei_nsf_link_num; i_index++)
{
MULTICH_INIT_STRUCT(DeiLink_CreateParams, deiPrm[i_index]);
MULTICH_INIT_STRUCT(NsfLink_CreateParams, nsfPrm[i_index]);
}
MULTICH_INIT_STRUCT(IpcLink_CreateParams,ipcOutVpssPrm);
MULTICH_INIT_STRUCT(IpcLink_CreateParams,ipcInVideoPrm);
MULTICH_INIT_STRUCT(EncLink_CreateParams, encPrm);
MULTICH_INIT_STRUCT(IpcBitsOutLinkRTOS_CreateParams,ipcBitsOutVideoPrm);
MULTICH_INIT_STRUCT(IpcBitsInLinkHLOS_CreateParams,ipcBitsInHostPrm[0]);
#ifdef ENABLE_FRAMES_EXPORT
MULTICH_INIT_STRUCT(IpcFramesOutLinkRTOS_CreateParams ,ipcFramesOutVpssToHostPrm);
MULTICH_INIT_STRUCT(IpcFramesInLinkHLOS_CreateParams ,ipcFramesInHostPrm);
MULTICH_INIT_STRUCT(IpcFramesOutLinkHLOS_CreateParams ,ipcFramesOutHostPrm);
MULTICH_INIT_STRUCT(IpcFramesInLinkRTOS_CreateParams ,ipcFramesInVpssFromHostPrm);
#endif
MultiCh_detectBoard();
TRACE_LOG("\n");
System_linkControl(
SYSTEM_LINK_ID_M3VPSS,
SYSTEM_M3VPSS_CMD_RESET_VIDEO_DEVICES,
NULL,
0,
TRUE
);
TRACE_LOG("\n");
if(VSYS_USECASE_MULTICHN_VCAP_VENC_3HD_EX1002F == gVsysModuleContext.vsysConfig.systemUseCase)
{
System_linkControl(
SYSTEM_LINK_ID_M3VIDEO,
SYSTEM_COMMON_CMD_SET_CH2IVAHD_MAP_TBL,
&system_IvaChMapTbl_HDEX1002F,
sizeof(SystemVideo_Ivahd2ChMap_Tbl),
TRUE
);
}
else
{
System_linkControl(
SYSTEM_LINK_ID_M3VIDEO,
SYSTEM_COMMON_CMD_SET_CH2IVAHD_MAP_TBL,
&system_IvaChMapTbl_HDEX1002F,
sizeof(SystemVideo_Ivahd2ChMap_Tbl),
TRUE
);
}
TRACE_LOG("\n");
//----------------------------------------------------------------------------------
gVcapModuleContext.captureId = SYSTEM_LINK_ID_CAPTURE;
gVcapModuleContext.deiId[0] = SYSTEM_LINK_ID_DEI_HQ_0;//---SYSTEM_LINK_ID_DEI_0;
gVcapModuleContext.deiId[1] = SYSTEM_LINK_ID_DEI_0;//---SYSTEM_LINK_ID_DEI_0;
gVcapModuleContext.deiId[2] = SYSTEM_LINK_ID_DEI_1;//---SYSTEM_LINK_ID_DEI_0;
gVcapModuleContext.nsfId[0] = SYSTEM_LINK_ID_NSF_0;//---SYSTEM_LINK_ID_DEI_0;
gVcapModuleContext.nsfId[1] = SYSTEM_LINK_ID_NSF_1;//---SYSTEM_LINK_ID_DEI_0;
gVcapModuleContext.nsfId[2] = SYSTEM_LINK_ID_NSF_2;//---SYSTEM_LINK_ID_DEI_0;
gVcapModuleContext.mergeId[0] = SYSTEM_VPSS_LINK_ID_MERGE_0;//SYSTEM_VPSS_LINK_ID_MERGE_1;
gVcapModuleContext.ipcOutVpssId = SYSTEM_VPSS_LINK_ID_IPC_OUT_M3_0;
gVencModuleContext.ipcM3InId = SYSTEM_VIDEO_LINK_ID_IPC_IN_M3_0;
gVencModuleContext.encId = SYSTEM_LINK_ID_VENC_0;
gVencModuleContext.ipcBitsOutRTOSId = SYSTEM_VIDEO_LINK_ID_IPC_BITS_OUT_0;
gVencModuleContext.ipcBitsInHLOSId = SYSTEM_HOST_LINK_ID_IPC_BITS_IN_0;
#ifdef ENABLE_FRAMES_EXPORT
gVcapModuleContext.ipcFramesOutVpssToHostId = SYSTEM_VPSS_LINK_ID_IPC_FRAMES_OUT_1;
gVcapModuleContext.ipcFramesInHostId = SYSTEM_HOST_LINK_ID_IPC_FRAMES_IN_0;
gVdisModuleContext.ipcFramesOutHostId = SYSTEM_HOST_LINK_ID_IPC_FRAMES_OUT_0;
gVdisModuleContext.ipcFramesInVpssFromHostId = SYSTEM_VPSS_LINK_ID_IPC_FRAMES_IN_0;
#endif
TRACE_LOG("Capture link Params\n");
for(i_index=0; i_index<i_dei_nsf_link_num; i_index++)
{
capturePrm.outQueParams[i_index].nextLink = gVcapModuleContext.deiId[i_index];
}
capturePrm.numVipInst = i_dei_nsf_link_num;
capturePrm.tilerEnable = TRUE;//FALSE;
capturePrm.numBufsPerCh = NUM_CAPTURE_BUFFERS;
capturePrm.maxBlindAreasPerCh = 4;
int standard;
for(vipInstId=0; vipInstId < capturePrm.numVipInst; vipInstId++)
{
pCaptureInstPrm = &capturePrm.vipInst[vipInstId];
pCaptureInstPrm->videoDecoderId = SYSTEM_DEVICE_VID_DEC_TVP7002_DRV;
pCaptureInstPrm->inDataFormat = SYSTEM_DF_YUV422P;
adv7441_outparams[vipInstId].instChId = vipInstId;
#ifdef LPW_DEBUG
standard = Vcap_GetAdv7441Resolution2(&adv7441_outparams[vipInstId], pAdv7441Inputprm[vipInstId]);/**/
#else
standard = Vcap_GetAdv7441Resolution(&adv7441_outparams[vipInstId]);
#endif
TRACE_LOG("VCap Ch cfg to standard %d \n", standard);
if(standard != SYSTEM_STD_INVALID)
{
pCaptureInstPrm->standard = standard;/*SYSTEM_Standard*/
}
else
{
pCaptureInstPrm->standard = SYSTEM_STD_XGA_60;
}
pCaptureInstPrm->numOutput = 1;
pCaptureOutPrm = &pCaptureInstPrm->outParams[0];
if (vipInstId == 0)
{
pCaptureInstPrm->vipInstId = (SYSTEM_CAPTURE_INST_VIP0_PORTA+
vipInstId)%SYSTEM_CAPTURE_INST_MAX;
}
else
{
pCaptureInstPrm->vipInstId = (SYSTEM_CAPTURE_INST_VIP0_PORTB+
vipInstId)%SYSTEM_CAPTURE_INST_MAX;
}
pCaptureOutPrm->outQueId = vipInstId;
pCaptureOutPrm->dataFormat = SYSTEM_DF_YUV422I_YUYV;
pCaptureOutPrm->scEnable = FALSE;
pCaptureOutPrm->scOutWidth = 0;
pCaptureOutPrm->scOutHeight = 0;
}
TRACE_LOG("\n");
int i_dei_cfg_out_index = 0;
for(i_index=0; i_index<i_dei_nsf_link_num; i_index++)
{
deiPrm[i_index].inQueParams.prevLinkId = gVcapModuleContext.captureId;
deiPrm[i_index].inQueParams.prevLinkQueId = i_index ;
deiPrm[i_index].enableLineSkipSc = FALSE;
if (adv7441_outparams[i_index].bInterlaced)
{
deiPrm[i_index].enableDeiForceBypass = FALSE;
}
else
{
deiPrm[i_index].enableDeiForceBypass = TRUE;
}
if(0 == i_index)
{
deiPrm[i_index].inputDeiFrameRate = 60;
deiPrm[i_index].outputDeiFrameRate = 60;
}
else
{
deiPrm[i_index].inputDeiFrameRate = 60;
deiPrm[i_index].outputDeiFrameRate = 60;
}
deiPrm[i_index].outQueParams[DEI_OUT_MAIN_STRAMER].nextLink = gVcapModuleContext.nsfId[i_index];
deiPrm[i_index].outQueParams[DEI_OUT_SUB_STRAMER].nextLink = gVcapModuleContext.mergeId[0];
deiPrm[i_index].enableOut[DEI_OUT_MAIN_STRAMER] = TRUE;
deiPrm[i_index].enableOut[DEI_OUT_SUB_STRAMER] = TRUE;
deiPrm[i_index].tilerEnable[DEI_OUT_MAIN_STRAMER] = TILER_ENABLE;
deiPrm[i_index].comprEnable = FALSE;
deiPrm[i_index].setVipScYuv422Format = FALSE;
deiPrm[i_index].inputFrameRate[DEI_OUT_MAIN_STRAMER] = DEI_INFRAME_RATE;
deiPrm[i_index].outputFrameRate[DEI_OUT_MAIN_STRAMER] = DEI_OUTFRAME_RATE;
deiPrm[i_index].inputFrameRate[DEI_OUT_SUB_STRAMER] = DEI_INFRAME_RATE;
deiPrm[i_index].outputFrameRate[DEI_OUT_SUB_STRAMER] = DEI_OUTFRAME_RATE_SUB;
TRACE_LOG("VCap ch %d DEI %d ������֡��: %d %d ������֡��: %d %d\n",
i_index, i_index, DEI_INFRAME_RATE, DEI_OUTFRAME_RATE,
DEI_INFRAME_RATE, DEI_OUTFRAME_RATE_SUB);
TRACE_LOG("��Ƶͨ�� %d �������ֱ���Auto\n", i_index);
deiPrm[i_index].outScaleFactor[DEI_OUT_MAIN_STRAMER][i_dei_cfg_out_index].scaleMode = DEI_SCALE_MODE_RATIO;
deiPrm[i_index].outScaleFactor[DEI_OUT_MAIN_STRAMER][i_dei_cfg_out_index].ratio.heightRatio.numerator = 1;
deiPrm[i_index].outScaleFactor[DEI_OUT_MAIN_STRAMER][i_dei_cfg_out_index].ratio.heightRatio.denominator = 1;
deiPrm[i_index].outScaleFactor[DEI_OUT_MAIN_STRAMER][i_dei_cfg_out_index].ratio.widthRatio.numerator = 1;
deiPrm[i_index].outScaleFactor[DEI_OUT_MAIN_STRAMER][i_dei_cfg_out_index].ratio.widthRatio.denominator = 1;
TRACE_LOG("��Ƶͨ�� %d ������ %d %d %d\n", i_index,
gVcapModuleContext.vcapConfig.channelParams[i_index].strmResolution[1].scaleMode,
gVcapModuleContext.vcapConfig.channelParams[i_index].strmResolution[1].param_x,
gVcapModuleContext.vcapConfig.channelParams[i_index].strmResolution[1].param_y);
if(1 == gVcapModuleContext.vcapConfig.channelParams[i_index].strmResolution[1].scaleMode)
{
TRACE_LOG("��Ƶͨ�� %d ������ �ֱ���ָ��%d %d\n", i_index,
gVcapModuleContext.vcapConfig.channelParams[i_index].strmResolution[1].param_x,
gVcapModuleContext.vcapConfig.channelParams[i_index].strmResolution[1].param_y);
deiPrm[i_index].outScaleFactor[DEI_OUT_SUB_STRAMER][i_dei_cfg_out_index].scaleMode = DEI_SCALE_MODE_ABSOLUTE;
deiPrm[i_index].outScaleFactor[DEI_OUT_SUB_STRAMER][i_dei_cfg_out_index].absoluteResolution.outWidth = gVcapModuleContext.vcapConfig.channelParams[i_index].strmResolution[1].param_x;
deiPrm[i_index].outScaleFactor[DEI_OUT_SUB_STRAMER][i_dei_cfg_out_index].absoluteResolution.outHeight = gVcapModuleContext.vcapConfig.channelParams[i_index].strmResolution[1].param_y;
}
else
{
TRACE_LOG("��Ƶͨ�� %d ������ �ֱ���AUTO\n", i_index);
deiPrm[i_index].outScaleFactor[DEI_OUT_SUB_STRAMER][i_dei_cfg_out_index].scaleMode = DEI_SCALE_MODE_RATIO;
deiPrm[i_index].outScaleFactor[DEI_OUT_SUB_STRAMER][i_dei_cfg_out_index].ratio.heightRatio.numerator = 1;
deiPrm[i_index].outScaleFactor[DEI_OUT_SUB_STRAMER][i_dei_cfg_out_index].ratio.heightRatio.denominator = 1;
deiPrm[i_index].outScaleFactor[DEI_OUT_SUB_STRAMER][i_dei_cfg_out_index].ratio.widthRatio.numerator = 1;
deiPrm[i_index].outScaleFactor[DEI_OUT_SUB_STRAMER][i_dei_cfg_out_index].ratio.widthRatio.denominator = 1;
}
}
for(i_index=0; i_index<i_dei_nsf_link_num; i_index++)
{
nsfPrm[i_index].inQueParams.prevLinkId = gVcapModuleContext.deiId[i_index];
nsfPrm[i_index].inQueParams.prevLinkQueId = DEI_OUT_MAIN_STRAMER;
nsfPrm[i_index].numOutQue = 1;
nsfPrm[i_index].outQueParams[0].nextLink = gVcapModuleContext.mergeId[0];
nsfPrm[i_index].bypassNsf = TRUE;
nsfPrm[i_index].tilerEnable = TILER_ENABLE;
nsfPrm[i_index].numBufsPerCh = NUM_NSF_BUFFERS;
nsfPrm[i_index].inputFrameRate = 30;
nsfPrm[i_index].outputFrameRate = 30;
}
mergePrm[0].numInQue = 2 * i_dei_nsf_link_num;
for(i_index=0; i_index<i_dei_nsf_link_num; i_index++)
{
mergePrm[0].inQueParams[i_index*2].prevLinkId = gVcapModuleContext.nsfId[i_index];
mergePrm[0].inQueParams[i_index*2].prevLinkQueId = 0;
mergePrm[0].inQueParams[i_index*2 + 1].prevLinkId = gVcapModuleContext.deiId[i_index];
mergePrm[0].inQueParams[i_index*2 + 1].prevLinkQueId = DEI_OUT_SUB_STRAMER;
}
#ifdef ENABLE_FRAMES_EXPORT
mergePrm[0].outQueParams.nextLink = gVcapModuleContext.ipcFramesOutVpssToHostId;
#else
mergePrm[0].outQueParams.nextLink = gVcapModuleContext.ipcOutVpssId;
#endif
mergePrm[0].notifyNextLink = TRUE;
ipcOutVpssPrm.inQueParams.prevLinkQueId = 0;
#ifdef ENABLE_FRAMES_EXPORT
/* Set ipcFramesOutVpss link info */
ipcFramesOutVpssToHostPrm.baseCreateParams.noNotifyMode = TRUE;
ipcFramesOutVpssToHostPrm.baseCreateParams.notifyNextLink = TRUE;//FALSE;
ipcFramesOutVpssToHostPrm.baseCreateParams.notifyPrevLink = TRUE;
ipcFramesOutVpssToHostPrm.baseCreateParams.inQueParams.prevLinkId = gVcapModuleContext.mergeId[0];
ipcFramesOutVpssToHostPrm.baseCreateParams.inQueParams.prevLinkQueId = 0;
ipcFramesOutVpssToHostPrm.baseCreateParams.outQueParams[0].nextLink = gVcapModuleContext.ipcFramesInHostId;
ipcFramesInHostPrm.baseCreateParams.noNotifyMode = TRUE;
ipcFramesInHostPrm.baseCreateParams.notifyNextLink = TRUE;//FALSE;
ipcFramesInHostPrm.baseCreateParams.notifyPrevLink = FALSE;
ipcFramesInHostPrm.baseCreateParams.inQueParams.prevLinkId = gVcapModuleContext.ipcFramesOutVpssToHostId;
ipcFramesInHostPrm.baseCreateParams.inQueParams.prevLinkQueId = 0;
ipcFramesInHostPrm.baseCreateParams.outQueParams[0].nextLink = SYSTEM_LINK_ID_INVALID;
ipcFramesInHostPrm.exportOnlyPhyAddr = TRUE;
ipcFramesInHostPrm.cbCtx = &gVcapModuleContext;
ipcFramesInHostPrm.cbFxn = Vcap_ipcFramesInCbFxn;
ipcFramesOutHostPrm.baseCreateParams.noNotifyMode = TRUE;
ipcFramesOutHostPrm.baseCreateParams.notifyNextLink = TRUE;//FALSE;
ipcFramesOutHostPrm.baseCreateParams.notifyPrevLink = FALSE;
ipcFramesOutHostPrm.baseCreateParams.inQueParams.prevLinkId = SYSTEM_LINK_ID_INVALID;
ipcFramesOutHostPrm.baseCreateParams.inQueParams.prevLinkQueId = 0;
ipcFramesOutHostPrm.baseCreateParams.outQueParams[0].nextLink = gVdisModuleContext.ipcFramesInVpssFromHostId;
#if 1
ipcFramesInVpssFromHostPrm.baseCreateParams.noNotifyMode = TRUE;
ipcFramesInVpssFromHostPrm.baseCreateParams.notifyNextLink = TRUE;
ipcFramesInVpssFromHostPrm.baseCreateParams.notifyPrevLink = FALSE;
ipcFramesInVpssFromHostPrm.baseCreateParams.inQueParams.prevLinkId = gVdisModuleContext.ipcFramesOutHostId;
ipcFramesInVpssFromHostPrm.baseCreateParams.inQueParams.prevLinkQueId = 0;
ipcFramesInVpssFromHostPrm.baseCreateParams.outQueParams[0].nextLink = gVcapModuleContext.ipcOutVpssId;//gVdisModuleContext.swMsId[0];
#endif
ipcOutVpssPrm.inQueParams.prevLinkId = gVdisModuleContext.ipcFramesInVpssFromHostId;
#else
ipcOutVpssPrm.inQueParams.prevLinkId = gVcapModuleContext.mergeId[0];
#endif
#if 1
ipcOutVpssPrm.outQueParams[0].nextLink = gVencModuleContext.ipcM3InId;
ipcOutVpssPrm.numOutQue = 1;
ipcOutVpssPrm.notifyNextLink = TRUE;
ipcOutVpssPrm.notifyPrevLink = TRUE;
ipcOutVpssPrm.noNotifyMode = FALSE;
ipcOutVpssPrm.notifyProcessLink = FALSE;
#endif
ipcInVideoPrm.inQueParams.prevLinkId = gVcapModuleContext.ipcOutVpssId;
ipcInVideoPrm.inQueParams.prevLinkQueId = 0;
ipcInVideoPrm.numOutQue = 1;
ipcInVideoPrm.outQueParams[0].nextLink = gVencModuleContext.encId;
ipcInVideoPrm.notifyNextLink = TRUE;
ipcInVideoPrm.notifyPrevLink = TRUE;
ipcInVideoPrm.noNotifyMode = FALSE;
TRACE_LOG("\n");
{
EncLink_ChCreateParams *pLinkChPrm;
EncLink_ChDynamicParams *pLinkDynPrm;
VENC_CHN_PARAMS_S *pChPrm;
VENC_CHN_DYNAMIC_PARAM_S *pDynPrm;
TRACE_LOG("������ͨ����: %d ������ͨ����: %d MJPEGͨ����: %d\n",
gVencModuleContext.vencConfig.numPrimaryChn,
gVencModuleContext.vencConfig.numSecondaryChn,
gVencModuleContext.vencConfig.numTertiaryChn);
encPrm.inQueParams.prevLinkId = gVencModuleContext.ipcM3InId;
encPrm.inQueParams.prevLinkQueId = 0;
encPrm.outQueParams.nextLink = gVencModuleContext.ipcBitsOutRTOSId;
encPrm.numBufPerCh[0] = NUM_ENCODE_D1_BUFFERS;
encPrm.numBufPerCh[1] = NUM_ENCODE_CIF_BUFFERS;
/* Primary Stream Params - D1 */
for (i=0; i<(gVencModuleContext.vencConfig.numPrimaryChn + gVencModuleContext.vencConfig.numSecondaryChn); i++)
{
pLinkChPrm = &encPrm.chCreateParams[i];
pLinkDynPrm = &pLinkChPrm->defaultDynamicParams;
pChPrm = &gVencModuleContext.vencConfig.encChannelParams[i];
pDynPrm = &pChPrm->dynamicParam;
pLinkChPrm->format = IVIDEO_H264HP;
pLinkChPrm->profile = gVencModuleContext.vencConfig.h264Profile[i];
pLinkChPrm->dataLayout = IVIDEO_FIELD_SEPARATED;
pLinkChPrm->fieldMergeEncodeEnable = FALSE;
pLinkChPrm->enableAnalyticinfo = pChPrm->enableAnalyticinfo;
pLinkChPrm->enableWaterMarking = pChPrm->enableWaterMarking;/*ͼ���Ƿ���ʾˮӡ*/
pLinkChPrm->maxBitRate = pChPrm->maxBitRate;
pLinkChPrm->encodingPreset = pChPrm->encodingPreset;
pLinkChPrm->rateControlPreset = pChPrm->rcType;
pLinkChPrm->enableSVCExtensionFlag = pChPrm->enableSVCExtensionFlag;
pLinkChPrm->numTemporalLayer = pChPrm->numTemporalLayer;
pLinkChPrm->sliceCodingPreset = pChPrm->sliceCodingPreset;
pLinkChPrm->sliceMode = pChPrm->sliceMode;
pLinkChPrm->sliceUnitSize = pChPrm->sliceUnitSize;
TRACE_LOG("Pri ch %d slice params %d %d %d\n",
i, pLinkChPrm->sliceCodingPreset, pLinkChPrm->sliceMode, pLinkChPrm->sliceUnitSize);
pLinkDynPrm->intraFrameInterval = pDynPrm->intraFrameInterval;
pLinkDynPrm->targetBitRate = pDynPrm->targetBitRate;
pLinkDynPrm->interFrameInterval = 1;
pLinkDynPrm->mvAccuracy = IVIDENC2_MOTIONVECTOR_QUARTERPEL;
pLinkDynPrm->inputFrameRate = pDynPrm->inputFrameRate;
pLinkDynPrm->rcAlg = pDynPrm->rcAlg;
pLinkDynPrm->qpMin = pDynPrm->qpMin;
pLinkDynPrm->qpMax = pDynPrm->qpMax;
pLinkDynPrm->qpInit = pDynPrm->qpInit;
pLinkDynPrm->vbrDuration = pDynPrm->vbrDuration;
pLinkDynPrm->vbrSensitivity = pDynPrm->vbrSensitivity;
}
#if 0
/* Secondary Out <CIF> Params */
for (i=gVencModuleContext.vencConfig.numPrimaryChn, j=VENC_PRIMARY_CHANNELS;
i<(gVencModuleContext.vencConfig.numPrimaryChn
+ gVencModuleContext.vencConfig.numSecondaryChn);
i++, j++)
{
pLinkChPrm = &encPrm.chCreateParams[i];
pLinkDynPrm = &pLinkChPrm->defaultDynamicParams;
pChPrm = &gVencModuleContext.vencConfig.encChannelParams[j];
pDynPrm = &pChPrm->dynamicParam;
pLinkChPrm->format = IVIDEO_H264HP;
pLinkChPrm->profile = gVencModuleContext.vencConfig.h264Profile[i];
pLinkChPrm->dataLayout = IVIDEO_FIELD_SEPARATED;
pLinkChPrm->fieldMergeEncodeEnable = FALSE;
pLinkChPrm->enableAnalyticinfo = pChPrm->enableAnalyticinfo;
pLinkChPrm->enableWaterMarking = pChPrm->enableWaterMarking;
pLinkChPrm->maxBitRate = pChPrm->maxBitRate;
pLinkChPrm->encodingPreset = pChPrm->encodingPreset;
pLinkChPrm->rateControlPreset = pChPrm->rcType;
pLinkChPrm->enableSVCExtensionFlag = pChPrm->enableSVCExtensionFlag;
pLinkChPrm->numTemporalLayer = pChPrm->numTemporalLayer;
pLinkDynPrm->intraFrameInterval = pDynPrm->intraFrameInterval;
pLinkDynPrm->targetBitRate = pDynPrm->targetBitRate;
pLinkDynPrm->interFrameInterval = 1;
pLinkDynPrm->mvAccuracy = IVIDENC2_MOTIONVECTOR_QUARTERPEL;
pLinkDynPrm->inputFrameRate = pDynPrm->inputFrameRate;
pLinkDynPrm->qpMin = pDynPrm->qpMin;
pLinkDynPrm->qpMax = pDynPrm->qpMax;
pLinkDynPrm->qpInit = pDynPrm->qpInit;
pLinkDynPrm->vbrDuration = pDynPrm->vbrDuration;
pLinkDynPrm->vbrSensitivity = pDynPrm->vbrSensitivity;
}
#endif
}
ipcBitsOutVideoPrm.baseCreateParams.inQueParams.prevLinkId = gVencModuleContext.encId;
ipcBitsOutVideoPrm.baseCreateParams.inQueParams.prevLinkQueId = 0;
ipcBitsOutVideoPrm.baseCreateParams.numOutQue = 1;
ipcBitsOutVideoPrm.baseCreateParams.outQueParams[0].nextLink = gVencModuleContext.ipcBitsInHLOSId;
TRACE_LOG("\n");
MultiCh_ipcBitsInitCreateParams_BitsOutRTOS(&ipcBitsOutVideoPrm,
TRUE);
TRACE_LOG("\n");
ipcBitsInHostPrm[0].baseCreateParams.inQueParams.prevLinkId = gVencModuleContext.ipcBitsOutRTOSId;
ipcBitsInHostPrm[0].baseCreateParams.inQueParams.prevLinkQueId = 0;
MultiCh_ipcBitsInitCreateParams_BitsInHLOS(&ipcBitsInHostPrm[0]);
TRACE_LOG("\n");
System_linkCreate (gVcapModuleContext.captureId, &capturePrm, sizeof(capturePrm));
TRACE_LOG("\n");
for(i_index=0; i_index<i_dei_nsf_link_num; i_index++)
{
System_linkCreate(gVcapModuleContext.deiId[i_index], &(deiPrm[i_index]), sizeof(DeiLink_CreateParams));
TRACE_LOG("\n");
System_linkCreate(gVcapModuleContext.nsfId[i_index], &(nsfPrm[i_index]), sizeof(NsfLink_CreateParams));
TRACE_LOG("\n");
}
System_linkCreate(gVcapModuleContext.mergeId[0], &mergePrm[0], sizeof(mergePrm[0]));
TRACE_LOG("\n");
System_linkCreate(gVcapModuleContext.ipcOutVpssId, &ipcOutVpssPrm , sizeof(ipcOutVpssPrm) );
#ifdef ENABLE_FRAMES_EXPORT
System_linkCreate(gVcapModuleContext.ipcFramesOutVpssToHostId , &ipcFramesOutVpssToHostPrm , sizeof(ipcFramesOutVpssToHostPrm));
System_linkCreate(gVcapModuleContext.ipcFramesInHostId , &ipcFramesInHostPrm , sizeof(ipcFramesInHostPrm));
System_linkGetInfo(gVcapModuleContext.ipcFramesInHostId,&framesProducerLinkInfo);
OSA_assert(framesProducerLinkInfo.numQue == 1);
ipcFramesOutHostPrm.inQueInfo = framesProducerLinkInfo.queInfo[0];
System_linkCreate(gVdisModuleContext.ipcFramesOutHostId , &ipcFramesOutHostPrm , sizeof(ipcFramesOutHostPrm));
System_linkCreate(gVdisModuleContext.ipcFramesInVpssFromHostId , &ipcFramesInVpssFromHostPrm , sizeof(ipcFramesInVpssFromHostPrm));
#endif
TRACE_LOG("\n");
System_linkCreate(gVencModuleContext.ipcM3InId , &ipcInVideoPrm , sizeof(ipcInVideoPrm) );
TRACE_LOG("\n");
System_linkCreate(gVencModuleContext.encId, &encPrm, sizeof(encPrm));
TRACE_LOG("\n");
System_linkCreate(gVencModuleContext.ipcBitsOutRTOSId, &ipcBitsOutVideoPrm, sizeof(ipcBitsOutVideoPrm));
TRACE_LOG("\n");
System_linkCreate(gVencModuleContext.ipcBitsInHLOSId, &ipcBitsInHostPrm[0], sizeof(ipcBitsInHostPrm[0]));
TRACE_LOG("\n");
System_linkGetInfo(gVencModuleContext.ipcBitsInHLOSId,&bitsProducerLinkInfo);
OSA_assert(bitsProducerLinkInfo.numQue == 1);
printf ("\n\n========bitsProducerLinkInfo============\n");
System_LinkQueInfo *p_queInfo = NULL;
for(i_index=0; i_index<bitsProducerLinkInfo.numQue; i_index++)
{
p_queInfo = &(bitsProducerLinkInfo.queInfo[i_index]);
for(j_index=0; j_index<p_queInfo->numCh; j_index++)
{
printf ("Que [%d] Ch [%d]/[%d] Width %d, Height %d\n",
i_index, j_index, p_queInfo->numCh,
p_queInfo->chInfo[j_index].width,
p_queInfo->chInfo[j_index].height);
}
/*if(p_queInfo->numCh > gVencModuleContext.vencConfig.numPrimaryChn)
{
p_queInfo->numCh = gVencModuleContext.vencConfig.numPrimaryChn;
printf ("Reducing bitsProducerLinkInfo.numCh to %d\n", p_queInfo->numCh);
}*/
}
printf ("\n=================================================\n\n");
TRACE_LOG("Create finish\n");
}
Void MultiCh_deleteVcapVenc()
{
int i_index;
System_linkDelete(gVcapModuleContext.captureId);
TRACE_LOG("Delete %d NumCh\n", gVcapModuleContext.vcapConfig.numChn);
for(i_index=0; i_index<gVcapModuleContext.vcapConfig.numChn; i_index++)
{
System_linkDelete(gVcapModuleContext.deiId[i_index]);
System_linkDelete(gVcapModuleContext.nsfId[i_index]);
}
System_linkDelete(gVcapModuleContext.mergeId[0]);
#ifdef SUPPORT_OSD
System_linkDelete(gVcapModuleContext.ipcFramesOutVpssId[0]);
System_linkDelete(gVcapModuleContext.ipcFramesInDspId[0]);
System_linkDelete(gVcapModuleContext.dspAlgId[0]);
#endif
System_linkDelete(gVcapModuleContext.ipcOutVpssId);
System_linkDelete(gVencModuleContext.ipcM3InId);
System_linkDelete(gVencModuleContext.encId);
System_linkDelete(gVencModuleContext.ipcBitsOutRTOSId);
System_linkDelete(gVencModuleContext.ipcBitsInHLOSId);
#ifdef ENABLE_FRAMES_EXPORT
System_linkDelete(gVcapModuleContext.ipcFramesOutVpssToHostId);
System_linkDelete(gVcapModuleContext.ipcFramesInHostId);
System_linkDelete(gVdisModuleContext.ipcFramesOutHostId);
System_linkDelete(gVdisModuleContext.ipcFramesInVpssFromHostId);
#endif
/* Print the HWI, SWI and all tasks load */
/* Reset the accumulated timer ticks */
MultiCh_prfLoadCalcEnable(FALSE, TRUE, FALSE);
}
#endif
If I disable ENABLE_FRAMES_EXPORT in the source file, the program work fine
the links added for ENABLE_FRAMES_EXPORT are "ipc frames out1", "ipc frames out1", "ipc frames out", "ipc frames in1"
the intent is to save YUV frames data at A8 side.
my question is :
1) why the program crash down?
2) Is there any problem with my usecase?, because when the program work fine, the image of encoded bits have the "offset " problem:
http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/717/t/275328.aspx
Thanks!