Mailing List archive

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

[vdr] Re: SV: Channellist for swedish cable operator ComHem?



Hi,

here is the patch. Another try.

Enjoy,

Emil
--- scan/scan.c	2002-12-05 14:57:22.000000000 +0100
+++ vdrscan/scan.c	2003-01-17 22:02:27.000000000 +0100
@@ -81,6 +81,9 @@
 	uint16_t pcr_pid;
 	uint16_t video_pid;
 	uint16_t audio_pid;
+        uint16_t audio2_pid;
+        uint16_t telet_pid;
+        uint16_t daudio_pid;
 	int private_pid_count     : 8;
 	enum service_type type    : 8;
 	enum running_mode running : 3;
@@ -112,7 +115,8 @@
 	0,
 	sizeof(struct service)
 };
-
+char *sat = "";
+int allinitflag = 0;
 
 
 static 
@@ -246,7 +250,7 @@
 
 	t->polarisation = (buf[8] >> 5) & 0x03;
 
-	dump_dvb_parameters (stderr, t->type, &t->param);
+	dump_dvb_parameters (stderr, t->type, &t->param,t->polarisation);
 	if (t->scan_done)
 		fprintf (stderr, " (done)");
 	fprintf (stderr, "\n");
@@ -427,8 +431,18 @@
 			break;
 		case 0x03:
 		case 0x04:
-			s->audio_pid = elementary_pid;
-			break;
+                        if ( ! s->audio_pid )
+                            s->audio_pid = elementary_pid;
+                        else
+                            s->audio2_pid = elementary_pid;
+			break;
+                case 0x06:
+                        if ( buf[8] == 0x6a || buf[11] == 0x6a || buf[14] == 0x6a  )
+                            s->daudio_pid = elementary_pid;
+                        else
+                            s->telet_pid = elementary_pid;
+
+                        break;
 		default:
 			s->private_pid_count++;
 		};
@@ -437,11 +451,11 @@
 		section_length -= ES_info_len + 5;
 	};
 
-	MSG("0x%04x 0x%04x: %s -- %s, pmt_pid 0x%04x, vpid 0x%04x, apid 0x%04x",
+	MSG("0x%04x 0x%04x: %s -- %s, pmt_pid 0x%04x, vpid 0x%04x, apid 0x%04x, apid2 0x%04x, dpid 0x%04x, tpid 0x%04x",
 	    s->transport_stream_id,
 	    s->service_id,
 	    s->provider_name, s->service_name,
-	    s->pmt_pid, s->video_pid, s->audio_pid);
+	    s->pmt_pid, s->video_pid, s->audio_pid,s->audio2_pid, s->daudio_pid,s->telet_pid);
 }
 
 
@@ -845,7 +859,7 @@
 	memcpy (&p, &t->param, sizeof(struct dvb_frontend_parameters));
 
 	MSG(">>> tune to: ");
-	dump_dvb_parameters (stderr, t->type, &p);
+	dump_dvb_parameters (stderr, t->type, &p,t->polarisation);
 	if (t->scan_done)
 		fprintf (stderr, " (done)");
 	MSG("\n");
@@ -917,8 +931,10 @@
 	while (index < list_size) {
 		struct transponder *t = &initial_list[index];
 
-		if (tune_to_transponder (frontend_fd, t) == 0)
+		if (tune_to_transponder (frontend_fd, t) == 0) {
+			index++;
 			return 0;
+		}
 
 		index++;
 	}
@@ -1000,6 +1016,25 @@
 static
 void scan_network (const char *frontend_devname, const char *demux_devname)
 {
+        int frontend_fd;
+
+        MSG ("using '%s' and '%s'\n", frontend_devname, demux_devname);
+
+        if ((frontend_fd = open (frontend_devname, O_RDWR)) < 0)
+                PERROR("failed opening '%s'", frontend_devname);
+
+        while (!tune_initial (frontend_fd) ) {
+            do {
+                scan_tp(demux_devname);
+            } while (tune_to_next_transponder(frontend_fd) == 0);
+        }
+
+        close (frontend_fd);
+}
+
+static
+void quick_scan_network (const char *frontend_devname, const char *demux_devname)
+{
 	int frontend_fd;
 
 	MSG ("using '%s' and '%s'\n", frontend_devname, demux_devname);
@@ -1037,18 +1072,26 @@
 			n = find_entry_by_id (&network_list, -1,
 					      t->network_id);
 
-			dump_service_parameter_set (stdout,
-						    s->service_name,
-						    t->type,
-						    &t->param,
-						    s->video_pid,
-						    s->audio_pid);
+                dump_service_parameter_set (stdout,
+                            s->provider_name,
+                            s->service_name,
+                            t->type,
+                            &t->param,
+                            t->polarisation,
+                            s->scrambled,
+                            s->video_pid,
+                            s->audio_pid,
+                            s->audio2_pid,
+                            s->daudio_pid,
+                            s->telet_pid,
+                            s->service_id);
+
 		}
 	}
 }
 
 
