📄 exolvidvbi.c
字号:
switch(tmError) { case TM_OK: break; case TM_ERR_VENCANA_NULL_CTLFUNC: // no video encoder connected to the system: // lcd // tmdlLcd() // lcd overdrive startup DBG_PRINT((dbgexolVideo, DBG_LEVEL_1, "VideoEncoder=False" )); ivp->AnalogVideoEncoder=False; break; default: DBG_ASSERT2((tmError == TM_OK),("tmVencAna_Open failed:0x%X\n",tmError)); break; } // Open Renderer tmError = tmolVrendGfxVoOpenM(&ivp->hVrendGfxVo, (tmUnitSelect_t)0); DBG_ASSERT2((tmError == TM_OK),("tmolVrendGfxVoOpenM failed:0x%X\n",tmError)); /*-----------------------------------------------------------------------*/ /* VrendGfxVo Instance Setup */ /*-----------------------------------------------------------------------*/ tmError = tmolVrendGfxVoGetInstanceSetup(ivp->hVrendGfxVo, &ivp->pVrendGfxVoSetup); DBG_ASSERT2((tmError == TM_OK),("tmolVrendGfxVoGetInstanceSetup failed:0x%X\n",tmError)); pVrendGfxVoSetup = ivp->pVrendGfxVoSetup; pVrendGfxVoSetup->pDefaultSetup->progressFunc = tmolVrendGfxVoProgFunc; pVrendGfxVoSetup->pDefaultSetup->errorFunc = tmolVrendGfxVoErrorFunc; pVrendGfxVoSetup->pDefaultSetup->progressReportFlags = 0xffffffff; pVrendGfxVoSetup->pDefaultSetup->parentId = (UInt32)ivp->hVrendGfxVo; if(ioDescr1)
{ pVrendGfxVoSetup->pDefaultSetup->inputDescriptors[VRENDGFXVO_MAIN_INPUT] = ioDescr1;
pVrendGfxVoSetup->pDefaultSetup->inputDescriptors[VRENDGFXVO_VBI_INPUT] = ivp->pVbiVipToRend1InIod;
} if(ioDescr2) pVrendGfxVoSetup->pDefaultSetup->inputDescriptors[VRENDGFXVO_SECOND_INPUT] = ioDescr2; pVrendGfxVoSetup->pDefaultSetup->priority = 63; strncpy(pVrendGfxVoSetup->pDefaultSetup->taskName, "REND", 5); pVrendGfxVoSetup->videoOutMode=ivp->OutputVideoMode; // video output mode. // Probably need more flexibility here in the future. // If it would be fixed like this, it better moves inside the renderer. if (videoOutInterlaced) { pVrendGfxVoSetup->videoOutFormat = vof8bitYUV422; pVrendGfxVoSetup->videoTypeFormat = vtfYUV; } else { pVrendGfxVoSetup->videoOutFormat = vof24bit444; pVrendGfxVoSetup->videoTypeFormat = vtfRGB; } // needed to access VencAnaExt interface pVrendGfxVoSetup->videoEncoderUnit = ivp->VideoEncUnit; //tmUnit0; pVrendGfxVoSetup->nrOfLayers = 1; pVrendGfxVoSetup->mainLayer = 0; tmError = tmVideoMode_GetResolution( ivp->OutputVideoMode, //tmVideoMode_t videoMode, // I: mode to query &ScreenWidth, // O: receives screen width &ScreenHeight); // O: recevies screen height /*--------------------------- Layer 0 -----------------------------------*/ if((exolVideoSetupFlags & (int)exolVideoSetup_UseLayer0) != 0) { pformat=(ptmVideoFormat_t)(ioDescr1->format); DBG_PRINT((dbgexolVideo, DBG_LEVEL_1, "exolVideoSetup_UseLayer0" )); pVrendGfxVoSetup->layerSetup[0].connect = True; if((exolVideoSetupFlags & (int)exolVideoSetup_HorizontalScalingInQvcp0) != 0) { pVrendGfxVoSetup->layerSetup[0].horizontalScalingInQvcp = True; } else { pVrendGfxVoSetup->layerSetup[0].horizontalScalingInQvcp = False; } FormatWidth = pformat->activeVideoEndX - pformat->activeVideoStartX; FormatHeight = pformat->activeVideoEndY - pformat->activeVideoStartY; if(FormatWidth > ScreenWidth) { // cropping pVrendGfxVoSetup->layerSetup[0].srcRect.ul.x = 0; pVrendGfxVoSetup->layerSetup[0].srcRect.lr.x = ScreenWidth; } else if(FormatWidth > 0) { pVrendGfxVoSetup->layerSetup[0].srcRect.ul.x = 0; pVrendGfxVoSetup->layerSetup[0].srcRect.lr.x = FormatWidth; }
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((dbgexolVideo, DBG_LEVEL_1, "exolVideoSetup 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((exolVideoSetupFlags & exolVideoSetup_NeedBuffer0) != 0) { DBG_PRINT((dbgexolVideo, DBG_LEVEL_1, "exolVideoSetup_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((dbgexolVideo, DBG_LEVEL_1, "exolVideoSetup_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((dbgexolVideo, 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((exolVideoSetupFlags & exolVideoSetup_UseLayer1) != 0) { pformat=(ptmVideoFormat_t)(ioDescr2->format); DBG_PRINT((dbgexolVideo, DBG_LEVEL_1, "exolVideoSetup_UseLayer1" )); pVrendGfxVoSetup->layerSetup[1].connect = True; //False; if((exolVideoSetupFlags & (int)exolVideoSetup_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((dbgexolVideo, DBG_LEVEL_1, "exolVideoSetup 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((exolVideoSetupFlags & exolVideoSetup_NeedBuffer1) != 0) { DBG_PRINT((dbgexolVideo, DBG_LEVEL_1, "exolVideoSetup_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].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((dbgexolVideo, DBG_LEVEL_1, "exolVideoSetup_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;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -