Re: Problem using v4l2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



Iñaki <gcypher@xxxxxxxx> writes:

>     I've developed an aplication on v4l2 but i've a doubt about how to
> sync with the capture of frames. Reading the draft of v4l2 i thought
> VIDIOC_DQBUF blocks aplication user until buffer wainting for was
> filled. When i tried to use DQBUF a buffer it rises an EINVAL with the
> perror "Resource temporarily unavailable"(i haven't opened fd with
> O_NONBLOCK and there is a buffer in queue). I've used select() to
> block the aplication until the buffer is filled and now it's work but
> i want to know if there is another way.

==============================[ cut here ]==============================
--- bttv-0.9.9/video-buf.c~	2003-03-21 11:16:36.000000000 +0100
+++ bttv-0.9.9/video-buf.c	2003-04-01 09:27:21.000000000 +0200
@@ -586,7 +586,7 @@
 	if (list_empty(&q->stream))
 		goto done;
 	buf = list_entry(q->stream.next, struct videobuf_buffer, stream);
-	retval = videobuf_waiton(buf,1,1);
+	retval = videobuf_waiton(buf, file->f_flags & O_NONBLOCK, 1);
 	if (retval < 0)
 		goto done;
 	switch (buf->state) {
==============================[ cut here ]==============================


> Another question is i've tried to change fmt.pix.field from
> V4L2_FIELD_ANY to V4L2_FIELD_ALTERNATE (i'm using the V4L2_MEMORY_MMAP
> and V4L2_BUF_TYPE_VIDEO_CAPTURE with GREYSCALE) to capture in half
> period time but it always rises an Segmentation fault in the second
> buffer (of 2) after VIDIOC_DQBUF call. Does anyone know some reason?

latest bttv version?  And you need more that two buffers, otherwise
you will not get full 50 fields/sec rate ...

  Gerd

-- 
Michael Moore for president!





[Index of Archives]     [Linux DVB]     [Video Disk Recorder]     [Asterisk]     [Photo]     [DCCP]     [Netdev]     [Xorg]     [Util Linux NG]     [Xfree86]     [Free Photo Albums]     [Fedora Users]     [Fedora Women]     [ALSA Users]     [ALSA Devel]     [Linux USB]

Powered by Linux