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

📄 ipipe_vga_example.c

📁 德州仪器新推出的达芬奇技术dm355的源代码
💻 C
字号:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>		/* low-level i/o */
#include <unistd.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/time.h>
#include <sys/mman.h>
#include <sys/ioctl.h>
#include <fcntl.h>
#include <linux/fb.h>
#include <asm/types.h>		/* for videodev2.h */
#include <pthread.h>
#include <time.h>
#include <linux/videodev.h>
#include <media/dm355_vpfe.h>	/*kernel header file, prefix path comes from
				   makefile */
#include <video/davincifb.h>
#include "ipipe_example.h"
#include <asm/arch/dm355_ipipe.h>
#include "ipipe_config.h"
#include "mt9t001_capture.h"
#include "display.h"

#define CAP_FORMAT		(V4L2_STD_MT9T001_VGA_30FPS)
#define CAP_WIDTH		(VGA_WIDTH)//+HCROP)
#define CAP_HEIGHT		(VGA_HEIGHT)//+VCROP)
#define CAP_PITCH		((CAP_WIDTH * 2 + 31) & (~31))

static struct buffer ipipebuffer;

extern int errno;
static int StartCameraCapture(void);

int main(int argc, char *argv[])
{
	StartCameraCapture();
	CloseCaptureDevice();
	CloseIpipe(&ipipebuffer);
	restore_display_config();
	return 0;
}

int StartCameraCapture(void)
{
	int capbuf_phyaddr;
	unsigned short *addr;
	unsigned char *addr8;
	int i,j;
	int max;
	printf("initializing capture device\n");
	InitCaptureDevice(CAP_FORMAT, CAP_WIDTH, CAP_HEIGHT);
	printf("initialize Ipipe");
	InitIpipe(CAP_WIDTH, CAP_HEIGHT, &ipipebuffer);
	printf("initializing display device\n");
	InitDisplayDevice();
	printf("starting streaming\n");
	StartStreaming();

	for (;;){
		CaptureFrame(&capbuf_phyaddr);
		DoIPIPING(CAP_WIDTH, CAP_HEIGHT, capbuf_phyaddr);

		DisplayFrame(ipipebuffer.start, VGA_WIDTH, VGA_HEIGHT);

	}			/*End of for loop */
}





⌨️ 快捷键说明

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