v4l2src:output truncated after changing capture size
When doing some testing with the vivid driver I noticed that if the v4l2src capture size is reduced
from the default, it can never be properly restored to its original size. This behaviour carries
across processes, so this problem exists even when running gst-launch
multiple times.
This only happens for devices that support the crop / compose API.
To reproduce:
$ sudo modprobe vivid n_devs=1 input_types=0x3
$ gst-launch-1.0 v4l2src ! video/x-raw, width=640, width=480 ! ximagesink
Output scaled down to 640x480 as expected
$ gst-launch-1.0 v4l2src ! ximagesink
Window size is 1280x720, but the image data is still 640x480 (right and bottom of image is black)
$ gst-launch-1.0 v4l2src ! video/x-raw, width=1280, width=720 ! ximagesink
Even explicitly setting the output size makes no difference. Image is still 640x480.
It seems like the problem is that the composition selection rectangle is reduced to 640x480 by the vivid driver, but is not increased again when a larger capture buffer size is requested. This looks like valid driver behaviour according to the spec, which doesn't require that the compose rectangle is reset on S_FMT.
I think that v4l2src would need to reset the compose rectangle to the default value when it does the format setting to avoid this
problem.
Does this sound correct?