#include <demos/link_api_demos/common/chains.h>
#include <mcfw/interfaces/ti_venc.h>
#include <demos/link_api_demos/common/chains_ipcFrames.h>
static SystemVideo_Ivahd2ChMap_Tbl systemVid_encDecIvaChMapTbl =
{
.isPopulated = 1,
.ivaMap[0] =
{
.EncNumCh = 10,
.EncChList = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 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 = 0,
.EncChList = {16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31},
.DecNumCh = 12,
.DecChList = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 0, 0 , 0, 0},
},
.ivaMap[2] =
{
.EncNumCh = 6,
.EncChList = {10, 11, 12, 13, 14, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
.DecNumCh = 4,
.DecChList = {12, 13, 14, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
},
};
Void Chains_singleChCapEncSend(Chains_Ctrl *chainsCfg)
{
CaptureLink_CreateParams capturePrm;
CaptureLink_VipInstParams *pCaptureInstPrm;
CaptureLink_OutParams *pCaptureOutPrm;
IpcFramesOutLinkRTOS_CreateParams ipcFramesOutVpssPrm;
IpcFramesInLinkHLOS_CreateParams ipcFramesInDspPrm;
DisplayLink_CreateParams displayPrm;
AlgLink_CreateParams osdPrm;
UInt32 captureId;
UInt32 vipInstId;
UInt32 ipcFramesOutVpssId;
UInt32 ipcFramesInDspId;
UInt32 osdId;
UInt32 displayId;
UInt32 i = 0;
// char ch;
Chains_ipcFramesInit();
CHAINS_INIT_STRUCT(CaptureLink_CreateParams, capturePrm);
CHAINS_INIT_STRUCT(DisplayLink_CreateParams, displayPrm);
CHAINS_INIT_STRUCT(IpcFramesOutLinkRTOS_CreateParams, ipcFramesOutVpssPrm);
CHAINS_INIT_STRUCT(IpcFramesInLinkHLOS_CreateParams, ipcFramesInDspPrm);
CHAINS_INIT_STRUCT(AlgLink_CreateParams,osdPrm);
CHAINS_INIT_STRUCT(DisplayLink_CreateParams, displayPrm);
;
captureId = SYSTEM_LINK_ID_CAPTURE;
ipcFramesOutVpssId = SYSTEM_VPSS_LINK_ID_IPC_FRAMES_OUT_0;
ipcFramesInDspId = SYSTEM_DSP_LINK_ID_IPC_FRAMES_IN_0;
osdId = SYSTEM_DSP_LINK_ID_ALG_0;
displayId = SYSTEM_LINK_ID_DISPLAY_0;
System_linkControl(
SYSTEM_LINK_ID_M3VIDEO,
SYSTEM_COMMON_CMD_SET_CH2IVAHD_MAP_TBL,
&systemVid_encDecIvaChMapTbl,
sizeof(SystemVideo_Ivahd2ChMap_Tbl),
TRUE
);
capturePrm.numVipInst = 1;
capturePrm.tilerEnable = FALSE;
capturePrm.numBufsPerCh = 16;//CAPTURE_LINK_NUM_BUFS_PER_CH_DEFAULT;
capturePrm.numExtraBufs = 0;
capturePrm.maxBlindAreasPerCh = 0;
capturePrm.isPalMode = FALSE;
capturePrm.enableSdCrop = FALSE;
capturePrm.doCropInCapture = FALSE;
for(vipInstId=0; vipInstId<capturePrm.numVipInst; vipInstId++)
{
pCaptureInstPrm = &capturePrm.vipInst[vipInstId];
pCaptureInstPrm->vipInstId = (SYSTEM_CAPTURE_INST_VIP0_PORTA+vipInstId*2)%SYSTEM_CAPTURE_INST_MAX;
pCaptureInstPrm->videoDecoderId = SYSTEM_DEVICE_VID_DEC_SII9233A_DRV;
pCaptureInstPrm->inDataFormat = SYSTEM_DF_YUV422P;
pCaptureInstPrm->standard = chainsCfg->displayRes[vipInstId];
pCaptureInstPrm->numOutput = 1;
pCaptureInstPrm->numChPerOutput = 1;
pCaptureInstPrm->frameCaptureMode = FALSE;
pCaptureInstPrm->fieldsMerged = FALSE;
if (Chains_IsInterlaced(chainsCfg->displayRes[0])) {
pCaptureInstPrm->frameCaptureMode = TRUE;
pCaptureInstPrm->fieldsMerged = TRUE;
}
pCaptureOutPrm = &pCaptureInstPrm->outParams[0];
pCaptureOutPrm->dataFormat = SYSTEM_DF_YUV422I_YUYV;
pCaptureOutPrm->scEnable = FALSE;
pCaptureOutPrm->scOutWidth = chainsCfg->channelConf[vipInstId].width;
pCaptureOutPrm->scOutHeight = chainsCfg->channelConf[vipInstId].height;
pCaptureOutPrm->outQueId = 0;
}
capturePrm.outQueParams[0].nextLink = ipcFramesOutVpssId;
System_linkCreate(captureId, &capturePrm, sizeof(capturePrm));
chainsCfg->displayRes[0] = capturePrm.vipInst[0].standard;
Vsys_getResSize(chainsCfg->displayRes[0], &chainsCfg->channelConf[0].width, &chainsCfg->channelConf[0].height);
Vsys_getResRate(chainsCfg->displayRes[0], &chainsCfg->channelConf[0].frameRate);
ipcFramesOutVpssPrm.baseCreateParams.inQueParams.prevLinkId = captureId;
ipcFramesOutVpssPrm.baseCreateParams.inQueParams.prevLinkQueId = 0;
ipcFramesOutVpssPrm.baseCreateParams.notifyPrevLink = TRUE;
ipcFramesOutVpssPrm.baseCreateParams.numOutQue =1;
ipcFramesOutVpssPrm.baseCreateParams.outQueParams[0].nextLink= displayId;
ipcFramesOutVpssPrm.baseCreateParams.processLink = ipcFramesInDspId;
ipcFramesOutVpssPrm.baseCreateParams.notifyProcessLink = FALSE;
ipcFramesOutVpssPrm.baseCreateParams.notifyNextLink = TRUE;
ipcFramesOutVpssPrm.baseCreateParams.noNotifyMode = TRUE;
ipcFramesInDspPrm.baseCreateParams.inQueParams.prevLinkId =ipcFramesOutVpssId;
ipcFramesInDspPrm.baseCreateParams.inQueParams.prevLinkQueId = 0;
ipcFramesInDspPrm.baseCreateParams.numOutQue = 1;
ipcFramesInDspPrm.baseCreateParams.outQueParams[0].nextLink = osdId;
ipcFramesInDspPrm.baseCreateParams.notifyNextLink =TRUE;
ipcFramesInDspPrm.baseCreateParams.notifyPrevLink = FALSE;
ipcFramesInDspPrm.baseCreateParams.noNotifyMode = TRUE;
osdPrm.inQueParams.prevLinkId = ipcFramesInDspId;
osdPrm.inQueParams.prevLinkQueId = 0;
osdPrm.enableOSDAlg = TRUE;
osdPrm.enableSCDAlg = FALSE;
AlgLink_OsdChWinParams *chWinPrm=&osdPrm.osdChCreateParams[0].chDefaultParams;
osdPrm.osdChCreateParams[0].maxHeight =64;
osdPrm.osdChCreateParams[0].maxWidth =320
chWinPrm->chId =0 ;
chWinPrm->numWindows =0;
displayPrm.inQueParams[0].prevLinkId = ipcFramesOutVpssId;
displayPrm.inQueParams[0].prevLinkQueId = 0;
displayPrm.displayRes=chainsCfg->displayRes[0];
Chains_displayCtrlInit(chainsCfg->displayRes);
System_linkCreate(ipcFramesOutVpssId,&ipcFramesOutVpssPrm,sizeof(ipcFramesOutVpssPrm));
System_linkCreate(ipcFramesInDspId,&ipcFramesInDspPrm,sizeof(ipcFramesInDspPrm));
System_linkCreate(osdId,&osdPrm,sizeof(osdPrm));
System_linkCreate(displayId,&displayPrm,sizeof(displayPrm));
Chains_memPrintHeapStatus();
{
System_linkStart(displayId);
System_linkStart(osdId);
System_linkStart(ipcFramesInDspId);
System_linkStart(ipcFramesOutVpssId);
System_linkStart(captureId);
/*
while(1)
{
ch = Chains_menuRunTime();
if(ch=='0')
break;
if(ch=='v')
System_linkControl(captureId, CAPTURE_LINK_CMD_FORCE_RESET, NULL, 0, TRUE);
if(ch=='p')
System_linkControl(captureId, CAPTURE_LINK_CMD_PRINT_ADV_STATISTICS, NULL, 0, TRUE);
}
*/
//´Ë´ÎÌí¼Ó´úÂëÔÚÐèÒªµÄʱֹͣ³ÌÐò
/*
while(1)
{
;
}
*/
sleep(100);
System_linkStop(captureId);
System_linkStart(ipcFramesOutVpssId);
System_linkStop(ipcFramesInDspId);
System_linkStop(osdId);
System_linkStop(displayId);
Chains_ipcFramesStop();
}
System_linkDelete(captureId);
System_linkDelete(ipcFramesOutVpssId);
System_linkDelete(ipcFramesInDspId);
System_linkDelete(osdId);
System_linkDelete(displayId);
Chains_ipcFramesExit();
}
steps : capture--->ipcframesoutvpss------(processlink)---->ipcframesinDsp----->osd
ipcframesoutvpss------(nextlink)---------->display
but there is no video on TV, screen is black.