[Mplayer-cvslog] CVS: main/libmpdemux tvi_v4l.c,1.44,1.45 tv.c,1.40,1.41 tv.h,1.18,1.19

Jindrich Makovicka CVS henry at mplayerhq.hu
Mon Dec 16 18:06:05 CET 2002


Update of /cvsroot/mplayer/main/libmpdemux
In directory mail:/var/tmp.root/cvs-serv3000

Modified Files:
	tvi_v4l.c tv.c tv.h 
Log Message:
support for exotic norms

Index: tvi_v4l.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/tvi_v4l.c,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -r1.44 -r1.45
--- tvi_v4l.c	14 Dec 2002 09:55:45 -0000	1.44
+++ tvi_v4l.c	16 Dec 2002 17:05:49 -0000	1.45
@@ -980,15 +980,21 @@
 	{
 	    int req_mode = (int)*(void **)arg;
 
-	    if ((req_mode != TV_NORM_PAL) && (req_mode != TV_NORM_NTSC) && (req_mode != TV_NORM_SECAM)) {
+	    if ((req_mode != TV_NORM_PAL) && (req_mode != TV_NORM_NTSC) && (req_mode != TV_NORM_SECAM)
+		&& (req_mode != TV_NORM_PALNC) && (req_mode != TV_NORM_PALM) && (req_mode != TV_NORM_PALN)
+		&& (req_mode != TV_NORM_NTSCJP)) {
 		mp_msg(MSGT_TV, MSGL_ERR, "Unknown norm!\n");
 		return(TVI_CONTROL_FALSE);
 	    }
 
 	    if (priv->channels[priv->act_channel].flags & VIDEO_VC_TUNER) {
 		control(priv, TVI_CONTROL_TUN_GET_TUNER, 0);
-		if (((req_mode == TV_NORM_PAL) && !(priv->tuner.flags & VIDEO_TUNER_PAL)) ||
-		    ((req_mode == TV_NORM_NTSC) && !(priv->tuner.flags & VIDEO_TUNER_NTSC)) ||
+		if (((req_mode == TV_NORM_PAL
+		      || req_mode == TV_NORM_PALNC
+		      || req_mode == TV_NORM_PALN) && !(priv->tuner.flags & VIDEO_TUNER_PAL)) ||
+		    ((req_mode == TV_NORM_NTSC
+		      || req_mode == TV_NORM_NTSCJP
+		      || req_mode == TV_NORM_PALM) && !(priv->tuner.flags & VIDEO_TUNER_NTSC)) ||
 		    ((req_mode == TV_NORM_SECAM) && !(priv->tuner.flags & VIDEO_TUNER_SECAM)))
 		{
 		    mp_msg(MSGT_TV, MSGL_ERR, "Tuner isn't capable to set norm!\n");
@@ -997,9 +1003,13 @@
 
 		switch(req_mode) {
 		case TV_NORM_PAL:
+		case TV_NORM_PALNC:
+		case TV_NORM_PALN:
 		    priv->tuner.mode = VIDEO_MODE_PAL;
 		    break;
 		case TV_NORM_NTSC:
+		case TV_NORM_NTSCJP:
+		case TV_NORM_PALM:
 		    priv->tuner.mode = VIDEO_MODE_NTSC;
 		    break;
 		case TV_NORM_SECAM:
@@ -1023,6 +1033,18 @@
 	    case TV_NORM_SECAM:
 		priv->channels[priv->act_channel].norm = VIDEO_MODE_SECAM;
 		break;
+	    case TV_NORM_PALNC:
+		priv->channels[priv->act_channel].norm = 3;
+		break;
+	    case TV_NORM_PALM:
+		priv->channels[priv->act_channel].norm = 4;
+		break;
+	    case TV_NORM_PALN:
+		priv->channels[priv->act_channel].norm = 5;
+		break;
+	    case TV_NORM_NTSCJP:
+		priv->channels[priv->act_channel].norm = 6;
+		break;
 	    }
 	    if (ioctl(priv->video_fd, VIDIOCSCHAN, &priv->channels[priv->act_channel]) == -1)
 	    {
@@ -1035,11 +1057,11 @@
 		return(TVI_CONTROL_FALSE);
 	    }
 
-	    if(req_mode == TV_NORM_PAL || req_mode == TV_NORM_SECAM) {
+	    if(req_mode == TV_NORM_PAL || req_mode == TV_NORM_SECAM || req_mode == TV_NORM_PALN || req_mode == TV_NORM_PALNC) {
 		priv->fps = PAL_FPS;
             }
 
-	    if(req_mode == TV_NORM_NTSC) {
+	    if(req_mode == TV_NORM_NTSC || req_mode == TV_NORM_NTSCJP || req_mode == TV_NORM_PALM) {
 		priv->fps = NTSC_FPS;
             }
 

Index: tv.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/tv.c,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -r1.40 -r1.41
--- tv.c	23 Nov 2002 10:58:08 -0000	1.40
+++ tv.c	16 Dec 2002 17:05:49 -0000	1.41
@@ -159,6 +159,18 @@
 	tvh->norm = TV_NORM_NTSC;
     else if (!strcasecmp(tv_param_norm, "secam"))
 	tvh->norm = TV_NORM_SECAM;
+    else if (!strcasecmp(tv_param_norm, "palnc"))
+	tvh->norm = TV_NORM_PALNC;
+    else if (!strcasecmp(tv_param_norm, "palm"))
+	tvh->norm = TV_NORM_PALM;
+    else if (!strcasecmp(tv_param_norm, "paln"))
+	tvh->norm = TV_NORM_PALN;
+    else if (!strcasecmp(tv_param_norm, "ntscjp"))
+	tvh->norm = TV_NORM_NTSCJP;
+    else {
+	mp_msg(MSGT_TV, MSGL_V, "Bogus norm parameter, setting PAL.\n");
+	tvh->norm = TV_NORM_PAL;
+    }
 
     mp_msg(MSGT_TV, MSGL_V, "Selected norm: %s\n", tv_param_norm);
     funcs->control(tvh->priv, TVI_CONTROL_TUN_SET_NORM, &tvh->norm);

Index: tv.h
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/tv.h,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- tv.h	25 Oct 2002 09:42:41 -0000	1.18
+++ tv.h	16 Dec 2002 17:05:49 -0000	1.19
@@ -154,6 +154,10 @@
 #define TV_NORM_PAL		1
 #define TV_NORM_NTSC		2
 #define TV_NORM_SECAM		3
+#define TV_NORM_PALNC		4
+#define TV_NORM_PALM		5
+#define TV_NORM_PALN		6
+#define TV_NORM_NTSCJP		7
 
 #endif /* USE_TV */
 




More information about the MPlayer-cvslog mailing list