⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 exolvidvbi.c

📁 pnx1500 video test demo
💻 C
📖 第 1 页 / 共 5 页
字号:
    adapter = 0;    sscanf(ins, "%d", &adapter);    switch (adapter)    {        case 1:            ivp->InternalTestPattern = 1;            printf("Choose internal test pattern 1 as source.\n");            break;        case 2:            printf("Choose internal test pattern 2 as source.\n");            ivp->InternalTestPattern = 2;            break;        default:            i = adapter - 3 ;            if (i >= config->vDec.numAdapters) {                printf("Unknown adapter... No change. Try again\n");                break;            }            ivp->InternalTestPattern = 0;            switch (config->vDec.adapterTable[i].adapterType) {                case vaaSvideo:                    ivp->InputVideoAdapter=vaaSvideo;                    break ;                case vaaNone:                    printf("Map Input adapter vaaNone to CVBS\n");                case vaaCVBS:                    ivp->InputVideoAdapter=vaaCVBS;                    break ;                case vaaGeneric:                case vaaExt1:                case vaaSCART:                case vaaVGA:                default:                    printf("Input adapter type not supported here.\n");                    break ;            }            ivp->InputVideoAdapterType  = config->vDec.adapterTable[i].adapterType;            ivp->InputVideoAdapterIndex = config->vDec.adapterTable[i].adapterIndex;            // I don't see where the previous two are passed to VdecAna            printf("chose board specific adapter %d (selection %d)\n", i, adapter);            break;    }	printf("\n\nSelect video output adapter\n");    printf("1  -CVBS \n");    printf("2  -Y/C (S-Video)\n");        gets(ins);    output = 0;    sscanf(ins, "%d", &output);    switch(output)    {        default:        case 1  :            printf("1  -CVBS \n");            ivp->OutputVideoAdapter=tmVencAna_Cvbs;            break;        case 2  :            printf("-Y/C (S-Video)\n");            ivp->OutputVideoAdapter=tmVencAna_Yc;            break;    }}//-----------------------------------------------------------------------------// FUNCTION:    exolVideoSetupVcapVip://// DESCRIPTION: This function does//                          set input format//                          set src rect//                          set dst rect//// RETURN:      tmErrorCode_t//// NOTES:       None//-----------------------------------------------------------------------------//tmErrorCode_texolVideoSetupVcapVip(    exolVideoInstance_t*        ivp,    ptmVideoFormat_t            pSetupFormat,    ptsaInOutDescriptor_t       ioDescr){    tmErrorCode_t                   tmError = TM_OK;    ptmolVcapVip2_InstanceSetup_t   pVcapVipSetup;

	// default set of lines for VBI /NTSC
    tmVideoDataService_t ntscFieldOne[25] = {
        vdsNone,vdsNone,vdsNone,vdsNone,vdsNone,
        vdsNone,vdsNone,vdsNone,vdsNone,vdsNone,
        vdsNone,vdsNone,vdsNone,vdsNone,vdsNone,
        vdsNone,vdsNone,vdsNone,vdsNone,vdsNone,
        vdsNone,vdsUSClosedCaption,vdsNone,vdsNone,vdsNone
    };
    tmVideoDataService_t ntscFieldTwo[25] = {
        vdsNone,vdsNone,vdsNone,vdsNone,vdsNone,
        vdsNone,vdsNone,vdsNone,vdsNone,vdsNone,
        vdsNone,vdsNone,vdsNone,vdsNone,vdsNone,
        vdsNone,vdsNone,vdsNone,vdsNone,vdsNone,
        vdsNone,vdsUSClosedCaption,vdsNone,vdsNone,vdsNone
	};    
	// default set of lines for VBI /PAL
    tmVideoDataService_t palFieldOne[25] = {
        vdsNone,vdsNone,vdsNone,vdsNone,vdsNone,
        vdsNone,vdsNone,vdsNone,vdsNone,vdsNone,
        vdsNone,vdsNone,vdsNone,vdsNone,vdsNone,
        vdsNone,vdsNone,vdsNone,vdsNone,vdsNone,
        vdsNone,vdsNone,vdsNone,vdsWSS,vdsNone
    };
    tmVideoDataService_t palFieldTwo[25] = {
        vdsNone,vdsNone,vdsNone,vdsNone,vdsNone,
        vdsNone,vdsNone,vdsNone,vdsNone,vdsNone,
        vdsNone,vdsNone,vdsNone,vdsNone,vdsNone,
        vdsNone,vdsNone,vdsNone,vdsNone,vdsNone,
        vdsNone,vdsNone,vdsNone,vdsNone,vdsNone
	};
    /*int i;*/    DBG_PRINT((dbgexolVideo, DBG_INTERFACE_ENTER, "exolVideoSetupVcapVip" ));    /*-----------------------------------------------------------------------*/    /*                       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->outputDescriptors[VCAPVIP2_VBI_OUTPUT] = ivp->pVbiVipToRend1InIod;
	}    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;	if(ivp->VbiSlicerEnable)
	{
		pVcapVipSetup->vbiEnable        = True;
	}
	else
	{
		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;

			tmError = tmVdecAna_SetDataServices (ivp->decInstance,  (pInt32)palFieldOne, (pInt32)palFieldTwo,25);
            DBG_ASSERT2( tmError == TM_OK, ("Error = 0x%x", tmError) );        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; 

			tmError = tmVdecAna_SetDataServices (ivp->decInstance,  (pInt32)ntscFieldOne, (pInt32)ntscFieldTwo,25);
            DBG_ASSERT2( tmError == TM_OK, ("Error = 0x%x", tmError) );        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((dbgexolVideo, DBG_INTERFACE_LEAVE, "exolVideoSetupVcapVip" ));    return tmError;}//-----------------------------------------------------------------------------// FUNCTION:    exolVideoSetupVrendGfxVo://// DESCRIPTION: This function does//                          set input format//                          set src rect//                          set dst rect//// RETURN:      tmErrorCode_t//// NOTES:       None//-----------------------------------------------------------------------------//typedef enum exolVideoSetupFlagsEnumSet_t{    exolVideoSetup_UseLayer0    =0x01,    exolVideoSetup_UseLayer1    =0x02,    exolVideoSetup_NeedBuffer0  =0x04,    exolVideoSetup_NeedBuffer1                  =0x08,    exolVideoSetup_HorizontalScalingInQvcp0     =0x10,    exolVideoSetup_HorizontalScalingInQvcp1     =0x20}exolVideoSetupFlags_t;tmErrorCode_t exolVideoSetupVrendGfxVo(    exolVideoInstance_t*        ivp,    ptmVideoFormat_t            pSetupFormat,    ptsaInOutDescriptor_t       ioDescr1,    ptsaInOutDescriptor_t       ioDescr2,    int                         exolVideoSetupFlags){    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((dbgexolVideo, DBG_INTERFACE_ENTER, "exolVideoSetupVrendGfxVo" ));    DBG_PRINT((dbgexolVideo, 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!

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -