|
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <math.h>
#include <errno.h>
#include <fcntl.h>
#include <string.h>
#include <signal.h>
#include <pthread.h>
#include <sys/types.h>
#include <sys/time.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <sys/mman.h>
#include <linux/types.h>
#include <linux/videodev.h>
在下面有个函数。我做摄像头采集数据的
unsigned char *camera_video_mmap(int cam_fd, struct video_mbuf *mbuf)
{
unsigned char *grab_data;
int debug_temp;
if((debug_temp == camera_video_mbuf(cam_fd, mbuf)) < 0)
{
fprintf(stderr,"the calling of camera_video_mbuf method is failure!\n");
exit(1);
}
if((grab_data = (unsigned char *)mmap(0, mbuf->size, PROT_READ | PROT_WRITE, MAP_SHARED, cam_fd, 0)) == MAP_FAILED)
{
if(erron == EINVAL) fprintf(stderr, "the erron NO is erron=%d\n",erron);
fprintf(stderr,"the calling of mmap method to get the value of grab_data is failure!\n");
exit(1);
}
return (grab_data);
}
}
//////////////////////////////////////////////////////////////////////////////
我这个mmap函数调用不起。返回的是MAP_FAILED。。。我想从erron中看到错误类型。。
可是我编译的时候。gcc -c camera.c(注camera.c是我保存的文件名)提示我没有定义erron这个变量。。
怎么回事情啊。。。
请教给位了。。。 |
|