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

📄 exolvidpip.c

📁 1500 video test demo,please note.
💻 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:     exolVidPip.c//// DESCRIPTION:  video system test application//// DOCUMENT REF: TV Video System MPTK1500 FRS 1.1 : exolVidPip//// 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\exolVidPip_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(dbgexolVidPip)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                      */    };/*----------------------- Global struct  ------------------------------------*/typedef struct _exolVidPipInstance_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           pVipToRend2InIod;        /*---------------------- Tssa Clock setup ------------------------------*/
    tsaClockHandle_t                hClock;    tsaClockInstanceSetup_t         *pClockSetup;    /*---------------------- Input Format & adapter ------------------------*/
    tmVideoFormat_t                 InputFormat;    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;
	/*---------------------- Output Format & adapter ------------------------*/
    tmVideoFormat_t                 OutputFormat;           // semi planar...
    tmVencAna_EncodingType_t        OutputVideoAdapter;     // cvbs, yc, vga
    tmVideoMode_t                   OutputVideoMode;        // The output video mode.
	/*--------------------------- 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];
	Bool							pipWindow;
	tmRect_t						pipStartPos;
	tmosalEventHandle_t             endOfTask;
	} exolVidPipInstance_t, *pexolVidPipInstance_t;//-----------------------------------------------------------------------------// Global data://-----------------------------------------------------------------------------////-----------------------------------------------------------------------------// Internal Function Prototypes://-----------------------------------------------------------------------------//void ProcessConfigs(pexolVidPipInstance_t ivp);
static tmErrorCode_t doMainMenu(exolVidPipInstance_t* ivp);static void RunVip(exolVidPipInstance_t* ivp);static tmErrorCode_t doVipSubMenu(exolVidPipInstance_t* ivp);static void SelectInputFormat(exolVidPipInstance_t* ivp);
tmErrorCode_t exolVidPipChangeDstRect(exolVidPipInstance_t* ivp ,int LayerId, tmRect_t* rect);
void BouncingTask(pVoid ptr);
void ScalingTask(pVoid ptr);
tmErrorCode_t exolVidPipFadeLayer(exolVidPipInstance_t* ivp,int LayerId,int alpha);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);

//-----------------------------------------------------------------------------// 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((dbgexolVidPip, 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((dbgexolVidPip, 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_TRACEexolVidPipInstance_t          g_ivp;tmMain(){    tmErrorCode_t                   tmError=TM_OK;    pexolVidPipInstance_t            ivp=&g_ivp;    tmError=tmError;    // print a standard program header to help debug basic problems    printf("-= %s Version %d.%d Build:%d.  ",EXOLVIDPIP_COMPNAME,EXOLVIDPIP_MAJOR,EXOLVIDPIP_MINOR,EXOLVIDPIP_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;        err = tmMemDbgSetup(1*1024*1024, 0);  // first param is size of memory trace buffer                                              // second param is level of detail, 0, 1, or 2        if (err)         {            printf("Failed to allocate memory for memory debug buffer.  0x%x\n", err);            tmMain_EXIT (err);        }        tmMemDbgStart();        tmMemDbgWriteMessage("Setting marker check1:\n");        err = tmMemDbgMarkCheckpoint("check1");        if (err)             printf("Failed to set first tmMemDbg check point.  0x%x\n", err);        tmMemDbgWriteMessage("Starting:\n");    }    #endif    #endif          #if defined(TMFL_NEED_TM_TRACE)          #if TMFL_NEED_TM_TRACE == 1        printf("Initializing tmTfeTrace\n");	    initTmTfeTrace();    #endif    #endif

⌨️ 快捷键说明

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