Google
  Web www.spinics.net

Re: xawtv scantv patch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


> Date: Thu, 10 Mar 2005 17:17:40 +0100
> From: jerome lacoste <jerome.lacoste@xxxxxxxxx>
> Subject: Re: xawtv scantv patch
> To: Linux and Kernel Video <video4linux-list@xxxxxxxxxx>
> Message-ID: <5a2cf1f60503100817423075d3@xxxxxxxxxxxxxx>
> Content-Type: text/plain; charset=US-ASCII
> 
> On Thu, 10 Mar 2005 11:12:18 +0100, Andrew Lunn <andrew@xxxxxxx> wrote:
> > Hi Folks
> > 
> > Attached is a patch to xawtv scantv program. Currently scantv hard
> > codes the input channel to Television. The device im using uses the
> > name "Tuner 0". This patch generalises scantv so the user gets the
> > option to specify the input channel.
> > 
> >         Thanks
> >                 Andrew
> 
> Working with a PVR 350 ? :)

Yes. I think all ivtv drivers use "Tuner 0", so its not just the 350
though.

> But mine also contained a change to the help. Maybe do you want to
> merge them both?  An change to the scantv man and doc would complete
> it well. If you have time of course...

Sure. Attached is a re-worked patch. I added to the usage and the man
page. Is there some more documentation i should change?

        Andrew
--- console/scantv.c.orig	2004-02-09 22:44:23.000000000 +0100
+++ console/scantv.c	2005-03-12 13:12:50.474936352 +0100
@@ -116,6 +116,7 @@
 	    "options:\n"
 	    "   -h           print this text\n"
 	    "   -o outfile   set output file.        [%s]\n"
+	    "   -i input     set input, eg Television\n"
 	    "   -n norm      set tv norm.\n"
 	    "   -f table     set frequency table.\n"
 	    "   -c device    set video device file.  [%s]\n"
@@ -132,10 +133,12 @@
 main(int argc, char **argv)
 {
     struct vbi_state *vbi;
-    struct ng_attribute *attr;
-    int c,fi,on,tuned,i,j,scan=1,fullscan=0;
+    struct ng_attribute *tvnorm_attr;
+    struct ng_attribute *input_attr;
+    int c,fi,on,tuned,i,j,k,scan=1,fullscan=0;
     unsigned int f,f1,f2,fc;
     char *name,dummy[32];
+    char *input   = NULL;
     char *tvnorm  = NULL;
     char *freqtab = NULL;
     char *outfile = NULL;
@@ -144,7 +147,7 @@
     /* parse options */
     ng_init();
     for (;;) {
-	if (-1 == (c = getopt(argc, argv, "hsadn:f:o:c:C:")))
+	if (-1 == (c = getopt(argc, argv, "hsadn:f:o:c:C:i:")))
 	    break;
 	switch (c) {
 	case 'd':
@@ -159,6 +162,9 @@
 	case 'n':
 	    tvnorm = optarg;
 	    break;
+	case 'i':
+	    input = optarg;
+	    break;
 	case 'f':
 	    freqtab = optarg;
 	    break;
@@ -200,16 +206,19 @@
     freq_init();
 
     /* ask the user some questions ... */
-    attr = ng_attr_byid(attrs,ATTR_ID_NORM);
-    i = menu("please select your TV norm",attr->choices,tvnorm);
+    tvnorm_attr = ng_attr_byid(attrs,ATTR_ID_NORM);
+    input_attr = ng_attr_byid(attrs,ATTR_ID_INPUT);
+
+    k = menu("please select your TV input",input_attr->choices,input);
+    i = menu("please select your TV norm",tvnorm_attr->choices,tvnorm);
     j = menu("please select a frequency table",chanlist_names,freqtab);
 
     fprintf(conf,"[global]\n");
     fprintf(conf,"freqtab = %s\n",chanlist_names[j].str);
     fprintf(conf,"\n");
     fprintf(conf,"[defaults]\n");
-    fprintf(conf,"input = Television\n");
-    fprintf(conf,"norm = %s\n",ng_attr_getstr(attr,i));
+    fprintf(conf,"input = %s\n", ng_attr_getstr(input_attr,k));
+    fprintf(conf,"norm = %s\n",ng_attr_getstr(tvnorm_attr,i));
     fprintf(conf,"\n");
     fflush(conf);
     if (!scan)
@@ -220,8 +229,8 @@
 	exit(0);
     }
     set_defaults();
-    do_va_cmd(2,"setinput","television");
-    do_va_cmd(2,"setnorm",ng_attr_getstr(attr,i));
+    do_va_cmd(2,"setinput",ng_attr_getstr(input_attr,k));
+    do_va_cmd(2,"setnorm",ng_attr_getstr(tvnorm_attr,i));
     do_va_cmd(2,"setfreqtab",chanlist_names[j].str);
 
     /* vbi */
--- man/scantv.1.orig	2005-03-12 13:13:08.772154752 +0100
+++ man/scantv.1	2005-03-12 13:15:02.708833744 +0100
@@ -13,6 +13,10 @@
 set tv  \fBn\fPorm.   scantv will ask interactively if
 none is given.
 .TP
+.B -i input
+set \fBi\fPnput channel of the grabber.   scantv will ask interactively if
+none is given.
+.TP
 .B -f table
 set \fBf\fPrequency table.  scantv will ask interactively if
 none is given.
--

Unsubscribe mailto:video4linux-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

[Home]     [Older V4L]     [Linux DVB]     [Video Disk Recorder]     [Video Technology]     [Asterisk]     [Photo]     [DCCP]     [Netdev]     [Plasma TVs]     [Video Projectors]     [PDAs]     [Xorg]     [Util Linux NG]     [Xfree86]     [Devices]     [Big List of Linux Books]     [Free Photo Albums]     [LCD TVs]     [Fedora Users]     [Webcams]     [Fedora Women]     [HDTV]     [ALSA Users]     [ALSA Devel]     [Stuff]     [SSH]     [Linux USB]

Powered by Linux

Google PageRank Checking tool