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

📄 spcav4l.h

📁 2410下面摄像头抓图程序
💻 H
字号:
/****************************************************************************
Mouse-capture Version 2:2006-7-5
This program is used to get continuous pictures from a jpeg webcam to show them in lcd(240x320,Of course,you can modify the size).
It is made for ARM9.
It is modified from servfox by daily3(戴丽-戴小鼠 in Hefei University of Technology and HHCN-BBS).
Thanks to 我爱狗熊.
If you have problems ,you can contact me.
Email:daily3@126.com
Wish you some useful help!
Best Wish to the orignal authors! Thank you very much!
****************************************************************************/
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <signal.h>
#include <errno.h>
#include <stdarg.h>
#include <linux/types.h>
#include <linux/videodev.h>
#include <sys/mman.h>
#include <sys/ioctl.h>
#include <sys/file.h>
#include <sys/types.h>
#include <sys/stat.h>

/* V4L1 extension API */
#define VIDEO_PALETTE_JPEG  21
/* in case default setting */
#define WIDTH 352
#define HEIGHT 288
#define BPPIN 8


#define OUTFRMNUMB 4

#define BRIDGE_ZC3XX 0
#define MAX_BRIDGE 2
#define JPEG 0
#define UNOW 1

struct bridge_list {
	int num;
	const char *name;
};

struct vdIn {
	int fd;
	char *videodevice ;
	struct video_mmap vmmap;
	struct video_capability videocap;
	int mmapsize;
	struct video_mbuf videombuf;
	struct video_picture videopict;
	struct video_window videowin;
	struct video_channel videochan;	
	int cameratype ;
	char *cameraname;
	char bridge[9];
	int palette; // available palette
	int channel ; // set spca506 usb video grabber
	int grabMethod ;
	unsigned char *pFramebuffer;
	unsigned char *ptframe[4];
	int framelock[4];
	int framesizeIn ;
	volatile int frame_cour;
	int bppIn;
	int  hdrwidth;
	int  hdrheight;
	int  formatIn;

	};
	struct vdIn videoIn;

static struct bridge_list Blist[]={
	{BRIDGE_ZC3XX,"ZC301-2"},
};

static int init_v4l (struct vdIn *vd);
static int checkpalette (struct vdIn *vd);
static int isSpcaChip ( const char * BridgeName );
/* return Bridge otherwhise -1 */
static int GetStreamId ( const char * BridgeName );
/* return Stream_id otherwhise -1 */
static int
GetDepth (int format);






	
int
init_videoIn(struct vdIn *vd,char *device,int width,int height,int format,int grabmethod);
int v4lGrab (struct vdIn *vd, char *filename);
int close_v4l (struct vdIn *vd);
int setPalette (struct vdIn *vd);


int
get_jpegsize (unsigned char *buf, int insize);
 
void
exit_fatal(char *messages);

⌨️ 快捷键说明

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