v4l2grab: Add threaded producer/consumer option
authorThiago Santos <ts.santos@sisa.samsung.com>
Mon, 9 Jun 2014 13:51:55 +0000 (10:51 -0300)
committerMauro Carvalho Chehab <m.chehab@samsung.com>
Sat, 26 Jul 2014 13:49:16 +0000 (10:49 -0300)
commit1b5d24b92a6d3b3929110d3359e7ff9455716e60
tree87dcbfcc20380d5f21cf94d56de78cbc9daf5797
parentfcee22962525cd352229185c0f3e12ab96a93993
v4l2grab: Add threaded producer/consumer option

Adds options to allow the buffer dqbuf to happen on one thread while
the qbuf happens on another. This is useful to test concurrency access to
the v4l2 features. To enable this, 3 new options were added:

t: enable threaded mode (off by default and will use the loop)
b: enable blocking io mode (off by default
s: how much the consumer thread will sleep after reading a buffer, this is to
   simulate the time that it takes to process a buffer in a real application
   (in ms)

For example, you can simulate an application that takes 1s to process a buffer
with:

v4l2grab -t -b -s 1000

Signed-off-by: Thiago Santos <ts.santos@sisa.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
contrib/test/Makefile.am
contrib/test/v4l2grab.c