qv4l2: Fixed a bug in the v4l2-api
cover qv4l2: Fixed a bug in the v4l2-api
Fixed a bug where the get_interval in v4l2-api where it would test for a compatibility flag irrelevant to the feature support and resulting return false.
PATCH 1/1 qv4l2: Fixed a bug in the v4l2-api
The get_interval would return false even if devices had support for this
Signed-off-by Bård Eirik Winther <[email protected]>
--- utils/qv4l2/v4l2-api.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-)
utils/qv4l2/v4l2-api.cpp +5 -7
@@ -613,13 +613,11 @@ bool v4l2::set_interval(v4l2_fract interval) bool v4l2::get_interval(v4l2_fract &interval) { v4l2_streamparm parm; - parm.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; - if (ioctl(VIDIOC_G_PARM, &parm) >= 0 && - (parm.parm.capture.capability & V4L2_CAP_TIMEPERFRAME)) { - interval = parm.parm.capture.timeperframe; - return true; - } - return false; + if (ioctl(VIDIOC_G_PARM, &parm) < 0) + return false; + + interval = parm.parm.capture.timeperframe; + return interval.numerator && interval.denominator; }
Signature · 1 line
1.8.3.2