diff options
Diffstat (limited to 'v4l_experimental/pvrusb2')
-rw-r--r-- | v4l_experimental/pvrusb2/pvrusb2-audio.c | 3 | ||||
-rw-r--r-- | v4l_experimental/pvrusb2/pvrusb2-encoder.c | 28 | ||||
-rw-r--r-- | v4l_experimental/pvrusb2/pvrusb2-hdw.c | 3 | ||||
-rw-r--r-- | v4l_experimental/pvrusb2/pvrusb2-hdw.h | 6 | ||||
-rw-r--r-- | v4l_experimental/pvrusb2/pvrusb2-tuner.c | 8 | ||||
-rw-r--r-- | v4l_experimental/pvrusb2/pvrusb2-v4l2.c | 36 | ||||
-rw-r--r-- | v4l_experimental/pvrusb2/pvrusb2-video-v4l.c | 8 |
7 files changed, 69 insertions, 23 deletions
diff --git a/v4l_experimental/pvrusb2/pvrusb2-audio.c b/v4l_experimental/pvrusb2/pvrusb2-audio.c index ebe1f38f1..8ba8827be 100644 --- a/v4l_experimental/pvrusb2/pvrusb2-audio.c +++ b/v4l_experimental/pvrusb2/pvrusb2-audio.c @@ -1,6 +1,6 @@ /* * - * $Id: pvrusb2-audio.c,v 1.1 2005/11/14 13:31:24 mchehab Exp $ + * $Id: pvrusb2-audio.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> @@ -70,6 +70,7 @@ int pvr2_audio_set_standard(struct pvr2_hdw *hdw) switch (hdw->controls[PVR2_CID_VIDEOSTANDARD].value) { default: case PVR2_CVAL_VIDEOSTANDARD_NTSC_M: + case PVR2_CVAL_VIDEOSTANDARD_PAL_M: /* Hack */ vc.norm = VIDEO_MODE_NTSC; break; case PVR2_CVAL_VIDEOSTANDARD_SECAM_L: diff --git a/v4l_experimental/pvrusb2/pvrusb2-encoder.c b/v4l_experimental/pvrusb2/pvrusb2-encoder.c index 450d14209..e935eaead 100644 --- a/v4l_experimental/pvrusb2/pvrusb2-encoder.c +++ b/v4l_experimental/pvrusb2/pvrusb2-encoder.c @@ -1,6 +1,6 @@ /* * - * $Id: pvrusb2-encoder.c,v 1.1 2005/11/14 13:31:24 mchehab Exp $ + * $Id: pvrusb2-encoder.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> @@ -360,12 +360,28 @@ static int pvr2_write_encoder_vcmd (struct pvr2_hdw *hdw, u8 cmd, int pvr2_encoder_configure(struct pvr2_hdw *hdw) { int ret = 0, audio, i; - int is_ntsc = (hdw->controls[PVR2_CID_VIDEOSTANDARD].value == - PVR2_CVAL_VIDEOSTANDARD_NTSC_M); + int vd_std = hdw->controls[PVR2_CID_VIDEOSTANDARD].value; int height = hdw->controls[PVR2_CID_VRES].value; int width = hdw->controls[PVR2_CID_HRES].value; int height_full = !hdw->controls[PVR2_CID_INTERLACE].value; + int is_30fps, is_ntsc; + + switch (vd_std) { + case PVR2_CVAL_VIDEOSTANDARD_NTSC_M: + is_ntsc=1; + is_30fps=1; + break; + case PVR2_CVAL_VIDEOSTANDARD_PAL_M: + is_ntsc=0; + is_30fps=1; + break; + default: + is_ntsc=0; + is_30fps=0; + break; + } + pvr2_trace(PVR2_TRACE_ENCODER,"pvr2_encoder_configure"); /* set stream output port. */ @@ -406,7 +422,7 @@ int pvr2_encoder_configure(struct pvr2_hdw *hdw) /* set fps to 25 or 30 (1 or 0)*/ ret |= pvr2_write_encoder_vcmd(hdw, IVTV_API_ASSIGN_FRAMERATE, 1, - is_ntsc ? 0 : 1); + is_30fps ? 0 : 1); /* set encoding resolution */ ret |= pvr2_write_encoder_vcmd(hdw, IVTV_API_ASSIGN_FRAME_SIZE, 2, @@ -419,7 +435,7 @@ int pvr2_encoder_configure(struct pvr2_hdw *hdw) /* VBI */ if (hdw->config == pvr2_config_vbi) { - int lines = 2 * (is_ntsc ? 12 : 18); + int lines = 2 * (is_30fps ? 12 : 18); int size = (4*((lines*1443+3)/4)) / lines; ret |= pvr2_write_encoder_vcmd(hdw, IVTV_API_CONFIG_VBI, 7, 0xbd05, 1, 4, @@ -427,7 +443,7 @@ int pvr2_encoder_configure(struct pvr2_hdw *hdw) lines , size); // 0x25256262, 0x13135454, lines , size); /* select vbi lines */ -#define line_used(l) (is_ntsc ? (l >= 10 && l <= 21) : (l >= 6 && l <= 23)) +#define line_used(l) (is_30fps ? (l >= 10 && l <= 21) : (l >= 6 && l <= 23)) for (i = 2 ; i <= 24 ; i++){ ret |= pvr2_write_encoder_vcmd( hdw,IVTV_API_SELECT_VBI_LINE, 5, diff --git a/v4l_experimental/pvrusb2/pvrusb2-hdw.c b/v4l_experimental/pvrusb2/pvrusb2-hdw.c index 715fb772e..9231d71a2 100644 --- a/v4l_experimental/pvrusb2/pvrusb2-hdw.c +++ b/v4l_experimental/pvrusb2/pvrusb2-hdw.c @@ -1,6 +1,6 @@ /* * - * $Id: pvrusb2-hdw.c,v 1.2 2005/11/27 23:01:16 mcisely Exp $ + * $Id: pvrusb2-hdw.c,v 1.3 2005/11/29 14:10:44 mchehab Exp $ * * Copyright (C) 2005 Mike Isely <isely@pobox.com> * @@ -127,6 +127,7 @@ static const char *control_values_videostandard[] = { [PVR2_CVAL_VIDEOSTANDARD_PAL_BG] = "PAL-BG", [PVR2_CVAL_VIDEOSTANDARD_PAL_I] = "PAL-I", [PVR2_CVAL_VIDEOSTANDARD_PAL_DK] = "PAL-DK", + [PVR2_CVAL_VIDEOSTANDARD_PAL_M] = "PAL-M", }; diff --git a/v4l_experimental/pvrusb2/pvrusb2-hdw.h b/v4l_experimental/pvrusb2/pvrusb2-hdw.h index 55feeaac2..4b3943f57 100644 --- a/v4l_experimental/pvrusb2/pvrusb2-hdw.h +++ b/v4l_experimental/pvrusb2/pvrusb2-hdw.h @@ -1,6 +1,6 @@ /* * - * $Id: pvrusb2-hdw.h,v 1.1 2005/11/14 13:31:24 mchehab Exp $ + * $Id: pvrusb2-hdw.h,v 1.2 2005/11/29 14:10:44 mchehab Exp $ * * Copyright (C) 2005 Mike Isely <isely@pobox.com> * @@ -100,8 +100,10 @@ #define PVR2_CVAL_VIDEOSTANDARD_PAL_BG 2 #define PVR2_CVAL_VIDEOSTANDARD_PAL_I 3 #define PVR2_CVAL_VIDEOSTANDARD_PAL_DK 4 +#define PVR2_CVAL_VIDEOSTANDARD_PAL_M 5 + #define PVR2_CVAL_VIDEOSTANDARD_MIN PVR2_CVAL_VIDEOSTANDARD_NTSC_M -#define PVR2_CVAL_VIDEOSTANDARD_MAX PVR2_CVAL_VIDEOSTANDARD_PAL_DK +#define PVR2_CVAL_VIDEOSTANDARD_MAX PVR2_CVAL_VIDEOSTANDARD_PAL_M /* Legal values for the INPUT state variable */ #define PVR2_CVAL_INPUT_TV 0 diff --git a/v4l_experimental/pvrusb2/pvrusb2-tuner.c b/v4l_experimental/pvrusb2/pvrusb2-tuner.c index ffbc66294..2dba9e8f8 100644 --- a/v4l_experimental/pvrusb2/pvrusb2-tuner.c +++ b/v4l_experimental/pvrusb2/pvrusb2-tuner.c @@ -1,6 +1,6 @@ /* * - * $Id: pvrusb2-tuner.c,v 1.1 2005/11/14 13:31:24 mchehab Exp $ + * $Id: pvrusb2-tuner.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> @@ -42,7 +42,8 @@ static u32 pvr_tbl_standard[] = { [PVR2_CVAL_VIDEOSTANDARD_PAL_I] = 0x00d4700a, /* PVR_STD_PAL_I */ [PVR2_CVAL_VIDEOSTANDARD_PAL_DK] = 0x00d4700b, /* PVR_STD_PAL_DK */ [PVR2_CVAL_VIDEOSTANDARD_SECAM_L] = 0x00c4100b, /* PVR_STD_SECAM */ - [PVR2_CVAL_VIDEOSTANDARD_NTSC_M] = 0x00163044 /* PVR_STD_NTSC */ + [PVR2_CVAL_VIDEOSTANDARD_NTSC_M] = 0x00163044, /* PVR_STD_NTSC */ + [PVR2_CVAL_VIDEOSTANDARD_PAL_M] = 0x00163044 /* PVR_STD_PAL_M */ }; #define trace_tuner(...) pvr2_trace(PVR2_TRACE_TUNER,__VA_ARGS__) @@ -136,6 +137,9 @@ int pvr2_tuner_set_standard(struct pvr2_hdw *hdw) case PVR2_CVAL_VIDEOSTANDARD_PAL_DK: vs = V4L2_STD_PAL_DK; break; + case PVR2_CVAL_VIDEOSTANDARD_PAL_M: + vs = V4L2_STD_PAL_M; + break; } pvr2_i2c_tuner_cmd(hdw,VIDIOC_S_STD,&vs); 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)); diff --git a/v4l_experimental/pvrusb2/pvrusb2-video-v4l.c b/v4l_experimental/pvrusb2/pvrusb2-video-v4l.c index fa35640f2..c87567b4d 100644 --- a/v4l_experimental/pvrusb2/pvrusb2-video-v4l.c +++ b/v4l_experimental/pvrusb2/pvrusb2-video-v4l.c @@ -1,6 +1,6 @@ /* * - * $Id: pvrusb2-video-v4l.c,v 1.1 2005/11/27 23:01:16 mcisely Exp $ + * $Id: pvrusb2-video-v4l.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> @@ -219,11 +219,11 @@ static int pvr2_decoder_v4l_set_norm(struct pvr2_decoder *dcp) case PVR2_CVAL_VIDEOSTANDARD_PAL_DK: std = V4L2_STD_PAL_DK; break; - case PVR2_CVAL_VIDEOSTANDARD_PAL_BG: - std = V4L2_STD_PAL_BG; + case PVR2_CVAL_VIDEOSTANDARD_PAL_M: + std = V4L2_STD_PAL_M; break; } - status = pvr2_i2c_saa7115_cmd(hdw,VIDIOC_S_STD,&std); + status = pvr2_i2c_saa7115_cmd(hdw,VIDIOC_S_STD,&std); if (status) return status; hdw->subsys_enabled_mask |= PVR2_SUBSYS_DIGITIZER_CFG_NORM; return 0; |