-static const char *usage = "\nusage: %s [-c] [-a adapter_num] [-f frontend_id] [-d demux_id] [-s switch_pos]\n\t-c\tscan on currently tuned transponder only\n\n";
+static const char *usage = "\nusage: %s [-i sat_id] [-A] [-c] [-a adapter_num] [-f frontend_id] [-d demux_id] [-s switch_pos]\n\t-c\tscan on currently tuned transponder only\n\t-A\tScan All initial Freq.\n\n";
 
 
 int main (int argc, char **argv)
@@ -1058,8 +1101,17 @@
 	int adapter = 0, frontend = 0, demux = 0;
 	int opt, current_tp_only = 0;
 
-	while ((opt = getopt(argc, argv, "ca:f:d:s:")) != -1) {
+        sat=malloc(255);
+        strcpy(sat,"S19.2E");
+
+	while ((opt = getopt(argc, argv, "Aca:f:d:s:i:")) != -1) {
 		switch (opt) {
+                case 'A':
+                        allinitflag = 1;
+                        break;
+                case 'i':
+                        strcpy(sat,optarg);
+                        break;
 		case 'a':
 			adapter = strtoul(optarg, NULL, 0);
 			break;
@@ -1094,11 +1146,13 @@
 
 	if (current_tp_only)
 		scan_tp (demux_devname);
-	else
-		scan_network (frontend_devname, demux_devname);
+        else if(allinitflag)
+                scan_network (frontend_devname, demux_devname);
+        else quick_scan_network (frontend_devname, demux_devname);
 
-	dump_lists ();
 
+	dump_lists ();
+	free(sat);
 	return 0;
 }
 
--- scan/dump.c	2002-10-28 12:59:46.000000000 +0100
+++ vdrscan/dump.c	2003-01-17 22:02:35.000000000 +0100
@@ -23,12 +23,12 @@
 
 static const char *qam_name [] = {
 	"QPSK",
-	"QAM_16",
-	"QAM_32",
-	"QAM_64",
-	"QAM_128",
-	"QAM_256",
-	"QAM_AUTO"
+	"M16",
+	"M32",
+	"M64",
+	"M128",
+	"M256",
+	"M_AUTO"
 };
 
 
@@ -62,23 +62,25 @@
 	"HIERARCHY_4",
 	"HIERARCHY_AUTO"
 };
+extern char *sat;
 
 
-void dump_dvb_parameters (FILE *f, fe_type_t type, struct dvb_frontend_parameters *p)
+void dump_dvb_parameters (FILE *f, fe_type_t type, struct dvb_frontend_parameters *p,int polarisation)
 {
-	fprintf (f, "%i:", p->frequency);
-	fprintf (f, "%s:", inv_name[p->inversion]);
 
 	switch (type) {
 	case FE_QPSK:
-		fprintf (f, "%i:", p->u.qpsk.symbol_rate);
-		fprintf (f, "%s", fec_name[p->u.qpsk.fec_inner]);
+		fprintf (f, "%i:", p->frequency/1000);
+                fprintf (f, "%c:",polarisation == 0x01 ? 'V' : 'H');
+                fprintf (f, "%s:",sat);
+                fprintf (f, "%i", p->u.qpsk.symbol_rate/1000);
 		break;
 
 	case FE_QAM:
-		fprintf (f, "%i:", p->u.qpsk.symbol_rate);
-		fprintf (f, "%s:", fec_name[p->u.qpsk.fec_inner]);
-		fprintf (f, "%s", qam_name[p->u.qam.modulation]);
+		fprintf (f, "%i:", p->frequency/1000000);
+		fprintf (f, "%s:", qam_name[p->u.qam.modulation]);
+		fprintf (f, "%c:", 'C');
+		fprintf (f, "%i", p->u.qpsk.symbol_rate/1000);
 		break;
 
 	case FE_OFDM:
@@ -96,16 +98,56 @@
 	};
 }
 
-void dump_service_parameter_set (FILE *f, 
-				 const char *service_name,
-				 fe_type_t type,
-				 struct dvb_frontend_parameters *p,
-				 int video_pid,
-				 int audio_pid)
+void dump_service_parameter_set (FILE *f,
+                                 unsigned char *provider_name,
+                                 unsigned char *service_name,
+                                 fe_type_t type,
+                                 struct dvb_frontend_parameters *p,
+                                 int polarisation,
+                                 int scrambled,
+                                 int video_pid,
+                                 int audio_pid,
+                                 int audio2_pid,
+                                 int daudio_pid,
+                                 int telet_pid,
+                                 int service_id)
 {
-	fprintf (f, "%s:", service_name);
-	dump_dvb_parameters (f, type, p);
-	fprintf (f, ":%i:%i", video_pid, audio_pid);
-	fprintf (f, "\n");
+        int     ca_set=0;
+        int     i;
+        FILE    *detailfile;
+        char    provider_file[255];
+        char    temporaer[255];
+
+
+	if (! provider_name || provider_name[0]=='\0')
+	    provider_name="Empty";
+	if (! service_name || service_name[0]=='\0')
+	    service_name="Empty";
+
+        if ( ! scrambled )
+                ca_set=0;
+        else if ( !strcmp(provider_name,"NetMed") && scrambled )
+            ca_set=1002;
+        else if ( !strcmp(provider_name,"ORF") && scrambled )
+            ca_set=102;
+        else ca_set=101;
+
+	if ( !audio_pid ) return;
+
+        fprintf (f, "%-30s:", service_name);
+
+        dump_dvb_parameters (f, type, p,polarisation);
+
+        if ( ! audio2_pid )
+            fprintf (f, ":%i:%i", video_pid, audio_pid);
+        else
+            fprintf (f, ":%i:%i,%i", video_pid, audio_pid, audio2_pid);
+
+        if ( daudio_pid )
+            fprintf (f, ";%i:%i:%i:%i:%i:%i:%i", daudio_pid,telet_pid, ca_set,service_id,0,0,0);
+        else
+            fprintf (f, ":%i:%i:%i:%i:%i:%i", telet_pid, ca_set,service_id,0,0,0);
+
+        fprintf (f, "\n");
 }
 
--- scan/initial.h	2002-12-13 09:27:46.000000000 +0100
+++ vdrscan/initial.h	2003-01-09 14:05:28.000000000 +0100
@@ -6,6 +6,57 @@
 static
 struct transponder qpsk_probes [] = {
 	/**
+	 *  Sirius 2,3
+	 */
+	{
+		.type = FE_QPSK,
+		.param = {
+			.frequency = 11728000,
+			.inversion = INVERSION_OFF,
+			{ qpsk:
+				{
+					.symbol_rate = 2750000,
+					.fec_inner = FEC_3_4
+				}
+			}
+		},
+		.polarisation = POLARISATION_HORIZONTAL
+	},
+	/**
+	 *  Sirius 2,3
+	 */
+	{
+		.type = FE_QPSK,
+		.param = {
+			.frequency = 11766000,
+			.inversion = INVERSION_OFF,
+			{ qpsk:
+				{
+					.symbol_rate = 2750000,
+					.fec_inner = FEC_3_4
+				}
+			}
+		},
+		.polarisation = POLARISATION_HORIZONTAL
+	},
+	/**
+	 *  Sirius 2,3
+	 */
+	{
+		.type = FE_QPSK,
+		.param = {
+			.frequency = 11785000,
+			.inversion = INVERSION_OFF,
+			{ qpsk:
+				{
+					.symbol_rate = 2750000,
+					.fec_inner = FEC_3_4
+				}
+			}
+		},
+		.polarisation = POLARISATION_VERTICAL
+	},
+	/**
 	 *  Astra 19.2E horizontal, Ard Digital (Arte, Das Erste, WDR...)
 	 */
 	{
@@ -45,9 +96,44 @@
 	{
 		.type = FE_QPSK,
 		.param = {
+			.frequency = 10758000,
+			.inversion = INVERSION_OFF,
+			{ qpsk:  
+                                {
+					.symbol_rate = 27500000,
+					.fec_inner = FEC_3_4
+				}
+			}
+		},
+		.polarisation = POLARISATION_VERTICAL
+	},
+	/**
+	 *  Hotbird 13.0E vertical, Deutsche Telekom (arte)
+	 */
+	{
+		.type = FE_QPSK,
+		.param = {
+			.frequency = 12169000,
+			.inversion = INVERSION_OFF,
+			{ qpsk:
+				{
+					.symbol_rate = 2750000,
+					.fec_inner = FEC_3_4
+				}
+			}
+		},
+		.polarisation = POLARISATION_HORIZONTAL
+	},
+	/**
+	 *  Hotbird 13.0E horizontal, Deutsche Telekom (ZDF, NBC, RL, VOX, ...)
+	 */
+	{
+		.type = FE_QPSK,
+		.param = {
 			.frequency = 11055000,
 			.inversion = INVERSION_OFF,
-			{ qpsk: {
+			{ qpsk:  
+                                {
 					.symbol_rate = 27500000,
 					.fec_inner = FEC_5_6
 				}
@@ -65,7 +151,7 @@
 			.inversion = INVERSION_OFF,
 			{ qpsk:
 				{
-					.symbol_rate = 6510000,
+					.symbol_rate = 2750000,
 					.fec_inner = FEC_5_6
 				}
 			}
@@ -73,6 +159,40 @@
 		.polarisation = POLARISATION_VERTICAL
 	},
 	/**
+	 *  Thor 1,2,3 0.8 West
+	 */
+	{
+		.type = FE_QPSK,
+		.param = {
+			.frequency = 12476000,
+			.inversion = INVERSION_ON,
+			{ qpsk:
+				{
+					.symbol_rate = 2780000,
+					.fec_inner = FEC_7_8
+				}
+			}
+		},
+		.polarisation = POLARISATION_HORIZONTAL
+	},
+	/**
+	 *  Thor 1,2,3 0.8 West
+	 */
+	{
+		.type = FE_QPSK,
+		.param = {
+			.frequency = 11372000,
+			.inversion = INVERSION_AUTO,
+			{ qpsk:
+				{
+					.symbol_rate = 2450000,
+					.fec_inner = FEC_AUTO
+				}
+			}
+		},
+		.polarisation = POLARISATION_VERTICAL
+	},
+	/**
 	 *  HISPASAT 1A/B, 30.0W vertical (TV de Galicia)
 	 */
 	{
@@ -241,6 +361,57 @@
 		},
 		.polarisation = POLARISATION_VERTICAL
 	},
+	/**
+	 *  Hotbird 13.0E horizontal, Deutsche Telekom (ZDF, NBC, RL, VOX, ...)
+	 */
+	{
+		.type = FE_QPSK,
+		.param = {
+			.frequency = 12169000,
+			.inversion = INVERSION_OFF,
+			{ qpsk:  
+                                {
+					.symbol_rate = 27500000,
+					.fec_inner = FEC_3_4
+				}
+			}
+		},
+		.polarisation = POLARISATION_HORIZONTAL
+	},
+	/**
+	 *  Hotbird 13.0E horizontal, Deutsche Telekom (ZDF, NBC, RL, VOX, ...)
+	 */
+	{
+		.type = FE_QPSK,
+		.param = {
+			.frequency = 10930000,
+			.inversion = INVERSION_OFF,
+			{ qpsk:  
+                                {
+					.symbol_rate = 27500000,
+					.fec_inner = FEC_3_4
+				}
+			}
+		},
+		.polarisation = POLARISATION_HORIZONTAL
+	},
+	/**
+	 *  Hotbird 13.0E horizontal, Deutsche Telekom (ZDF, NBC, RL, VOX, ...)
+	 */
+	{
+		.type = FE_QPSK,
+		.param = {
+			.frequency = 11823000,
+			.inversion = INVERSION_OFF,
+			{ qpsk:  
+                                {
+					.symbol_rate = 27500000,
+					.fec_inner = FEC_3_4
+				}
+			}
+		},
+		.polarisation = POLARISATION_HORIZONTAL
+	},
 };
 
 
--- scan/dump.h	2002-10-28 12:59:46.000000000 +0100
+++ vdrscan/dump.h	2003-01-08 22:40:12.000000000 +0100
@@ -4,15 +4,37 @@
 #include <linux/dvb/frontend.h>
 
 extern 
-void dump_dvb_parameters (FILE *f, fe_type_t type, struct dvb_frontend_parameters *p);
+void dump_dvb_parameters (FILE *f, fe_type_t type, struct dvb_frontend_parameters *p,int polarisation);
 
 extern
 void dump_service_parameter_set (FILE *f,
-				 const char *service_name,
+				 char *provider_name,
+				 char *service_name,
 				 fe_type_t type,
 				 struct dvb_frontend_parameters *p,
+				 int polarisation,
+				 int scrambled,
 				 int video_pid,
-				 int audio_pid);
+				 int audio_pid,
+				 int audio2_pid,
+				 int daudio_pid,
+				 int telet_pid,
+				 int service_id);
+extern
+void dumpline (FILE *f, 
+	unsigned char *provider_name,
+	unsigned char *service_name,
+	fe_type_t type,
+	struct dvb_frontend_parameters *p,
+	int polarisation,
+	int scrambled,
+	int video_pid,
+	int audio_pid,
+	int audio2_pid,
+	int daudio_pid,
+	int telet_pid,
+	int service_id,
+	int ca_set);
 
 #endif
 


--
Info:
To unsubscribe send a mail to listar@linuxtv.org with "unsubscribe vdr" as subject.



Home | Main Index | Thread Index