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

📄 tskvideooutput.c

📁 基于TI DSP TMS320DM642 平台的上的H.263示例代码。
💻 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 "appMain.h"
#include "appThreads.h"
#include "tskVideoOutput.h"
#include "prepost.h"

ThrOutput thrOutput;

/* heap IDs defined in the BIOS configuration file */
extern int extHeap;

#pragma DATA_SECTION(scratch2,".internal_data1");
#pragma DATA_ALIGN(scratch2,8);
unsigned char scratch2[20*LINE_SZ];


FVID_Handle  disChan;
FVID_Frame *disFrameBuf;


/*-------------------------------------------------------*/
/* 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()
{

    unsigned char   *frame;
    IMG in1,out1;
    SCRATCH scr;
    
    SCOM_Handle fromProctoOut,fromOuttoProc;
	ScomBufChannels *pMsgBuf; 
    fromProctoOut = SCOM_open("PROCTOOUT");
	fromOuttoProc = SCOM_open("OUTTOPROC");
	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);
        frame = (char *)pMsgBuf->bufChannel;
            		   
 		in1.Y_data  = (unsigned char*)(*(int*)(frame+0));
 		in1.Cb_data = (unsigned char*)(*(int*)(frame+4));
		in1.Cr_data = (unsigned char*)(*(int*)(frame+8));

		out1.Y_data = disFrameBuf->frame.iFrm.y1;
		out1.Cb_data = disFrameBuf->frame.iFrm.cr1;
		out1.Cr_data = disFrameBuf->frame.iFrm.cb1;

 		scr.in_data = scratch2;	
 		CACHE_clean(CACHE_L2ALL,NULL,NULL);

 		/*-----------------------------------------------------------*/
 		/* Call YUV420to422v to do chroma resampling                 */
 		/*-----------------------------------------------------------*/
 		YUV420to422v(&in1,&out1,720,MAX_NUM_LINES_PER_FIELD*2,&scr);	
		
 		CACHE_clean(CACHE_L2ALL,NULL,NULL);

       	/*-----------------------------------------------------------*/
       	/* Display the decoded frame.                                */
      	/*-----------------------------------------------------------*/
	    FVID_exchange(disChan, &disFrameBuf);
  
 	  	/*-----------------------------------------------------------*/
   		/* Send message to process task to continue                  */
   		/*-----------------------------------------------------------*/
 	  	SCOM_putMsg(fromOuttoProc, pMsgBuf);

	}	    

}

⌨️ 快捷键说明

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