From d80ed69255760c20ea3d3dbea7ced423248e4abb Mon Sep 17 00:00:00 2001 From: Jussi Saavalainen Date: Mon, 27 Aug 2012 14:23:02 +0300 Subject: [PATCH] Disable calls to broken VIDIOC_TRY_FMT Our driver doesn't properly handle the TRY_FMT calls, so relying on their results will only get us in trouble. Change-Id: I7f83564127224e31a8e3270f07e1a2ffc1836e24 --- gst/mfldv4l2cam/v4l2camsrc_calls.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gst/mfldv4l2cam/v4l2camsrc_calls.c b/gst/mfldv4l2cam/v4l2camsrc_calls.c index 31502ca..a4b8389 100644 --- a/gst/mfldv4l2cam/v4l2camsrc_calls.c +++ b/gst/mfldv4l2cam/v4l2camsrc_calls.c @@ -2531,6 +2531,8 @@ gst_v4l2camsrc_get_nearest_size (GstMFLDV4l2CamSrc * v4l2camsrc, fmt.fmt.pix.pixelformat = pixelformat; fmt.fmt.pix.field = V4L2_FIELD_INTERLACED; +/* FIXME: Disable TRY_FMT check, driver is not returning anything useful yet */ +#if 0 r = ioctl (fd, VIDIOC_TRY_FMT, &fmt); if (r < 0 && errno == EINVAL) { /* try again with progressive video */ @@ -2546,14 +2548,17 @@ gst_v4l2camsrc_get_nearest_size (GstMFLDV4l2CamSrc * v4l2camsrc, S_FMT to probe */ if (errno != ENOTTY) return FALSE; +#endif /* Only try S_FMT if we're not actively capturing yet, which we shouldn't be, because we're still probing */ if (GST_V4L2CAMSRC_IS_ACTIVE (v4l2camsrc)) return FALSE; +#if 0 GST_LOG_OBJECT (v4l2camsrc, "Failed to probe size limit with VIDIOC_TRY_FMT, trying VIDIOC_S_FMT"); +#endif fmt.fmt.pix.width = *width; fmt.fmt.pix.height = *height; @@ -2570,7 +2575,9 @@ gst_v4l2camsrc_get_nearest_size (GstMFLDV4l2CamSrc * v4l2camsrc, if (r < 0) return FALSE; +#if 0 } +#endif GST_LOG_OBJECT (v4l2camsrc, "got nearest size %dx%d", fmt.fmt.pix.width, fmt.fmt.pix.height); -- 2.7.4