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

📄 tskvideoinput.c

📁 ZPAV (H265) DM64XX(TI) demo ZPAV (H265) 是 音视频 压缩解压 协议
💻 C
字号:

/*
///////////////////////////////////////////////////////////////////////////////
//                                                                           //
//   Copyright (C) 2006-2008  Beijing,  pengzhen  (pengzhenxp@yahoo.com.cn)  //
//                                                                           //
///////////////////////////////////////////////////////////////////////////////
*/

#include <std.h>
#include <stdio.h>
#include <csl.h>
#include <csl_dat.h>
#include <csl_cache.h>
#include <fvid.h>
#include <tsk.h>
#include "edc.h"

#include <vport.h>
#include <vportcap.h> 
   
#include "NetworkMain.h"

#ifdef __TVP5150__
#include "settings\TVP5150.c"
#endif /* __TVP5150__ */

#ifdef __SAA7115__
#include "settings\saa7115.c"
#endif /* __SAA7115__ */


extern FVID_Handle  m_hVi    ;

/*
 *  ======== tskVideoInputInit ========
 *  Open Capture channel and init channel data
 */
void tskVideoInputInit()
{

	VPORTCAP_Params * ViParams = & m_ViParams ; 

    int             status = 0 ;
    EDC_Handle 		handle = 0 ;

    ViParams->segId = extHeap;
    
# if VI_PAL /* PAL */
    {
	    ViParams->fldXStop1  = 720-8-1;
	    ViParams->fldYStop1  = 288;
	    ViParams->fldXStop2  = 720-8-1;
	    ViParams->fldYStop2  = 288;

		image_width  = default_width ;
        image_height = default_height ;
	    //image_width  = 352 ;
        //image_height = 288 ;
	    image_max_width  = 352*2 ;
	    image_max_height = 288*2 ;
    }
#else  /* NTSC */
    {
	    ViParams->fldXStop1  = 640-1;
	    ViParams->fldYStop1  = 240;
	    ViParams->fldXStop2  = 640-1;
	    ViParams->fldYStop2  = 240;

		image_width  = default_width ;
        image_height = default_height ;
        //image_width  = 320 ;
        //image_height = 240 ;
	    image_max_width  = 320*2 ;
	    image_max_height = 240*2 ;
    } 
#endif /* 1 */
    

	ViParams->scale  = VPORT_RESMPL_DISABLE ;
	//ViParams->scale  = ( image_width > image_max_width/2) ? VPORT_RESMPL_DISABLE : VPORT_SCALING_ENABLE ;
	ViParams->fldOp  = ( image_height > image_max_height/2 ) ? VPORT_FLDOP_FRAME : VPORT_FLDOP_FLD1 ;
	
	//ViParams->resmpl = VPORT_RESMPL_ENABLE ; /* YUV420 */
	//ViParams->mergeFlds  = ( image_height > image_max_height/2 ) ? VPORT_FLDS_MERGED : VPORT_FLDS_SEPARATED ;


	/*Create New capture Devices*/    

#ifdef __TVP5150__
	m_ViTVP5150.hI2C = EVMDM642_I2C_hI2C;
	handle = TVP5150_Fxns.open("/0",NULL); 
	TVP5150_Fxns.ctrl(handle, EDC_CONFIG, (Arg)(Ptr)&m_ViTVP5150); 
	
    m_hVi = FVID_create("/VP0CAPTURE/A/0", IOM_INPUT, &status, (Ptr)&m_ViParams, NULL);
    FVID_control(m_hVi, VPORT_CMD_EDC_BASE + EDC_CONFIG, (Ptr)&m_ViTVP5150);
#endif /* __TVP5150__ */

#ifdef __SAA7115__
	m_ViSAA7115.hI2C = EVMDM642_I2C_hI2C;
	handle = SAA7115_Fxns.open("/0",NULL); 
	SAA7115_Fxns.ctrl(handle, EDC_CONFIG, (Arg)(Ptr)&m_ViSAA7115); 
	
    m_hVi = FVID_create("/VP0CAPTURE/A/0", IOM_INPUT, &status, (Ptr)&m_ViParams, NULL);
    FVID_control(m_hVi, VPORT_CMD_EDC_BASE + EDC_CONFIG, (Ptr)&m_ViSAA7115);
#endif /* __SAA7115__ */

}

/*
 *  ======== tskVideoInputStart ========
 *  Start Capture 
 */

void tskVideoInputStart()
{
	/*Start New capture */    
    FVID_control(m_hVi, VPORT_CMD_START, NULL);
}



⌨️ 快捷键说明

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