v4l2 driver seems to be capturing frames too slow!
- Date: Thu, 10 Sep 2009 22:16:46 -0300
- From: Guilherme Raymo Longo <grlongo.ireland@xxxxxxxxx>
- Subject: v4l2 driver seems to be capturing frames too slow!
Plz, could I get some help from here. This is my first attempt of creating a
v4l2 app and I am a bit confused about few things even after reading the
1 - I am using mmap to map the memory in the device. In the example I have,
there is only 1 QBUF and 1 DQBUF, so I presume that all the 4 buffers are
been queued and dequeued when those functions are called. Am I committing a
mistake here or that is correct?
Here you can see the code: http://pastebin.com/m367448b8
2 - If you notice, right after the buffers been dequeued the program calls a
function "process_image (buffers[buf.index].start);" that I also presume
been all the 4 buffers "buffer[start] to buffer". Each buffer is 8byte
long so I have 64bits of memory mapped. The compression I am using is RGB32
that stores each RGBA pixels in 4 bytes (1 for each color + 1 for alpha): If
this is true and I am capturing a image 640x480 I am gonna have 307.200
pixel and a necessary space of 1.228.8 bytes to store each frame. What means
approximately 1.23MB per frame.
Is that correct or I am calculating it improperly
3 - And the last question is, that function I mentioned earlier
process_image (buffers[buf.index].start) prints approximately 6 dots per
second wich means (taking in account
that each buffer has 8bytes and I have them all filled with data) 6 x 8bytes
read to process the image. Not even close to be a complete frame.
the full program can be seen here: http://pastebin.com/m43801a5e
Please, I read the whole v4l2 spec and it seems a bit confusing for a newb
Thanks for all ur attention.
video4linux-list mailing list