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

📄 tskvideocapturevp1.c

📁 dsp平台的一路采集显示算法源码。详细介绍路采集显示。
💻 C
字号:
/*
 *  Copyright 2004 by SEED Incorporated.
 *  All rights reserved. Property of SEED Incorporated.
 *  Restricted rights to use, duplicate or disclose this code are
 *  granted through contract.
 *  
 */
#include <std.h>
#include <tsk.h>
#include <vport.h>
#include <vportcap.h>
#include <tvp51xx.h> 
#include <csl_edma.h>
#include <fvid.h>
#include <csl_dat.h>
#include <csl_cache.h>
#include <scom.h>

#include "seeddm642.h"
#include "seedvpm642cfg.h"
#include "seedvpm642_vcapparams.h"
#include "seedvpm642_tskvp1.h"

//extern MBX_Obj VP1CAPTURE;
extern int EXTERNALHEAP;
FVID_Handle capChanCh1;
/*
 * ======== tskVideoCaptureVp1Init ========
 * video capture function init.
 */
void VideoCaptureVp1Init()
{
	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);	
}
/*
 * ======== tskVideoCaptureVp1Start ========
 * video capture function start.
 */
void VideoCaptureVp1Start()
{
	/*启动采集*/     		  
    FVID_control(capChanCh1, VPORT_CMD_START, NULL);
}
/*
 * ======== tskVideoCaptureVp1 ========
 * video capture function.
 */
void tskVideoCaptureVp1()
{
	FVID_Frame *capFrameBuf;
	SCOM_Handle fromInput1toDIS,fromDIStoInput1;
    
    /*打开SCOM模块*/
    fromInput1toDIS = SCOM_open("IN1TODIS");
    fromDIStoInput1 = SCOM_open("DISTOIN1");
    /*申请一个空间*/
    FVID_alloc(capChanCh1, &capFrameBuf);
	
	while(1)
    {		
		/*-----------------------------------------------------------*/
   		/* Send message to process task with pointers to captured frame*/
   		/*-----------------------------------------------------------*/
    	SCOM_putMsg(fromInput1toDIS, (FVID_Frame *)capFrameBuf);
		
		/*-----------------------------------------------------------*/
   		/* Wait for the message from the process task                */
   		/*-----------------------------------------------------------*/
    	SCOM_getMsg(fromDIStoInput1, SYS_FOREVER);
    	
    	/*-----------------------------------------------------------*/
    	/* Capture a new frame.                                      */
    	/*-----------------------------------------------------------*/
    	FVID_exchange(capChanCh1, &capFrameBuf);	    
	}	
}

⌨️ 快捷键说明

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