summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim.muller@collabora.co.uk>2009-08-09 14:19:42 +0100
committerTim-Philipp Müller <tim.muller@collabora.co.uk>2009-08-09 14:19:42 +0100
commit8c8e6af45badae969278c35da114ded6ce0ef0f7 (patch)
tree747c5dc572dcc602c92b39a9b2543fe3a89613d4 /sys
parent6df8fb76ef23939cf802ed022360e98083907755 (diff)
v4l2src: if max == min width/height put an int in the probed caps, not an int range
Fixes #560033.
Diffstat (limited to 'sys')
-rw-r--r--sys/v4l2/gstv4l2object.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/sys/v4l2/gstv4l2object.c b/sys/v4l2/gstv4l2object.c
index 021e49db..ce6f7c9a 100644
--- a/sys/v4l2/gstv4l2object.c
+++ b/sys/v4l2/gstv4l2object.c
@@ -1681,17 +1681,24 @@ default_frame_sizes:
tmp = gst_structure_copy (template);
if (fix_num) {
- gst_structure_set (tmp,
- "width", GST_TYPE_INT_RANGE, min_w, max_w,
- "height", GST_TYPE_INT_RANGE, min_h, max_h,
- "framerate", GST_TYPE_FRACTION, fix_num, fix_denom, NULL);
+ gst_structure_set (tmp, "framerate", GST_TYPE_FRACTION, fix_num,
+ fix_denom, NULL);
} else {
/* if norm can't be used, copy the template framerate */
- gst_structure_set (tmp,
- "width", GST_TYPE_INT_RANGE, min_w, max_w,
- "height", GST_TYPE_INT_RANGE, min_h, max_h,
- "framerate", GST_TYPE_FRACTION_RANGE, 0, 1, 100, 1, NULL);
+ gst_structure_set (tmp, "framerate", GST_TYPE_FRACTION_RANGE, 0, 1,
+ 100, 1, NULL);
}
+
+ if (min_w == max_w)
+ gst_structure_set (tmp, "width", G_TYPE_INT, max_w, NULL);
+ else
+ gst_structure_set (tmp, "width", GST_TYPE_INT_RANGE, min_w, max_w, NULL);
+
+ if (min_h == max_h)
+ gst_structure_set (tmp, "height", G_TYPE_INT, max_h, NULL);
+ else
+ gst_structure_set (tmp, "height", GST_TYPE_INT_RANGE, min_h, max_h, NULL);
+
gst_caps_append_structure (ret, tmp);
return ret;