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

📄 tskvideoinput.c

📁 DM643sobel边缘检测程序
💻 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 <vportcap.h>
#include <tvp51xx.h>    
#include <dec643.h>
#include <evmdm642_capParamsSDTVDefault.h>

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

VPORT_PortParams EVMDM642_vCapParamsPort 
  = EVMDM642_CAP_PARAMS_PORT_EMBEDDED_DEFAULT;


static VPORTCAP_Params EVMDM642_vCapParamsChan 
  = EVMDM642_CAP_PARAMS_CHAN_EMBEDDED_DEFAULT(PAL720);

static TVP51XX_ConfParams EVMDM642_vCapParamsTVP5150 
  = EVMDM642_CAP_PARAMS_TVP51XX_EMBEDDED_DEFAULT(PAL601, COMPOSITE, 0);

FVID_Handle  capChan;
FVID_Frame *capFrameBuf;

ScomBufChannels MsgInput;

unsigned char InData[0x97E00];

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

void tskVideoInputInit()
{
    
    int status;    
    /******************************************************/
    /* allocate capture  frame buffers                    */
    /* in external heap memory                            */
    /******************************************************/
     EVMDM642_vCapParamsChan.segId = extHeap ;//EXTERNALHEAP;
     EVMDM642_vCapParamsTVP5150.hI2C = DEC643_I2C_hI2C;
     capChan = FVID_create("/VP1CAPTURE/A/1", 
        IOM_INPUT, &status, (Ptr)&EVMDM642_vCapParamsChan, NULL);

	 FVID_control(capChan, VPORT_CMD_EDC_BASE + EDC_CONFIG, 
      (Ptr)&EVMDM642_vCapParamsTVP5150);

}


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

void tskVideoInput()
{
    int frame=0;
    SCOM_Handle fromInputtoProc,fromProctoInput;
    char *outBuf[3];
    char *inBuf[3];
    //ScomMessage scomMsg;
    fromInputtoProc = SCOM_open("INTOPROC");
    fromProctoInput = SCOM_open("PROCTOIN");

    FVID_alloc(capChan, &capFrameBuf);

    while(1)
    {
        frame++;

        UTL_stsStart( stsCapTime );

        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];
	 	

        UTL_stsStop( stsCapTime );
       
		SCOM_putMsg(fromInputtoProc,&MsgInput);
        // Calculate how long it takes to capture one frame
        UTL_stsPeriod( stsCycleTime );

        FVID_exchange(capChan, &capFrameBuf);

        SCOM_getMsg(fromProctoInput, SYS_FOREVER);
    }
}

⌨️ 快捷键说明

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