📄 exolvidpip.c
字号:
else
{
pVrendGfxVoSetup->layerSetup[0].srcRect.ul.x = 0;
pVrendGfxVoSetup->layerSetup[0].srcRect.lr.x = ScreenWidth;
} if(FormatHeight > ScreenHeight) { pVrendGfxVoSetup->layerSetup[0].srcRect.ul.y = 0; pVrendGfxVoSetup->layerSetup[0].srcRect.lr.y = ScreenHeight; } else if(FormatHeight > 0) { pVrendGfxVoSetup->layerSetup[0].srcRect.ul.y = 0; pVrendGfxVoSetup->layerSetup[0].srcRect.lr.y = FormatHeight; }
else
{
pVrendGfxVoSetup->layerSetup[0].srcRect.ul.y = 0;
pVrendGfxVoSetup->layerSetup[0].srcRect.lr.y = ScreenHeight;
} DBG_PRINT((dbgexolVidPip, DBG_LEVEL_1, "exolVidPipSetup Layer 0 srcRect: %d %d %d %d", pVrendGfxVoSetup->layerSetup[0].srcRect.ul.x, pVrendGfxVoSetup->layerSetup[0].srcRect.ul.y, pVrendGfxVoSetup->layerSetup[0].srcRect.lr.x, pVrendGfxVoSetup->layerSetup[0].srcRect.lr.y)); if((exolVidPipSetupFlags & exolVidPipSetup_NeedBuffer0) != 0) { DBG_PRINT((dbgexolVidPip, DBG_LEVEL_1, "exolVidPipSetup_NeedBuffer0 True" )); // scale up to video output resolution pVrendGfxVoSetup->layerSetup[0].dstRect.ul.x = 0; pVrendGfxVoSetup->layerSetup[0].dstRect.ul.y = 0; pVrendGfxVoSetup->layerSetup[0].dstRect.lr.x = ScreenWidth; pVrendGfxVoSetup->layerSetup[0].dstRect.lr.y = ScreenHeight; pVrendGfxVoSetup->layerSetup[0].deinterlaceMode = ivp->Deinterlace[0]; pVrendGfxVoSetup->layerSetup[0].eddiLevel = ivp->Eddi[0];
pVrendGfxVoSetup->layerSetup[0].operatingMode = tmolVrendGfxVo_OperatingModeFieldBased;
pVrendGfxVoSetup->maxLayerSetup[0].needBuffer = True; pVrendGfxVoSetup->maxLayerSetup[0].size = 0; //1024 * 768 * 4; //*/768 * 576 * 4; // max possible size for PAL } else { int FormatWidth=0; int FormatHeight=0; DBG_PRINT((dbgexolVidPip, DBG_LEVEL_1, "exolVidPipSetup_NeedBuffer0 False" )); pformat=(ptmVideoFormat_t)(ioDescr1->format); FormatWidth=pformat->activeVideoEndX - pformat->activeVideoStartX; FormatHeight=pformat->activeVideoEndY - pformat->activeVideoStartY; if(ScreenWidth>FormatWidth) { pVrendGfxVoSetup->layerSetup[0].dstRect.ul.x = (ScreenWidth-FormatWidth)/2; pVrendGfxVoSetup->layerSetup[0].dstRect.lr.x = pVrendGfxVoSetup->layerSetup[0].dstRect.ul.x + FormatWidth; } else { pVrendGfxVoSetup->layerSetup[0].dstRect.ul.x = 0; pVrendGfxVoSetup->layerSetup[0].dstRect.lr.x = pVrendGfxVoSetup->layerSetup[0].dstRect.ul.x + ScreenWidth; } if(ScreenHeight>FormatHeight) { pVrendGfxVoSetup->layerSetup[0].dstRect.ul.y = (ScreenHeight-FormatHeight)/2; pVrendGfxVoSetup->layerSetup[0].dstRect.lr.y = pVrendGfxVoSetup->layerSetup[0].dstRect.ul.y + FormatHeight; } else { pVrendGfxVoSetup->layerSetup[0].dstRect.ul.y = 0; pVrendGfxVoSetup->layerSetup[0].dstRect.lr.y = pVrendGfxVoSetup->layerSetup[0].dstRect.ul.y + ScreenHeight; } pVrendGfxVoSetup->layerSetup[0].deinterlaceMode = tmolVrendGfxVo_DeinterlaceModeNone; pVrendGfxVoSetup->layerSetup[0].eddiLevel = tmolVrendGfxVoEddiOff; pVrendGfxVoSetup->maxLayerSetup[0].needBuffer = False; pVrendGfxVoSetup->maxLayerSetup[0].size = 0; } DBG_PRINT((dbgexolVidPip, DBG_LEVEL_1, " dstRect: %d %d %d %d", pVrendGfxVoSetup->layerSetup[0].dstRect.ul.x, pVrendGfxVoSetup->layerSetup[0].dstRect.ul.y, pVrendGfxVoSetup->layerSetup[0].dstRect.lr.x, pVrendGfxVoSetup->layerSetup[0].dstRect.lr.y)); } else { pVrendGfxVoSetup->layerSetup[0].srcRect.ul.x = 0; pVrendGfxVoSetup->layerSetup[0].srcRect.ul.y = 0; pVrendGfxVoSetup->layerSetup[0].srcRect.lr.x = ScreenWidth; pVrendGfxVoSetup->layerSetup[0].srcRect.lr.y = ScreenHeight; pVrendGfxVoSetup->layerSetup[0].dstRect.ul.x = 0; pVrendGfxVoSetup->layerSetup[0].dstRect.ul.y = 0; pVrendGfxVoSetup->layerSetup[0].dstRect.lr.x = ScreenWidth; pVrendGfxVoSetup->layerSetup[0].dstRect.lr.y = ScreenHeight; pVrendGfxVoSetup->layerSetup[0].connect = False; } /*--------------------------- Layer 1 -----------------------------------*/ if((exolVidPipSetupFlags & exolVidPipSetup_UseLayer1) != 0) { pformat=(ptmVideoFormat_t)(ioDescr2->format); DBG_PRINT((dbgexolVidPip, DBG_LEVEL_1, "exolVidPipSetup_UseLayer1" )); pVrendGfxVoSetup->layerSetup[1].connect = True; //False; if((exolVidPipSetupFlags & (int)exolVidPipSetup_HorizontalScalingInQvcp1) != 0) { pVrendGfxVoSetup->layerSetup[1].horizontalScalingInQvcp = True; } else { pVrendGfxVoSetup->layerSetup[1].horizontalScalingInQvcp = False; } FormatWidth = pformat->activeVideoEndX - pformat->activeVideoStartX; FormatHeight = pformat->activeVideoEndY - pformat->activeVideoStartY; if(FormatWidth > ScreenWidth) { // cropping pVrendGfxVoSetup->layerSetup[1].srcRect.ul.x = 0; pVrendGfxVoSetup->layerSetup[1].srcRect.lr.x = ScreenWidth; } else if (FormatWidth > 0) { pVrendGfxVoSetup->layerSetup[1].srcRect.ul.x = 0; pVrendGfxVoSetup->layerSetup[1].srcRect.lr.x = FormatWidth; }
else
{
pVrendGfxVoSetup->layerSetup[1].srcRect.ul.x = 0;
pVrendGfxVoSetup->layerSetup[1].srcRect.lr.x = ScreenWidth;
} if(FormatHeight > ScreenHeight) { pVrendGfxVoSetup->layerSetup[1].srcRect.ul.y = 0; pVrendGfxVoSetup->layerSetup[1].srcRect.lr.y = ScreenHeight; } else if( FormatHeight > 0) { pVrendGfxVoSetup->layerSetup[1].srcRect.ul.y = 0; pVrendGfxVoSetup->layerSetup[1].srcRect.lr.y = FormatHeight; }
else
{
pVrendGfxVoSetup->layerSetup[1].srcRect.ul.y = 0;
pVrendGfxVoSetup->layerSetup[1].srcRect.lr.y = ScreenHeight;
} /* --- set source and dest rects ---*/ DBG_PRINT((dbgexolVidPip, DBG_LEVEL_1, "exolVidPipSetup Layer 1 srcRect: %d %d %d %d", pVrendGfxVoSetup->layerSetup[1].srcRect.ul.x, pVrendGfxVoSetup->layerSetup[1].srcRect.ul.y, pVrendGfxVoSetup->layerSetup[1].srcRect.lr.x, pVrendGfxVoSetup->layerSetup[1].srcRect.lr.y)); if((exolVidPipSetupFlags & exolVidPipSetup_NeedBuffer1) != 0) { DBG_PRINT((dbgexolVidPip, DBG_LEVEL_1, "exolVidPipSetup_NeedBuffer1 True" )); // set the destination rect to output display resolution //pVrendGfxVoSetup->layerSetup[1].dstRect.ul.x = 0; //pVrendGfxVoSetup->layerSetup[1].dstRect.ul.y = 0; //pVrendGfxVoSetup->layerSetup[1].dstRect.lr.x = ScreenWidth; //pVrendGfxVoSetup->layerSetup[1].dstRect.lr.y = ScreenHeight;
pVrendGfxVoSetup->layerSetup[1].dstRect.ul.x = 0;
pVrendGfxVoSetup->layerSetup[1].dstRect.ul.y = 0;
pVrendGfxVoSetup->layerSetup[1].dstRect.lr.x = ScreenWidth/2;
pVrendGfxVoSetup->layerSetup[1].dstRect.lr.y = ScreenHeight/2;
ivp->pipStartPos = pVrendGfxVoSetup->layerSetup[1].dstRect;
pVrendGfxVoSetup->layerSetup[1].deinterlaceMode = ivp->Deinterlace[1]; pVrendGfxVoSetup->layerSetup[1].eddiLevel = ivp->Eddi[1]; pVrendGfxVoSetup->layerSetup[1].operatingMode = tmolVrendGfxVo_OperatingModeFieldBased;
pVrendGfxVoSetup->maxLayerSetup[1].needBuffer = True; pVrendGfxVoSetup->maxLayerSetup[1].size = 1024 * 768 * 4; //*/768 * 576 * 4; // max possible size for PAL } else { int FormatWidth=0; int FormatHeight=0; DBG_PRINT((dbgexolVidPip, DBG_LEVEL_1, "exolVidPipSetup_NeedBuffer1 False" )); // set the destination rect to input format (no scaling) pformat=(ptmVideoFormat_t)(ioDescr2->format); FormatWidth= pformat->activeVideoEndX - pformat->activeVideoStartX; FormatHeight= pformat->activeVideoEndY - pformat->activeVideoStartY; if(ScreenWidth >= FormatWidth) { pVrendGfxVoSetup->layerSetup[1].dstRect.ul.x = (ScreenWidth-FormatWidth)/2; pVrendGfxVoSetup->layerSetup[1].dstRect.lr.x = pVrendGfxVoSetup->layerSetup[1].dstRect.ul.x + FormatWidth; } else { pVrendGfxVoSetup->layerSetup[1].dstRect.ul.x = 0; pVrendGfxVoSetup->layerSetup[1].dstRect.lr.x = pVrendGfxVoSetup->layerSetup[1].dstRect.ul.x + ScreenWidth; } if(ScreenHeight >= FormatHeight) { pVrendGfxVoSetup->layerSetup[1].dstRect.ul.y = (ScreenHeight-FormatHeight)/2; pVrendGfxVoSetup->layerSetup[1].dstRect.lr.y = pVrendGfxVoSetup->layerSetup[1].dstRect.ul.y + FormatHeight; } else { pVrendGfxVoSetup->layerSetup[1].dstRect.ul.y = 0; pVrendGfxVoSetup->layerSetup[1].dstRect.lr.y = pVrendGfxVoSetup->layerSetup[1].dstRect.ul.y + ScreenHeight; } pVrendGfxVoSetup->layerSetup[1].deinterlaceMode = tmolVrendGfxVo_DeinterlaceModeNone; pVrendGfxVoSetup->layerSetup[1].eddiLevel = tmolVrendGfxVoEddiOff; pVrendGfxVoSetup->maxLayerSetup[1].needBuffer = False; pVrendGfxVoSetup->maxLayerSetup[1].size = 0; } DBG_PRINT((dbgexolVidPip, DBG_LEVEL_1, " dstRect: %d %d %d %d", pVrendGfxVoSetup->layerSetup[1].dstRect.ul.x, pVrendGfxVoSetup->layerSetup[1].dstRect.ul.y, pVrendGfxVoSetup->layerSetup[1].dstRect.lr.x, pVrendGfxVoSetup->layerSetup[1].dstRect.lr.y)); } else { // set to some legal values pVrendGfxVoSetup->layerSetup[1].srcRect.ul.x = 0; pVrendGfxVoSetup->layerSetup[1].srcRect.ul.y = 0; pVrendGfxVoSetup->layerSetup[1].srcRect.lr.x = ScreenWidth; pVrendGfxVoSetup->layerSetup[1].srcRect.lr.y = ScreenHeight; pVrendGfxVoSetup->layerSetup[1].dstRect.ul.x = 0; pVrendGfxVoSetup->layerSetup[1].dstRect.ul.y = 0; pVrendGfxVoSetup->layerSetup[1].dstRect.lr.x = ScreenWidth; pVrendGfxVoSetup->layerSetup[1].dstRect.lr.y = ScreenHeight; pVrendGfxVoSetup->layerSetup[1].connect = False; } /*-----------------------------------------------------------------------*/ pVrendGfxVoSetup->zOrder.layerZPos[0] = 0; pVrendGfxVoSetup->zOrder.layerZPos[1] = 1; pVrendGfxVoSetup->clockHandles[0] = Null; pVrendGfxVoSetup->clockHandles[1] = Null; if(((exolVidPipSetupFlags & exolVidPipSetup_UseLayer1) != 0) && ((exolVidPipSetupFlags & exolVidPipSetup_UseLayer0) == 0)) pVrendGfxVoSetup->mainLayer = 1; else pVrendGfxVoSetup->mainLayer = 0;
pVrendGfxVoSetup->mbsClockFreq = tmolVrendGfxVo_mbsClockFreq144Mhz;
pVrendGfxVoSetup->vbiSetup.vbiEnable = False;
tmError = tmolVrendGfxVoInstanceSetup(ivp->hVrendGfxVo, pVrendGfxVoSetup); DBG_ASSERT2((tmError == TM_OK),("tmolVrendGfxVoInstanceSetup failed:0x%X\n",tmError)); /*------------------------ Setup Denc (VencAna) -------------------------*/ tmError = tmVideoMode_GetName ( ivp->OutputVideoMode, // I: mode to query VideoModeName); // O: receives mode name DBG_ASSERT2((tmError == TM_OK),("tmVideoMode_GetName failed:0x%X\n",tmError)); if(ivp->AnalogVideoEncoder) { // Setup VencAna. tmError = (strcmp(VideoModeName, "pal") == 0) ? tmVencAna_SetColorSystem(ivp->pVencAnaInst, tmVencAna_PalBg): (strcmp(VideoModeName, "ntsc") == 0)? tmVencAna_SetColorSystem(ivp->pVencAnaInst, tmVencAna_NtscM): TM_OK ; DBG_ASSERT2((tmError == TM_OK),("tmVencAna_SetColorSystem failed:0x%X\n",tmError)); tmError = tmVencAna_SetEncodingType(ivp->pVencAnaInst, ivp->OutputVideoAdapter); DBG_ASSERT2((tmError == TM_OK),("tmVencAna_SetEncodingType failed:0x%X\n",tmError)); tmError = tmVencAna_ApplyExtInterfaceSettings(ivp->pVencAnaInst); DBG_ASSERT2((tmError == TM_OK),("tmVencAna_ApplyExtInterfaceSettings failed:0x%X\n",tmError)); } DBG_PRINT((dbgexolVidPip, DBG_INTERFACE_LEAVE, "exolVidPipSetupVrendGfxVo" )); return tmError;}//-----------------------------------------------------------------------------// FUNCTION: exolVidPipCreateIoDescr://// DESCRIPTION: This function does// set input format// set src rect// set dst rect//// RETURN: tmErrorCode_t//// NOTES: None//-----------------------------------------------------------------------------//tmErrorCode_t exolVidPipCreateIoDescr( ptsaDefaultCapabilities_t pDefaultCap1, ptsaDefaultInstanceSetup_t pDefaultSetup1, int SenderIndex,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -