From a597c1d4e3ccba83963e4bf928913c414a3636a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Tue, 13 Nov 2007 17:19:13 +0000 Subject: [PATCH] sys/v4l2/v4l2src_calls.c: but the corresponding ioctl() call fails even though the driver claims to support this form... Original commit message from CVS: * sys/v4l2/v4l2src_calls.c: (gst_v4l2src_probe_caps_for_format): If VIDIOC_ENUM_FRAMESIZES is defined (= recent kernel), but the corresponding ioctl() call fails even though the driver claims to support this format, just fall back to the pre-2.6.19 kernel routine that creates caps with suitable height and width ranges (see #448278). --- ChangeLog | 9 +++++++++ sys/v4l2/v4l2src_calls.c | 12 ++++++++++++ 2 files changed, 21 insertions(+) diff --git a/ChangeLog b/ChangeLog index 08fbd6e65a..ec3790d7ae 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2007-11-13 Tim-Philipp Müller + + * sys/v4l2/v4l2src_calls.c: (gst_v4l2src_probe_caps_for_format): + If VIDIOC_ENUM_FRAMESIZES is defined (= recent kernel), but the + corresponding ioctl() call fails even though the driver claims to + support this format, just fall back to the pre-2.6.19 kernel + routine that creates caps with suitable height and width ranges + (see #448278). + 2007-11-13 Tim-Philipp Müller Patch by: Mark Nauwelaerts diff --git a/sys/v4l2/v4l2src_calls.c b/sys/v4l2/v4l2src_calls.c index edd4a013e5..0b03c9998c 100644 --- a/sys/v4l2/v4l2src_calls.c +++ b/sys/v4l2/v4l2src_calls.c @@ -810,6 +810,9 @@ gst_v4l2src_probe_caps_for_format (GstV4l2Src * v4l2src, guint32 pixelformat, results = g_list_delete_link (results, results); } + if (gst_caps_is_empty (ret)) + goto enum_framesizes_no_results; + return ret; /* ERRORS */ @@ -821,6 +824,15 @@ enum_framesizes_failed: " (%s)", GST_FOURCC_ARGS (pixelformat), g_strerror (errno)); goto default_frame_sizes; } +enum_framesizes_no_results: + { + /* it's possible that VIDIOC_ENUM_FRAMESIZES is defined but the driver in + * question doesn't actually support it yet */ + GST_DEBUG_OBJECT (v4l2src, "No results for pixelformat %" GST_FOURCC_FORMAT + " enumerating frame sizes, trying fallback", + GST_FOURCC_ARGS (pixelformat)); + goto default_frame_sizes; + } unknown_type: { GST_WARNING_OBJECT (v4l2src,