return outsize;
}
-
-static gboolean can_scale_to_resolution(int w, int h)
-{
- return w >= 128 && h >= 96 && (w % 32) == 0 && (h % 4) == 0;
-}
-
/*
*/
static gboolean
GST_DEBUG_OBJECT (v4l2camsrc, "Configuring device to %dx%d, format "
"%" GST_FOURCC_FORMAT, *width, *height, GST_FOURCC_ARGS (*pixelformat));
- if(!can_scale_to_resolution(*width, *height))
- goto broken_resolution;
-
GST_V4L2CAMSRC_CHECK_OPEN (v4l2camsrc);
memset (&format, 0x00, sizeof (struct v4l2_format));
return ret;
/* ERRORS */
-broken_resolution:
- {
- GST_ELEMENT_ERROR (v4l2camsrc, RESOURCE, SETTINGS,
- ("Device '%s' cannot scale to %dx%d.",
- v4l2camsrc->videodev, *width, *height),
- ("Device mode not changed."));
- return FALSE;
- }
get_fmt_failed:
{
GST_ELEMENT_ERROR (v4l2camsrc, RESOURCE, SETTINGS,
}
}
+static gboolean resolution_is_supported(int w, int h)
+{
+ return (w % 4) == 0 && (h % 4) == 0;
+}
+
#define probe_and_add_for_w_h(w, h) \
do{ \
GST_LOG(" w=%lu h=%lu",w,h); \
w = MIN (size.discrete.width, G_MAXINT);
h = MIN (size.discrete.height, G_MAXINT);
- if(can_scale_to_resolution(w, h)) {
+ if(resolution_is_supported(w, h)) {
tmp = gst_v4l2camsrc_probe_caps_for_format_and_size (v4l2camsrc,
pixelformat, w, h, template);