+2007-06-06 Andy Wingo <wingo@pobox.com>
+
+ * sys/v4l2/v4l2src_calls.c (gst_v4l2src_probe_caps_for_format)
+ (gst_v4l2src_probe_caps_for_format_and_size): Only probe for
+ format and size if the ioctls are defined; should fix compilation
+ on Linux < 2.16.19.
+
2007-06-06 Tim-Philipp Müller <tim at centricular dot net>
* gst/videobox/gstvideobox.c: (gst_video_box_ayuv_i420):
return TRUE;
}
+/* The frame interval enumeration code first appeared in Linux 2.6.19. */
+#ifdef VIDIOC_ENUM_FRAMEINTERVALS
static GstStructure *
gst_v4l2src_probe_caps_for_format_and_size (GstV4l2Src * v4l2src,
guint32 pixelformat,
return NULL;
}
}
+#endif /* defined VIDIOC_ENUM_FRAMEINTERVALS */
GstCaps *
gst_v4l2src_probe_caps_for_format (GstV4l2Src * v4l2src, guint32 pixelformat,
const GstStructure * template)
{
+#ifdef VIDIOC_ENUM_FRAMESIZES
GstCaps *ret;
GstStructure *tmp;
gint fd = v4l2src->v4l2object->video_fd;
": %u", GST_FOURCC_ARGS (pixelformat), size.type);
return NULL;
}
+#else /* defined VIDIOC_ENUM_FRAMESIZES */
+ GstCaps *ret;
+ GstStructure *tmp;
+
+ /* This code is for Linux < 2.6.19 */
+
+ ret = gst_caps_new_empty ();
+ tmp = gst_structure_copy (template);
+ gst_structure_set (tmp, "width", GST_TYPE_INT_RANGE, (gint) 1,
+ (gint) GST_V4L2_MAX_SIZE, "height", GST_TYPE_INT_RANGE,
+ (gint) 1, (gint) GST_V4L2_MAX_SIZE,
+ "framerate", GST_TYPE_FRACTION_RANGE, (gint) 0,
+ (gint) 1, (gint) 100, (gint) 1, NULL);
+ gst_caps_append_structure (ret, tmp);
+ return ret;
+#endif /* defined VIDIOC_ENUM_FRAMESIZES */
}
/******************************************************