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

📄 exolvidvbi.c

📁 pnx1500 video test demo
💻 C
📖 第 1 页 / 共 5 页
字号:
//-----------------------------------------------------------------------------// $Header:// (C) Copyright 2000 Philips Semiconductors, All rights reserved//// This source code and any compilation or derivative thereof is the sole// property of Philips Corporation and is provided pursuant to a Software// License Agreement.  This code is the proprietary information of Philips// Corporation and is confidential in nature.  Its use and dissemination by// any party other than Philips Corporation is strictly limited by the// confidential information provisions of the Agreement referenced above.//-----------------------------------------------------------------------------// FILENAME:     exolVidVbi.c//// DESCRIPTION:  video system test application//// DOCUMENT REF: TV Video System MPTK1500 FRS 1.1 : exolVidVbi//// NOTES:        //-----------------------------------------------------------------------------////-----------------------------------------------------------------------------// Standard include files://-----------------------------------------------------------------------------//#include <stdio.h>#include <stdlib.h>#include <string.h>#include <tmMainStreaming.h>#include <tmAvFormats.h>#include <tmosal.h>#include <tmml.h>#include <tsaClock.h>#include <version\exolVidVbi_version.h>//-----------------------------------------------------------------------------// Project include files://-----------------------------------------------------------------------------//#include <tmVideoFormats.h>#include <tmVideoUtil.h>#include <tmDbg.h>#include <tmVencAna.h>#include <tmVdecAna.h>#include <tmolVrendGfxVo.h>#include <tmolVcapVip2.h>// NDK tool system#if defined(TMFL_NEED_MEM_DEBUG)#if TMFL_NEED_MEM_DEBUG == 1#include <tmMemDbg.h>#endif#endif#if defined(TMFL_NEED_TM_TRACE)      #if TMFL_NEED_TM_TRACE == 1#include <tmTfeTrace.h>#endif#endif#if defined(TMFL_NEED_TIME_DOCTOR)#if TMFL_NEED_TIME_DOCTOR == 1#include <tmtdCommon.h>#include <tmtdApi.h>#endif#endif#include <mmio.h> // for internal testpattern 2#include <custom_defs.h>#include <tmbslVdecAna.h>#ifndef cycles#define cycles() 0#endif

char *  gconfig[500];
int     gtotalconfig=0;

