v4l2: Disabling libv4l2 code by default makes various cheap webcams unusable
This issue seems to be a problem that the now enumerated video formats do not match the capabilities that cheese expects. These formats seem to be emulated by v4l: (export GST_DEBUG=4)
Working: gst_v4l2_object_fill_format_list: got 4 format(s): gst_v4l2_object_fill_format_list: YU12 (emulated) gst_v4l2_object_fill_format_list: YV12 (emulated) gst_v4l2_object_fill_format_list: BGR3 (emulated) gst_v4l2_object_fill_format_list: RGB3 (emulated)
Failing: gst_v4l2_object_fill_format_list: got 1 format(s): gst_v4l2_object_fill_format_list: PJPG
Further digging leads to patch 31d8a1d9 with following description:
v4l2: Add run-time environment to enable libv4l2 The library has started preventing a lot of interesting use cases, like CREATE_BUFS, DMABuf, usage of TRY_FMT. As the libv4l2 is totally inactive and not maintained, we decided to disable it. As a convenience we added a run-time environment that let you enable it for testing. GST_V4L2_USE_LIBV4L2=1 This of course only works if you have enabled libv4l2 at build time.
Setting this environment makes the device work like usual, but it took me quite some time to get to that point.
If it is expected that there are more such cheap devices out there, maybe a hint could be added to point to that environment variable, e.g. when no matching capability could be found (gst_device_monitor_get_devices).