Commit 18034a51 authored by Pavel Rojtberg's avatar Pavel Rojtberg Committed by Pavel Rojtberg

allow icvGetPropertyCAM_V4L to return zero

now icvGetPropertyCAM_V4L behaves the same as in cap_libv4l. This also
fixes passing boolean values.
parent f7981a8a
......@@ -2303,15 +2303,11 @@ static double icvGetPropertyCAM_V4L (CvCaptureCAM_V4L* capture,
return -1;
}
if(property_id == CV_CAP_PROP_AUTOFOCUS) {
return (double)capture->control.value;
}
/* get the min/max values */
cv::Range range = capture->getRange(property_id);
/* all was OK, so convert to 0.0 - 1.0 range, and return the value */
return ((float)capture->control.value - range.start + 1) / range.size();
return ((float)capture->control.value - range.start) / range.size();
}
#endif /* HAVE_CAMV4L2 */
......
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