[MPlayer-cvslog] CVS: main/libmpdemux dvbin.h, 1.8, 1.9 dvbin.c, 1.11, 1.12 dvb_tune.c, 1.10, 1.11

Nico Sabbi CVS syncmail at mplayerhq.hu
Thu Jan 6 10:43:13 CET 2005


CVS change done by Nico Sabbi CVS

Update of /cvsroot/mplayer/main/libmpdemux
In directory mail:/var2/tmp/cvs-serv16213

Modified Files:
	dvbin.h dvbin.c dvb_tune.c 
Log Message:
added support for ATSC tuner and conf.file

Index: dvbin.h
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/dvbin.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- dvbin.h	26 Aug 2004 19:37:55 -0000	1.8
+++ dvbin.h	6 Jan 2005 09:43:10 -0000	1.9
@@ -8,6 +8,7 @@
 #ifdef HAVE_DVB_HEAD
 	#include <linux/dvb/dmx.h>
 	#include <linux/dvb/frontend.h>
+	#include <linux/dvb/version.h>
 #else
 	#include <ost/dmx.h>
 	#include <ost/sec.h>
@@ -26,6 +27,12 @@
 	#define dmx_pes_type_t dmxPesType_t
 #endif
 
+#undef DVB_ATSC
+#if defined(DVB_API_VERSION_MINOR)
+#if DVB_API_VERSION == 3 && DVB_API_VERSION_MINOR >= 1
+#define DVB_ATSC 1
+#endif
+#endif
 
 
 #define DVB_CHANNEL_LOWER -1
@@ -92,6 +99,7 @@
 #define TUNER_SAT	1
 #define TUNER_TER	2
 #define TUNER_CBL	3
+#define TUNER_ATSC	4
 
 extern int dvb_step_channel(dvb_priv_t *, int);
 extern int dvb_set_channel(dvb_priv_t *, int, int);

Index: dvbin.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/dvbin.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- dvbin.c	26 Aug 2004 19:38:04 -0000	1.11
+++ dvbin.c	6 Jan 2005 09:43:10 -0000	1.12
@@ -133,6 +133,7 @@
 	const char *cbl_conf = "%a[^:]:%d:%a[^:]:%d:%a[^:]:%a[^:]:%a[^:]:%a[^:]\n";
 	const char *sat_conf = "%a[^:]:%d:%c:%d:%d:%a[^:]:%a[^:]\n";
 	const char *ter_conf = "%a[^:]:%d:%a[^:]:%a[^:]:%a[^:]:%a[^:]:%a[^:]:%a[^:]:%a[^:]:%a[^:]:%a[^:]:%a[^:]\n";
+	const char *atsc_conf = "%a[^:]:%d:%a[^:]:%a[^:]:%a[^:]\n";
 	
 	mp_msg(MSGT_DEMUX, MSGL_V, "CONFIG_READ FILE: %s, type: %d\n", filename, type);
 	if((f=fopen(filename, "r"))==NULL)
@@ -180,6 +181,16 @@
 				"CBL, NUM: %d, NUM_FIELDS: %d, NAME: %s, FREQ: %d, SRATE: %d",
 				list->NUM_CHANNELS, fields, ptr->name, ptr->freq, ptr->srate);
 		}
