#根据网上常见的一个测试程序修改而来 by rockie cheng
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#define CLEAR(x) memset (&(x), 0, sizeof (x))
struct buffer {
void * start;
size_t length;
};
static char * dev_name = "/dev/video0";
static int fd = -1;
struct buffer * buffers = NULL;
FILE *file_fd;
static unsigned long file_length;
static unsigned char *file_name;
int main (int argc,char ** argv)
{
struct v4l2_capability cap;
struct v4l2_format fmt;