Re: v4l and threads?

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



Ronald Bultje wrote:
>  Hi all,
>  
>  I've tried to do some threading magic in lavrec... Basically, sync
>  (VIDIOCSYNC) and queue (VIDIOCMCAPTURE) calls go in different threads.
>  Problem: I queue all buffers, then sync on each of them, give the buffer
>  to a different thread and let it re-queue it. After some time (testing,
>  100% CPU load, so I can't keep up and have to lose frames...), when my
>  number of queued buffers starts to decrease to zero and I'm about to
>  sync on yet-unqueued buffers, I get a -EINV return value ("invalid
>  argument") on my next VIDIOCSYNC.

Yes, of course.

>  How threadsafe is v4l supposed to be?

Shouldn't be a problem.  If it is you found a bug in the driver's
locking.

>  Can I sync on unqueued buffers (assuming, of course, that they'll be
>  queued later on - i.e. I'm losing frames)?

You can't.

  Gerd

-- 
#define	ENOCLUE 125 /* userland programmer induced race condition */





[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