+#ifdef DVB_ATSC
+		else if(type == TUNER_ATSC)
+		{
+			fields = sscanf(line, atsc_conf,
+				&ptr->name, &ptr->freq, &mod, &vpid_str, &apid_str);
+			mp_msg(MSGT_DEMUX, MSGL_V,
+				"ATSC, NUM: %d, NUM_FIELDS: %d, NAME: %s, FREQ: %d\n",
+				list->NUM_CHANNELS, fields, ptr->name, ptr->freq);
+		}
+#endif
 		else //SATELLITE
 		{
 			fields = sscanf(line, sat_conf,
@@ -264,7 +275,11 @@
 			else if(! strcmp(cr, "FEC_NONE"))
 				ptr->cr =FEC_NONE;
 			else ptr->cr =FEC_AUTO;
+		}
+	
 
+		if((type == TUNER_TER) || (type == TUNER_CBL) || (type == TUNER_ATSC))
+		{
 			if(! strcmp(mod, "QAM_128"))
 				ptr->mod = QAM_128;
 			else if(! strcmp(mod, "QAM_256"))
@@ -275,9 +290,15 @@
 				ptr->mod = QAM_32;
 			else if(! strcmp(mod, "QAM_16"))
 				ptr->mod = QAM_16;
-			//else ptr->mod = QPSK;
-		}
+#ifdef DVB_ATSC	
+			else if(! strcmp(mod, "VSB_8") || ! strcmp(mod, "8VSB"))
+				ptr->mod = VSB_8;
+			else if(! strcmp(mod, "VSB_16") || !strcmp(mod, "16VSB"))
+				ptr->mod = VSB_16;
 
+			ptr->inv = INVERSION_AUTO;
+#endif
+		}
 
 		if(type == TUNER_TER)
 		{
@@ -487,6 +508,11 @@
 			sprintf(priv->new_tuning, "%d|%09d|%d|%d|%d|%d", priv->card, channel->freq, channel->inv, channel->srate,
 				channel->cr, channel->mod);
 		break;
+#ifdef DVB_ATSC
+		case TUNER_ATSC:
+			sprintf(priv->new_tuning, "%d|%09d|%d", priv->card, channel->freq, channel->mod);
+		break;
+#endif
 	}
 
 
@@ -752,7 +778,7 @@
 			
 		type = dvb_get_tuner_type(fd);
 		close(fd);
-		if(type != TUNER_SAT && type != TUNER_TER && type != TUNER_CBL)
+		if(type != TUNER_SAT && type != TUNER_TER && type != TUNER_CBL && type != TUNER_ATSC)
 		{
 			mp_msg(MSGT_DEMUX, MSGL_V, "DVB_CONFIG, can't detect tuner type of card %d, skipping\n", i);
 			continue;
@@ -769,6 +795,9 @@
 				case TUNER_SAT:
 				conf_file = get_path("channels.conf.sat");
 					break;
+				case TUNER_ATSC:
+				conf_file = get_path("channels.conf.atsc");
+					break;
 			}
 		
 		if((access(conf_file, F_OK | R_OK) != 0))

Index: dvb_tune.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/dvb_tune.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- dvb_tune.c	31 Dec 2004 11:40:01 -0000	1.10
+++ dvb_tune.c	6 Jan 2005 09:43:10 -0000	1.11
@@ -84,6 +84,11 @@
       mp_msg(MSGT_DEMUX, MSGL_V, "TUNER TYPE SEEMS TO BE DVB-C\n");
 	  return TUNER_CBL;
 
+#ifdef DVB_ATSC
+	case FE_ATSC:
+      mp_msg(MSGT_DEMUX, MSGL_V, "TUNER TYPE SEEMS TO BE DVB-ATSC\n");
+	  return TUNER_ATSC;
+#endif
 	default:
 	  mp_msg(MSGT_DEMUX, MSGL_ERR, "UNKNOWN TUNER TYPE\n");
 	  return 0;
@@ -386,6 +391,12 @@
 			mp_msg(MSGT_DEMUX, MSGL_V, "        SymbolRate: %d\n",feparams->u.qpsk.symbol_rate);
 			mp_msg(MSGT_DEMUX, MSGL_V, "        FEC_inner:  %d\n",feparams->u.qpsk.fec_inner);
 			break;
+#ifdef DVB_ATSC
+			case FE_ATSC:
+			mp_msg(MSGT_DEMUX, MSGL_V, "Event:  Frequency: %d\n",feparams->frequency);
+			mp_msg(MSGT_DEMUX, MSGL_V, "        Modulation: %d\n",feparams->u.vsb.modulation);
+			break;
+#endif
 			default:
 			break;
 		}
@@ -755,6 +766,13 @@
       feparams.u.qam.QAM = modulation;
 #endif
       break;
+#ifdef DVB_ATSC
+    case FE_ATSC:
+      mp_msg(MSGT_DEMUX, MSGL_V, "tuning ATSC to %d, modulation=%d\n",freq,modulation);
+      feparams.frequency=freq;
+      feparams.u.vsb.modulation = modulation;
+      break;
+#endif
     default:
       mp_msg(MSGT_DEMUX, MSGL_V, "Unknown FE type. Aborting\n");
       return 0;




More information about the MPlayer-cvslog mailing list