Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 138043
b: refs/heads/master
c: 51f0b8d
h: refs/heads/master
i:
  138041: a35d048
  138039: a1d3140
v: v3
  • Loading branch information
Trent Piepho authored and Mauro Carvalho Chehab committed Mar 30, 2009
1 parent d893735 commit edb786e
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 26 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 337f9d205972bfe1cb7982384fd0f4caa4af001d
refs/heads/master: 51f0b8d57af501624ee55e8ca15d09d5bdc2b0dd
6 changes: 2 additions & 4 deletions trunk/drivers/media/video/bt8xx/bttv-driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -2932,13 +2932,11 @@ static int bttv_g_parm(struct file *file, void *f,
{
struct bttv_fh *fh = f;
struct bttv *btv = fh->btv;
struct v4l2_standard s;

if (parm->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
return -EINVAL;
v4l2_video_std_construct(&s, bttv_tvnorms[btv->tvnorm].v4l2_id,
bttv_tvnorms[btv->tvnorm].name);
parm->parm.capture.timeperframe = s.frameperiod;
v4l2_video_std_frame_period(bttv_tvnorms[btv->tvnorm].v4l2_id,
&parm->parm.capture.timeperframe);
return 0;
}

Expand Down
39 changes: 18 additions & 21 deletions trunk/drivers/media/video/v4l2-ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,25 +101,27 @@ const char *v4l2_norm_to_name(v4l2_std_id id)
}
EXPORT_SYMBOL(v4l2_norm_to_name);

/* Returns frame period for the given standard */
void v4l2_video_std_frame_period(int id, struct v4l2_fract *frameperiod)
{
if (id & V4L2_STD_525_60) {
frameperiod->numerator = 1001;
frameperiod->denominator = 30000;
} else {
frameperiod->numerator = 1;
frameperiod->denominator = 25;
}
}
EXPORT_SYMBOL(v4l2_video_std_frame_period);

/* Fill in the fields of a v4l2_standard structure according to the
'id' and 'transmission' parameters. Returns negative on error. */
int v4l2_video_std_construct(struct v4l2_standard *vs,
int id, const char *name)
{
u32 index = vs->index;

memset(vs, 0, sizeof(struct v4l2_standard));
vs->index = index;
vs->id = id;
if (id & V4L2_STD_525_60) {
vs->frameperiod.numerator = 1001;
vs->frameperiod.denominator = 30000;
vs->framelines = 525;
} else {
vs->frameperiod.numerator = 1;
vs->frameperiod.denominator = 25;
vs->framelines = 625;
}
vs->id = id;
v4l2_video_std_frame_period(id, &vs->frameperiod);
vs->framelines = (id & V4L2_STD_525_60) ? 525 : 625;
strlcpy(vs->name, name, sizeof(vs->name));
return 0;
}
Expand Down Expand Up @@ -1076,7 +1078,6 @@ static long __video_do_ioctl(struct file *file,
return -EINVAL;

v4l2_video_std_construct(p, curr_id, descr);
p->index = index;

dbgarg(cmd, "index=%d, id=0x%Lx, name=%s, fps=%d/%d, "
"framelines=%d\n", p->index,
Expand Down Expand Up @@ -1565,15 +1566,11 @@ static long __video_do_ioctl(struct file *file,
if (ops->vidioc_g_parm) {
ret = ops->vidioc_g_parm(file, fh, p);
} else {
struct v4l2_standard s;

if (p->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
return -EINVAL;

v4l2_video_std_construct(&s, vfd->current_norm,
v4l2_norm_to_name(vfd->current_norm));

p->parm.capture.timeperframe = s.frameperiod;
v4l2_video_std_frame_period(vfd->current_norm,
&p->parm.capture.timeperframe);
ret = 0;
}

Expand Down
1 change: 1 addition & 0 deletions trunk/include/media/v4l2-ioctl.h
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ struct v4l2_ioctl_ops {

/* Video standard functions */
extern const char *v4l2_norm_to_name(v4l2_std_id id);
extern void v4l2_video_std_frame_period(int id, struct v4l2_fract *frameperiod);
extern int v4l2_video_std_construct(struct v4l2_standard *vs,
int id, const char *name);
/* Prints the ioctl in a human-readable format */
Expand Down

0 comments on commit edb786e

Please sign in to comment.