Commit dd803ce0 authored by Andy Wingo Wingo's avatar Andy Wingo Wingo
Browse files

sys/v4l2/v4l2src_calls.c (gst_v4l2src_probe_caps_for_format)

Original commit message from CVS:
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.
parent 37e30979
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):
......
......@@ -114,6 +114,8 @@ gst_v4l2src_clear_format_list (GstV4l2Src * v4l2src)
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,
......@@ -260,11 +262,13 @@ unknown_type:
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;
......@@ -342,6 +346,22 @@ unknown_type:
": %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 */
}
/******************************************************
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment