uvc-gadget: Dynamically watch/unwatch uvc device fd
authorPaul Elder <paul.elder@ideasonboard.com>
Mon, 21 May 2018 15:45:17 +0000 (23:45 +0800)
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Mon, 21 May 2018 18:27:39 +0000 (21:27 +0300)
commit349679083d1f1053ee79cc933e0e41c48ce05fb9
treeb38a26dd0023624de0f4beea56d6fcf627d15900
parent702526917b38d832788fd737ff9e6d5fa8f83fc5
uvc-gadget: Dynamically watch/unwatch uvc device fd

When the uvc device fd is put on the watch list statically, then there
are many "Unable to dequeue buffer: Invalid argument (22)." because the
V4L2 API returns write events immediately when the stream is off.

To fix this, add the fd to the watch list on streamon, and remove it on
streamoff.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
uvc-gadget.c