📄 exolvidpip.c
字号:
break;
case 1 :
ivp->pipWindow = True;
break;
case 2 :
break;
}
tmosalTaskSleep(200);}//-----------------------------------------------------------------------------// FUNCTION: exolVidPipSetupVcapVip://// DESCRIPTION: This function does// set input format// set src rect// set dst rect//// RETURN: tmErrorCode_t//// NOTES: None//-----------------------------------------------------------------------------//tmErrorCode_texolVidPipSetupVcapVip( exolVidPipInstance_t* ivp, ptmVideoFormat_t pSetupFormat, ptsaInOutDescriptor_t ioDescr){ tmErrorCode_t tmError = TM_OK; ptmolVcapVip2_InstanceSetup_t pVcapVipSetup;
DBG_PRINT((dbgexolVidPip, DBG_INTERFACE_ENTER, "exolVidPipSetupVcapVip" )); /*-----------------------------------------------------------------------*/ /* Get Capabilities */ /*-----------------------------------------------------------------------*/ tmError = tmolVcapVip2_GetCapabilities(&ivp->pVcapVipCap); DBG_ASSERT2((tmError == TM_OK),("tmolVcapVipGetCapabilities failed:0x%X\n",tmError)); /*-----------------------------------------------------------------------*/ /* Open Components */ /*-----------------------------------------------------------------------*/ // Open VIP tmError = tmolVcapVip2_OpenM(&ivp->hVcapVip, (tmUnitSelect_t)0); DBG_ASSERT2((tmError == TM_OK),("tmolVcapVip2_OpenM failed:0x%X\n",tmError)); /*-----------------------------------------------------------------------*/ /* VcapVip Instance Setup */ /*-----------------------------------------------------------------------*/ tmError = tmolVcapVip2_GetInstanceSetup(ivp->hVcapVip, &ivp->pVcapVipSetup); DBG_ASSERT2((tmError == TM_OK),("tmolVcapVip2_GetInstanceSetup failed:0x%X\n",tmError)); pVcapVipSetup = ivp->pVcapVipSetup; pVcapVipSetup->pDefaultSetup->progressFunc = tmolVcapVipProgFunc; pVcapVipSetup->pDefaultSetup->errorFunc = tmolVcapVipErrorFunc; pVcapVipSetup->pDefaultSetup->createNoTask = True; pVcapVipSetup->pDefaultSetup->progressReportFlags = 0xffffffff; pVcapVipSetup->pDefaultSetup->parentId = (UInt32)ivp->hVcapVip; if(ioDescr)
{ pVcapVipSetup->pDefaultSetup->outputDescriptors[VCAPVIP2_MAIN_OUTPUT] = ioDescr; //ivp->pVipToRend1InIod;
} pVcapVipSetup->pDefaultSetup->priority = 60; strncpy(pVcapVipSetup->pDefaultSetup->taskName, "VDIG", 5); pVcapVipSetup->patMode= (ivp->InternalTestPattern == 0) ? tmVcapVip2_PatternGenModeNone : ( pSetupFormat->videoStandard == vasPAL) ? tmVcapVip2_PatternGenModePal : tmVcapVip2_PatternGenModeNtsc ; // source rectangle is active area (no vbi lines) // destination rectangle is source rectangle normalized to (0,0) pVcapVipSetup->srcRect.ul.x = pSetupFormat->activeVideoStartX; pVcapVipSetup->srcRect.ul.y = pSetupFormat->activeVideoStartY; pVcapVipSetup->srcRect.lr.x = pSetupFormat->activeVideoEndX; pVcapVipSetup->srcRect.lr.y = pSetupFormat->activeVideoEndY; // The previous function gets a full size source rectangle starting at the line where // active video area starts. However we need to move the source rectangle back // to 0,0 because the TSSA capture component will offset the rectangle // from the start of active video anyway. pVcapVipSetup->srcRect.lr.y -= pVcapVipSetup->srcRect.ul.y; pVcapVipSetup->srcRect.ul.y = 0; // no scaling/cropping in VcapVip pVcapVipSetup->dstRect = pVcapVipSetup->srcRect; pVcapVipSetup->dataType=(tmVideoTypeFormat_t)pSetupFormat->dataType; pVcapVipSetup->subType=(UInt32)pSetupFormat->dataSubtype; pVcapVipSetup->imageStride=pSetupFormat->imageStride; pVcapVipSetup->imageUVStride=pSetupFormat->imageUVStride; // for vip use the field in field format. //pVcapVipSetup->outputFormat.description=vdfFieldInField;
pVcapVipSetup->bufferLayout=tmVideoFieldBuffer;
pVcapVipSetup->scaleMode = tmVcapVip2_ScaleModeNoScaling; pVcapVipSetup->vbiEnable = False;
tmError = tmolVcapVip2_InstanceSetup( ivp->hVcapVip, pVcapVipSetup); DBG_ASSERT2((tmError == TM_OK),("tmolVcapVip2_InstanceSetup failed:0x%X\n",tmError)); { UInt32 maxNumUnits=0; /*int fieldRate=0;*/ tmRect_t acqRect=pVcapVipSetup->srcRect; // digitiser tmError = tmVdecAna_GetNumberOfUnits(&maxNumUnits); DBG_ASSERT2((tmError == TM_OK),("tmVdecAna_GetNumberOfUnits failed:0x%X\n",tmError)); tmError = tmVdecAna_Open(&(ivp->decInstance),(tmUnitSelect_t)0); DBG_ASSERT2((tmError == TM_OK),("tmVdecAna_Open failed:0x%X\n",tmError)); switch(pSetupFormat->videoStandard) { case vasPAL: tmError=tmVdecAna_SetVideoStd (ivp->decInstance,"pal"); DBG_ASSERT2((tmError == TM_OK),("tmVdecAna_SetVideoStd failed:0x%X\n",tmError)); /*fieldRate = 50;*/ acqRect.lr.y = 624;
break; case vasNTSC: tmError=tmVdecAna_SetVideoStd (ivp->decInstance,"ntsc"); DBG_ASSERT2((tmError == TM_OK),("tmVdecAna_SetVideoStd failed:0x%X\n",tmError)); /*fieldRate = 60;*/ acqRect.lr.y = 524;
break; default: /*DBG_ASSERT(False);*/ break; } tmError=tmVdecAna_SetAdapterType (ivp->decInstance,ivp->InputVideoAdapter, 0);
DBG_ASSERT2((tmError == TM_OK),("tmVdecAna_SetAdapterType failed:0x%X\n",tmError)); tmError=tmVdecAna_SetAcquisitionWindow(ivp->decInstance, acqRect); DBG_ASSERT2((tmError == TM_OK),("tmVdecAna_SetAcquisitionWindow failed:0x%X\n",tmError)); tmError=tmVdecAna_SetSourceType (ivp->decInstance, vsoVCR); DBG_ASSERT2((tmError == TM_OK),("tmVdecAna_SetSourceType failed:0x%X\n",tmError)); } DBG_PRINT((dbgexolVidPip, DBG_INTERFACE_LEAVE, "exolVidPipSetupVcapVip" )); return tmError;}//-----------------------------------------------------------------------------// FUNCTION: exolVidPipSetupVrendGfxVo://// DESCRIPTION: This function does// set input format// set src rect// set dst rect//// RETURN: tmErrorCode_t//// NOTES: None//-----------------------------------------------------------------------------//typedef enum exolVidPipSetupFlagsEnumSet_t{ exolVidPipSetup_UseLayer0 =0x01, exolVidPipSetup_UseLayer1 =0x02, exolVidPipSetup_NeedBuffer0 =0x04, exolVidPipSetup_NeedBuffer1 =0x08, exolVidPipSetup_HorizontalScalingInQvcp0 =0x10, exolVidPipSetup_HorizontalScalingInQvcp1 =0x20}exolVidPipSetupFlags_t;tmErrorCode_t exolVidPipSetupVrendGfxVo( exolVidPipInstance_t* ivp, ptmVideoFormat_t pSetupFormat, ptsaInOutDescriptor_t ioDescr1, ptsaInOutDescriptor_t ioDescr2, int exolVidPipSetupFlags){ tmErrorCode_t tmError = TM_OK; ptmolVrendGfxVoInstanceSetup_t pVrendGfxVoSetup; Bool videoOutInterlaced = True; char VideoModeName[TM_VIDEOMODE_NAME_MAXSIZE]; UInt32 ScreenWidth; // O: receives screen width UInt32 ScreenHeight; // O: recevies screen height UInt32 FormatWidth; UInt32 FormatHeight; ptmVideoFormat_t pformat=Null; (void) pSetupFormat; DBG_PRINT((dbgexolVidPip, DBG_INTERFACE_ENTER, "exolVidPipSetupVrendGfxVo" )); DBG_PRINT((dbgexolVidPip, DBG_LEVEL_1, "ivp->OutputVideoMode :%d",ivp->OutputVideoMode )); tmError = tmVideoMode_GetScanType ( ivp->OutputVideoMode, // I: mode to query &videoOutInterlaced); // O: receives result of query DBG_ASSERT2((tmError == TM_OK),("tmVideoMode_GetScanType failed:0x%X\n",tmError)); /*-----------------------------------------------------------------------*/ /* Get Capabilities */ /*-----------------------------------------------------------------------*/ tmError = tmolVrendGfxVoGetCapabilities(&ivp->pVrendGfxVoCap); DBG_ASSERT2((tmError == TM_OK),("tmolVrendGfxVoGetCapabilities failed:0x%X\n",tmError)); // Open denc tmError = tmVencAna_Open(&ivp->pVencAnaInst, ivp->VideoEncUnit); // Unit 0! 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((dbgexolVidPip, 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;
} 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((exolVidPipSetupFlags & (int)exolVidPipSetup_UseLayer0) != 0) { pformat=(ptmVideoFormat_t)(ioDescr1->format); DBG_PRINT((dbgexolVidPip, DBG_LEVEL_1, "exolVidPipSetup_UseLayer0" )); pVrendGfxVoSetup->layerSetup[0].connect = True; if((exolVidPipSetupFlags & (int)exolVidPipSetup_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; }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -