I can't get all pixels values from my driver. plz help ;0(

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

After 3 weeks trying to solve my problem, I am about to give up and find another solution instead of trying to fix this one.
I have changed few things in the capture.c example available for download at http://www.linuxtv.org/downloads/video4linux/API/V4L2_API/ and
the altered code can be seen here: http://pastebin.com/m7ef25480

So... what is the problem?

Well, I have set the following configuration for capture:

        fmt.type                = V4L2_BUF_TYPE_VIDEO_CAPTURE;
        fmt.fmt.pix.width       = 160;
        fmt.fmt.pix.height      = 120;
        fmt.fmt.pix.pixelformat = V4L2_PIX_FMT_RGB32;
        fmt.fmt.pix.field       = V4L2_FIELD_INTERLACED;

All the process is implemented in a function called process_image(void * p) where p is a void pointer to the buffer where the frames captures should be stored.

this is the function that reads the buffer:

if (-1 == read (fd, buffers[0].start, buffers[0].length))   (length = 160x120 -> 19200)

then after, I call the process_image function:
process_image (buffers[0].start);

What I need is read the buffer separation the R, G, B, A storing them in unsigned char variables. 

It should have 19.200 pixel (160x120) but instead, look what i have got:

[0]87 [0]110 [0]68 [0]134
[1]202 [1]73 [1]119 [1]109
[2]213 [2]36 [2]73 [2]33
.....
.....
[1287]73 [1287]100 [1287]150 [1287]133
[1288]69 [1288]133 [1288]4 [1288]0
[1289]0 [1289]0 [1289]0 [1289]0
[1290]0 [1290]0 [1290]0 [1290]0
[1291]0 [1291]0 [1291]0 [1291]0
.....
[4799]0 [4799]0 [4799]0 [4799]0
[0]80 [0]105 [0]145 [0]4
[1]146 [1]18 [1]108 [1]182
[2]68 [2]136 [2]137 [2]170

As you can see, I get only 1289 pixels with values and all the rest are 0; 
When the function is called again, the same happens over and over.

So... why am I getting only 1289 pixel with values when in fact it should be 160x120 pixel corresponding to 1 frame?
I am begging help 'cause my arsenal's over.. I am really out of ideas!

Thanks a lot!



_________________________________________________________________
Drag n’ drop—Get easy photo sharing with Windows Live™ Photos.

http://www.microsoft.com/windows/windowslive/products/photos.aspx--
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.