v4l2: Also set max_width/max_height if enum framesize fail

Some driver doesn't implement enum_framesize. The maximum supported
size can be got by trying format with a very large size. Also need
to set max_width/max_height for this case, otherwise default encoded
buffer size 256kB is too small.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6416>
This commit is contained in:
Hou Qi 2024-03-21 18:07:42 +09:00 committed by GStreamer Marge Bot
parent 0c148a96db
commit 024d3ab051

View file

@ -3178,6 +3178,8 @@ default_frame_sizes:
min_w = min_h = 1;
if (max_w == 0 || max_h == 0)
max_w = max_h = GST_V4L2_MAX_SIZE;
v4l2object->max_width = max_w;
v4l2object->max_height = max_h;
/* Since we can't get framerate directly, try to use the current norm */
if (v4l2object->tv_norm && v4l2object->norms) {