//-----------------------------------------------------------------------------// Types and defines://-----------------------------------------------------------------------------//DBG_UNIT(dbgexolVideo)static const tmVideoFormat_t defFormatPAL =    {        sizeof(tmVideoFormat_t),  /* size                               */        0,                        /* hash                               */        0,                        /* referenceCount                     */        avdcVideo,                /* dataClass                          */        vtfYUV,                   /* dataType                           */        vdfUYVY,                  /* dataSubtype                        */        vdfInterlaced,            /* description                        */        720,                      /* imageWidth                         */        576,                      /* imageHeight                        */        720*2,                    /* imageStride                        */        0,                        /* activeVideoStartX                  */        0,                        /* activeVideoStartY                  */        720,                      /* activeVideoEndX                    */        576,                      /* activeVideoEndY                    */        vasPAL,                   /* tmVideoAnalogStandard_t            */        0,                        /* imageUVStride                      */    };static const tmVideoFormat_t defFormatNTSC =    {        sizeof(tmVideoFormat_t),  /* size                               */        0,                        /* hash                               */        0,                        /* referenceCount                     */        avdcVideo,                /* dataClass                          */        vtfYUV,                   /* dataType                           */        vdfUYVY,                  /* dataSubtype                        */        vdfInterlaced,            /* description                        */        720,                      /* imageWidth                         */        480,                      /* imageHeight                        */        720*2,                    /* imageStride                        */        0,                        /* activeVideoStartX                  */        0,                        /* activeVideoStartY                  */        720,                      /* activeVideoEndX                    */        480,                      /* activeVideoEndY                    */        vasNTSC,                   /* tmVideoAnalogStandard_t            */        0,                        /* imageUVStride                      */    };static tmAvFormat_t outputFormatVbi =
{
    sizeof(tmAvFormat_t),                                                           // size
    0,                                                                              // hash
    0,                                                                              // referenceCount
    avdcAuxVideoData,                                                               // dataClass
    avdtfDataService,                                                               // dataType
    vdsWSS|vdsVPS|vdsUSClosedCaption|vdsEuroClosedCaption|
	vdsEuroTeleText|vdsUSTeleText|vdsTeleText|vdsUSNABTS|vdsMoji,                                                                         // dataSubtype
    avdsGeneric                                                                     // description
};
/*----------------------- Global struct  ------------------------------------*/typedef struct _exolVideoInstance_t{    tmmlMmspHandle_t                hInstMemSpace;    /*------------- GfxVo ---------------------*/    Int                             hVrendGfxVo;    ptmolVrendGfxVoCapabilities_t   pVrendGfxVoCap;    ptmolVrendGfxVoInstanceSetup_t  pVrendGfxVoSetup;    // instance pointer and interface to encoder bsl    ptmVencAna_t                    pVencAnaInst;    tmUnitSelect_t                  VideoEncUnit;    Bool                            AnalogVideoEncoder;    /*------------- VcapVip -------------------*/    Int                             hVcapVip;    ptmolVcapVip2_Capabilities_t    pVcapVipCap;    ptmolVcapVip2_InstanceSetup_t   pVcapVipSetup;    
    int                             decInstance;
    /*------------- iodescr -------------------*/    ptsaInOutDescriptor_t           pVipToRend1InIod;
	ptsaInOutDescriptor_t           pVbiVipToRend1InIod;
    ptsaInOutDescriptor_t           pVipToRend2InIod;        /*---------------------- Tssa Clock setup ------------------------------*/
    tsaClockHandle_t                hClock;    tsaClockInstanceSetup_t         *pClockSetup;    /*---------------------- Input Format & adapter ------------------------*/
    tmVideoFormat_t                 InputFormat;    tmAvFormat_t					VbiFormat;
    Int                             InternalTestPattern;    // 0 for video in, 1 or 2 for internal patterns    // input video adapter for VIP    tmVideoAnalogAdapter_t          InputVideoAdapter;       // vaaSvideo  vaaCVBS    Int                             InputVideoAdapterType;    Int                             InputVideoAdapterIndex;
	Bool							VbiSlicerEnable;
	/*-----------------------Vbi Master Enable ------------------------------*/
	Bool							VbiEnable;
    /*---------------------- Output Format & adapter ------------------------*/
    tmVideoFormat_t                 OutputFormat;           // semi planar...
    tmVencAna_EncodingType_t        OutputVideoAdapter;     // cvbs, yc, vga
    tmVideoMode_t                   OutputVideoMode;        // The output video mode.	Bool							VbiInsertionEnabled;	Bool							InsertVbiData;			// These 4 flags are overkill but easy!	Bool							insertCCData;	Bool							insertWSSData4X3;	Bool							insertWSSData16X9;	FILE							*ccFile;    /*--------------------------- Layer setup -------------------------------*/    tmolVrendGfxVo_DeinterlaceMode_t    Deinterlace[TMOL_VRENDGFXVO_MAX_LAYERS];    tmolVrendGfxVo_EddiLevel_t          Eddi[TMOL_VRENDGFXVO_MAX_LAYERS];    /*---------------------- command line options ---------------------------*/    int                             timeout;        /*------------------- source rectangle ----------------------------------*/    Bool                            SourceWindow[2];    tmRect_t                        SourceWindowRect[2];    // destination rectangle    Bool                            DestinationWindow[2];    tmRect_t                        DestinationWindowRect[2];} exolVideoInstance_t, *pexolVideoInstance_t;//-----------------------------------------------------------------------------// Global data://-----------------------------------------------------------------------------//UInt8 vbiBuffer2[1024];//-----------------------------------------------------------------------------// Internal Function Prototypes://-----------------------------------------------------------------------------//void ProcessConfigs(pexolVideoInstance_t ivp);
static tmErrorCode_t doMainMenu(exolVideoInstance_t* ivp);static void RunVip(exolVideoInstance_t* ivp);static tmErrorCode_t doVipSubMenu(exolVideoInstance_t* ivp);static void SelectInputFormat(exolVideoInstance_t* ivp);void exEnableDbgFlags(int mutch);// callbacksstatic tmErrorCode_t tmolVcapVipProgFunc (Int inst,UInt32 flags,ptsaProgressArgs_t args);static tmErrorCode_t tmolVcapVipErrorFunc(Int inst, UInt32 flags,ptsaErrorArgs_t pErrorArgs);static tmErrorCode_t tmolVrendGfxVoProgFunc (Int inst,UInt32 flags,ptsaProgressArgs_t args);static tmErrorCode_t tmolVrendGfxVoErrorFunc(Int inst, UInt32 flags,ptsaErrorArgs_t pErrorArgs);

tmErrorCode_t exolVidVbiToggleVbiEnable(exolVideoInstance_t* ivp);
tmErrorCode_t exolVidVbiInsertCCData(exolVideoInstance_t* ivp, UInt8 cc1,UInt8 cc2 );
tmErrorCode_t exolVidVbiInsertWSSData(exolVideoInstance_t* ivp, Bool widescreen );//-----------------------------------------------------------------------------// FUNCTION:    VSYSTV_MAIN://// DESCRIPTION: The main function//// RETURN:      //// NOTES:       None//-----------------------------------------------------------------------------/////* For NDK stuff, */#undef tmMain_DBG_BUFF_SIZE#define tmMain_DBG_BUFF_SIZE (8*1024*1024)#define CHK(x) {tmErrorCode_t err=x ;\    DBG_PRINT((dbgexolVideo, DBG_LEVEL_4, "Calling %s from [%s:%d]", #x ,__FILE__,__LINE__))\    if(err) {\        printf("\nError: Function call %s in [%s:%d] returned error 0x%x\n\n", #x ,__FILE__,__LINE__,err);\        tmMain_EXIT(err);\    } else {DBG_PRINT((dbgexolVideo, DBG_LEVEL_4, "Successfully returned from Calling %s from [%s:%d]", #x ,__FILE__,__LINE__))}\}#if defined(TMFL_NEED_TM_TRACE)      #if TMFL_NEED_TM_TRACE == 1#include <tmTfeTrace.h>#include <tmml.h>void initTmTfeTrace(){	int traceBufferSize;    int *traceBuffer;    tmErrorCode_t tmError;    static tmmlMmspHandle_t handle;    static void* mem;    tmTfeTraceGetTraceBufferSize(&traceBufferSize);    tmError = tmmlCreate(&handle, traceBufferSize+1024, tmmlMmspMpCached);    if(tmError != TM_OK)        printf("Memspace creation for TFE trace failed");    tmError = tmmlMalloc(handle, traceBufferSize, (pVoid *) (&mem), tmmlMallocNone);    if(tmError != TM_OK)        printf("Malloc for TFE trace failed");    traceBuffer = mem;    tmTfeTraceInit(traceBuffer);}#endif //defined(USE_TFE_TRACE)#endif // USE_TFE_TRACEexolVideoInstance_t          g_ivp;tmMain(){    tmErrorCode_t                   tmError=TM_OK;    pexolVideoInstance_t            ivp=&g_ivp;    tmError=tmError;    // print a standard program header to help debug basic problems    printf("-= %s Version %d.%d Build:%d.  ",EXOLVIDVBI_COMPNAME,EXOLVIDVBI_MAJOR,EXOLVIDVBI_MINOR,EXOLVIDVBI_BUILD);    printf("Compiled: %s %s\n\n",__DATE__,__TIME__);    tmMain_PrintSystemInfo(Null);    // system info to debug buffer    tmMain_PrintSystemInfo(stdout);  // system info via printf    #if defined(TMFL_NEED_MEM_DEBUG)          #if TMFL_NEED_MEM_DEBUG == 1    {        tmErrorCode_t err = TM_OK;

⌨️ 快捷键说明

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