lib: v4l2-source: Check v4l2_device type
We do not currently check the capabilities of the v4l2_device that uvc-gadget is instructed to open; this can result in an output device being opened with no obvious error, which is confusing.
Check the buffer type of the v4l2_device, which is set by checking the device capabilities during v4l2_open(). If the device does not support video capture, tell the user and error out.
As we're adding a new error to the function, refactor the error handling into the usual style.
Signed-off-by: Daniel Scally dan.scally@ideasonboard.com