#include "chains.h" #include "ti_swosd_logo_224x30_yuv422i.h"
Void Chains_singleChCapOsdDis(Chains_Ctrl *chainsCfg) { CaptureLink_CreateParams capturePrm; CaptureLink_VipInstParams *pCaptureInstPrm; CaptureLink_OutParams *pCaptureOutPrm; AlgLink_CreateParams osdPrm; DisplayLink_CreateParams displayPrm;
IpcFramesInLinkRTOS_CreateParams ipcFramesInDspPrm; IpcFramesOutLinkRTOS_CreateParams ipcFramesOutVpssPrm;
UInt32 captureId; UInt32 vipInstId; UInt32 osdId; UInt32 displayId; Uint32 ipcFramesOutVpssId, ipcFramesInDspId;
Ptr osdWinSrAddr[ALG_LINK_OSD_MAX_CH][CHAINS_OSD_NUM_WINDOWS]; Ptr osdWinBuPtr[ALG_LINK_OSD_MAX_CH][CHAINS_OSD_NUM_WINDOWS];
char ch;
CHAINS_INIT_STRUCT(CaptureLink_CreateParams, capturePrm); CHAINS_INIT_STRUCT(DisplayLink_CreateParams,displayPrm); CHAINS_INIT_STRUCT(IpcFramesInLinkRTOS_CreateParams,ipcFramesInDspPrm); CHAINS_INIT_STRUCT(IpcFramesOutLinkRTOS_CreateParams,ipcFramesOutVpssPrm);
captureId = SYSTEM_LINK_ID_CAPTURE; osdId = SYSTEM_LINK_ID_ALG_0; displayId = SYSTEM_LINK_ID_DISPLAY_0;
ipcFramesOutVpssId = SYSTEM_VPSS_LINK_ID_IPC_FRAMES_OUT_0; ipcFramesInDspId = SYSTEM_DSP_LINK_ID_IPC_FRAMES_IN_0;
capturePrm.numVipInst = 1; capturePrm.tilerEnable = FALSE; capturePrm.numBufsPerCh = 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->chCfg[vipInstId].inStd; pCaptureInstPrm->numOutput = 1; pCaptureInstPrm->numChPerOutput = 1;
pCaptureOutPrm = &pCaptureInstPrm->outParams[0]; pCaptureOutPrm->dataFormat = SYSTEM_DF_YUV422I_YUYV; pCaptureOutPrm->scEnable = FALSE; pCaptureOutPrm->outQueId = 0; } capturePrm.outQueParams[0].nextLink = ipcFramesOutVpssId;
System_linkCreate(captureId, &capturePrm, sizeof(capturePrm)); Chains_updateInfo(chainsCfg, &capturePrm);
ipcFramesOutVpssPrm.baseCreateParams.inQueParams.prevLinkId = captureId; ipcFramesOutVpssPrm.baseCreateParams.inQueParams.prevLinkQueId = 0; ipcFramesOutVpssPrm.baseCreateParams.notifyPrevLink = FALSE;
ipcFramesOutVpssPrm.baseCreateParams.numOutQue = 1; ipcFramesOutVpssPrm.baseCreateParams.outQueParams[0].nextLink = displayId; ipcFramesOutVpssPrm.baseCreateParams.notifyNextLink = TRUE;
ipcFramesOutVpssPrm.baseCreateParams.processLink = ipcFramesInDspId; ipcFramesOutVpssPrm.baseCreateParams.notifyProcessLink = TRUE; ipcFramesOutVpssPrm.baseCreateParams.noNotifyMode = FALSE;
ipcFramesInDspPrm.baseCreateParams.inQueParams.prevLinkId = ipcFramesOutVpssId; ipcFramesInDspPrm.baseCreateParams.inQueParams.prevLinkQueId = 0; ipcFramesInDspPrm.baseCreateParams.numOutQue = 1; ipcFramesInDspPrm.baseCreateParams.outQueParams[0].nextLink = osdId; ipcFramesInDspPrm.baseCreateParams.notifyPrevLink = FALSE; ipcFramesInDspPrm.baseCreateParams.notifyNextLink = TRUE; ipcFramesInDspPrm.baseCreateParams.noNotifyMode = FALSE;
osdPrm.enableOSDAlg = TRUE; osdPrm.enableSCDAlg = FALSE; osdPrm.inQueParams.prevLinkId = ipcFramesInDspId; osdPrm.inQueParams.prevLinkQueId = 0;
int i, j; for(i=0; i<1; i++) { /* set osd window max width and height */ osdPrm.osdChCreateParams[i].maxWidth = CHAINS_OSD_WIN_MAX_WIDTH; osdPrm.osdChCreateParams[i].maxHeight = CHAINS_OSD_WIN_MAX_HEIGHT;
/* set osd window params */ AlgLink_OsdChWinParams * chWinPrm = &osdPrm.osdChCreateParams[i].chDefaultParams; chWinPrm->chId = i; chWinPrm->numWindows = CHAINS_OSD_NUM_WINDOWS; chWinPrm->colorKey[0] = 0xfa; /* Y */ chWinPrm->colorKey[1] = 0x7e; /* U */ chWinPrm->colorKey[2] = 0x7d; /* V */ chWinPrm->winPrm[0].startX = CHAINS_OSD_WIN0_STARTX; chWinPrm->winPrm[0].startY = CHAINS_OSD_WIN0_STARTY;
for(j=0; j < chWinPrm->numWindows; j++) { Chains_createBuf(&chWinPrm->winPrm[j].addr[0][0], &osdWinBuPtr[i][j], &osdWinSrAddr[i][j], CHAINS_OSD_WIN_WIDTH * CHAINS_OSD_WIN_HEIGHT*2, SYSTEM_IPC_SR_NON_CACHED_DEFAULT);
chWinPrm->winPrm[j].format = SYSTEM_DF_YUV422I_YUYV; chWinPrm->winPrm[j].width = CHAINS_OSD_WIN_WIDTH; chWinPrm->winPrm[j].height = CHAINS_OSD_WIN_HEIGHT; chWinPrm->winPrm[j].lineOffset = CHAINS_OSD_WIN_PITCH; chWinPrm->winPrm[j].globalAlpha = CHAINS_OSD_GLOBAL_ALPHA; chWinPrm->winPrm[j].transperencyEnable = CHAINS_OSD_TRANSPARENCY; chWinPrm->winPrm[j].enableWin = CHAINS_OSD_ENABLE_WIN;
memcpy(osdWinBuPtr[0][j], gMCFW_swosdTiLogoYuv422i, sizeof(gMCFW_swosdTiLogoYuv422i)); } }
displayPrm.inQueParams[0].prevLinkId = ipcFramesOutVpssId; displayPrm.inQueParams[0].prevLinkQueId = 0; displayPrm.displayRes = chainsCfg->displayRes[0]; displayPrm.numInputQueues = 1; displayPrm.activeQueue = 0; displayPrm.forceFieldSeparatedInputMode = FALSE;
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(ipcFramesOutVpssId); System_linkStart(ipcFramesInDspId); System_linkStart(osdId); 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); System_linkControl(displayId, DISPLAY_LINK_CMD_PRINT_STATISTICS, NULL, 0, TRUE); } }
System_linkStop(captureId); System_linkStop(ipcFramesOutVpssId); System_linkStop(ipcFramesInDspId); System_linkStop(osdId); System_linkStop(displayId); }
System_linkDelete(captureId); System_linkDelete(ipcFramesOutVpssId); System_linkDelete(ipcFramesInDspId); System_linkDelete(osdId); System_linkDelete(displayId);
for(i = 0; i < 1; i++) { AlgLink_OsdChWinParams * chWinPrm = &osdPrm.osdChCreateParams[i].chDefaultParams;
chWinPrm->numWindows = CHAINS_OSD_NUM_WINDOWS;
for(j=0; j < chWinPrm->numWindows; j++) { Chains_deleteBuf(osdWinBuPtr[i][j], CHAINS_OSD_WIN_WIDTH * CHAINS_OSD_WIN_HEIGHT*2, SYSTEM_IPC_SR_NON_CACHED_DEFAULT); } } Chains_displayCtrlDeInit(); }
我想更换 "ti_swosd_logo_224x30_yuv422i.h" logo所生成的文件,但是更换后更改了width和height,osd区域显示不正常,请问怎么回事,正确的步骤是怎样的,前边由jpeg图片生成数组文件的详细步骤是怎样的,thanks!
Eason Wang:
RDK包里面关于如何从图片生成数组文件有USER GUIDE做详细阐述的。
你出的是什么问题,显示不正常的类型很多,最好贴图看看
Jason_Zhang:
回复 Eason Wang:
根据DM81xx_DVR_RDK_Software_OSD_Text_Render_Notes介绍的步骤操作,将1.jpeg图片生成1.yuyv图片,然后用bin2c工具生成数组,替换掉ti_swosd_logo_224x30_yuv422i.h后,请问CHAINS_OSD_WIN_WIDTH和HEIGHT是按照图片(比如460*71)更改吗?osd显示区域类似于花屏,完全看不出图片,还有一点,自己制作的图片CHAINS_OSD_WIN_WIDTH *CHAINS_OSD_WIN_HEIGHT*2与sizeof(gMCFW_swosdTiLogoYuv422i)并不相等,请问详细的该如何设置?方便留个QQ交流吗
QQ 1045917067