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

📄 tskvideoinput.c

📁 DM642多媒体原版程序代码,用于图象,语音算法.
💻 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 <vport.h>
#include <vportcap.h>
#include <tvp51xx.h>

#include "seeddm642.h"
#include "seedvpm642_vcapparams.h"

#include "edc.h"                   
#include "saa7115.h"    
#include "appMain.h"
#include "appThreads.h"
#include "tskVideoInput.h"
#include "prepost.h"




ScomBufChannels MsgInput;
FVID_Frame *capFrameBuf;
unsigned char InData[0x97E00];

/*-----------------------------------------------------------*/
/* heap IDs defined in the BIOS configuration file           */
/*-----------------------------------------------------------*/
//extern MBX_Obj VP1CAPTURE;
extern int EXTERNALHEAP;
FVID_Handle capChanCh1;


/*-----------------------------------------------------------*/
/* heap IDs defined in the BIOS configuration file           */
/*-----------------------------------------------------------*/
//extern MBX_Obj VP1CAPTURE;
extern int EXTERNALHEAP;
FVID_Handle capChanCh1;

void tskVideoInputInit()
{
    
    int status;    
    SEEDVPM642_vCapParamsChan.segId = EXTERNALHEAP ;//EXTERNALHEAP;
    SEEDVPM642_vCapParamsTVP5150.hI2C = SEEDVPM642_I2C_hI2C; /*打开驱动程序*/  

	/******************************************************/
    /* initialization of capture driver                   */
    /******************************************************/
	/*打开第一通路*/
	capChanCh1  = FVID_create(	"/VP1ACAPTURE/A/1", 
            				    IOM_INPUT, 
            				    &status, 
            				    (Ptr)&SEEDVPM642_vCapParamsChan, 
            				    NULL);   	
    /******************************************************/
    /* configure video encoder 			                  */
    /******************************************************/
    /*配置第一通路的TVP5150*/
    FVID_control( capChanCh1, 
    			  VPORT_CMD_EDC_BASE+EDC_CONFIG, 
        		  (Ptr)&SEEDVPM642_vCapParamsTVP5150);	


}


/*-----------------------------------------------------------*/
/*Start the capturing                                        */
/*-----------------------------------------------------------*/
void tskVideoInputStart() 
{
	FVID_control(capChanCh1, VPORT_CMD_START, NULL);
}


/*-----------------------------------------------------------*/
/* handle video capture, scaling and re-format               */
/*-----------------------------------------------------------*/
void tskVideoInput()
{
  SCOM_Handle fromInputtoProc,fromProctoInput;
    char *outBuf[3];
    char *inBuf[3];
    
    fromInputtoProc = SCOM_open("INTOPROC");
    fromProctoInput = SCOM_open("PROCTOIN");

	FVID_alloc(capChanCh1, &capFrameBuf);

 	while(1)
 	{	
 		inBuf[0]  = capFrameBuf->frame.iFrm.y1;
        inBuf[1]  = capFrameBuf->frame.iFrm.cb1;
        inBuf[2]  = capFrameBuf->frame.iFrm.cr1;

        outBuf[0] =  (char *)(&InData[0]);
        outBuf[1] =  (char *)(&InData[0x65400]);
        outBuf[2] =  (char *)(&InData[0x7E900]);

        yuv422to420(inBuf,outBuf, 720, 576);
        	
	 	MsgInput.bufChannel = &InData[0];
	 	
        /*-----------------------------------------------------------*/
	   	/* Send message to process task with pointers to captured frame*/
	   	/*-----------------------------------------------------------*/
        SCOM_putMsg(fromInputtoProc, &MsgInput);
			
		/*-----------------------------------------------------------*/
	   	/* Wait for the message from the process task                */
	   	/*-----------------------------------------------------------*/
        SCOM_getMsg(fromProctoInput, SYS_FOREVER);
        	
        /*-----------------------------------------------------------*/
        /* Capture a new frame.                                      */
        /*-----------------------------------------------------------*/
       	FVID_exchange(capChanCh1, &capFrameBuf);
	 	
	 }	    
}

⌨️ 快捷键说明

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