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

📄 tskvideooutput.c

📁 闻亭提供的DM642EVM板时频编码演示程序
💻 C
字号:
/*
 *  Copyright 2003 by Texas Instruments Incorporated.
 *  All rights reserved. Property of Texas Instruments Incorporated.
 *  Restricted rights to use, duplicate or disclose this code are
 *  granted through contract.
 *  
 */
#include <std.h>
#include <csl.h>
#include <csl_dat.h>
#include <csl_cache.h>
#include <chan.h>
#include <scom.h>
#include <utl.h>
#include <fvid.h>
#include <tsk.h>
#include "edc.h"

#include "vport.h"
#include "vportdis.h"
#include "evmdm642.h"                      
#include "saa7105.h"    
#include "evmdm642_vdisparams.h"
#include "evm642_mpeg2enc.h"


#include "appMain.h"
#include "appThreads.h"
#include "tskVideoOutput.h"

ThrOutput thrOutput;

/*-------------------------------------------------------*/
/* Initialize the display channel                        */
/*-------------------------------------------------------*/
void tskVideoOutputInit()
{
    
    int status;    

	EVMDM642_vDisParamsChan.segId = extHeap; //EXTERNALHEAP;
    EVMDM642_vDisParamsSAA7105.hI2C = EVMDM642_I2C_hI2C;
    
    /******************************************************/
    /* initialization of display driver                   */
    /******************************************************/
    disChan = FVID_create("/VP2DISPLAY", IOM_OUTPUT, 
        &status, (Ptr)&EVMDM642_vDisParamsChan, NULL);
        

    /******************************************************/
    /* configure video encoder & decoder                  */
    /******************************************************/
    FVID_control(disChan, VPORT_CMD_EDC_BASE + EDC_CONFIG, 
        (Ptr)&EVMDM642_vDisParamsSAA7105);	
}


/*-------------------------------------------------------*/
/* Start the display channel                             */
/*-------------------------------------------------------*/
void tskVideoOutputStart() 
{
	FVID_control(disChan, VPORT_CMD_START, NULL);
}

/*-------------------------------------------------------*/
/* handle video display, scaling and re-format           */
/*-------------------------------------------------------*/
void tskVideoOutput()
{
    int             status;

    unsigned int *bufs;
    
    char *inBuf[3], *outBuf[3];

   
    SCOM_Handle fromProctoOut,fromOuttoIn;

	ScomBufChannels *pMsgBuf; 

    fromProctoOut = SCOM_open("PROCTOOUT");
	fromOuttoIn = SCOM_open("OUTTOIN");


	FVID_alloc(disChan, &disFrameBuf);

	while(1) 
	{
 	    /*-----------------------------------------------------------*/
  	    /* Wait for the message from the process task to recieve new */
  		/* frame to be displayed.                                    */
   		/*-----------------------------------------------------------*/
 		pMsgBuf = SCOM_getMsg(fromProctoOut, SYS_FOREVER);
       	status = pMsgBuf->status;   
	   	if(status) 
	   	{
	        bufs = pMsgBuf->bufChannel;
	        inBuf[0] = (char *)bufs[0];
	        inBuf[1] = (char *)bufs[1];                  
	        inBuf[2] = (char *)bufs[2];                  
	                           
	        outBuf[0] =  disFrameBuf->frame.iFrm.y1;
	        outBuf[1] =  disFrameBuf->frame.iFrm.cb1;
	        outBuf[2] =  disFrameBuf->frame.iFrm.cr1;
	 		
	 		/*-----------------------------------------------------------*/
 			/* Call YUV420to422 to do chroma resampling                  */
 			/*-----------------------------------------------------------*/
	        yuv420to422(inBuf,outBuf,720,480);
            
           	/*-----------------------------------------------------------*/
	       	/* Display the decoded frame.                                */
    	  	/*-----------------------------------------------------------*/
		    FVID_exchange(disChan, &disFrameBuf);
       }

 	  	/*-----------------------------------------------------------*/
   		/* Send message to input task to continue                    */
   		/*-----------------------------------------------------------*/
 	    SCOM_putMsg(fromOuttoIn, pMsgBuf);

    }
}

⌨️ 快捷键说明

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