v4l2object: there have some errors in aligning width/height in the case of stepwise frame sizes
- there are errors about print log in hint1. this shoule be max height.
2. when the w, maxw and step_w(or h, maxh and step_h)size got form dirver
is not meet the condition of gst_value_set_int_range_step,the step_range will
got not correct value.
For example, we got size as bellow, and these size are not meet the conditions
in gst_value_set_int_range_step, and then we got error width and height as caps
video/x-vp9, width=(int)[ 0, 0 ], height=(int)[ 0, 0 ].
And I think different platform have different size alignment rules.
Gstreamer should not align again, and should set min_width/height
and max_width/height to caps directly
>
gst_v4l2_object_probe_caps_for_format:<v4l2mtkvpudec0:sink> Enumerating frame sizes for VP90
gst_v4l2_object_probe_caps_for_format:<v4l2mtkvpudec0:sink> we have stepwise frame sizes:
gst_v4l2_object_probe_caps_for_format:<v4l2mtkvpudec0:sink> min width: 16
gst_v4l2_object_probe_caps_for_format:<v4l2mtkvpudec0:sink> min height: 16
gst_v4l2_object_probe_caps_for_format:<v4l2mtkvpudec0:sink> max width: 4096
gst_v4l2_object_probe_caps_for_format:<v4l2mtkvpudec0:sink> min height: 2304
gst_v4l2_object_probe_caps_for_format:<v4l2mtkvpudec0:sink> step width: 64
gst_v4l2_object_probe_caps_for_format:<v4l2mtkvpudec0:sink> step height: 64
>
the relate code is in gst_v4l2_object_probe_caps_for_format as bellow, and I didn't modify anything.
} else if (size.type == V4L2_FRMSIZE_TYPE_STEPWISE) {
guint32 maxw, maxh, step_w, step_h;
GST_DEBUG_OBJECT (v4l2object->dbg_obj, "we have stepwise frame sizes:");
GST_DEBUG_OBJECT (v4l2object->dbg_obj, "min width: %d",
size.stepwise.min_width);
GST_DEBUG_OBJECT (v4l2object->dbg_obj, "min height: %d",
size.stepwise.min_height);
GST_DEBUG_OBJECT (v4l2object->dbg_obj, "max width: %d",
size.stepwise.max_width);
GST_DEBUG_OBJECT (v4l2object->dbg_obj, "min height: %d", //hint1
size.stepwise.max_height);
GST_DEBUG_OBJECT (v4l2object->dbg_obj, "step width: %d",
size.stepwise.step_width);
GST_DEBUG_OBJECT (v4l2object->dbg_obj, "step height: %d",
size.stepwise.step_height);
w = MAX (size.stepwise.min_width, 1);
h = MAX (size.stepwise.min_height, 1);
maxw = MIN (size.stepwise.max_width, G_MAXINT);
maxh = MIN (size.stepwise.max_height, G_MAXINT);
step_w = MAX (size.stepwise.step_width, 1);
step_h = MAX (size.stepwise.step_height, 1);
/* FIXME: check for sanity and that min/max are multiples of the steps */
/* we only query details for the max width/height since it's likely the
* most restricted if there are any resolution-dependent restrictions */
tmp = gst_v4l2_object_probe_caps_for_format_and_size (v4l2object,
pixelformat, maxw, maxh, template);
if (tmp) {
GValue step_range = G_VALUE_INIT;
g_value_init (&step_range, GST_TYPE_INT_RANGE);
gst_value_set_int_range_step (&step_range, w, maxw, step_w);
gst_structure_set_value (tmp, "width", &step_range);
gst_value_set_int_range_step (&step_range, h, maxh, step_h);
gst_structure_take_value (tmp, "height", &step_range);
/* no point using the results list here, since there's only one struct */
gst_v4l2_object_update_and_append (v4l2object, pixelformat, ret, tmp);
}
} else if (size.type == V4L2_FRMSIZE_TYPE_CONTINUOUS) {