Hey Geoff,

 

This is a great file to start with. In fact it's what I used first.
Couple things make it a bit tricky. One is that he's using switch
statements to separate different ways to read from the cameras, so
you'll want to note which method you're using, (should be MMAP).

 

The line where he actually captures a frame is in the read_frame
function. 

 

(-1 == xioctl (fd, VIDIOC_DQBUF, &buf))

 

This blocks until it's able to deque a frame from the camera (unless you
specify non-blocking when you open the cam file, in which case it
returns -1 when it can't immediately deque a frame). You can get at the
raw frame data through the buf struct.

 

A little farther down, he re-enques the buffer after he's finished with
with this line:

 

(-1 == xioctl (fd, VIDIOC_QBUF, &buf))

 

You can read through the V4L2 spec a bit at bytesex.org to check out the
parameters of the buf struct.

 

If you want to display this data, a quick way to do it would be to pull
the Y values from the buffer and use these to write a grayscale image to
the screen. I used a Qt picture object when I first started doing this,
and that actually worked quite well.

 

Hope that helps, and good luck!

 

 

  -- Nathanael

 

________________________________

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Geoffrey
Plitt
Sent: Thursday, October 04, 2007 9:18 PM



hey christopher. this file looks promising, but it doesn't do anything
with the frames. i compiled/ran and it just prints dots, you have to
take as faith that it's capturing - it doesn't output or save the
frames. in fact, i can't tell exactly where in the code it actually
grabs a frame and has access to the frame's pixel buffer. any clues? 
-geoff

On 10/4/07, Christopher HORLER <[EMAIL PROTECTED]> wrote:

http://v4l2spec.bytesex.org/v4l2spec/capture.c




 

_______________________________________________
Linux-uvc-devel mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/linux-uvc-devel

Reply via email to