v4l2: handle 0x0 sizes gracefully

Also ignore 0x0 sizes in the fallback case and assume the size can be
anything between 1x1 and MAXxMAX.

This fixes the case where a width=0, height=0 caps are created. Whith
this patch the caps will contain width=[1,MAX], height=[1,MAX].

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1396>
This commit is contained in:
Wim Taymans 2021-11-29 15:35:36 +01:00
parent e90859f4d8
commit 9aaef931bf

View file

@ -2933,6 +2933,10 @@ default_frame_sizes:
"Could not probe maximum capture size for pixelformat %"
GST_FOURCC_FORMAT, GST_FOURCC_ARGS (pixelformat));
}
if (min_w == 0 || min_h == 0)
min_w = min_h = 1;
if (max_w == 0 || max_h == 0)
max_w = max_h = GST_V4L2_MAX_SIZE;
/* Since we can't get framerate directly, try to use the current norm */
if (v4l2object->tv_norm && v4l2object->norms) {