Commit 2591d64e authored by Ghislain MARY's avatar Ghislain MARY
Browse files

Implement all types of frame intervals when querying a V4L2 camera for its max fps.

parent 279fddf9
......@@ -151,10 +151,14 @@ static int query_max_fps_for_format_resolution(int fd, int pixelformat, MSVideoS
frmival.height = vsize.height;
while (v4l2_ioctl(fd, VIDIOC_ENUM_FRAMEINTERVALS, &frmival) >= 0) {
frmival.index++;
if (frmival.type == V4L2_FRMIVAL_TYPE_DISCRETE) {
fps = MAX(fps, (int) (frmival.discrete.denominator / frmival.discrete.numerator));
} else if (frmival.type == V4L2_FRMIVAL_TYPE_STEPWISE) {
return (int) (frmival.stepwise.max.denominator / frmival.stepwise.max.numerator);
} else if (frmival.type == V4L2_FRMIVAL_TYPE_CONTINUOUS) {
return (int) (frmival.stepwise.min.denominator / frmival.stepwise.min.numerator);
}
frmival.index++;
}
return fps;
}
......
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