Commit 3ae17c66 authored by Jose Abreu's avatar Jose Abreu Committed by Mauro Carvalho Chehab

media: cobalt: Use v4l2_calc_timeperframe helper

Currently, cobalt driver always returns 60fps in g_parm.
This patch uses the new v4l2_calc_timeperframe helper to
calculate the time per frame value.
Signed-off-by: default avatarJose Abreu <joabreu@synopsys.com>
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
parent 87f9ed85
...@@ -1064,10 +1064,15 @@ static int cobalt_subscribe_event(struct v4l2_fh *fh, ...@@ -1064,10 +1064,15 @@ static int cobalt_subscribe_event(struct v4l2_fh *fh,
static int cobalt_g_parm(struct file *file, void *fh, struct v4l2_streamparm *a) static int cobalt_g_parm(struct file *file, void *fh, struct v4l2_streamparm *a)
{ {
struct cobalt_stream *s = video_drvdata(file);
struct v4l2_fract fps;
if (a->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) if (a->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
return -EINVAL; return -EINVAL;
a->parm.capture.timeperframe.numerator = 1;
a->parm.capture.timeperframe.denominator = 60; fps = v4l2_calc_timeperframe(&s->timings);
a->parm.capture.timeperframe.numerator = fps.numerator;
a->parm.capture.timeperframe.denominator = fps.denominator;
a->parm.capture.readbuffers = 3; a->parm.capture.readbuffers = 3;
return 0; return 0;
} }
......
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