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

📄 captest.c

📁 linux下的视频捕周编程应用程序
💻 C
字号:
head	1.2;access;symbols	START:1.1.1.1	F[Cujitsu:1.1.1;locks; strict;comment	@ * @;1.2date	2004.09.30.04.01.44;	author floyd;	state Exp;branches;next	1.1;deltatype	text;permissions	444;commitid	dc8415b84a31938;kopt	kv;filename	@captest.c@;1.1date	2004.09.30.01.37.07;	author floyd;	state Exp;branches	1.1.1.1;next	;deltatype	text;permissions	444;1.1.1.1date	2004.09.30.01.37.07;	author floyd;	state Exp;branches;next	;deltatype	text;permissions	444;desc@@1.2log@replace to new file@text@/*************************************************//**                                             **//**  Reference program for SPD                  **//**  FR-V Companion part TEST program           **//**  Video Capture Controller Test application  **//**  Copyright (C) 2004 FMC / Fujitsu           **//**                                             **//*************************************************//* * $Log: captest.c,v $ * Revision 1.1  2004/05/29 12:24:41  root * Initial revision * * */#include <stdio.h>#include <string.h>#include <linux/config.h>#include <AbsDeviceDrv/FRV_Companion/VideoDevice/inc/ADD_VideoCapture.h>#include <AbsDeviceDrv/FRV_Companion/VideoDevice/inc/ADD_VideoOut.h>static int ntsc_flg = 0;main(int argc, char **argv){	ADD_VideoStr	vs_in, vs_out;	char		*in, *out;	vs_in.mode = C2_NTSC;	vs_in.width = QVGA_W;	vs_in.height = QVGA_H;	ADD_CaptureInit(&vs_in);		if(argc > 1){		if(!strcmp(argv[1],"-ntsc")){			printf("NTSC mode\n");			vs_out.mode = C2_NTSC;			(unsigned int)out =				(unsigned int)ADD_VideoInit(&vs_out);			ADD_VideoStart();				ntsc_flg = 1;		}else if(!strcmp(argv[1], "-h")){			printf("usage : captest [-ntsc]\n");			exit(-1);		}else{			vs_out.mode = C2_QVGA;			vs_out.width = QVGA_W;			vs_out.height = QVGA_H;			(unsigned int)out = (unsigned int)atoi(argv[1]);			if(out == 0){				printf("bad vram address\n");			}		}	}else{		vs_out.mode = C2_QVGA;		(unsigned int)out = (unsigned int)ADD_VideoInit(&vs_out);		ADD_VideoStart();		}	printf("in : %d x %d\n", vs_in.width, vs_in.height);	printf("out: %d x %d\n", vs_out.width, vs_out.height);	ADD_CaptureStart();	while(1){		(unsigned int)in = (unsigned int)ADD_CaptureFrame(1);#ifdef CONFIG_VDC_E_MEDIAMASTER		if(vs_out.width == vs_in.width &&	           vs_out.height == vs_in.height){			bcopy(in, out, vs_out.width*vs_out.height*2);		}else{			int y;			for(y = 0; y < vs_in.height; y++){				bcopy(in + y * vs_in.width * 2,				      out + y * vs_out.width * 2,				      vs_in.width * 2);			}		}#else		if(ntsc_flg){			// Interlace convert. output to center of screen			PIconv_o(in, QVGA_W*2,QVGA_H,				out + (720*60+200)*2, NTSC_W*2); 			PIconv_e(in, QVGA_W*2,QVGA_H,				out + NTSC_W*NTSC_H + (720*60+200)*2,				NTSC_W*2); 		}else{			bcopy(in, out, QVGA_W*QVGA_H*2);		}#endif		ADD_FreeCapturedFrame();	}}@1.1log@Initial revision@text@@1.1.1.1log@native SPD@text@@

⌨️ 快捷键说明

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