Revert "Check resolution against bad scaling on mode switch"
authorTelle-Tiia Pitkänen <telle-tiia.pitkanen@ixonos.com>
Mon, 26 Nov 2012 13:04:43 +0000 (15:04 +0200)
committerTelle-Tiia Pitkänen <telle-tiia.pitkanen@ixonos.com>
Mon, 26 Nov 2012 13:04:43 +0000 (15:04 +0200)
This reverts commit e87938069027f704dfb95942534515ad6a248140.

gst/mfldv4l2cam/v4l2camsrc_calls.c

index 637a1a3..0bdb92c 100644 (file)
@@ -1656,12 +1656,6 @@ gst_v4l2camsrc_get_frame_size (guint32 fourcc, guint * w, guint * h)
   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
@@ -1677,9 +1671,6 @@ gst_v4l2camsrc_configure_device (GstMFLDV4l2CamSrc * v4l2camsrc,
   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));
@@ -1826,14 +1817,6 @@ no_crop:
   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,
@@ -1874,6 +1857,11 @@ invalid_pixelformat:
   }
 }
 
+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);                            \
@@ -1946,7 +1934,7 @@ gst_v4l2camsrc_probe_caps_for_format (GstMFLDV4l2CamSrc * v4l2camsrc,
        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);