Skip to content

Commit

Permalink
media: uvcvideo: Set capability in s_param
Browse files Browse the repository at this point in the history
Fixes v4l2-compliance:

Format ioctls (Input 0):
                warn: v4l2-test-formats.cpp(1339): S_PARM is supported but doesn't report V4L2_CAP_TIMEPERFRAME
                fail: v4l2-test-formats.cpp(1241): node->has_frmintervals && !cap->capability

Reviewed-by: Hans Verkuil <[email protected]>
Signed-off-by: Ricardo Ribalda <[email protected]>
Signed-off-by: Laurent Pinchart <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
  • Loading branch information
ribalda authored and mchehab committed Sep 30, 2021
1 parent 0c6bcbd commit 97a2777
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions drivers/media/usb/uvc/uvc_v4l2.c
Original file line number Diff line number Diff line change
Expand Up @@ -472,10 +472,13 @@ static int uvc_v4l2_set_streamparm(struct uvc_streaming *stream,
uvc_simplify_fraction(&timeperframe.numerator,
&timeperframe.denominator, 8, 333);

if (parm->type == V4L2_BUF_TYPE_VIDEO_CAPTURE)
if (parm->type == V4L2_BUF_TYPE_VIDEO_CAPTURE) {
parm->parm.capture.timeperframe = timeperframe;
else
parm->parm.capture.capability = V4L2_CAP_TIMEPERFRAME;
} else {
parm->parm.output.timeperframe = timeperframe;
parm->parm.output.capability = V4L2_CAP_TIMEPERFRAME;
}

return 0;
}
Expand Down

0 comments on commit 97a2777

Please sign in to comment.