summaryrefslogtreecommitdiff
path: root/v4l_experimental/pvrusb2/pvrusb2-v4l2.c
diff options
context:
space:
mode:
Diffstat (limited to 'v4l_experimental/pvrusb2/pvrusb2-v4l2.c')
-rw-r--r--v4l_experimental/pvrusb2/pvrusb2-v4l2.c36
1 files changed, 29 insertions, 7 deletions
diff --git a/v4l_experimental/pvrusb2/pvrusb2-v4l2.c b/v4l_experimental/pvrusb2/pvrusb2-v4l2.c
index c10c1a4e6..0c9719bfb 100644
--- a/v4l_experimental/pvrusb2/pvrusb2-v4l2.c
+++ b/v4l_experimental/pvrusb2/pvrusb2-v4l2.c
@@ -1,6 +1,6 @@
/*
*
- * $Id: pvrusb2-v4l2.c,v 1.1 2005/11/14 13:31:24 mchehab Exp $
+ * $Id: pvrusb2-v4l2.c,v 1.2 2005/11/29 14:10:44 mchehab Exp $
*
* Copyright (C) 2005 Mike Isely <isely@pobox.com>
* Copyright (C) 2004 Aurelien Alleaume <slts@free.fr>
@@ -191,6 +191,16 @@ struct v4l2_standard pvr_standards[] = {
},
.framelines = 525,
.reserved = {0,0,0,0}
+ },
+ [PVR2_CVAL_VIDEOSTANDARD_PAL_M] = {
+ .id = V4L2_STD_PAL_M,
+ .frameperiod =
+ {
+ .numerator = 1001,
+ .denominator= 30000
+ },
+ .framelines = 525,
+ .reserved = {0,0,0,0}
}
};
@@ -493,6 +503,9 @@ static int pvr2_v4l2_do_ioctl(struct inode *inode, struct file *file,
case PVR2_CVAL_VIDEOSTANDARD_NTSC_M:
*vs = V4L2_STD_NTSC;
break;
+ case PVR2_CVAL_VIDEOSTANDARD_PAL_M:
+ *vs = V4L2_STD_PAL_M;
+ break;
case PVR2_CVAL_VIDEOSTANDARD_SECAM_L:
*vs = V4L2_STD_SECAM;
break;
@@ -525,6 +538,8 @@ static int pvr2_v4l2_do_ioctl(struct inode *inode, struct file *file,
val = PVR2_CVAL_VIDEOSTANDARD_PAL_DK;
} else if (*vs & V4L2_STD_SECAM){
val = PVR2_CVAL_VIDEOSTANDARD_SECAM_L;
+ } else if (*vs & V4L2_STD_PAL_M){
+ val = PVR2_CVAL_VIDEOSTANDARD_PAL_M;
}
pvr2_hdw_set_ctl_value(hdw,PVR2_CID_VIDEOSTANDARD,val);
@@ -759,14 +774,21 @@ static int pvr2_v4l2_do_ioctl(struct inode *inode, struct file *file,
ret = 0;
switch(vf->type) {
case V4L2_BUF_TYPE_VIDEO_CAPTURE: {
- int is_ntsc = (pvr2_hdw_get_ctl_value(
- hdw,
- PVR2_CID_VIDEOSTANDARD) ==
- PVR2_CVAL_VIDEOSTANDARD_NTSC_M);
- int hf = is_ntsc ? 480 : 576;
- int hh = (int) (hf / 2);
int h = vf->fmt.pix.height;
int w = vf->fmt.pix.width;
+ int vd_std, hf, hh;
+
+ vd_std = pvr2_hdw_get_ctl_value(hdw,
+ PVR2_CID_VIDEOSTANDARD);
+ switch (vd_std) {
+ case PVR2_CVAL_VIDEOSTANDARD_NTSC_M:
+ case PVR2_CVAL_VIDEOSTANDARD_PAL_M:
+ hf=480;
+ break;
+ default:
+ hf=576;
+ }
+ hh = (int) (hf / 2);
memcpy(vf, &pvr_format[PVR_FORMAT_PIX],
sizeof(struct v4l2_format));