Hi there,
I am writing a small program to test capture abilities of my frame
grabber. The problem is that I don't know what is going on with the image
captured. Is it possible that I am not capturing using the right
parameters such as palette and norm and that could be causing the
problem? How do I know what palettes are supported by my framegrabber?
Does it have to be in accord with the frame buffer depth? Here is a small
part of the program. If anybody out there could have a look and maybe
point me out some more detailed documentation to read or even correct my
program, I'd appreciated a lot.
if (ioctl (fdVideoDev, VIDIOCGMBUF, &vd.CapturedFrameBuffer) == -1) {
map = (char*) malloc (vd.Window.width * vd.Window.height * 3);
len = read (fdVideoDev, map, vd.Window.width * vd.Window.height * 3);
if (len <= 0) {
free (map);
return (NULL);
}
//*size = 0;
return (map);
}
//CapturedFrameBuffer is struct video_mbuf
vd.buf_v4l = (struct video_mmap*)malloc(vd.CapturedFrameBuffer.frames *
sizeof(struct video_mmap));
//buf_v4l is struct video_mmap
vd.buf_v4l[0].format = vd.Picture.palette;
vd.buf_v4l[0].frame = 0;
vd.buf_v4l[0].width = vd.Window.width;
vd.buf_v4l[0].height = vd.Window.height;
if (ioctl (fdVideoDev, VIDIOCMCAPTURE, &(vd.buf_v4l[0])) == -1) {
perror ("VIDIOCMCAPTURE");
munmap (map, vd.CapturedFrameBuffer.size);
return (NULL);
}
FILE *out;
out = fopen("pic","w");
fprintf(out,"P5\n%d
%d\n255\n",vd.buf_v4l[0].width,vd.buf_v4l[0].height);
fwrite(frame,vd.buf_v4l[0].width,vd.buf_v4l[0].height,out);
Thank's in advance,
Marcio Cabral
_______________________________________________
Video4linux-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/video4linux-list