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

📄 test.cpp

📁 Microsoft WinCE 6.0 BSP FINAL release source code for use with the i.MX27ADS TO2 WCE600_FINAL_MX27_S
💻 CPP
字号:
//-----------------------------------------------------------------------------
//
// Copyright (C) 2006, Freescale Semiconductor, Inc. All Rights Reserved.
// THIS SOURCE CODE, AND ITS USE AND DISTRIBUTION, IS SUBJECT TO THE TERMS
// AND CONDITIONS OF THE APPLICABLE LICENSE AGREEMENT
//
//-----------------------------------------------------------------------------
//
// File: main.cpp
//
// the main function for loopback demo application
//
//-----------------------------------------------------------------------------
#include <windows.h>
#include "vpu_api.h"
#include "bsp.h"
#include "test.h"

BOOL g_fLoopTest = TRUE;
PhysicalAddress BitstreamPhy;
UINT8* pBitStream; 

double	fHighFre;

int main()
{
    RetCode ret;
    CodStd codestd;
    DWORD dwtmp;
    LARGE_INTEGER liFre, litmp0, litmp1;

	VPUMemAlloc  bitstreambuf = {0};
    QueryPerformanceFrequency(&liFre);
    fHighFre = (double)liFre.QuadPart;

    QueryPerformanceCounter(&litmp0);
    QueryPerformanceCounter(&litmp1);
    dwtmp = (DWORD) (litmp1.QuadPart - litmp0.QuadPart);

    printf("\n\nHigh-resolution Frequency: %f calltime: %d\n",fHighFre,dwtmp);

    // Initiate vpu*/
    ret = vpu_Init(); 
    if( ret != RETCODE_SUCCESS && ret != RETCODE_CALLED_BEFORE ) { 
    	DEBUGMSG(1, (_T("vpu_Init failed Error code is 0x%x \n"),  ret));
    	goto MAIN_CLEANUP;
    }

    {   // check version
    	char productstr[18]={0};
    	char versionstr[18]={0};
    	Uint32 versioninfo;
    	Uint16 pn;
    	Uint16 version;
    	Uint8  ipprjnum;
     
    	vpu_GetVersionInfo( &versioninfo );    		
    	pn = (Uint16)(versioninfo>>16);
    	version = (Uint16)versioninfo;
    	ipprjnum = (Uint8)(pn);

        switch(ipprjnum) {
            case (PRJ_TRISTAN & 0x0f):
                strcpy(productstr, "TRISTANeX");
                break;
            case (PRJ_TRISTAN_REV & 0x0f):
                strcpy(productstr, "TRISTANeX-Rev");
                break;	
            case (PRJ_PRISM_CX & 0x0f):
                strcpy(productstr, "PRiSM-CX");
                break;
            case (PRJ_SHIVA & 0x0f):
                strcpy(productstr, "Shiva");
                break;
            case (PRJ_PRISM_EX & 0x0f):
                strcpy(productstr, "PRiSM-EX");
                break;
            default: break;
        }

        sprintf( versionstr, "%04d.%04d.%08d", (version>>(12))&0x0f, (version>>(8))&0x0f, (version)&0xff );

        RETAILMSG(1, (_T("VPU Firmware Version => \n product : %S | version : %S\n\n"),  productstr, versionstr));
    }

    // Allocate bitstream buffer for decoder

	if (RETCODE_SUCCESS != vpu_AllocPhysMem(CODEC_BITSTREAM_SIZE, &bitstreambuf)) {
        goto MAIN_CLEANUP;
    }
    pBitStream = (UINT8 *)bitstreambuf.VirtAdd;
	BitstreamPhy = bitstreambuf.PhysAdd;
    
    if(!pBitStream){
    	goto MAIN_CLEANUP;
    }
    codestd = CODEC_STD;
    DecodeTest(codestd);

MAIN_CLEANUP:
    vpu_Deinit();
    return 0;   
}

⌨️ 快捷键说明

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