基于V4L(video4linux)的视频采集相关代码(2)

 /*
* http://www.jollen.org
*
* v4l.c - the video4linux user space library
* by 2001 Jollen
*/
#ifndef _V4L_H_
#define _V4L_H_

#include
#include

#define PAL_WIDTH 768
#define PAL_HEIGHT 576
#define CIF_WIDTH 352
#define CIF_HEIGHT 288
#define NTSC_WIDTH 320
#define NTSC_HEIGHT 240

#define FALSE 0
#define TRUE -1

struct _v4l_struct
{
   int fd;
   struct video_capability capability;
   struct video_buffer buffer;
   struct video_window window;
   struct video_channel channel[8];
   struct video_picture picture;
   struct video_tuner tuner;
   struct video_audio audio[8];
   struct video_mmap mmap;
   struct video_mbuf mbuf;
   unsigned char *map;
   int frame_current;
   int frame_using[VIDEO_MAX_FRAME];
};

struct _v4l_attr {
   long nr;
   const char *name;
};

typedef struct _v4l_struct v4l_device;
typedef struct _v4l_attr V4LATTR;

extern int v4l_open(char *, v4l_device *);
extern int v4l_close(v4l_device *);
extern int v4l_get_capability(v4l_device *);
extern int v4l_set_norm(v4l_device *, int);
extern int v4l_get_channels(v4l_device *);
extern int v4l_get_audios(v4l_device *);
extern int v4l_get_picture(v4l_device *);
extern int v4l_grab_init(v4l_device *, int, int);
extern int v4l_grab_frame(v4l_device *, int);
extern int v4l_grab_sync(v4l_device *);
extern int v4l_mmap_init(v4l_device *);
extern int v4l_get_mbuf(v4l_device *);
extern int v4l_get_picture(v4l_device *);
extern int v4l_set_picture(v4l_device *, int, int, int, int, int);
extern int v4l_grab_picture(v4l_device *, unsigned int);
extern int v4l_set_buffer(v4l_device *);
extern int v4l_get_buffer(v4l_device *);
extern int v4l_switch_channel(v4l_device *, int);
extern int v4l_set_palette(v4l_device *, int, int);

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值