v4l2 driver seems to be capturing frames too slow!

Guilherme Raymo Longo <[email protected]>
Newsgroups gmane.comp.video.video4linux
Message-ID <[email protected]>
Hi mates.

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
WIKI.

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[3]". 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
like me.
Thanks for all ur attention.
Guilherme Longo
--
video4linux-list mailing list
Unsubscribe mailto:[email protected]?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.