diff options
Diffstat (limited to 'v4l_experimental/pvrusb2/pvrusb2-encoder.c')
-rw-r--r-- | v4l_experimental/pvrusb2/pvrusb2-encoder.c | 28 |
1 files changed, 22 insertions, 6 deletions
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, |