[SCM] Mumudvb packaging branch, upstream, updated. 24c2efb080b56abb8e7be67bae30ba7fe457759e
Brice DUBOST
braice at braice.net
Sat Nov 1 13:31:05 UTC 2008
The following commit has been merged in the upstream branch:
commit fb987a3ec3a64cd34a91b2ca889f0b495efd6880
Author: Brice DUBOST <braice at braice.net>
Date: Sat Oct 4 19:28:57 2008 +0200
File cleaning, doc update, forgotted headers, some code improvements
* Outdated scripts removed
* Cleaning in the tool directory
* Some small code improvements
* Documentation updates
diff --git a/README b/README
index 29c6c9b..c885d1e 100644
--- a/README
+++ b/README
@@ -38,7 +38,7 @@ Special thanks to Dave CHAPMAN (dvbstream author)
* Stream channels from a transponder on different multicast IPs
* Can show reception level when streaming
- * Mumudvb make a list of streamed and down channels in real time (can be used to make SAP announces)
+ * Mumudvb make a list of streamed and down channels in real time
* Can deamonize and write his own pid in a file
* Mumudvb use a config file
* The program can kill himself if it receives no data from the card
@@ -60,11 +60,7 @@ Special thanks to Dave CHAPMAN (dvbstream author)
Others programs are joined with mumudvb :
* relay : this program takes a stream and sends it again on a different ip. It can be used to unicaast a stream over a network that doesn't support multicast, and multicast it again at the other end.
- * dumpudp : this program takes a stream from the network and puts it on the standard output. you can set an optionnal timeout ( Can be useful to record a TV program )
- * dumpudp_limited : same as dumpudp but for a limited number of packets (used to generate thunbails)
- * recup_sap : tiny sap client, get sap announces during 60 seconds and put them on the standard output (unsorted)
- * scan_modified : it's a modified version of the scan utility from dvb-apps. It is able to generate mumudvb configuration files.
- * Example scripts are joind in the script directory. They are undocumented for the moment. They are used to genreate sap announces, automtically launch and generate configuration for mumudvb on multiple cards and multiple servers, and generate thundbails. See the source code for more explanations.
+ * recup_sap : tiny sap client, get sap announces during 60 seconds and put them on a file (unsorted)
= Installation =
diff --git a/README-fr b/README-fr
index 0bd8aa0..1936fa1 100644
--- a/README-fr
+++ b/README-fr
@@ -8,7 +8,7 @@ mumudvb est,
Désormais mumudvb est un projet indépendant de dvbstream.
-Mumudvb permet de diffuser plusieurs chaines d'un transpondeur dvb sur différentes adresse de multicast.
+Mumudvb permet de diffuser plusieurs chaines d'un transpondeur dvb sur différentes adresses de multicast.
= Auteurs =
@@ -35,7 +35,7 @@ Dave CHAPMAN pour avoir
* Possibilité de diffuser plusieurs chaînes d'un même transpondeur sur des ips différentes
* Pouvoir afficher la puissance du signal pendant l'utilisation
- * Liste mise a jour en temps réel des chaînes diffusées (permet de générer les annonces SAP)
+ * Liste mise a jour en temps réel des chaînes diffusées
* Mumudvb peut être lancé en tant que démon (en cas d'exécution en tache de fond les logs sont écrit via syslog)
* Ecriture dans un fichier de son pid
* Pouvoir utiliser des fichiers de configuration
@@ -58,11 +58,7 @@ Dave CHAPMAN pour avoir
D'autres programmes sont joints dans les sources de mumudvb:
* relay : permet de relayer un flux (récupérer un flux en multicast et l'unicaster ou l'envoyer vers une autre ip de multicast) il peut être utilisé pour traverser des routeurs ou des firewalls interdisant le multicast.
- * dumpudp : permet de récupérer le flux et de l'envoyer sur la sortie standard (utile pour les programmes n'ayant pas de greffon d'entrée en udp comme mplayer ou pour enregistrer le flux)
- * dumpudp_limited : idem que dumpudp mais récupère un nombre limité de paquets (utilisé pour générer des vignettes (voir les scripts d'exemple joints))
- * recup_sap : mini client sap, récupère les annonces sap sur le réseau pendant 60 secondes et les envoie sur la sortie standard (non triées)
- * scan_modified : une version modifiée de l'utilitaire scan du paquet dvb-apps. Il est capable de générer des fichiers de configuration au formate mumudvb.
- * Des scripts d'exemple d'utilisation de mumudvb sont inclus dans le répertoire scripts, ils sont écrits en python, mais aucune documentation n'est fournie, pour savoir ce qu'ils font, il faut lire le code source ... Ces scripts permettent de configurer automatiquement mumudvb, de générer les annonces sap et de créér des vignettes.
+ * recup_sap : mini client sap, récupère les annonces sap sur le réseau pendant 60 secondes et les écrit dans un fichier (non triées)
= Installation =
@@ -201,12 +197,10 @@ Note : si vous pr
= Sap announces =
-A traduire ...
+Les annonces sap permettent aux clients de connaitre les flux diffusés automatinquement
-The sap announces are made for the client to know wich channels are streamed.
+VLC et la plupart des set-top-boxes les supporte.
-Vlc and most of the set top boxes are know to support them.
+Mumudvb génerera et enverra automatiquement les annonces sap si cela est demandé dans le fichier de configuration ou si le mode autoconfiguration complète est choisi.
-Mumudvb will automatically generate and send sap announces if it's asked in the config file or if you are in full autoconfiguration mode.
-
-The sap announces will be only sent for alive channels. When a channel goes down, mumudvb will stop sending announces for this channel, until it goes back.
\ No newline at end of file
+Les annonces sap sont envoyées pour les chaines détectées comme étant "vivantes". Si une chaine stoppe sa diffusion, mumudvb arretera de diffuser les annonces la concernant jusqu'a la reprise de la diffusiot.
diff --git a/doc/QUICKSTART b/doc/QUICKSTART
index 9f99a7d..9ff9dba 100644
--- a/doc/QUICKSTART
+++ b/doc/QUICKSTART
@@ -3,7 +3,7 @@ Quickstart guide for mumudvb
It this guide I'll explain how to stream a full transponder (all the channels
multiplexed on the same carrier frequency) over a network, by assigning each
-channel to a different multicast IP.
+channel to a different multicast IP. The sap announces will automatically be generated.
I'll take an example for DVB-S (satellite) and DVB-T (terrestrial)
diff --git a/doc/README_CONF b/doc/README_CONF
index 3d4d3cf..63d5cc1 100644
--- a/doc/README_CONF
+++ b/doc/README_CONF
@@ -8,7 +8,7 @@ Mumudvb does not worry to the parameter's order except for chanels where pids mu
You can put comments everywhere in the configuration file : just start the line with #
-All parameters are like: name=value
+All parameters are in the form : name=value
'''List of parameters and their description '''
diff --git a/doc/conf.example b/doc/conf.example
index 9542660..c492fc9 100644
--- a/doc/conf.example
+++ b/doc/conf.example
@@ -8,21 +8,19 @@ srate=27500
card=0
#tuning timeout
timeout_accord=20
+#Port used to stream channels
+common_port=1234
#Channel list
#The number of pids must be less than 16
ip=239.200.200.200
-port=1234
name=fra_autres__EBS
pids=101 201 202 203 204 205 206 207 208 209 210 211 212 100
ip=239.200.200.201
-port=1234
name=fra_X_Stream
pids=551 552 550
ip=239.200.200.202
-port=1234
name=ara_2M
pids=601 602 257
ip=239.200.200.203
-port=1234
name=kur_CTV_Kurdistan
pids=700 701 702
diff --git a/doc/conf.example_dvbT b/doc/conf.example_dvbT
index 9e8eb9c..ecdf544 100644
--- a/doc/conf.example_dvbT
+++ b/doc/conf.example_dvbT
@@ -1,10 +1,5 @@
freq=474000
-qam=auto
-trans_mode=auto
-bandwidth=8MHz
-guardinterval=auto
-coderate=auto
-card=4
+card=0
timeout_accord=20
timeout_no_diff=60
ip=239.202.204.200
diff --git a/scripts/dvb_base.py b/scripts/dvb_base.py
deleted file mode 100644
index aa054a5..0000000
--- a/scripts/dvb_base.py
+++ /dev/null
@@ -1,419 +0,0 @@
-#! /usr/bin/env python
-# -*- coding: iso8859-15 -*-
-
-""" Configuration de base des différents transpondeurs disponibles """
-
-#Auteur : Frédéric Pauget
-#Maintenance et adaptations : DUBOST Brice
-#Licence : GPLv2
-
-from commands import getoutput
-from time import sleep
-import os, socket
-
-IP = socket.gethostbyaddr(socket.gethostname())[-1][0]
-
-class CarteOqp(Exception) :
- """ La carte est déja utilisée """
-
-class NotRunning(Exception) :
- """ La carte ne diffuse rien """
-
-class carte :
- """ Classe parent de toute classe de transpondeur """
- # Niveux de verbosite :
- # 0 : ne dit rien
- # 1 : messages à caractères informatifs
- # 2 : messages de debug
- # 3 : ne permet pas à mumudvb de daemonizer
- verbose = 3
-
- CONF_FILE = "/etc/mumudvb/carte%i.conf" # %i : numero de la carte
-
- timeout_accord=20 #en secondes
- timeout_no_diff=60 #en secondes
-
- entete_conf = """### Fichier généré, NE PAS EDITER
-freq=%(freq)i
-pol=%(pol)s
-srate=%(srate)i
-card=%(card)i
-timeout_accord=%(timeout_accord)i
-timeout_no_diff=%(timeout_no_diff)i
-"""
-
- entete_conf_TNT = """### Fichier généré, NE PAS EDITER
-freq=%(freq)i
-qam=%(qam)s
-trans_mode=%(trans_mode)s
-bandwidth=%(bandwidth)s
-guardinterval=%(guardinterval)s
-coderate=%(coderate)s
-card=%(card)i
-timeout_accord=%(timeout_accord)i
-timeout_no_diff=%(timeout_no_diff)i
-"""
-
- chaine_template = """ip=%(ip)s
-port=1234
-name=%(name)s
-pids=%(pids)s
-"""
-
- pid_file = "/var/run/mumudvb/mumudvb_carte%i.pid" # % num carte
- mumudvb = "/usr/local/bin/mumudvb "
-
- def __cmp__(a,b) :
- for attr in ( 'card', 'freq', 'chaines' ) :
- if getattr(a,attr) != getattr(b,attr) :
- return -2
- return 0
-
- def __init__(self,card) :
- """ Initalisation card est le numéro (entier) de la carte
- correspondante """
- try :
- self.freq = int(str(self.__class__).split('_')[-1])
- except :
- # On ne pourra pas faire grand chose à part killer le flux de la carte
- self.freq = ''
- pass
- self.card = card
-
- def gen_conf(self) :
- """ Génère le fichier de conf """
- if not self.freq :
- if self.verbose > 1 : print "Instance ne permettant pas la génération de la conf"
- return
-
- fd = open(self.CONF_FILE % self.card,'w')
- # Entète du fichier
- try:
- fd.write( self.entete_conf_TNT %
- { 'qam' : self.qam, 'trans_mode' : self.trans_mode ,
- 'bandwidth' : self.bandwidth, 'guardinterval' : self.guardinterval ,
- 'coderate' : self.coderate,
- 'freq' : self.freq , 'card' : self.card ,
- 'timeout_accord' : self.timeout_accord ,
- 'timeout_no_diff' : self.timeout_no_diff } )
- except:
- fd.write( self.entete_conf %
- { 'pol' : self.pol, 'srate' : self.srate ,
- 'freq' : self.freq , 'card' : self.card ,
- 'timeout_accord' : self.timeout_accord ,
- 'timeout_no_diff' : self.timeout_no_diff } )
-
- # Chaines
- n = 0
- for pids, name in self.chaines.items() :
- ip = '239.%s.20%i.2%02i' % ( IP.split('.')[-1], self.card, n)
- n += 1
- fd.write(self.chaine_template % vars())
- fd.close()
-
- def get_pid(self) :
- """ Retourne le pid associé à la carte """
- try:
- pid = int(open(self.pid_file % self.card).readline().strip())
- if self.verbose > 1 :
- print 'pid : %i' % pid ,
- return pid
- except :
- raise NotRunning
-
- def is_running(self) :
- """ Vérifie si le process correspondant à la carte toune """
- if self.verbose > 1 :
- redir = ''
- else :
- redir = '>/dev/null 2>&1'
- try :
- if not os.system('ps %i %s' % (self.get_pid() , redir) ) :
- # Il tourne
- return True
- except NotRunning :
- pass
- return False
-
- def start(self) :
- """ Lance la diffusion """
- if not self.freq :
- if self.verbose > 1 : print "Instance ne permettant pas le lancement d'un flux"
- return
-
- if self.verbose >0 :
- print "Lancement de %s sur la carte %i" % (str(self.__class__).split('.')[-1], self.card)
-
- if self.is_running() :
- raise CarteOqp
-
- if self.verbose >0 : print "\tGénération de la conf...",
- self.gen_conf()
- if self.verbose >0 : print "OK"
-
- cmd = '%s -c %s' % ( self.mumudvb, self.CONF_FILE % self.card )
- if self.verbose > 2 : cmd += ' -d -s'
- if self.verbose > 1 :
- print "\tCommande : %s" % cmd
- for i in range(2*self.timeout_accord) :
- if not i%5 and i <= self.timeout_accord :
- if self.verbose > 0 and i : print "ATTENTE/ERREUR"
- # On fait une tentative de lancement toutes les 5s (en cas de pb de diseq)
- if self.verbose > 0 : print "\tTentative %i" %(i/5+1) ,
- os.system(cmd)
- sleep(1)
- if self.is_running() :
- if self.verbose > 0 : print 'OK'
- break
- sleep(1)
- if not self.is_running() :
- if self.verbose > 0 : print 'ABANDON'
- raise NotRunning
-
- def stop(self) :
- """ Arrète la diffusion de la carte """
- if self.verbose >0 :
- print "Arret diffusion carte %i..." % self.card ,
-
- try :
- # Ca tourne au moins ?
- if not self.is_running() :
- if self.verbose >0 : print "carte déja arrétée"
- return
-
- os.kill(self.get_pid(),15)
- sleep(1)
- if not self.is_running() :
- if self.verbose >0 : print "OK"
- return
-
- # Crève !!
- if not self.is_running() :
- if self.verbose >0 : print "SIGKILL"
- return
-
- os.kill(self.get_pid(),9)
- # Salloperie
- raise CarteOqp
- except NotRunning :
- # Parfait, c'était le but
- pass
-
- def restart(self) :
- """ Redémarre le flux """
- self.stop()
- self.start()
-
-class Hotbird_10796(carte) :
- pol='v'
- srate=27500
- chaines = {
- '3534 3504' : 'rad fra France Inter',
- '3535 3505' : 'rad fra France Info' }
-
-class Hotbird_10873(carte) :
- pol='v'
- srate=27500
- chaines = {
- '3101 3131' : 'rad fra Europe 1',
- '3102 3132' : 'rad fra Europe 2',
- '3103 3133' : 'rad fra RFM',
- '3105 3135' : 'rad fra RTL',
- '3106 3136' : 'rad fra NRJ',
- '3107 3137' : 'rad fra Radio Classique',
- '3108 3138' : 'rad fra Cherie FM',
- '3111 3141' : 'rad fra HITWEST',
- '3202 3232' : 'rad fra Rires et chansons',
- '3210 3240' : 'rad fra Nostalgie',
- '4100 4130' : 'rad fra GUIDE' }
-
-class Hotbird_10911(carte) :
- pol='v'
- srate=27500
- chaines = {
- '3207 3237' : 'rad fra RFI',
- '3301 3331' : 'rad fra Beur FM',
- '3501 3531' : 'rad fra France Musiques',
- '3503 3533' : 'rad fra FIP',
- '3506 3536' : 'rad fra France Culture',
- '3508 3538' : 'rad fra Le Mouv',
- '5801 5831' : 'rad fra Meteo Express',
- '7500 7530' : 'rad fra PLAYIN TV' }
-
-class Hotbird_11137(carte) :
- pol='h'
- srate=27500
- chaines = {
- '524 644 260' : 'fra Beur TV',
- '3521 3641 717 3601' : 'fra TV5 FBS',
- '3522 3642 719 3602' : 'fra TV5 Europe',
- '3523 3643 265' : 'ita Roma uno',
- '3524 3644 262' : 'ara ANN',
- '3525 3645 267' : 'ita Videolook',
- '3526 3646 263' : 'ara K-TV',
- '3528 3648 264' : 'ita Videolina',
- '3529 3649 258' : 'ita TeleGenova Sat 2',
- '3531 3651 261' : 'ita Amica9 telestar' }
-
-class Hotbird_11200(carte) :
- pol='V'
- srate=27500
- chaines = {
- '366 367 2560' : 'ita Elite shopping TV',
- '382 383 768' : 'ita calabria sat',
- '386 387 512' : 'x-ero tv conto',
- '397 398 399' : 'ita starsat',
- '382 383 2048' : 'ita italia.tv channel',
- '394 395 394' : 'x-ero play TV',
- '400 401 402' : 'ita people tv',
- '405 406 407' : 'ita roma sat',
- '413 414 415' : 'ita sat adriatico' }
-
-class Hotbird_11242(carte) :
- pol='v'
- srate=27500
- chaines = {
- '121 122 123' : 'ita TV7 Lombardia',
- '3011 3012 3010' : 'fra TV8 Mont Blanc',
- '33 36 35 500' : 'fra HD Forum',
- '308 256 257' : 'fra World Fashion Channel' }
-
-class Hotbird_11304(carte) :
- pol='h'
- srate=27500
- chaines = {
- '1060 1020 210' : 'esp venevision continental',
- '310 256 211' : 'esp TV Chile',
- '513 514 212' : 'esp TV Colombia'}
-
-class Hotbird_11604(carte) :
- pol='h'
- srate=27500
- chaines = {
- '172 173 600 174' : 'ger Das Erste',
- '1000 1001 700' : 'ger DW TV',
- '175 176 900 177' : 'ger RTL2 Schweiz',
- '180 181 1100 182' : 'ger SUPER RTL Schweiz',
- '190 191 1200' : 'pol Viva Polska' }
-
-class Hotbird_11623(carte) :
- pol='v'
- srate=27500
- chaines = {
- '230 250 210 297' : 'fra 123 sat',
- '225 245 205' : 'fra Best Of Shopping',
- '221 241 201' : 'x-ero Videosexy TV',
- '231 251 32' : 'x-ero SexySat 3',
- '227 247 207 287' : 'rom TV romania'}
-
-class Hotbird_11642(carte) :
- pol='h'
- srate=27500
- chaines = {
- '1360 1320 5003' : 'eng Bloomberg Europe',
- '1460 1420 5004' : 'ger Bloomberg TV Deutschland',
- '1560 1520 5005' : 'eng Bloomberg U.K.' }
-
-class Hotbird_11727(carte) :
- pol='v'
- srate=27500
- chaines = {
- '2711 2712 257' : 'fra la locale',
- '2730 2731 2732 264' : 'ara Al Maghribiyah',
- '2741 2742 265' : 'ita Sicilia International (SET)',
- '2751 2752 266' : 'ita Sardegna Uno Sat'}
-
-class Hotbird_11785(carte) :
- pol='h'
- srate=27500
- chaines = {
- '3521 3522 3520 3525' : 'esp TVE International',
- '3569 3570 3568 3573' : 'esp Canal 24 Horas',
- '3553 3554 3552' : 'esp TVE Internacional Asia/Africa' }
-
-class Hotbird_12245(carte) :
- pol='h'
- srate=27500
- chaines = {
- '127 137 117' : 'fra TELIF',
- '128 138 32' : 'x-ero sexysat',
- '1023 1033 1014' : 'fra astro center TV' }
-
-class Hotbird_12476(carte) :
- pol='h'
- srate=27500
- chaines = {
- '101 201 202 203 204 205 206 207 208 209 210 211 212 100' : 'vo autres EBS',
- '101 203 100' : 'fra EBS',
- '601 602 257' : 'ara 2M',
- '551 552 550' : 'x-ero X Stream'}
-
-class Hotbird_12558(carte) :
- pol='v'
- srate=27500
- chaines = {
- '6660 6661 6659' : 'ita Administra.it',
- '6916 6917 6915 6930' : 'ita 24 Ore' }
-
-class Hotbird_12577(carte) :
- pol='h'
- srate=27500
- chaines = {
- '1204 1304 1104' : 'fra telesud',
- '1206 1306 1106' : 'fra F men',
- '1218 1313 33 34' : 'x-ero sexysat1',
- '1206 1306 1106' : 'x-ero Full X 4 free',
- '1209 1309 1109' : 'fra liberty TV',
- '1239 1339 1139' : 'ned liberty TV' }
-
-class Hotbird_12597(carte) :
- pol='v'
- srate=27500
- chaines = {
- '80 81 1024' : 'rus sport planeta',
- '163 92 1027' : 'eng BBC World',
- '167 108 1031' : 'rus ORT International',
- '2221 2231 2232 2233 2234 2235 2236 2237 2238 1034 768' : 'fra autres Euronews',
- '2221 2232 1034 768' : 'eng Euronews' }
-
-class TNT_base(carte) :
- qam="auto"
- trans_mode="auto"
- guardinterval="auto"
- coderate="auto"
- bandwidth="8MHz"
-
-class TNT_R1_586000(TNT_base) :
- chaines = {
- '120 130 110' : 'fra TNT02 France 2',
- '210 220 230' : 'fra TNT03 France 3',
- '410 420 430' : 'fra TNT14 France 4',
- '310 320 330' : 'fra TNT05 France 5',
- '510 520 530' : 'fra TNT07 Arte',
- '510 520 531' : 'ger Arte',
- '610 620 630' : 'fra TNT13 LCP Public Senat' }
-
-class TNT_R2_474000(TNT_base) :
- chaines = {
- '160 80 1280' : 'fra TNT08 Direct 8',
- '161 84 1281' : 'fra TNT10 TMC',
- '162 88 1282' : 'fra TNT15 BFM TV',
- '163 92 1283' : 'fra TNT16 i tele',
- '164 96 1284' : 'fra TNT17 europe2 TV',
- '165 100 1285' : 'fra TNT18 Gulli'}
-
-class TNT_R3_522000(TNT_base) :
- chaines = {
- '160 170 120 1280' : 'fra TNT04 Canal'}
-
-class TNT_R4_498000(TNT_base) :
- chaines = {
- '120 130 110' : 'fra TNT06 M6',
- '220 230 210' : 'fra TNT09 W9',
- '320 330 310' : 'fra TNT11 NT1'}
-
-class TNT_R6_562000(TNT_base) :
- chaines = {
- '120 130 100' : 'fra TNT01 TF1',
- '220 230 231 200' : 'fra TNT12 NRJ12'}
-
diff --git a/scripts/dvb_conf.py b/scripts/dvb_conf.py
deleted file mode 100644
index 0ceeffd..0000000
--- a/scripts/dvb_conf.py
+++ /dev/null
@@ -1,38 +0,0 @@
-#! /usr/bin/env python
-# -*- coding: iso-8859-15 -*-
-
-""" Défini les transpondeurs à associer à chacune des cartes """
-
-from dvb_base import *
-from socket import gethostname
-
-host = gethostname()
-
-transpondeurs = { 'canard' : [ TNT_R4_498000(0) ,
- Hotbird_12476(1) ,
- Hotbird_11242(2) ,
- Hotbird_12597(3) ,
- Hotbird_12577(4) ],
- 'lapin' : [ Hotbird_10911(0) ,
- Hotbird_11604(1) ,
- TNT_R1_586000(2) ,
- TNT_R6_562000(3) ,
- TNT_R2_474000(4) ,
- TNT_R3_522000(5) ],
- 'oie' : [ Hotbird_12245(0) ,
- Hotbird_11137(1) ,
- Hotbird_10873(2) ,
- Hotbird_11304(3) ,
- Hotbird_11623(4) ]
- }
-
-conf = transpondeurs.get(host,[])
-
-if __name__ == '__main__' :
- import sys
- if len(sys.argv) == 2 :
- conf = transpondeurs.get(sys.argv[1],[])
- for t in conf :
- print t
- for chaine in t.chaines.values() :
- print '\t%s' % chaine
diff --git a/scripts/dvb_daemon.py b/scripts/dvb_daemon.py
deleted file mode 100644
index bf7e4de..0000000
--- a/scripts/dvb_daemon.py
+++ /dev/null
@@ -1,151 +0,0 @@
-#! /usr/bin/env python
-# -*- coding: iso-8859-15 -*-
-
-""" Script de lancement de mumudvb
-
-Auteur : Frédéric Pauget
-Licence : GPLv2
-"""
-import sys, getopt, os, time, copy, signal
-from dvb_base import NotRunning, CarteOqp
-
-import dvb_conf
-
-sys.path.append('/usr/scripts/python-lib')
-import lock
-from daemon import daemonize
-
-LOCK='/var/run/mumudvb/tv'
-
-def usage(erreur=None) :
- if erreur : print erreur
- print """Usage :
- %(p)s start [<numero carte> [<transpondeur>]]:
- démarrage le transpondeur donné sur la carte donnée,
- si le transpondeur est omis démarre celui défini dans la conf
- si seul démarre des flux définis dans la conf
- %(p)s stop [numero carte] :
- arrête tous les flux des cartes spécifiées,
- si aucune carte est fournie arrète tous les flux
-
-Les options possibles sont :
- -d ou --debug : affiche tous les messages
- et ne daemonize pas crans_dvbsream
- -v ou --verbose : affiche les messages de debuggage
- -q ou --quiet : affiche rien
- --timeout_accord=<nb> : nb de secondes données pour l'accord""" \
- % { 'p' : sys.argv[0].split('/')[-1] + ' [options]'}
- if not erreur : sys.exit(0)
- else : sys.exit(-1)
-
-def analyse_opt() :
- """ Traitement des options
- Retourne le niveau de verbosité et les arguments """
- # Options par défaut
- verbose = 1
- timeout_accord = 20
-
- try :
- options, args = getopt.getopt(sys.argv[1:], 'hdvq', [ 'help', 'debug' , 'quiet' , 'verbose', 'timeout_accord='] )
- except getopt.error, msg :
- usage('%s\n' % msg)
-
- for opt, val in options :
- if opt in [ '-v' , '--verbose' ] :
- verbose = 2
- elif opt in [ '-d' , '--debug' ] :
- verbose = 3
- elif opt == [ '-q' , '--quiet' ] :
- verbose = 0
- elif opt == '--timeout_accord' :
- try:
- timeout_accord = int(val)
- except ValueError:
- usage("Valeur de timeout_accord (%s) incorrecte" % val)
- elif opt in [ '-h', '--help' ] :
- usage()
-
- return verbose, timeout_accord, args
-
-def term(a=None,b=None) :
- """ Tue tous les mumudvb et quitte """
- stop(range(6))
- lock.remove_lock(LOCK)
- sys.exit(0)
-
-def stop(liste) :
- """ Coupe la diffusion des cartes dont le numéro est dans la liste """
- from dvb_base import carte
- for i in liste :
- print "stop %i" % carte(i).card
- #carte(i).stop()
-
-def hup(sig,frame) :
- """ Reli la conf et stop les cartes dont la conf à changé """
- orig_conf = frame.f_globals['conf']
- conf = config(frame.f_globals['verbose'],
- frame.f_globals['timeout_accord'])
-
- # Quelles cartes faut-il-arréter ?
- to_stop=range(6) # carte pouvant être arrétées
- for carte in orig_conf :
- print "Test carte %i (%s)" % (carte.card, carte.freq)
- if carte in conf :
- try:
- to_stop.remove(carte.card)
- except ValueError:
- # N'était pas dans la liste
- pass
-
- stop(to_stop)
- frame.f_globals['conf']=conf
-
-def config(verbose,timeout_accord) :
- """ Retourne une liste d'instance de carte """
- reload(dvb_conf)
-
- # Config des cartes
- for carte in dvb_conf.conf :
- carte.verbose = verbose
- carte.timeout_accord = timeout_accord
-
- return dvb_conf.conf
-
-if __name__ == '__main__' :
- ## Lancement par l'utilisateur tv
- if os.getuid() == 0 :
- os.system('su tv --command="%s"' % ' '.join(sys.argv))
- sys.exit(0)
- elif os.getuid() != 101 :
- print "Ce programme doit être lancé par l'utilisateur tv (uid=101)"
- print "Astuce : sudo -u tv %s" % sys.argv[0]
- sys.exit(1)
-
- verbose, timeout_accord , args = analyse_opt()
-
- if verbose < 2 :
- daemonize()
-
- # Lock
- lock.make_lock(LOCK,"Lancement des mumudvb")
-
- # Signal handler
- signal.signal(signal.SIGTERM,term)
- signal.signal(signal.SIGINT,term)
- signal.signal(signal.SIGHUP,hup)
-
- conf = config(verbose,timeout_accord)
-
- # Lancement de la TV
- while 1 :
- for carte in conf :
- try :
- print "Carte %i" % carte.card
-# carte.start()
- except CarteOqp :
- print "Carte %i occupée, abandon" % carte.card
- except NotRunning :
- # On retentera plus tard
- pass
- time.sleep(60)
-
diff --git a/scripts/dvb_sap.py b/scripts/dvb_sap.py
deleted file mode 100755
index ba4bc1f..0000000
--- a/scripts/dvb_sap.py
+++ /dev/null
@@ -1,136 +0,0 @@
-#! /usr/bin/env python
-# -*- coding: iso-8859-15 -*-
-
-""" Génération de la configuration sap pour le satellite à partir des
- fichiers de crans_dvbstrean
- Lancement du serveur sap.
-
- Option -d pour que le programme ne se lance pas en daemon. """
-
-import os, sys, signal
-from socket import getfqdn
-from time import sleep
-from commands import getoutput
-
-sys.path.append('/usr/scripts/python-lib')
-import lock
-from daemon import daemonize
-
-################CONFIG
-
-SAP_CONF = '/etc/sap.cfg'
-LOCK='/var/run/mumudvb/sat_sap'
-CHAINES_DIFFUSES = '/var/run/mumudvb/chaines_diffusees_carte%d'
-base_conf = """##################################
-# Fichier généré automatiquement #
-# NE PAS EDITER #
-##################################
-[global]
-sap_ttl=4
-sap_ipversion=4
-sap_delay=10
-ipv6_scope=8
-"""
-
-chaine_template="""
-[program]
-name=%s
-user=crans
-machine=%s
-site=http://www.crans.org
-address=%s
-port=%s
-program_ttl=4
-program_ipversion=4
-playlist_group=cransTV
-""" % ( '%(nom)s', getfqdn(), '%(ip)s', '%(port)s' )
-
-################FIN CONFIG
-
-# Variables globales, ne pas toucher
-sap_pid = 0
-sum = 0
-
-def gen_sap() :
- """ Génération du ficher de conf du sap
- Retourne 1 si le fichier est vide
- """
- data = []
- for i in range(0,5) :
- try :
- data.append(open(CHAINES_DIFFUSES % i).readlines())
- except IOError :
- continue
-
- file = open(SAP_CONF,'w')
- file.write(base_conf)
- ok=0
- for fichier in data :
- for line in fichier :
- ip, port, nom_chaine = line.split(':')
- file.write(chaine_template % {
- 'nom' : nom_chaine,
- 'ip' : ip,
- 'port' : port} )
- ok=1
- file.close()
- return ok
-
-def is_alive(child_pid) :
- """ Vérifie si le processus fils tourne """
- try :
- if os.waitpid(child_pid,1) != (0,0) :
- raise OSError
- return True
- except OSError :
- return False
-
-def term(a=None,b=None) :
- """ Tue le serveur sap puis quitte """
- kill()
- lock.remove_lock(LOCK)
- sys.exit(0)
-
-def kill() :
- """ Tue le serveur sap """
- if not is_alive(sap_pid) :
- return
- print "Kill sap"
- os.kill(sap_pid,15)
- sleep(1)
- if is_alive(sap_pid) :
- # Salloperie
- print "WARNING : sap résitant"
- os.kill(sap_pid,9)
- sleep(1)
-
-if __name__ == '__main__' :
- # Arguments
- if '-d' not in sys.argv :
- daemonize()
-
- # Lock
- lock.make_lock(LOCK,"Serveur SAP")
-
- # Signal handler
- signal.signal(signal.SIGTERM,term)
- signal.signal(signal.SIGINT,term)
-
- while 1 :
- if not gen_sap() :
- # Aucune diffusion
- kill()
- else :
- # Changent de config ?
- new_sum = getoutput('md5sum %s' % SAP_CONF).split()[0]
- if new_sum != sum :
- print "Reconfiguration"
- sum = new_sum
- if sap_pid>1 and is_alive(sap_pid) :
- kill()
- if not is_alive(sap_pid) :
- # Ne tourne pas, on relance
- sap_pid = os.spawnl(os.P_NOWAIT,'/usr/local/bin/sapserver','sap_sat')
- print "Lancement serveur, pid=%s" % sap_pid
-
- sleep(60)
diff --git a/scripts/sap.py b/scripts/sap.py
deleted file mode 100755
index 18da630..0000000
--- a/scripts/sap.py
+++ /dev/null
@@ -1,138 +0,0 @@
-#! /usr/bin/env python
-# -*- coding: iso-8859-15 -*-
-
-""" Génération de la configuration sap à partir des données de mumudvb
- Lancement du serveur sap.
-
- Option -d pour que le programme ne se lance pas en daemon. """
-
-import os, sys, signal
-from socket import getfqdn
-from time import sleep
-from commands import getoutput
-
-sys.path.append('/usr/scripts/python-lib')
-import lock
-from daemon import daemonize
-
-################CONFIG
-
-SAP_CONF = '/etc/sap.cfg'
-LOCK='/var/run/mumudvb/sap'
-CHAINES_DIFFUSES = '/var/run/mumudvb/chaines_diffusees_carte%d'
-base_conf = """##################################
-# Fichier généré automatiquement #
-# NE PAS EDITER #
-##################################
-[global]
-sap_ttl=4
-sap_ipversion=4
-sap_delay=10
-ipv6_scope=8
-"""
-
-chaine_template="""
-[program]
-name=%s
-user=crans
-machine=%s
-site=http://www.crans.org
-address=%s
-port=%s
-program_ttl=4
-program_ipversion=4
-playlist_group=%s
-""" % ( '%(nom)s', getfqdn(), '%(ip)s', '%(port)s', '%(langue)s' )
-
-################FIN CONFIG
-
-# Variables globales, ne pas toucher
-sap_pid = 0
-sum = 0
-class no_data(Exception):
- pass
-
-def gen_sap() :
- """ Génération du ficher de conf du sap """
- data = []
- for i in range(0,6) :
- try :
- data.append(open(CHAINES_DIFFUSES % i).readlines())
- except IOError :
- continue
-
- file = open(SAP_CONF,'w')
- file.write(base_conf)
- ok=0
- for fichier in data :
- for line in fichier :
- ip, port, nom_chaine = line.strip().split(':')
- file.write(chaine_template % {
- 'nom' : nom_chaine,
- 'langue': nom_chaine.split()[0],
- 'ip' : ip,
- 'port' : port} )
- ok=1
- file.close()
- if not ok : raise no_data
-
-def is_alive(child_pid) :
- """ Vérifie si le processus fils tourne """
- try :
- if os.waitpid(child_pid,1) != (0,0) :
- raise OSError
- return True
- except OSError :
- return False
-
-def term(a=None,b=None) :
- """ Tue le serveur sap puis quitte """
- kill()
- lock.remove_lock(LOCK)
- sys.exit(0)
-
-def kill() :
- """ Tue le serveur sap """
- if not is_alive(sap_pid) :
- return
- print "Kill sap"
- os.kill(sap_pid,15)
- sleep(1)
- if is_alive(sap_pid) :
- # Salloperie
- print "WARNING : sap résitant"
- os.kill(sap_pid,9)
- sleep(1)
-
-if __name__ == '__main__' :
- # Arguments
- if '-d' not in sys.argv :
- daemonize()
-
- # Lock
- lock.make_lock(LOCK,"Serveur SAP")
-
- # Signal handler
- signal.signal(signal.SIGTERM,term)
- signal.signal(signal.SIGINT,term)
-
- while 1 :
- try :
- gen_sap()
- except no_data :
- # Rien n'est diffusé
- kill()
- else :
- # Changent de config ?
- new_sum = getoutput('md5sum %s' % SAP_CONF).split()[0]
- if new_sum != sum :
- print "Reconfiguration"
- sum = new_sum
- if sap_pid>1 and is_alive(sap_pid) :
- kill()
- if not is_alive(sap_pid) :
- # Ne tourne pas, on relance
- sap_pid = os.spawnl(os.P_NOWAIT,'/usr/local/bin/sapserver','sap','-f',SAP_CONF)
- print "Lancement serveur, pid=%s" % sap_pid
-
- sleep(60)
diff --git a/scripts/startmumudvb.py b/scripts/startmumudvb.py
deleted file mode 100755
index 15efd04..0000000
--- a/scripts/startmumudvb.py
+++ /dev/null
@@ -1,111 +0,0 @@
-#! /usr/bin/env python
-# -*- coding: iso8859-15 -*-
-
-""" Script de lancement de mumudvb
-
-Auteur : Frédéric Pauget
-Licence : GPLv2
-"""
-import sys, getopt, os
-from dvb_base import NotRunning, CarteOqp
-
-if os.getuid() != 101 :
- print "Ce programme doit être lancé par l'utilisateur tv (uid=101)"
- print "Astuce : sudo -u tv %s" % sys.argv[0]
- sys.exit(1)
-
-def usage(erreur=None) :
- if erreur :
- print erreur
- print """Usage :
- %(p)s start [<numero carte> [<transpondeur>]]:
- démarrage le transpondeur donné sur la carte donnée,
- si le transpondeur est omis démarre celui défini dans la conf
- si seul démarre des flux définis dans la conf
- %(p)s stop [numero carte] :
- arrête tous les flux des cartes spécifiées,
- si aucune carte est fournie arrète tous les flux
-
-Les options possibles sont :
- -d ou --debug : affiche tous les messages
- et ne daemonize pas crans_dvbsream
- -v ou --verbose : affiche les messages de debuggage
- -q ou --quiet : affiche rien
- --timeout_accord=<nb> : nb de secondesdonnées pour l'accord""" \
- % { 'p' : sys.argv[0].split('/')[-1] + ' [options]'}
- if not erreur : sys.exit(0)
- else : sys.exit(-1)
-
-# Arguments
-try :
- options, args = getopt.getopt(sys.argv[1:], 'hdvq', [ 'help', 'debug' , 'quiet' , 'verbose', 'timeout_accord='] )
-except getopt.error, msg :
- sys.stderr.write('%s\n' % msg)
- sys.exit(255)
-
-verbose = 1
-timeout_accord = 20
-for opt, val in options :
- if opt in [ '-v' , '--verbose' ] :
- verbose = 2
- elif opt in [ '-d' , '--debug' ] :
- verbose = 3
- elif opt == [ '-q' , '--quiet' ] :
- verbose = 0
- elif opt == '--timeout_accord' :
- try:
- timeout_accord = int(val)
- except:
- usage("Valeur de timeout_accord (%s) incorrecte" % val)
- elif opt in [ '-h', '--help' ] :
- usage()
-
-if not args :
- usage('Argument requis')
-
-elif args[0] not in [ 'start', 'stop' ] :
- usage("Commande %s incorrecte" % args[0])
-
-
-# Carte fournie ?
-try :
- cartes = [ int(args[1]) ]
-except ValueError :
- usage("Argument %s incorrect (doit être le numéro de carte)." % args[1])
-except :
- # Toutes les cartes
- cartes = range(5)
- if verbose > 2 :
- print "Mode debug non permis avec le lancement automatique"
- verbose = 2
-
-if args[0] == 'start' :
- if cartes == range(5) :
- from dvb_conf import conf
- cartes = conf
- else :
- transpondeur = args[2].capitalize()
- from dvb_base import *
- try :
- carte = eval(transpondeur)
- cartes = [ carte(cartes[0]) ]
- except NameError:
- usage('Transpondeur %s inconnu.' % transpondeur)
-
-
-elif args[0] == 'stop' :
- from dvb_base import carte
- cartes = map(carte,cartes)
-
-# On effectue l'opération demandée
-for carte in cartes :
- carte.verbose = verbose
- carte.timeout_accord = timeout_accord
- try :
- eval('carte.%s()' % args[0])
- except CarteOqp :
- print "Carte %i occupée, abandon" % carte.card
- except NotRunning :
- # Pas réussi à lancer, TODO
- pass
-
diff --git a/scripts/tv b/scripts/tv
deleted file mode 100755
index ddb42b2..0000000
--- a/scripts/tv
+++ /dev/null
@@ -1,117 +0,0 @@
-#! /usr/bin/env python
-# -*- coding: iso8859-15 -*-
-
-""" Script de lancement de mumudvb
-
-Auteur : Frédéric Pauget
-Licence : GPLv2
-"""
-import sys, getopt, os
-from sat_base import NotRunning, CarteOqp
-
-if os.getuid() == 0 :
- os.system("su tv -c %s" % " ".join(sys.argv))
- sys.exit(0)
-elif os.getuid() != 101 :
- print "Ce programme doit être lancé par l'utilisateur tv (uid=101)"
- print "Astuce : sudo -u tv %s" % sys.argv[0]
- sys.exit(1)
-
-def usage(erreur=None) :
- if erreur :
- print erreur
- print """Usage :
- %(p)s start [<numero carte> [<transpondeur>]]:
- démarrage le transpondeur donné sur la carte donnée,
- si le transpondeur est omis démarre celui défini dans la conf
- si seul démarre des flux définis dans la conf
- %(p)s stop [numero carte] :
- arrête tous les flux des cartes spécifiées,
- si aucune carte est fournie arrète tous les flux
- %(p)s restart [numero carte] :
- démarre tous les flux des cartes spécifiées
- si aucune carte est fournie redémarre tous les flux
-
-Les options possibles sont :
- -d ou --debug : affiche tous les messages
- et ne daemonize pas crans_dvbsream
- -v ou --verbose : affiche les messages de debuggage
- -q ou --quiet : affiche rien
- --timeout_accord=<nb> : nb de secondesdonnées pour l'accord""" \
- % { 'p' : sys.argv[0].split('/')[-1] + ' [options]'}
- if not erreur : sys.exit(0)
- else : sys.exit(-1)
-
-# Arguments
-try :
- options, args = getopt.getopt(sys.argv[1:], 'hdvq', [ 'help', 'debug' , 'quiet' , 'verbose', 'timeout_accord='] )
-except getopt.error, msg :
- sys.stderr.write('%s\n' % msg)
- sys.exit(255)
-
-verbose = 1
-timeout_accord = 20
-for opt, val in options :
- if opt in [ '-v' , '--verbose' ] :
- verbose = 2
- elif opt in [ '-d' , '--debug' ] :
- verbose = 3
- elif opt == [ '-q' , '--quiet' ] :
- verbose = 0
- elif opt == '--timeout_accord' :
- try:
- timeout_accord = int(val)
- except:
- usage("Valeur de timeout_accord (%s) incorrecte" % val)
- elif opt in [ '-h', '--help' ] :
- usage()
-
-if not args :
- usage('Argument requis')
-
-elif args[0] not in [ 'start', 'stop' , 'restart' ] :
- usage("Commande %s incorrecte" % args[0])
-
-
-# Carte fournie ?
-try :
- cartes = [ int(args[1]) ]
-except ValueError :
- usage("Argument %s incorrect (doit être le numéro de carte)." % args[1])
-except :
- # Toutes les cartes
- cartes = range(6)
- if verbose > 2 :
- print "Mode debug non permis avec le lancement automatique"
- verbose = 2
-
-if args[0] in ( 'start', 'restart' ) :
- if cartes == range(6) :
- from sat_conf import conf
- cartes = conf
- else :
- transpondeur = args[2]
- from sat_base import *
- try :
- carte = eval(transpondeur)
- cartes = [ carte(cartes[0]) ]
- except NameError:
- usage('Transpondeur %s inconnu.' % transpondeur)
-
-
-elif args[0] == 'stop' :
- from sat_base import carte
- cartes = map(carte,cartes)
-
-# On effectue l'opération demandée
-for carte in cartes :
- carte.verbose = verbose
- carte.timeout_accord = timeout_accord
- try :
- eval('carte.%s()' % args[0])
- except CarteOqp :
- print "Carte %i occupée, abandon" % carte.card
- except NotRunning :
- # Pas réussi à lancer, TODO
- pass
-
diff --git a/scripts/vignettes/README b/scripts/vignettes/README
deleted file mode 100644
index 19362ad..0000000
--- a/scripts/vignettes/README
+++ /dev/null
@@ -1,11 +0,0 @@
-vignettes.py
-
-With this script you can generate thumbails of all channels on your lan.
-
-It needs recup_sap, dumpudp (in progs_divers), mencoder and convert.
-
-You must change the path in the script to adapt to your configuration.
-
-Have a lot of fun !
-
-Brice DUBOST <mumudvb at braice.net>
diff --git a/scripts/vignettes/vignettes.py b/scripts/vignettes/vignettes.py
deleted file mode 100755
index a0239c1..0000000
--- a/scripts/vignettes/vignettes.py
+++ /dev/null
@@ -1,176 +0,0 @@
-#! /usr/bin/env python
-# -*- coding: iso-8859-15 -*-
-
-import os
-import lock
-import time
-from time import localtime,sleep
-
-t = localtime()
-trame_entete="""
-<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">
-<html lang=\"fr\">
-<head>
-<title>Chaines diffusées</title>
-<meta http-equiv=\"refresh\" content=\"300\">
-<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=iso-8859-1\">
-</head>
-<body BACKGROUND=\"style2_left.png\" leftmargin=\"0\" topmargin=\"0\" marginwidth=\"0\" marginheight=\"0\" STYLE=\"background-repeat:repeat-y\">
-<img src=\"style2_top.png\" alt=\"En_tete\"><br>
-<div id=\"Titre\" style=\"position:absolute; left:580px; top:70px; width:400px;height:34px; z-index:2\"><font size=\"5\"><b>Chaines diffusées</b></font></div>
-<div id=\"Heure\" style=\"position:absolute; left:380px; top:140px; width:500px;height:34px; z-index:2\"><font size=\"4\">
-<u>Cette page à été générée à %02ih%02i</u></font></div>
-<div id=\"Texte\" style=\"position:absolute; left:245px; top:190px; right:16px; z-index:1; overflow: visible; visibility: visible; background-color: #FFFFFF; layer-background-color: #FFFFFF;\">
-</center>
-<h2><b><a href=http://wiki.crans.org/moin.cgi/TvReseau>Pour plus d'informations cliquez ici</a><br></b></h2>
-<a href=index_petites.html>Petites vignettes</a><br>
-<a href=index.html>Vignettes Normales</a><br>
-<table cellpading=25 cellspacing=25>
-<tr>
-""" % (int(t[3]) ,int(t[4]) )
-
-table_piedpage="""</tr>
-</table>
-"""
-
-trame_piedpage="""</body>
-</html>
-"""
-
-def ajoute_image(nom,ip,html,html_petites):
- html.write('<td align="center">')
- html.write('<img src="images/%s.jpg" alt="Chaine : %s / IP : %s"><br>' % (ip, nom, ip))
- html.write('<b><u>Chaine :</u></b> %s<br><b><u>IP :</u></b> %s:1234' % (nom, ip))
- html.write('</td>\n')
- html_petites.write('<td align="center">')
- html_petites.write('<img src="images/%s_petites.jpg" alt="Chaine : %s / IP : %s"><br>' % (ip, nom, ip))
- html_petites.write('<b><u>Chaine :</u></b> %s<br><b><u>IP :</u></b> %s:1234' % (nom, ip))
- html_petites.write('</td>\n')
-
-
-
-def vignettes() :
- html = open('/tmp/index.html','w')
- html.write(trame_entete)
- html_petites = open('/tmp/index_petites.html','w')
- html_petites.write(trame_entete)
- col = 0
- col_petites = 0
- #a factoriser
- chaines_probleamatiques=[]
- os.system('/usr/local/bin/recup_sap')
- os.system('sort /tmp/chaines_recup_sap.txt> /tmp/chaines_recup_sap_triees.txt')
- data = open('/tmp/chaines_recup_sap_triees.txt','r').readlines()
-# for line in data :
-
-# line = line.strip()
-# nom=line.split(':')[0]
-# ip=line.split(':')[1]
- #on évite les radios, peu de debit et pas de vignettes
-# if nom[0:3]=='rad' :
-# continue
-# print 'on s\'occupe de %s %s' % (ip,nom)
-# print '\trecuperation du flux'
- #ip port duree
-# os.system('dumpudp %s 1234 2 > /tmp/%s.ts 2>/dev/null &' % (ip,ip))
- #on dort de la durre du dump divise par le nb de flux qu'on accepte
-# sleep(1.5)
-
- #on attends que tout le monde aie fini
-# print '\nFin de la recuperation des flux'
-# sleep(2)
-
- for line in data :
-
- line = line.strip()
- nom=line.split(':')[0]
- ip=line.split(':')[1]
- #on évite les radios, peu de debit et pas de vignettes
- if nom[0:3]=='rad' :
- #C'est une radio on cherche un logo
- ok=0 #désolé vince j'ai essayé les exceptions mois c pas si simple
- nom_court=(' '.join(nom.split(' ')[2:])).lower()
- print "On s'occupe de la radio %s" % nom_court
- for file in os.listdir('/var/www/images/logos_radios'):
- if file.startswith(nom_court):
- os.system('cp /var/www/images/logos_radios/\"%s\" /var/www/images/%s.jpg' % (file,ip))
- os.system('cp /var/www/images/logos_radios/\"%s\" /var/www/images/%s_petites.jpg' % (file,ip))
- if col == 2 :
- col = 1
- html.write('</tr><tr>\n')
- else :
- col += 1
- if col_petites == 3:
- col_petites = 1
- html_petites.write('</tr><tr>\n')
- else :
- col_petites += 1
- ajoute_image(nom,ip,html,html_petites)
- ok=1 #désolé vince j'ai essayé les exceptions mois c pas si simple
- if not ok:
- #il n'y a pas de logo :-(
- chaines_probleamatiques.append('<b><u>Chaine :</u></b> %s<br><b><u>IP :</u></b> %s:1234<br><br>\n' %(nom,ip))
- print "\t Fait"
- continue
- print 'on s\'occupe de %s %s' % (ip,nom)
- print '\trecuperation du flux'
- #ip port duree
- os.system('dumpudp %s 1234 2 > /tmp/%s.ts 2>/dev/null &' % (ip,ip))
- print '\tconversion en mpeg1'
- os.system('rm /tmp/%s.mpg 2>/dev/null 1> /dev/null' % (ip)) #eviter le message demandant l'ecrasement
- os.system('ffmpeg -deinterlace -an -i /tmp/%s.ts /tmp/%s.mpg 2>/dev/null 1> /dev/null' % (ip,ip))
- if not os.path.exists('/tmp/%s.mpg' % (ip)) :
- print '\tOn retente'
- os.system('dumpudp %s 1234 2 > /tmp/%s.ts ' % (ip,ip))
- print '\t\tconversion en mpeg1'
- os.system('ffmpeg -deinterlace -an -i /tmp/%s.ts /tmp/%s.mpg 2>/dev/null 1> /dev/null' % (ip,ip))
- print '\tconversion en ppm de la frame 11'
- os.system('rm /tmp/image_%s*ppm 2>/dev/null 2> /dev/null 1> /dev/null' % (ip)) #eviter le message demandant l'ecrasement
- os.system('transcode -q 0 -i /tmp/%s.mpg -x mpeg2,null -y ppm,null -c 10-11 -o /tmp/image_%s 2>/dev/null 1>/dev/null' % (ip,ip))
- print '\tconversion en jpg\n'
- os.system('convert -geometry \'400x300 !\' /tmp/image_%s*ppm /var/www/images/%s.jpg 2>/dev/null 1>/dev/null' % (ip,ip))
- os.system('convert -geometry \'200x150 !\' /tmp/image_%s*ppm /var/www/images/%s_petites.jpg 2>/dev/null 1>/dev/null' % (ip,ip))
-
- if os.path.exists('/tmp/%s.mpg' % (ip)) : #on teste sur le mpg car il est enleve a chaque fois
- if col == 2 :
- col = 1
- html.write('</tr><tr>\n')
- else :
- col += 1
- if col_petites == 3:
- col_petites = 1
- html_petites.write('</tr><tr>\n')
- else :
- col_petites += 1
- ajoute_image(nom,ip,html,html_petites)
- else :
- chaines_probleamatiques.append('<b><u>Chaine :</u></b> %s<br><b><u>IP :</u></b> %s:1234<br><br>\n' %(nom,ip))
- os.system('rm /var/www/images/%s.jpg' % (ip))
- os.system('rm /var/www/images/%s_petites.jpg' % (ip))
-
- os.system('rm /tmp/%s.ts /tmp/%s.mpg /tmp/image_%s*ppm' % (ip,ip,ip))
-
-
- html.write(table_piedpage)
- html_petites.write(table_piedpage)
- #on ecrit les radios
- html.write('<br><u><b><h3>Liste des chaines diffusées mais dont le flux est érroné ou uniquement audio (les flux videos ne seront probablement non lisibles avec VLC mais lisibles avec xine)</h3></b></u><br>')
- html_petites.write('<br><u><b><h3>Liste des chaines diffusées mais dont le flux est érroné ou uniquement audio (les flux videos ne seront probablement non lisibles avec VLC mais lisibles avec xine)</h3></b></u><br>')
- for line in chaines_probleamatiques :
- html.write(line)
- html_petites.write(line)
- #on ecrit la vraie fin
- html.write(trame_piedpage)
- html.close()
- html_petites.write(trame_piedpage)
- html_petites.close()
- os.system('mv -f /tmp/index.html /var/www/index.html')
- os.system('mv -f /tmp/index_petites.html /var/www/index_petites.html')
-
-
-if __name__ == '__main__' :
- lock.make_lock('vignettes')
- print 'Vignetisation générale'
- vignettes()
- print 'On a fini'
- lock.remove_lock('vignettes')
diff --git a/src/autoconf.c b/src/autoconf.c
index 6610d61..18900b9 100644
--- a/src/autoconf.c
+++ b/src/autoconf.c
@@ -515,9 +515,10 @@ int services_to_channels(mumudvb_service_t *services, mumudvb_channel_t *channel
return channel_number;
}
-//TODO : explain
void autoconf_end(int card, int number_of_channels, mumudvb_channel_t *channels, fds_t *fds)
{
+ //This function is called when autoconfiguration is finished
+ //It open what is needed to stream the new channels
int curr_channel;
int curr_pid;
diff --git a/src/cam.c b/src/cam.c
index 0949588..e77694a 100644
--- a/src/cam.c
+++ b/src/cam.c
@@ -62,7 +62,7 @@
/****************************************************************************/
-//Code from libdvb with commentaries added
+//Code from libdvbpsi, adapted and with commentaries added
//convert the PMT into CA_PMT
/****************************************************************************/
diff --git a/src/errors.h b/src/errors.h
index 15abe92..3ad42d7 100644
--- a/src/errors.h
+++ b/src/errors.h
@@ -1,3 +1,28 @@
+/*
+ * mumudvb - UDP-ize a DVB transport stream.
+ *
+ * (C) Brice DUBOST
+ *
+ * The latest version can be found at http://mumudvb.braice.net
+ *
+ * Copyright notice:
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ */
+
#ifndef _ERRORS_MUMUDVB_H
#define _ERRORS_MUMUDVB_H
diff --git a/src/mumudvb.c b/src/mumudvb.c
index f442e29..e67a89b 100644
--- a/src/mumudvb.c
+++ b/src/mumudvb.c
@@ -142,7 +142,6 @@ int
main (int argc, char **argv)
{
int k;
- int buf_pos;
//polling of the dvr device
struct pollfd pfds[2]; // DVR device
@@ -1215,9 +1214,8 @@ main (int argc, char **argv)
/******************************************************/
if(send_packet==1)
{
- // we fill the channel buffer //TODO Make a memcpy
- for (buf_pos = 0; buf_pos < bytes_read; buf_pos++)
- channels[curr_channel].buf[channels[curr_channel].nb_bytes + buf_pos] = temp_buffer_from_dvr[buf_pos];
+ // we fill the channel buffer
+ memcpy(channels[curr_channel].buf + channels[curr_channel].nb_bytes, temp_buffer_from_dvr, bytes_read);
channels[curr_channel].buf[channels[curr_channel].nb_bytes + 1] =
(channels[curr_channel].buf[channels[curr_channel].nb_bytes + 1] & 0xe0) | hi_mappids[pid];
diff --git a/src/sap.c b/src/sap.c
index c62b8fc..bfde008 100644
--- a/src/sap.c
+++ b/src/sap.c
@@ -6,9 +6,6 @@
*
* The latest version can be found at http://mumudvb.braice.net
*
- * Parts of this code is from the VLC project, modified for mumudvb
- * by Brice DUBOST
- *
* Copyright notice:
*
* This program is free software; you can redistribute it and/or modify
diff --git a/src/sap.h b/src/sap.h
index f1800d4..48cafc7 100644
--- a/src/sap.h
+++ b/src/sap.h
@@ -6,9 +6,6 @@
*
* The latest version can be found at http://mumudvb.braice.net
*
- * Parts of this code is from the VLC project, modified for mumudvb
- * by Brice DUBOST
- *
* Copyright notice:
*
* This program is free software; you can redistribute it and/or modify
diff --git a/src/tune.h b/src/tune.h
index a01ae2e..5329a3b 100644
--- a/src/tune.h
+++ b/src/tune.h
@@ -1,3 +1,29 @@
+/* dvbtune - tune.c
+
+ part of mumudvb
+
+ last version availaible from http://mumudvb.braice.net/
+
+ Copyright (C) Brice DUBOST
+ Copyright (C) Dave Chapman 2001,2002
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ as published by the Free Software Foundation; either version 2
+ of the License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ Or, point your browser to http://www.gnu.org/copyleft/gpl.html
+
+*/
+
#ifndef _TUNE_H
#define _TUNE_H
diff --git a/tools/README b/tools/README
index 218450e..a846e29 100644
--- a/tools/README
+++ b/tools/README
@@ -2,4 +2,6 @@ Mumudvb Tools Readme
Here you can find the tools programs that are joined with mumudvb.
-If you want more documentation e-mail me (cf README)
\ No newline at end of file
+ * relay : can be used to unicast a multicast stream, or relay a stream between two networks
+ * recup_sap : get the sap announces and put them in a file
+
diff --git a/tools/dumpudp.c b/tools/dumpudp.c
deleted file mode 100644
index cf479a7..0000000
--- a/tools/dumpudp.c
+++ /dev/null
@@ -1,351 +0,0 @@
-/*
-Dumpudp : dump a raw udp multicast stream
-By Brice DUBOST
- *
-The latest version can be found at http://www.crans.org
-
-Copyright notice:
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#define _GNU_SOURCE // pour utiliser le program_invocation_short_name (extension gnu)
-
-// Linux includes:
-#include <stdio.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include <sys/ioctl.h>
-#include <sys/time.h>
-#include <sys/poll.h>
-#include <sys/stat.h>
-#include <resolv.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <signal.h>
-#include <values.h>
-#include <string.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <netdb.h>
-#include <sys/types.h>
-#include <arpa/inet.h>
-#include <getopt.h>
-#include <errno.h> // pour utiliser le program_invocation_short_name (extension gnu)
-
-
-#define MAX_IP_LENGTH 18
-
-#define PACKET_SIZE 188
-
-//the cache size in UDP packet numbers
-#define CACHE_SIZE 10
-
-#define MAX_UDP_SIZE 188*7
-
- //same MTU as mumudvb (no sync errors)
-#define MTU MAX_UDP_SIZE
-
-#define ERROR_ARGS 8
-#define ERROR_FILE 9
-
-int Interrupted=0;
-int fini=0;
-
-
-// create a sender socket.
-int makesocket(char *szAddr,unsigned short port,int TTL,struct sockaddr_in *sSockAddr) {
- int iRet, iLoop = 1;
- struct sockaddr_in sin;
- char cTtl = (char)TTL;
- char cLoop=0;
-
- int iSocket = socket( AF_INET, SOCK_DGRAM, 0 );
-
- if (iSocket < 0) {
- fprintf(stderr,"socket() failed.\n");
- exit(1);
- }
-
- sSockAddr->sin_family = sin.sin_family = AF_INET;
- sSockAddr->sin_port = sin.sin_port = htons(port);
- sSockAddr->sin_addr.s_addr = inet_addr(szAddr);
-
- iRet = setsockopt(iSocket, SOL_SOCKET, SO_REUSEADDR, &iLoop, sizeof(int));
- if (iRet < 0) {
- fprintf(stderr,"setsockopt SO_REUSEADDR failed\n");
- exit(1);
- }
-
- iRet = setsockopt(iSocket, IPPROTO_IP, IP_MULTICAST_TTL, &cTtl, sizeof(char));
- if (iRet < 0) {
- fprintf(stderr,"setsockopt IP_MULTICAST_TTL failed. multicast in kernel?\n");
- exit(1);
- }
-
- cLoop = 1; /* !? */
- iRet = setsockopt(iSocket, IPPROTO_IP, IP_MULTICAST_LOOP,
- &cLoop, sizeof(char));
- if (iRet < 0) {
- fprintf(stderr,"setsockopt IP_MULTICAST_LOOP failed. multicast in kernel?\n");
- exit(1);
- }
-
- return iSocket;
-}
-
-// create a receiver socket, i.e. join the multicast group.
-int makeclientsocket(char *szAddr,unsigned short port,int TTL,struct sockaddr_in *sSockAddr) {
- int socket=makesocket(szAddr,port,TTL,sSockAddr);
- struct ip_mreq blub;
- struct sockaddr_in sin;
- unsigned int tempaddr;
- sin.sin_family=AF_INET;
- sin.sin_port=htons(port);
- sin.sin_addr.s_addr=inet_addr(szAddr);
- if (bind(socket,(struct sockaddr *)&sin,sizeof(sin))) {
- perror("bind failed");
- exit(1);
- }
- tempaddr=inet_addr(szAddr);
- if ((ntohl(tempaddr) >> 28) == 0xe) {
- blub.imr_multiaddr.s_addr = inet_addr(szAddr);
- blub.imr_interface.s_addr = 0;
- if (setsockopt(socket,IPPROTO_IP,IP_ADD_MEMBERSHIP,&blub,sizeof(blub))) {
- perror("setsockopt IP_ADD_MEMBERSHIP failed (multicast kernel?)");
- exit(1);
- }
- }
- return socket;
-}
-
-
-void
-usage (char *name)
-{
- fprintf (stderr, "%s \n"
- "Program used to dump an UDP multicast stream to a file\n"
- "\n"
- "Usage: %s [options] \n"
- "-i, --ip : Multicast Ip\n"
- "-p, --port : Port\n"
- "-o, --out : Output file\n"
- "-d, --duration : Dump duration\n"
- "-h, --help : Help\n"
- "\n"
- "Released under the GPL.\n"
- "Latest version available from http://mumudvb.braice.net/\n"
- "by Brice DUBOST (mumudvb at braice.net)\n", name, name);
-}
-
-
-static void
-SignalHandler (int signum)
-{
- if (signum == SIGALRM)
- {
- if(!fini)
- {
- fprintf (stderr, "\nFin\n");
- fini=1;
- }
- else
- {
- exit(1);
- }
- alarm (1);
- }
- if (signum != SIGPIPE)
- {
- Interrupted = signum;
- }
- signal (signum, SignalHandler);
-}
-
-
-int
-main (int argc, char **argv)
-{
-
- /* sockets */
- int ttl;
- char ipIn[MAX_IP_LENGTH];
- int portIn=0;
- struct sockaddr_in sIn;
- int socketIn;
- int lengthPacket;
- int num=0;
- int num80=0;
- int signaux=0;
- int duree=0;
- int cache_pos=0;
- char *out_filename=NULL;
- FILE *out_file;
-
- unsigned char cache[MTU*CACHE_SIZE];
-
- const char short_options[] = "i:p:o:d:h";
- const struct option long_options[] = {
- {"ip", required_argument, NULL, 'i'},
- {"port", required_argument, NULL, 'p'},
- {"out", required_argument, NULL, 'o'},
- {"duration", no_argument, NULL, 'd'},
- {"help", no_argument, NULL, 'h'},
- {0, 0, 0, 0}
- };
-
- int c, option_index = 0;
-
- while (1)
- {
- c = getopt_long (argc, argv, short_options,
- long_options, &option_index);
-
- if (c == -1)
- {
- break;
- }
- switch (c)
- {
- case 'i':
- if(strlen (optarg)>MAX_IP_LENGTH){
- fprintf(stderr, "Ip too long\n");
- }
- else{
- strncpy (ipIn, optarg,MAX_IP_LENGTH);
- }
-
- break;
- case 'p':
- portIn=strtol(optarg,NULL,10);
- break;
- case 'o':
- out_filename = (char *) malloc (strlen (optarg) + 1);
- if (!out_filename)
- {
- fprintf(stderr, "malloc() failed: %s\n", strerror(errno));
- exit(errno);
- }
- strncpy (out_filename, optarg, strlen (optarg) + 1);
- break;
- case 'd':
- duree=atoi(optarg);
- break;
- case 'h':
- usage (program_invocation_short_name);
- exit(ERROR_ARGS);
- break;
- }
- }
- if (optind < argc)
- {
- usage (program_invocation_short_name);
- exit(ERROR_ARGS);
- }
-
-
-
- // output file
- out_file = fopen (out_filename, "w");
- if (out_file == NULL)
- {
- fprintf (stderr,
- "%s: %s\n",
- out_filename, strerror (errno));
- exit(ERROR_FILE);
- }
-
-
- ttl = 2;
- fprintf (stderr, "Dump start\n");
- fprintf (stderr, "Ip \"%s\", Port \"%d\", Output file : \"%s\", ",ipIn,portIn,out_filename);
- if(duree)
- fprintf (stderr, "Duration \"%d\" \n",duree);
- else
- fprintf (stderr, "\n");
- fprintf (stderr, "A dot is printed every 500 packets\n");
-
- /* Init udp */
- socketIn = makeclientsocket (ipIn, portIn, ttl, &sIn); //le makeclientsocket est pour joindre automatiquement le flux
-
-
- //In order to program records
- if(duree)
- {
- // alarme pour la fin
- if (signal (SIGALRM, SignalHandler) == SIG_IGN)
- signal (SIGALRM, SIG_IGN);
- alarm (duree);
- }
-
-
- /* Read packets */
-
-
- while (!Interrupted)
- {
- lengthPacket=recv(socketIn,cache+cache_pos,MTU,0);
- cache_pos+=MTU;
- num++;
- // mis ici pour pouvoir le tuer s'il n'y a pas de flux (automatiser ça à l'avenir)
- if(signaux==0)
- {
- if (signal (SIGHUP, SignalHandler) == SIG_IGN)
- signal (SIGHUP, SIG_IGN);
- if (signal (SIGINT, SignalHandler) == SIG_IGN)
- signal (SIGINT, SIG_IGN);
- if (signal (SIGTERM, SignalHandler) == SIG_IGN)
- signal (SIGTERM, SIG_IGN);
- signaux=1;
- }
- if (lengthPacket != MTU)
- {
- fprintf (stderr, "No bytes left to read - aborting\n");
- break;
- }
- if(cache_pos==MTU*CACHE_SIZE){
- fwrite(cache, sizeof(unsigned char), cache_pos,out_file);
- cache_pos=0;
- }
- if(num%500==0)
- {
- num=0;
- num80++;
- if(num80%80==0)
- {
- fprintf (stderr,".\n");
- num80=0;
- }
- else
- fprintf (stderr,".");
- fflush(stderr);
- }
-
- if (Interrupted)
- {
- //if some data need to be written
- if(cache_pos)
- fwrite(cache, sizeof(unsigned char), cache_pos,out_file);
- fprintf (stderr, "\nCaught signal %d - closing cleanly.\n", Interrupted);
- }
- }
-
- close (socketIn);
- fclose (out_file);
-
-
- return (0);
-}
diff --git a/tools/dumpudp_limited.c b/tools/dumpudp_limited.c
deleted file mode 100644
index 95979ad..0000000
--- a/tools/dumpudp_limited.c
+++ /dev/null
@@ -1,255 +0,0 @@
-/*
-
-crans_dvbstream - UDP-ize a DVB transport stream.
-(C) Dave Chapman <dave at dchapman.com> 2001, 2002.
-Modified By Brice DUBOST
- *
-The latest version can be found at http://www.crans.org
-
-Copyright notice:
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-// Linux includes:
-#include <stdio.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include <sys/ioctl.h>
-#include <sys/time.h>
-#include <sys/poll.h>
-#include <sys/stat.h>
-#include <resolv.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <signal.h>
-#include <values.h>
-#include <string.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <netdb.h>
-#include <sys/types.h>
-#include <arpa/inet.h>
-
-#define MAX_IP_LENGTH 18
-
-#define PACKET_SIZE 188
-
-
-#define MAX_UDP_SIZE 188*7
-#define MTU MAX_UDP_SIZE
-
-#define NUM_PAQUETS_A_PRENDRE 1000
-#define TIMEOUT 30
-
-// global car je le vaux bien
- int socketIn;
- int Interrupted=0;
-
-int sendudp(int fd, struct sockaddr_in *sSockAddr, char *data, int len) {
- return sendto(fd,data,len,0,(struct sockaddr *)sSockAddr,sizeof(*sSockAddr));
-}
-
-
-
-// create a sender socket.
-int makesocket(char *szAddr,unsigned short port,int TTL,struct sockaddr_in *sSockAddr) {
- int iRet, iLoop = 1;
- struct sockaddr_in sin;
- char cTtl = (char)TTL;
- char cLoop=0;
-
- int iSocket = socket( AF_INET, SOCK_DGRAM, 0 );
-
- if (iSocket < 0) {
- fprintf(stderr,"socket() failed.\n");
- exit(1);
- }
-
- sSockAddr->sin_family = sin.sin_family = AF_INET;
- sSockAddr->sin_port = sin.sin_port = htons(port);
- sSockAddr->sin_addr.s_addr = inet_addr(szAddr);
-
- iRet = setsockopt(iSocket, SOL_SOCKET, SO_REUSEADDR, &iLoop, sizeof(int));
- if (iRet < 0) {
- fprintf(stderr,"setsockopt SO_REUSEADDR failed\n");
- exit(1);
- }
-
- iRet = setsockopt(iSocket, IPPROTO_IP, IP_MULTICAST_TTL, &cTtl, sizeof(char));
- if (iRet < 0) {
- fprintf(stderr,"setsockopt IP_MULTICAST_TTL failed. multicast in kernel?\n");
- exit(1);
- }
-
- cLoop = 1; /* !? */
- iRet = setsockopt(iSocket, IPPROTO_IP, IP_MULTICAST_LOOP,
- &cLoop, sizeof(char));
- if (iRet < 0) {
- fprintf(stderr,"setsockopt IP_MULTICAST_LOOP failed. multicast in kernel?\n");
- exit(1);
- }
-
- return iSocket;
-}
-// create a receiver socket, i.e. join the multicast group.
-int makeclientsocket(char *szAddr,unsigned short port,int TTL,struct sockaddr_in *sSockAddr) {
- int socket=makesocket(szAddr,port,TTL,sSockAddr);
- struct ip_mreq blub;
- struct sockaddr_in sin;
- unsigned int tempaddr;
- sin.sin_family=AF_INET;
- sin.sin_port=htons(port);
- sin.sin_addr.s_addr=inet_addr(szAddr);
- if (bind(socket,(struct sockaddr *)&sin,sizeof(sin))) {
- perror("bind failed");
- exit(1);
- }
- tempaddr=inet_addr(szAddr);
- if ((ntohl(tempaddr) >> 28) == 0xe) {
- blub.imr_multiaddr.s_addr = inet_addr(szAddr);
- blub.imr_interface.s_addr = 0;
- if (setsockopt(socket,IPPROTO_IP,IP_ADD_MEMBERSHIP,&blub,sizeof(blub))) {
- perror("setsockopt IP_ADD_MEMBERSHIP failed (multicast kernel?)");
- exit(1);
- }
- }
- return socket;
-}
-
-
-void
-Usage ()
-{
- fprintf (stderr, "Usage: relay source portsource dest portdest \n\n");
-}
-
-void on_ferme()
-{
- close (socketIn);
-}
-
-static void
-SignalHandler (int signum)
-{
- if (signum != SIGPIPE)
- {
- Interrupted = signum;
- }
- if (signum == SIGALRM)
- {
- on_ferme();
- exit(0);
- }
-
- signal (signum, SignalHandler);
-}
-
-
-int
-main (int argc, char **argv)
-{
-
- /* sockets */
- int ttl;
- char ipIn[MAX_IP_LENGTH];
- int portIn;
- struct sockaddr_in sIn;
- int lengthPacket;
- int num_total=0;
- int num=0;
- int num80=0;
- int signaux=0;
-
- unsigned char temp_buf[MTU];
-
- fprintf (stderr,"dumpudp_limited\n\tDum a limited size of a multicast stream\n");
-
- if (argc != 3)
- {
- Usage ();
- exit (1);
- }
- else
- {
- strncpy (ipIn, argv[1],MAX_IP_LENGTH);
- portIn = atoi(argv[2]);
- }
-
-
- ttl = 2;
- fprintf (stderr,"Recuperation\nUn point est affiché tous les 500 paquets\n");
-
- /* Init udp */
- socketIn = makeclientsocket (ipIn, portIn, ttl, &sIn); //le makeclientsocket est pour joindre automatiquement le flux
-
- /* Read packets */
- if (signal (SIGALRM, SignalHandler) == SIG_IGN)
- signal (SIGALRM, SIG_IGN);
- // timeout au cas ou
- alarm (TIMEOUT);
-
-
- while (!Interrupted)
- {
- lengthPacket=recv(socketIn,temp_buf,MTU,0);
- num++;
- num_total++;
- // mis ici pour pouvoir le tuer s'il n'y a pas de flux (aytomatiser ça à l'avenir)
- if(signaux==0)
- {
- if (signal (SIGHUP, SignalHandler) == SIG_IGN)
- signal (SIGHUP, SIG_IGN);
- if (signal (SIGINT, SignalHandler) == SIG_IGN)
- signal (SIGINT, SIG_IGN);
- if (signal (SIGTERM, SignalHandler) == SIG_IGN)
- signal (SIGTERM, SIG_IGN);
- signaux=1;
- }
- if (lengthPacket != MTU)
- {
- fprintf (stderr, "No bytes left to read - aborting\n");
- break;
- }
-
- write(STDOUT_FILENO, temp_buf, MTU);
- fflush(stdout);
- if(num%500==0)
- {
- num=0;
- num80++;
- if(num80%80==0)
- {
- fprintf (stderr,".\n");
- num80=0;
- }
- else
- fprintf (stderr,".");
- fflush(stdout);
- }
-
- if(num_total==NUM_PAQUETS_A_PRENDRE)
- Interrupted=999;
-
- if (Interrupted)
- {
- fprintf (stderr, "Caught signal %d - closing cleanly.\n", Interrupted);
- }
- }
-
- on_ferme();
- return (0);
-}
diff --git a/tools/recup_sap.c b/tools/recup_sap.c
index 9a82ad0..95b1118 100644
--- a/tools/recup_sap.c
+++ b/tools/recup_sap.c
@@ -59,6 +59,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#define IP "224.2.127.254\0"
#define DUREE_PRISE_SAP 60
+#define SAP_FILE "/tmp/chaines_recup_sap.txt"
#define MAX_CHAINES 256
@@ -147,7 +148,7 @@ int makeclientsocket(char *szAddr,unsigned short port,int TTL,struct sockaddr_in
void
Usage ()
{
- fprintf (stderr, "Usage: rtfm (qui n'existe pas) (pour le moment usage perso) \n\n");
+ fprintf (stderr, "Usage: just launch recup sap without arguments.\n");
}
@@ -178,6 +179,8 @@ main (int argc, char **argv)
unsigned char temp_buf[MAX_PACKET_SIZE];
fprintf (stderr, "recup_sap\nProgram used to get a SAP stream\n");
+ fprintf (stderr, "This program only get well formated sap announces, it does NO checking\n");
+ fprintf (stderr, "It's a very simple program, if you experience issues please contact me\n\n");
fprintf (stderr, "Released under the GPL.\n");
fprintf (stderr,
"Latest version available from http://mumudvb.braice.net/\n");
@@ -192,7 +195,7 @@ main (int argc, char **argv)
ttl = 2;
- fprintf (stderr, "C parti pour %ds de récupération de SAP\n",DUREE_PRISE_SAP);
+ fprintf (stderr, "We will get sap announces during %d seconds\nThey will be put in %s\n",DUREE_PRISE_SAP, SAP_FILE);
/* Init udp */
socketIn = makeclientsocket (ipIn, portIn, ttl, &sIn); //le makeclientsocket est pour joindre automatiquement le flux
@@ -207,7 +210,6 @@ main (int argc, char **argv)
while (!Interrupted)
{
lengthPacket=recv(socketIn,temp_buf,MAX_PACKET_SIZE,0);
-// lengthPacket=recv(socketIn,temp_buf,MAX_PACKET_SIZE,MSG_DONTWAIT);
if(lengthPacket>0)
{
if(signaux==0)//mis ici pour pouvoir le tuer s'il n'y a pas de flux (aytomatiser ça à l'avenir)
@@ -250,7 +252,7 @@ main (int argc, char **argv)
j++;
if(j>255)
{
- fprintf(stderr,"Chaine trop longue, il y a un GROS probleme avec les annonces SAP\n");
+ fprintf(stderr,"String too long.\nBad sap announces\n");
print_line=0;
}
@@ -297,16 +299,15 @@ void on_ferme()
{
int i;
FILE *fich_chaines;
- fich_chaines=fopen("/tmp/chaines_recup_sap.txt","w");
+ fich_chaines=fopen(SAP_FILE,"w");
if(fich_chaines==NULL)
{
- printf("Pb qvec le fichier\n");
+ printf("Issues with the file %s\n", SAP_FILE);
exit(1);
}
for(i=0;i<num_chaines;i++)
{
-// printf("%s\n",chaines[i]);
fprintf(fich_chaines,"%s\n",chaines[i]);
}
fclose(fich_chaines);
diff --git a/tools/scan_modified/README b/tools/scan_modified/README
deleted file mode 100644
index 83e5df7..0000000
--- a/tools/scan_modified/README
+++ /dev/null
@@ -1,11 +0,0 @@
-This is a modified version of scan from dbv-apps : http://linuxtv.org/
-The original version can be found here : http://www.linuxtv.org/downloads/linuxtv-dvb-apps-1.1.1.tar.gz
-
-This new version is able to write his output in the format asked by mumudvb. You just have to add the "-o mumudvb" parameter on the command line
-
-For example if you want to scan the card 0 (already tuned with zap for example) for Free to Air channel and put the results in card0.conf
-"scan -a 0 -o mumudvb -c -x 0 > card0.conf"
-
-Notes :
- * you have to add the card parameter and check the Ip adresses
-
diff --git a/tools/scan_modified/patch-linuxtv-dvb-apps-1.1.1-scan-mumudvb.patch b/tools/scan_modified/patch-linuxtv-dvb-apps-1.1.1-scan-mumudvb.patch
deleted file mode 100644
index dc18095..0000000
--- a/tools/scan_modified/patch-linuxtv-dvb-apps-1.1.1-scan-mumudvb.patch
+++ /dev/null
@@ -1,379 +0,0 @@
-diff -uNr linuxtv-dvb-apps-1.1.1/util/scan/dump-mumudvb.c linuxtv-dvb-apps-scan-mumu/util/scan/dump-mumudvb.c
---- linuxtv-dvb-apps-1.1.1/util/scan/dump-mumudvb.c 1970-01-01 01:00:00.000000000 +0100
-+++ linuxtv-dvb-apps-scan-mumu/util/scan/dump-mumudvb.c 2008-05-04 13:24:28.464941015 +0200
-@@ -0,0 +1,206 @@
-+#include <stdio.h>
-+#include "dump-mumudvb.h"
-+#include <linux/dvb/frontend.h>
-+
-+
-+static const char *inv_name [] = {
-+ "0",
-+ "1",
-+ "999"
-+};
-+
-+static const char *fec_name [] = {
-+ "0",
-+ "12",
-+ "23",
-+ "34",
-+ "45",
-+ "56",
-+ "67",
-+ "78",
-+ "89",
-+ "999"
-+};
-+
-+static const char *qam_name [] = {
-+ "0",
-+ "16",
-+ "32",
-+ "64",
-+ "128",
-+ "256",
-+ "999"
-+};
-+
-+
-+static const char *bw_name [] = {
-+ "8",
-+ "7",
-+ "6",
-+ "999"
-+};
-+
-+
-+static const char *mode_name [] = {
-+ "2",
-+ "8",
-+ "999"
-+};
-+
-+static const char *guard_name [] = {
-+ "32",
-+ "16",
-+ "8",
-+ "4",
-+ "999"
-+};
-+
-+
-+static const char *hierarchy_name [] = {
-+ "0",
-+ "1",
-+ "2",
-+ "4",
-+ "999"
-+};
-+
-+static const char *west_east_flag_name [] = {
-+ "W",
-+ "E"
-+};
-+
-+void mumudvb_dump_dvb_parameters (FILE *f, fe_type_t type,
-+ struct dvb_frontend_parameters *p,
-+ char polarity, int orbital_pos, int we_flag)
-+{
-+
-+ switch (type) {
-+ case FE_QPSK:
-+ fprintf (f, "#QPSK Modulation : DVB-S. Satellite : S%i.%i%s\n", orbital_pos/10,
-+ orbital_pos % 10, west_east_flag_name[we_flag]);
-+ fprintf (f, "freq=%i\n", p->frequency / 1000);
-+ fprintf (f, "pol=%c\n", polarity);
-+ fprintf (f, "srate=%i\n", p->u.qpsk.symbol_rate / 1000);
-+ break;
-+
-+ case FE_QAM:
-+ fprintf (f, "#QAM Modulation : Probably DVB-C ---------- Not Tested ----------- \n");
-+ fprintf (f, "%i:", p->frequency / 1000000);
-+ fprintf (f, "M%s:C:", qam_name[p->u.qam.modulation]);
-+ fprintf (f, "%i:", p->u.qam.symbol_rate / 1000);
-+ break;
-+
-+ case FE_OFDM:
-+ fprintf (f, "#OFDM Modulation : DVB-T\n");
-+ fprintf (f, "#QAM : %s ", qam_name[p->u.ofdm.constellation]);
-+ fprintf (f, "Inversion : %s ", inv_name[p->inversion]);
-+ fprintf (f, "Coderate HP : %s ", fec_name[p->u.ofdm.code_rate_HP]);
-+ fprintf (f, "Coderate LP : %s ", fec_name[p->u.ofdm.code_rate_LP]);
-+ fprintf (f, "Guard interval : %s ", guard_name[p->u.ofdm.guard_interval]);
-+ fprintf (f, "Transmission mode : %s ", mode_name[p->u.ofdm.transmission_mode]);
-+ fprintf (f, "Hierarchy : %s ", hierarchy_name[p->u.ofdm.hierarchy_information]);
-+ fprintf (f, "\n");
-+ if(p->frequency>=0xfffffff)
-+ fprintf (f, "#==========WARNING=============\n#The network provider probably returned the wrong frequency\n#You have to set manually the freq= option\n\n");
-+ else
-+ fprintf (f, "freq=%i\n", p->frequency );
-+ fprintf (f, "bandwith=%sMhz\n", bw_name[p->u.ofdm.bandwidth]);
-+ fprintf (f, "qam=auto\n");
-+ fprintf (f, "trans_mode=auto\n");
-+ fprintf (f, "guardinterval=auto\n");
-+ fprintf (f, "coderate=auto\n");
-+ // fprintf (f, ":T:27500:");
-+ break;
-+
-+ case FE_ATSC:
-+ fprintf (f, "%i:", p->frequency / 1000);
-+ fprintf (f, "VDR does not support ATSC at this time");
-+ break;
-+
-+ default:
-+ fprintf (f, "Modulation : %d\n", type);
-+ ;
-+ };
-+
-+}
-+
-+void mumudvb_dump_service_parameter_set (FILE *f,
-+ const char *service_name,
-+ const char *provider_name,
-+ fe_type_t type,
-+ struct dvb_frontend_parameters *p,
-+ char polarity,
-+ int video_pid,
-+ int pcr_pid,
-+ uint16_t *audio_pid,
-+ char audio_lang[][4],
-+ int audio_num,
-+ int teletext_pid,
-+ int scrambled,
-+ int ac3_pid,
-+ int service_id,
-+ int network_id,
-+ int transport_stream_id,
-+ int orbital_pos,
-+ int we_flag,
-+ int ca_select,
-+ int channel_num,
-+ int channel_num_mumudvb,
-+ int pmt_pid,
-+ int subtitling_pid)
-+{
-+ int i;
-+
-+ if (channel_num_mumudvb == 0)
-+ {
-+ fprintf (f, "#This is an automatically generated config file for mumudvb\n#Check if the ip adresses are good for you\n#You might also have to ad the card=n parameter with n the number of your DVB adapter\n\n");
-+ mumudvb_dump_dvb_parameters (f, type, p, polarity, orbital_pos, we_flag);
-+ }
-+ if ((video_pid || audio_pid[0]) && ((ca_select > 0) || ((ca_select == 0) && (scrambled == 0)))) {
-+ fprintf (f, "\n#Channel : \"%s\" Provider : \"%s\" Number : %d\n", service_name, provider_name, channel_num);
-+ fprintf (f, "ip=239.200.200.2%02i\n",channel_num_mumudvb);
-+ fprintf (f, "port=1234\n");
-+ fprintf (f, "name=");
-+ if (audio_lang && audio_lang[0][0])
-+ fprintf (f, "%.4s ", audio_lang[0]);
-+ fprintf (f, "%s\n", service_name);
-+
-+ fprintf (f, "#Pids are the following : PMT ");
-+ if ((pcr_pid != video_pid) && (video_pid > 0)) fprintf (f, "Video PCR ");
-+ else if (video_pid > 0) fprintf (f, "Video ");
-+ for (i = 0; i < audio_num; i++)
-+ {
-+ if(audio_pid[i]) fprintf (f, "Audio ");
-+ }
-+ if (ac3_pid) fprintf (f, "AC3 ");
-+ if (teletext_pid) fprintf (f, "Text ");
-+ if (subtitling_pid) fprintf (f, "SUB ");
-+ fprintf (f, "\n");
-+ fprintf (f, "pids=");
-+ fprintf (f, "%i ", pmt_pid);
-+ if ((pcr_pid != video_pid) && (video_pid > 0))
-+ fprintf (f, "%i %i", video_pid, pcr_pid);
-+ else if (video_pid > 0)
-+ fprintf (f, "%i", video_pid);
-+ if(audio_pid[0])
-+ fprintf (f, " %i", audio_pid[0]);
-+ for (i = 1; i < audio_num; i++)
-+ {
-+ if(audio_pid[i])
-+ fprintf (f, " %i", audio_pid[i]);
-+ }
-+ if (ac3_pid)
-+ {
-+ fprintf (f, " %i", ac3_pid);
-+ }
-+ if (scrambled == 1) scrambled = ca_select;
-+ if (teletext_pid)
-+ fprintf (f, " %d", teletext_pid);
-+ if (subtitling_pid)
-+ fprintf (f, " %d", subtitling_pid);
-+ // fprintf (f, ":%d:%d:%d:%d:%d:0", teletext_pid, scrambled,
-+ // service_id, network_id, transport_stream_id);
-+ fprintf (f, "\n");
-+ }
-+}
-+
-diff -uNr linuxtv-dvb-apps-1.1.1/util/scan/dump-mumudvb.h linuxtv-dvb-apps-scan-mumu/util/scan/dump-mumudvb.h
---- linuxtv-dvb-apps-1.1.1/util/scan/dump-mumudvb.h 1970-01-01 01:00:00.000000000 +0100
-+++ linuxtv-dvb-apps-scan-mumu/util/scan/dump-mumudvb.h 2008-05-04 13:24:03.839096762 +0200
-@@ -0,0 +1,39 @@
-+#ifndef __DUMP_MUMUDVB_H__
-+#define __DUMP_MUMUDVB_H__
-+
-+#include <stdint.h>
-+#include <linux/dvb/frontend.h>
-+
-+extern
-+void mumudvb_dump_dvb_parameters (FILE *f, fe_type_t type,
-+ struct dvb_frontend_parameters *p,
-+ char polarity, int orbital_pos, int we_flag);
-+
-+extern
-+void mumudvb_dump_service_parameter_set (FILE *f,
-+ const char *service_name,
-+ const char *provider_name,
-+ fe_type_t type,
-+ struct dvb_frontend_parameters *p,
-+ char polarity,
-+ int video_pid,
-+ int pcr_pid,
-+ uint16_t *audio_pid,
-+ char audio_lang[][4],
-+ int audio_num,
-+ int teletext_pid,
-+ int scrambled,
-+ int ac3_pid,
-+ int service_id,
-+ int network_id,
-+ int transport_stream_id,
-+ int orbital_pos,
-+ int we_flag,
-+ int ca_select,
-+ int channel_num,
-+ int channel_num_mumudvb,
-+ int pmt_pid,
-+ int subtitling_pid);
-+
-+#endif
-+
-diff -uNr linuxtv-dvb-apps-1.1.1/util/scan/Makefile linuxtv-dvb-apps-scan-mumu/util/scan/Makefile
---- linuxtv-dvb-apps-1.1.1/util/scan/Makefile 2006-05-18 01:34:53.000000000 +0200
-+++ linuxtv-dvb-apps-scan-mumu/util/scan/Makefile 2008-05-04 13:30:28.291877015 +0200
-@@ -3,7 +3,7 @@
- CFLAGS = -MD -g -Wall -O2 -I../../include
- LFLAGS = -g -Wall
-
--OBJS = diseqc.o dump-zap.o dump-vdr.o scan.o lnb.o section.o atsc_psip_section.o
-+OBJS = diseqc.o dump-mumudvb.o dump-zap.o dump-vdr.o scan.o lnb.o section.o atsc_psip_section.o
- SRCS = $(OBJS:.o=.c)
-
- TARGET = scan
-diff -uNr linuxtv-dvb-apps-1.1.1/util/scan/scan.c linuxtv-dvb-apps-scan-mumu/util/scan/scan.c
---- linuxtv-dvb-apps-1.1.1/util/scan/scan.c 2006-05-18 01:33:25.000000000 +0200
-+++ linuxtv-dvb-apps-scan-mumu/util/scan/scan.c 2008-05-04 13:25:41.183405766 +0200
-@@ -41,6 +41,7 @@
- #include "diseqc.h"
- #include "dump-zap.h"
- #include "dump-vdr.h"
-+#include "dump-mumudvb.h"
- #include "scan.h"
- #include "lnb.h"
-
-@@ -79,7 +80,8 @@
- enum format {
- OUTPUT_ZAP,
- OUTPUT_VDR,
-- OUTPUT_PIDS
-+ OUTPUT_PIDS,
-+ OUTPUT_MUMUDVB
- };
- static enum format output_format = OUTPUT_ZAP;
- static int output_format_set = 0;
-@@ -528,6 +530,7 @@
- t->other_f[i] = f * 10;
- buf += 4;
- }
-+
- }
-
- static void parse_service_descriptor (const unsigned char *buf, struct service *s)
-@@ -1923,6 +1926,7 @@
- int n = 0, i;
- char sn[20];
- int anon_services = 0;
-+ int channel_num_mumudvb = 0;
-
- list_for_each(p1, &scanned_transponders) {
- t = list_entry(p1, struct transponder, list);
-@@ -1938,6 +1942,7 @@
- t = list_entry(p1, struct transponder, list);
- if (t->wrong_frequency)
- continue;
-+ channel_num_mumudvb = 0;
- list_for_each(p2, &t->services) {
- s = list_entry(p2, struct service, list);
-
-@@ -2001,6 +2006,34 @@
- vdr_dump_channum,
- s->channel_num);
- break;
-+ case OUTPUT_MUMUDVB:
-+ mumudvb_dump_service_parameter_set (stdout,
-+ s->service_name,
-+ s->provider_name,
-+ t->type,
-+ &t->param,
-+ sat_polarisation(t),
-+ s->video_pid,
-+ s->pcr_pid,
-+ s->audio_pid,
-+ s->audio_lang,
-+ s->audio_num,
-+ s->teletext_pid,
-+ s->scrambled,
-+ //FIXME: s->subtitling_pid
-+ s->ac3_pid,
-+ s->service_id,
-+ t->network_id,
-+ s->transport_stream_id,
-+ t->orbital_pos,
-+ t->we_flag,
-+ ca_select,
-+ s->channel_num,
-+ channel_num_mumudvb,
-+ s->pmt_pid,
-+ s->subtitling_pid);
-+ channel_num_mumudvb++;
-+ break;
- case OUTPUT_ZAP:
- zap_dump_service_parameter_set (stdout,
- s->service_name,
-@@ -2013,7 +2046,7 @@
- s->service_id);
- default:
- break;
-- }
-+ }
- }
- }
- info("Done.\n");
-@@ -2065,7 +2098,7 @@
- " -n evaluate NIT-other for full network scan (slow!)\n"
- " -5 multiply all filter timeouts by factor 5\n"
- " for non-DVB-compliant section repitition rates\n"
-- " -o fmt output format: 'zap' (default), 'vdr' or 'pids' (default with -c)\n"
-+ " -o fmt output format: 'zap' (default), 'vdr', 'mumudvb' or 'pids' (default with -c)\n"
- " -x N Conditional Axcess, (default 1)\n"
- " N=0 gets only FTA channels\n"
- " N=xxx sets ca field in vdr output to :xxx:\n"
-@@ -2158,6 +2191,7 @@
- if (strcmp(optarg, "zap") == 0) output_format = OUTPUT_ZAP;
- else if (strcmp(optarg, "vdr") == 0) output_format = OUTPUT_VDR;
- else if (strcmp(optarg, "pids") == 0) output_format = OUTPUT_PIDS;
-+ else if (strcmp(optarg, "mumudvb") == 0) output_format = OUTPUT_MUMUDVB;
- else {
- bad_usage(argv[0], 0);
- return -1;
-@@ -2280,6 +2314,7 @@
- switch (output_format) {
- case OUTPUT_PIDS:
- case OUTPUT_VDR:
-+ case OUTPUT_MUMUDVB:
- vdr_dump_dvb_parameters(f, t->type, &t->param,
- sat_polarisation (t), t->orbital_pos, t->we_flag);
- break;
diff --git a/tools/scan_modified/scan/Makefile b/tools/scan_modified/scan/Makefile
deleted file mode 100644
index 2831aa6..0000000
--- a/tools/scan_modified/scan/Makefile
+++ /dev/null
@@ -1,21 +0,0 @@
-
-CC = gcc
-CFLAGS = -MD -g -Wall -O2 -I./include
-LFLAGS = -g -Wall
-
-OBJS = diseqc.o dump-mumudvb.o dump-zap.o dump-vdr.o scan.o lnb.o section.o atsc_psip_section.o
-SRCS = $(OBJS:.o=.c)
-
-TARGET = scan
-
-$(TARGET): $(OBJS)
- $(CC) $(LFLAGS) -o $(TARGET) $(OBJS)
-
-.c.o:
- $(CC) $(CFLAGS) -c $< -o $@
-
-clean:
- $(RM) *.o *.d $(TARGET)
-
--include $(wildcard *.d) dummy
-
diff --git a/tools/scan_modified/scan/README b/tools/scan_modified/scan/README
deleted file mode 100644
index a6c1767..0000000
--- a/tools/scan_modified/scan/README
+++ /dev/null
@@ -1,18 +0,0 @@
-Hi,
-
-this is a little channel scan utility to generate szap/tzap/czap compatible
-channel lists. Scan does not do a frequency scan, however, so you must
-manually provide the data for tuning to one or more start transponders.
-A number of initial-tuning-data files are provided for various dvb-c, dvb-s
-and dvb-t networks around the world. If you make a new one feel free to
-submit it to the linux-dvb mailing list http://linuxtv.org/mailinglists.xml.
-
-Basic usage: ./scan dvb-s/Astra-19.2E | tee mychannels.conf
-
-If you want it to check a specific frequency, tune to that frequency
-(e.g. using szap/tzap/czap) and then use './scan -c'.
-
-For more scan options see ./scan -h.
-
-Good luck,
-Holger + Johannes
diff --git a/tools/scan_modified/scan/atsc/us-ATSC-center-frequencies-8VSB b/tools/scan_modified/scan/atsc/us-ATSC-center-frequencies-8VSB
deleted file mode 100644
index ffd0b02..0000000
--- a/tools/scan_modified/scan/atsc/us-ATSC-center-frequencies-8VSB
+++ /dev/null
@@ -1,71 +0,0 @@
-# US ATSC center frequencies, use if in doubt
-
-A 57028615 8VSB
-A 63028615 8VSB
-A 69028615 8VSB
-A 79028615 8VSB
-A 85028615 8VSB
-A 177028615 8VSB
-A 183028615 8VSB
-A 189028615 8VSB
-A 195028615 8VSB
-A 201028615 8VSB
-A 207028615 8VSB
-A 213028615 8VSB
-A 473028615 8VSB
-A 479028615 8VSB
-A 485028615 8VSB
-A 491028615 8VSB
-A 497028615 8VSB
-A 503028615 8VSB
-A 509028615 8VSB
-A 515028615 8VSB
-A 521028615 8VSB
-A 527028615 8VSB
-A 533028615 8VSB
-A 539028615 8VSB
-A 545028615 8VSB
-A 551028615 8VSB
-A 557028615 8VSB
-A 563028615 8VSB
-A 569028615 8VSB
-A 575028615 8VSB
-A 581028615 8VSB
-A 587028615 8VSB
-A 593028615 8VSB
-A 599028615 8VSB
-A 605028615 8VSB
-A 611028615 8VSB
-A 617028615 8VSB
-A 623028615 8VSB
-A 629028615 8VSB
-A 635028615 8VSB
-A 641028615 8VSB
-A 647028615 8VSB
-A 653028615 8VSB
-A 659028615 8VSB
-A 665028615 8VSB
-A 671028615 8VSB
-A 677028615 8VSB
-A 683028615 8VSB
-A 689028615 8VSB
-A 695028615 8VSB
-A 701028615 8VSB
-A 707028615 8VSB
-A 713028615 8VSB
-A 719028615 8VSB
-A 725028615 8VSB
-A 731028615 8VSB
-A 737028615 8VSB
-A 743028615 8VSB
-A 749028615 8VSB
-A 755028615 8VSB
-A 761028615 8VSB
-A 767028615 8VSB
-A 773028615 8VSB
-A 779028615 8VSB
-A 785028615 8VSB
-A 791028615 8VSB
-A 797028615 8VSB
-A 803028615 8VSB
-
diff --git a/tools/scan_modified/scan/atsc/us-CA-SF-Bay-Area b/tools/scan_modified/scan/atsc/us-CA-SF-Bay-Area
deleted file mode 100644
index 8cca4e0..0000000
--- a/tools/scan_modified/scan/atsc/us-CA-SF-Bay-Area
+++ /dev/null
@@ -1,16 +0,0 @@
-# initial tuning data for some frequencies of for the San Francisco Bay Area
-# includes San Francisco, San Jose, Oakland...
-
-A 503000000 8VSB
-A 551000000 8VSB
-A 563000000 8VSB
-A 593000000 8VSB
-A 623000000 8VSB
-A 635000000 8VSB
-A 647000000 8VSB
-A 659000000 8VSB
-A 683000000 8VSB
-A 689000000 8VSB
-A 701000000 8VSB
-A 725000000 8VSB
-A 731000000 8VSB
diff --git a/tools/scan_modified/scan/atsc/us-Cable-EIA-542-HRC-center-frequencies-QAM256 b/tools/scan_modified/scan/atsc/us-Cable-EIA-542-HRC-center-frequencies-QAM256
deleted file mode 100644
index c0afed9..0000000
--- a/tools/scan_modified/scan/atsc/us-Cable-EIA-542-HRC-center-frequencies-QAM256
+++ /dev/null
@@ -1,142 +0,0 @@
-# US EIA-542 Cable center frequencies
-# Harmonically Related Carriers (HRC)
-# Channels 1 to 125 are in ascending EIA/NCTA channel designation order
-
-#1
-A 73753600 QAM256
-A 55752700 QAM256
-A 61753000 QAM256
-A 67753300 QAM256
-A 77753900 QAM256
-A 83754200 QAM256
-A 175758700 QAM256
-A 181759000 QAM256
-A 187759300 QAM256
-#10
-A 193759600 QAM256
-A 199759900 QAM256
-A 205760200 QAM256
-A 211760500 QAM256
-A 121756000 QAM256
-A 127756300 QAM256
-A 133756600 QAM256
-A 139756900 QAM256
-A 145757200 QAM256
-A 151757500 QAM256
-#20
-A 157757800 QAM256
-A 163758100 QAM256
-A 169758400 QAM256
-A 217760800 QAM256
-A 223761100 QAM256
-A 229761400 QAM256
-A 235761700 QAM256
-A 241762000 QAM256
-A 247762300 QAM256
-A 253762600 QAM256
-#30
-A 259762900 QAM256
-A 265763200 QAM256
-A 271763500 QAM256
-A 277763800 QAM256
-A 283764100 QAM256
-A 289764400 QAM256
-A 295764700 QAM256
-A 301765000 QAM256
-A 307765300 QAM256
-A 313765600 QAM256
-#40
-A 319765900 QAM256
-A 325766200 QAM256
-A 331766500 QAM256
-A 337766800 QAM256
-A 343767100 QAM256
-A 349767400 QAM256
-A 355767700 QAM256
-A 361768000 QAM256
-A 367768300 QAM256
-A 373768600 QAM256
-#50
-A 379768900 QAM256
-A 385769200 QAM256
-A 391769500 QAM256
-A 397769800 QAM256
-A 403770100 QAM256
-A 409770400 QAM256
-A 415770700 QAM256
-A 421771000 QAM256
-A 427771300 QAM256
-A 433771600 QAM256
-#60
-A 439771900 QAM256
-A 445772200 QAM256
-A 451772500 QAM256
-A 457772800 QAM256
-A 463773100 QAM256
-A 469773400 QAM256
-A 475773700 QAM256
-A 481774000 QAM256
-A 487774300 QAM256
-A 493774600 QAM256
-#70
-A 499774900 QAM256
-A 505775200 QAM256
-A 511775500 QAM256
-A 517775800 QAM256
-A 523776100 QAM256
-A 529776400 QAM256
-A 535776700 QAM256
-A 541777000 QAM256
-A 547777300 QAM256
-A 553777600 QAM256
-#80
-A 559777900 QAM256
-A 565778200 QAM256
-A 571778500 QAM256
-A 577778800 QAM256
-A 583779100 QAM256
-A 589779400 QAM256
-A 595779700 QAM256
-A 601780000 QAM256
-A 607780300 QAM256
-A 613780600 QAM256
-#90
-A 619780900 QAM256
-A 625781200 QAM256
-A 631781500 QAM256
-A 637781800 QAM256
-A 643782100 QAM256
-A 91754500 QAM256
-A 97754800 QAM256
-A 103755100 QAM256
-A 109775000 QAM256
-A 115775000 QAM256
-#100
-A 649782400 QAM256
-A 655782700 QAM256
-A 661783000 QAM256
-A 667783300 QAM256
-A 673783600 QAM256
-A 679783900 QAM256
-A 685784200 QAM256
-A 691784500 QAM256
-A 697784800 QAM256
-A 703785100 QAM256
-#110
-A 709785400 QAM256
-A 715785700 QAM256
-A 721786000 QAM256
-A 727786300 QAM256
-A 733786600 QAM256
-A 739786900 QAM256
-A 745787200 QAM256
-A 751787500 QAM256
-A 757787800 QAM256
-A 763788100 QAM256
-#120
-A 769788400 QAM256
-A 775788700 QAM256
-A 781789000 QAM256
-A 787789300 QAM256
-A 793789600 QAM256
-A 799789900 QAM256
diff --git a/tools/scan_modified/scan/atsc/us-Cable-EIA-542-IRC-center_frequencies-QAM256 b/tools/scan_modified/scan/atsc/us-Cable-EIA-542-IRC-center_frequencies-QAM256
deleted file mode 100644
index f18d5e5..0000000
--- a/tools/scan_modified/scan/atsc/us-Cable-EIA-542-IRC-center_frequencies-QAM256
+++ /dev/null
@@ -1,142 +0,0 @@
-# US Cable EIA-542 center frequencies
-# Incrementally Related Carriers (IRC)
-# Channels 1-125 are in ascending EIA/NCTA channel designation order
-
-#1
-A 75012500 QAM256
-A 57025000 QAM256
-A 63012500 QAM256
-A 69012500 QAM256
-A 79012500 QAM256
-A 85012500 QAM256
-A 177012500 QAM256
-A 183012500 QAM256
-A 189012500 QAM256
-#10
-A 195012500 QAM256
-A 201012500 QAM256
-A 207012500 QAM256
-A 213012500 QAM256
-A 123012500 QAM256
-A 129012500 QAM256
-A 135012500 QAM256
-A 141012500 QAM256
-A 147012500 QAM256
-A 153012500 QAM256
-#20
-A 159012500 QAM256
-A 165012500 QAM256
-A 171012500 QAM256
-A 219012500 QAM256
-A 225012500 QAM256
-A 231012500 QAM256
-A 237012500 QAM256
-A 243012500 QAM256
-A 249012500 QAM256
-A 255012500 QAM256
-#30
-A 261012500 QAM256
-A 267012500 QAM256
-A 273012500 QAM256
-A 279012500 QAM256
-A 285012500 QAM256
-A 291012500 QAM256
-A 297012500 QAM256
-A 303012500 QAM256
-A 309012500 QAM256
-A 315012500 QAM256
-#40
-A 321012500 QAM256
-A 327012500 QAM256
-A 333025000 QAM256
-A 339012500 QAM256
-A 345012500 QAM256
-A 351012500 QAM256
-A 357012500 QAM256
-A 363012500 QAM256
-A 369012500 QAM256
-A 375012500 QAM256
-#50
-A 381012500 QAM256
-A 387012500 QAM256
-A 393012500 QAM256
-A 399012500 QAM256
-A 405012500 QAM256
-A 411012500 QAM256
-A 417012500 QAM256
-A 423012500 QAM256
-A 429012500 QAM256
-A 435012500 QAM256
-#60
-A 441012500 QAM256
-A 447012500 QAM256
-A 453012500 QAM256
-A 459012500 QAM256
-A 465012500 QAM256
-A 471012500 QAM256
-A 477012500 QAM256
-A 483012500 QAM256
-A 489012500 QAM256
-A 495012500 QAM256
-#70
-A 501012500 QAM256
-A 507012500 QAM256
-A 513012500 QAM256
-A 519012500 QAM256
-A 525012500 QAM256
-A 531012500 QAM256
-A 537012500 QAM256
-A 543012500 QAM256
-A 549012500 QAM256
-A 555012500 QAM256
-#80
-A 561012500 QAM256
-A 567012500 QAM256
-A 573012500 QAM256
-A 579012500 QAM256
-A 585012500 QAM256
-A 591012500 QAM256
-A 597012500 QAM256
-A 603012500 QAM256
-A 609012500 QAM256
-A 615012500 QAM256
-#90
-A 621012500 QAM256
-A 627012500 QAM256
-A 633012500 QAM256
-A 639012500 QAM256
-A 645012500 QAM256
-A 93012500 QAM256
-A 99012500 QAM256
-A 105012500 QAM256
-A 111012500 QAM256
-A 117012500 QAM256
-#100
-A 651012500 QAM256
-A 657012500 QAM256
-A 663012500 QAM256
-A 669012500 QAM256
-A 675012500 QAM256
-A 681012500 QAM256
-A 687012500 QAM256
-A 693012500 QAM256
-A 699012500 QAM256
-A 705012500 QAM256
-#110
-A 711012500 QAM256
-A 717012500 QAM256
-A 723012500 QAM256
-A 729012500 QAM256
-A 735012500 QAM256
-A 741012500 QAM256
-A 747012500 QAM256
-A 753012500 QAM256
-A 759012500 QAM256
-A 765012500 QAM256
-#120
-A 771012500 QAM256
-A 777012500 QAM256
-A 783012500 QAM256
-A 789012500 QAM256
-A 795012500 QAM256
-A 801012500 QAM256
diff --git a/tools/scan_modified/scan/atsc/us-Cable-HRC-center-frequencies-QAM256 b/tools/scan_modified/scan/atsc/us-Cable-HRC-center-frequencies-QAM256
deleted file mode 100644
index 2bc3838..0000000
--- a/tools/scan_modified/scan/atsc/us-Cable-HRC-center-frequencies-QAM256
+++ /dev/null
@@ -1,142 +0,0 @@
-# US Cable center frequencies
-# Harmonically Related Carriers (HRC)
-# Channels are in ascending EIA/NCTA channel designation order
-
-#1
-A 73753600 QAM256
-A 55752700 QAM256
-A 61753000 QAM256
-A 67753300 QAM256
-A 77753900 QAM256
-A 83754200 QAM256
-A 175758700 QAM256
-A 181759000 QAM256
-A 187759300 QAM256
-#10
-A 193759600 QAM256
-A 199759900 QAM256
-A 205760200 QAM256
-A 211760500 QAM256
-A 121756000 QAM256
-A 127756300 QAM256
-A 133756600 QAM256
-A 139756900 QAM256
-A 145757200 QAM256
-A 151757500 QAM256
-#20
-A 157757800 QAM256
-A 163758100 QAM256
-A 169758400 QAM256
-A 217760800 QAM256
-A 223761100 QAM256
-A 229761400 QAM256
-A 235761700 QAM256
-A 241762000 QAM256
-A 247762300 QAM256
-A 253762600 QAM256
-#30
-A 259762900 QAM256
-A 265763200 QAM256
-A 271763500 QAM256
-A 277763800 QAM256
-A 283764100 QAM256
-A 289764400 QAM256
-A 295764700 QAM256
-A 301765000 QAM256
-A 307765300 QAM256
-A 313765600 QAM256
-#40
-A 319765900 QAM256
-A 325766200 QAM256
-A 331766500 QAM256
-A 337766800 QAM256
-A 343767100 QAM256
-A 349767400 QAM256
-A 355767700 QAM256
-A 361768000 QAM256
-A 367768300 QAM256
-A 373768600 QAM256
-#50
-A 379768900 QAM256
-A 385769200 QAM256
-A 391769500 QAM256
-A 397769800 QAM256
-A 403770100 QAM256
-A 409770400 QAM256
-A 415770700 QAM256
-A 421771000 QAM256
-A 427771300 QAM256
-A 433771600 QAM256
-#60
-A 439771900 QAM256
-A 445772200 QAM256
-A 451772500 QAM256
-A 457772800 QAM256
-A 463773100 QAM256
-A 469773400 QAM256
-A 475773700 QAM256
-A 481774000 QAM256
-A 487774300 QAM256
-A 493774600 QAM256
-#70
-A 499774900 QAM256
-A 505775200 QAM256
-A 511775500 QAM256
-A 517775800 QAM256
-A 523776100 QAM256
-A 529776400 QAM256
-A 535776700 QAM256
-A 541777000 QAM256
-A 547777300 QAM256
-A 553777600 QAM256
-#80
-A 559777900 QAM256
-A 565778200 QAM256
-A 571778500 QAM256
-A 577778800 QAM256
-A 583779100 QAM256
-A 589779400 QAM256
-A 595779700 QAM256
-A 601780000 QAM256
-A 607780300 QAM256
-A 613780600 QAM256
-#90
-A 619780900 QAM256
-A 625781200 QAM256
-A 631781500 QAM256
-A 637781800 QAM256
-A 643782100 QAM256
-A 91754500 QAM256
-A 97754800 QAM256
-A 103755100 QAM256
-A 109755400 QAM256
-A 115755700 QAM256
-#100
-A 649782400 QAM256
-A 655782700 QAM256
-A 661783000 QAM256
-A 667783300 QAM256
-A 673783600 QAM256
-A 679783900 QAM256
-A 685784200 QAM256
-A 691784500 QAM256
-A 697784800 QAM256
-A 703785100 QAM256
-#110
-A 709785400 QAM256
-A 715785700 QAM256
-A 721786000 QAM256
-A 727786300 QAM256
-A 733786600 QAM256
-A 739786900 QAM256
-A 745787200 QAM256
-A 751787500 QAM256
-A 757787800 QAM256
-A 763788100 QAM256
-#120
-A 769788400 QAM256
-A 775788700 QAM256
-A 781789000 QAM256
-A 787789300 QAM256
-A 793789600 QAM256
-A 799789900 QAM256
diff --git a/tools/scan_modified/scan/atsc/us-Cable-IRC-center-frequencies-QAM256 b/tools/scan_modified/scan/atsc/us-Cable-IRC-center-frequencies-QAM256
deleted file mode 100644
index 72842e0..0000000
--- a/tools/scan_modified/scan/atsc/us-Cable-IRC-center-frequencies-QAM256
+++ /dev/null
@@ -1,142 +0,0 @@
-# US Cable center frequencies
-# Incrementally Related Carriers (IRC)
-# Channels are in ascending EIA/NCTA channel designation order
-
-#1
-A 75000000 QAM256
-A 57000000 QAM256
-A 63000000 QAM256
-A 69000000 QAM256
-A 79000000 QAM256
-A 85000000 QAM256
-A 177000000 QAM256
-A 183000000 QAM256
-A 189000000 QAM256
-#10
-A 195000000 QAM256
-A 201000000 QAM256
-A 207000000 QAM256
-A 213000000 QAM256
-A 123000000 QAM256
-A 129000000 QAM256
-A 135000000 QAM256
-A 141000000 QAM256
-A 147000000 QAM256
-A 153000000 QAM256
-#20
-A 159000000 QAM256
-A 165000000 QAM256
-A 171000000 QAM256
-A 219000000 QAM256
-A 225000000 QAM256
-A 231000000 QAM256
-A 237000000 QAM256
-A 243000000 QAM256
-A 249000000 QAM256
-A 255000000 QAM256
-#30
-A 261000000 QAM256
-A 267000000 QAM256
-A 273000000 QAM256
-A 279000000 QAM256
-A 285000000 QAM256
-A 291000000 QAM256
-A 297000000 QAM256
-A 303000000 QAM256
-A 309000000 QAM256
-A 315000000 QAM256
-#40
-A 321000000 QAM256
-A 327000000 QAM256
-A 333000000 QAM256
-A 339000000 QAM256
-A 345000000 QAM256
-A 351000000 QAM256
-A 357000000 QAM256
-A 363000000 QAM256
-A 369000000 QAM256
-A 375000000 QAM256
-#50
-A 381000000 QAM256
-A 387000000 QAM256
-A 393000000 QAM256
-A 399000000 QAM256
-A 405000000 QAM256
-A 411000000 QAM256
-A 417000000 QAM256
-A 423000000 QAM256
-A 429000000 QAM256
-A 435000000 QAM256
-#60
-A 441000000 QAM256
-A 447000000 QAM256
-A 453000000 QAM256
-A 459000000 QAM256
-A 465000000 QAM256
-A 471000000 QAM256
-A 477000000 QAM256
-A 483000000 QAM256
-A 489000000 QAM256
-A 495000000 QAM256
-#70
-A 501000000 QAM256
-A 507000000 QAM256
-A 513000000 QAM256
-A 519000000 QAM256
-A 525000000 QAM256
-A 531000000 QAM256
-A 537000000 QAM256
-A 543000000 QAM256
-A 549000000 QAM256
-A 555000000 QAM256
-#80
-A 561000000 QAM256
-A 567000000 QAM256
-A 573000000 QAM256
-A 579000000 QAM256
-A 585000000 QAM256
-A 591000000 QAM256
-A 597000000 QAM256
-A 603000000 QAM256
-A 609000000 QAM256
-A 615000000 QAM256
-#90
-A 621000000 QAM256
-A 627000000 QAM256
-A 633000000 QAM256
-A 639000000 QAM256
-A 645000000 QAM256
-A 93000000 QAM256
-A 99000000 QAM256
-A 105000000 QAM256
-A 111000000 QAM256
-A 117000000 QAM256
-#100
-A 651000000 QAM256
-A 657000000 QAM256
-A 663000000 QAM256
-A 669000000 QAM256
-A 675000000 QAM256
-A 681000000 QAM256
-A 687000000 QAM256
-A 693000000 QAM256
-A 699000000 QAM256
-A 705000000 QAM256
-#110
-A 711000000 QAM256
-A 717000000 QAM256
-A 723000000 QAM256
-A 729000000 QAM256
-A 735000000 QAM256
-A 741000000 QAM256
-A 747000000 QAM256
-A 753000000 QAM256
-A 759000000 QAM256
-A 765000000 QAM256
-#120
-A 771000000 QAM256
-A 777000000 QAM256
-A 783000000 QAM256
-A 789000000 QAM256
-A 795000000 QAM256
-A 801000000 QAM256
diff --git a/tools/scan_modified/scan/atsc/us-Cable-Standard-center-frequencies-QAM256 b/tools/scan_modified/scan/atsc/us-Cable-Standard-center-frequencies-QAM256
deleted file mode 100644
index 4367e7a..0000000
--- a/tools/scan_modified/scan/atsc/us-Cable-Standard-center-frequencies-QAM256
+++ /dev/null
@@ -1,140 +0,0 @@
-# US EIA/NCTA Standard Cable center frequencies
-# Channels are in ascending EIA/NCTA channel designation order
-
-#2
-A 57000000 QAM256
-A 63000000 QAM256
-A 69000000 QAM256
-A 79000000 QAM256
-A 85000000 QAM256
-A 177000000 QAM256
-A 183000000 QAM256
-A 189000000 QAM256
-#10
-A 195000000 QAM256
-A 201000000 QAM256
-A 207000000 QAM256
-A 213000000 QAM256
-A 123012500 QAM256
-A 129012500 QAM256
-A 135012500 QAM256
-A 141000000 QAM256
-A 147000000 QAM256
-A 153000000 QAM256
-#20
-A 159000000 QAM256
-A 165000000 QAM256
-A 171000000 QAM256
-A 219000000 QAM256
-A 225000000 QAM256
-A 231012500 QAM256
-A 237012500 QAM256
-A 243012500 QAM256
-A 249012500 QAM256
-A 255012500 QAM256
-#30
-A 261012500 QAM256
-A 267012500 QAM256
-A 273012500 QAM256
-A 279012500 QAM256
-A 285012500 QAM256
-A 291012500 QAM256
-A 297012500 QAM256
-A 303012500 QAM256
-A 309012500 QAM256
-A 315012500 QAM256
-#40
-A 321012500 QAM256
-A 327012500 QAM256
-A 333025000 QAM256
-A 339012500 QAM256
-A 345012500 QAM256
-A 351012500 QAM256
-A 357012500 QAM256
-A 363012500 QAM256
-A 369012500 QAM256
-A 375012500 QAM256
-#50
-A 381012500 QAM256
-A 387012500 QAM256
-A 393012500 QAM256
-A 399012500 QAM256
-A 405000000 QAM256
-A 411000000 QAM256
-A 417000000 QAM256
-A 423000000 QAM256
-A 429000000 QAM256
-A 435000000 QAM256
-#60
-A 441000000 QAM256
-A 447000000 QAM256
-A 453000000 QAM256
-A 459000000 QAM256
-A 465000000 QAM256
-A 471000000 QAM256
-A 477000000 QAM256
-A 483000000 QAM256
-A 489000000 QAM256
-A 495000000 QAM256
-#70
-A 501000000 QAM256
-A 507000000 QAM256
-A 513000000 QAM256
-A 519000000 QAM256
-A 525000000 QAM256
-A 531000000 QAM256
-A 537000000 QAM256
-A 543000000 QAM256
-A 549000000 QAM256
-A 555000000 QAM256
-#80
-A 561000000 QAM256
-A 567000000 QAM256
-A 573000000 QAM256
-A 579000000 QAM256
-A 585000000 QAM256
-A 591000000 QAM256
-A 597000000 QAM256
-A 603000000 QAM256
-A 609000000 QAM256
-A 615000000 QAM256
-#90
-A 621000000 QAM256
-A 627000000 QAM256
-A 633000000 QAM256
-A 639000000 QAM256
-A 645000000 QAM256
-A 93000000 QAM256
-A 99000000 QAM256
-A 105000000 QAM256
-A 111025000 QAM256
-A 117025000 QAM256
-#100
-A 651000000 QAM256
-A 657000000 QAM256
-A 663000000 QAM256
-A 669000000 QAM256
-A 675000000 QAM256
-A 681000000 QAM256
-A 687000000 QAM256
-A 693000000 QAM256
-A 699000000 QAM256
-A 705000000 QAM256
-#110
-A 711000000 QAM256
-A 717000000 QAM256
-A 723000000 QAM256
-A 729000000 QAM256
-A 735000000 QAM256
-A 741000000 QAM256
-A 747000000 QAM256
-A 753000000 QAM256
-A 759000000 QAM256
-A 765000000 QAM256
-#120
-A 771000000 QAM256
-A 777000000 QAM256
-A 783000000 QAM256
-A 789000000 QAM256
-A 795000000 QAM256
-A 801000000 QAM256
diff --git a/tools/scan_modified/scan/atsc/us-ID-Boise b/tools/scan_modified/scan/atsc/us-ID-Boise
deleted file mode 100644
index 9fe7cd2..0000000
--- a/tools/scan_modified/scan/atsc/us-ID-Boise
+++ /dev/null
@@ -1,8 +0,0 @@
-# Boise, ID, USA
-# A freq mod
-A 195000000 8VSB
-A 213000000 8VSB
-A 515000000 8VSB
-A 533000000 8VSB
-A 545000000 8VSB
-A 557000000 8VSB
diff --git a/tools/scan_modified/scan/atsc/us-MA-Boston b/tools/scan_modified/scan/atsc/us-MA-Boston
deleted file mode 100644
index 05f170a..0000000
--- a/tools/scan_modified/scan/atsc/us-MA-Boston
+++ /dev/null
@@ -1,13 +0,0 @@
-# initial tuning data for Boston, MA
-
-A 503000000 8VSB
-A 509000000 8VSB
-A 527000000 8VSB
-A 563000000 8VSB
-A 569000000 8VSB
-A 575000000 8VSB
-A 581000000 8VSB
-A 623000000 8VSB
-A 635000000 8VSB
-A 641000000 8VSB
-A 647000000 8VSB
diff --git a/tools/scan_modified/scan/atsc/us-MI-Lansing b/tools/scan_modified/scan/atsc/us-MI-Lansing
deleted file mode 100644
index 167555f..0000000
--- a/tools/scan_modified/scan/atsc/us-MI-Lansing
+++ /dev/null
@@ -1,7 +0,0 @@
-# initial tuning data for Lansing, MI
-
-A 617000000 8VSB
-A 695000000 8VSB
-A 719000000 8VSB
-A 731000000 8VSB
-A 743000000 8VSB
diff --git a/tools/scan_modified/scan/atsc/us-NTSC-center-frequencies-8VSB b/tools/scan_modified/scan/atsc/us-NTSC-center-frequencies-8VSB
deleted file mode 100644
index d21f9ae..0000000
--- a/tools/scan_modified/scan/atsc/us-NTSC-center-frequencies-8VSB
+++ /dev/null
@@ -1,71 +0,0 @@
-# US NTSC center frequencies, use if in doubt
-
-A 57000000 8VSB
-A 63000000 8VSB
-A 69000000 8VSB
-A 79000000 8VSB
-A 85000000 8VSB
-A 177000000 8VSB
-A 183000000 8VSB
-A 189000000 8VSB
-A 195000000 8VSB
-A 201000000 8VSB
-A 207000000 8VSB
-A 213000000 8VSB
-A 473000000 8VSB
-A 479000000 8VSB
-A 485000000 8VSB
-A 491000000 8VSB
-A 497000000 8VSB
-A 503000000 8VSB
-A 509000000 8VSB
-A 515000000 8VSB
-A 521000000 8VSB
-A 527000000 8VSB
-A 533000000 8VSB
-A 539000000 8VSB
-A 545000000 8VSB
-A 551000000 8VSB
-A 557000000 8VSB
-A 563000000 8VSB
-A 569000000 8VSB
-A 575000000 8VSB
-A 581000000 8VSB
-A 587000000 8VSB
-A 593000000 8VSB
-A 599000000 8VSB
-A 605000000 8VSB
-A 611000000 8VSB
-A 617000000 8VSB
-A 623000000 8VSB
-A 629000000 8VSB
-A 635000000 8VSB
-A 641000000 8VSB
-A 647000000 8VSB
-A 653000000 8VSB
-A 659000000 8VSB
-A 665000000 8VSB
-A 671000000 8VSB
-A 677000000 8VSB
-A 683000000 8VSB
-A 689000000 8VSB
-A 695000000 8VSB
-A 701000000 8VSB
-A 707000000 8VSB
-A 713000000 8VSB
-A 719000000 8VSB
-A 725000000 8VSB
-A 731000000 8VSB
-A 737000000 8VSB
-A 743000000 8VSB
-A 749000000 8VSB
-A 755000000 8VSB
-A 761000000 8VSB
-A 767000000 8VSB
-A 773000000 8VSB
-A 779000000 8VSB
-A 785000000 8VSB
-A 791000000 8VSB
-A 797000000 8VSB
-A 803000000 8VSB
-
diff --git a/tools/scan_modified/scan/atsc/us-NY-TWC-NYC b/tools/scan_modified/scan/atsc/us-NY-TWC-NYC
deleted file mode 100644
index 0ad6e48..0000000
--- a/tools/scan_modified/scan/atsc/us-NY-TWC-NYC
+++ /dev/null
@@ -1,53 +0,0 @@
-#initial tuning data for Time Warner Cable in New York City
-
-#80
-A 561000000 QAM256
-A 567000000 QAM256
-A 573000000 QAM256
-A 579000000 QAM256
-A 585000000 QAM256
-A 591000000 QAM256
-A 597000000 QAM256
-A 603000000 QAM256
-A 609000000 QAM256
-A 615000000 QAM256
-#90
-A 621000000 QAM256
-A 627000000 QAM256
-A 633000000 QAM256
-A 639000000 QAM256
-A 645000000 QAM256
-A 93000000 QAM256
-A 99000000 QAM256
-A 105000000 QAM256
-A 111025000 QAM256
-A 117025000 QAM256
-#100
-A 651000000 QAM256
-A 657000000 QAM256
-A 663000000 QAM256
-A 669000000 QAM256
-A 675000000 QAM256
-A 681000000 QAM256
-A 687000000 QAM256
-A 693000000 QAM256
-A 699000000 QAM256
-A 705000000 QAM256
-#110
-A 711000000 QAM256
-A 717000000 QAM256
-A 723000000 QAM256
-A 729000000 QAM256
-A 735000000 QAM256
-A 741000000 QAM256
-A 747000000 QAM256
-A 753000000 QAM256
-A 759000000 QAM256
-A 765000000 QAM256
-#120
-A 771000000 QAM256
-A 777000000 QAM256
-A 783000000 QAM256
-A 789000000 QAM256
-A 795000000 QAM256
-A 801000000 QAM256
diff --git a/tools/scan_modified/scan/atsc/us-PA-Philadelphia b/tools/scan_modified/scan/atsc/us-PA-Philadelphia
deleted file mode 100644
index eea9685..0000000
--- a/tools/scan_modified/scan/atsc/us-PA-Philadelphia
+++ /dev/null
@@ -1,16 +0,0 @@
-# US NY state
-
-#A 183000000 8VSB
-#A 515000000 8VSB
-#A 545000000 8VSB
-#A 551000000 8VSB
-A 575000000 8VSB
-A 581000000 8VSB
-A 593000000 8VSB
-#A 641000000 8VSB
-A 647000000 8VSB
-A 713000000 8VSB
-#A 719000000 8VSB
-A 773000000 8VSB
-A 785000000 8VSB
-A 791000000 8VSB
diff --git a/tools/scan_modified/scan/atsc_psip_section.c b/tools/scan_modified/scan/atsc_psip_section.c
deleted file mode 100644
index 0c50014..0000000
--- a/tools/scan_modified/scan/atsc_psip_section.c
+++ /dev/null
@@ -1,62 +0,0 @@
-#include "atsc_psip_section.h"
-
-struct ATSC_extended_channel_name_descriptor read_ATSC_extended_channel_name_descriptor(const u8 *b)
-{
- struct ATSC_extended_channel_name_descriptor v;
- v.descriptor_tag = getBits(b, 0, 8);
- v.descriptor_length = getBits(b, 8, 8);
- v.TODO = getBits(b, 16, 1);
- return v;
-}
-
-struct ATSC_service_location_descriptor read_ATSC_service_location_descriptor(const u8 *b)
-{
- struct ATSC_service_location_descriptor v;
- v.descriptor_tag = getBits(b, 0, 8);
- v.descriptor_length = getBits(b, 8, 8);
- v.reserved = getBits(b, 16, 3);
- v.PCR_PID = getBits(b, 19,13);
- v.number_elements = getBits(b, 32, 8);
- return v;
-}
-
-struct ATSC_service_location_element read_ATSC_service_location_element(const u8 *b)
-{
- struct ATSC_service_location_element v;
- v.stream_type = getBits(b, 0, 8);
- v.reserved = getBits(b, 8, 3);
- v.elementary_PID = getBits(b, 11,13);
- v.ISO_639_language_code = getBits(b, 24,24);
- return v;
-}
-
-struct tvct_channel read_tvct_channel(const u8 *b)
-{
- struct tvct_channel v;
- v.short_name0 = getBits(b, 0,16);
- v.short_name1 = getBits(b, 16,16);
- v.short_name2 = getBits(b, 32,16);
- v.short_name3 = getBits(b, 48,16);
- v.short_name4 = getBits(b, 64,16);
- v.short_name5 = getBits(b, 80,16);
- v.short_name6 = getBits(b, 96,16);
- v.reserved0 = getBits(b,112, 4);
- v.major_channel_number = getBits(b,116,10);
- v.minor_channel_number = getBits(b,126,10);
- v.modulation_mode = getBits(b,136, 8);
- v.carrier_frequency = getBits(b,144,32);
- v.channel_TSID = getBits(b,176,16);
- v.program_number = getBits(b,192,16);
- v.ETM_location = getBits(b,208, 2);
- v.access_controlled = getBits(b,210, 1);
- v.hidden = getBits(b,211, 1);
- v.reserved1 = getBits(b,212, 2);
- v.hide_guide = getBits(b,214, 1);
- v.reserved2 = getBits(b,215, 3);
- v.service_type = getBits(b,218, 6);
- v.source_id = getBits(b,224,16);
- v.reserved3 = getBits(b,240, 6);
- v.descriptors_length = getBits(b,246,10);
- return v;
-}
-
diff --git a/tools/scan_modified/scan/atsc_psip_section.h b/tools/scan_modified/scan/atsc_psip_section.h
deleted file mode 100644
index c76bce7..0000000
--- a/tools/scan_modified/scan/atsc_psip_section.h
+++ /dev/null
@@ -1,60 +0,0 @@
-#ifndef __ATSC_PSIP_SECTION_H_
-#define __ATSC_PSIP_SECTION_H_
-
-#include "section.h"
-
-#define ATSC_EXTENDED_CHANNEL_NAME_DESCRIPTOR_ID 0xA0
-struct ATSC_extended_channel_name_descriptor {
- u8 descriptor_tag : 8;
- u8 descriptor_length : 8;
- u8 TODO : 1;
-} PACKED;
-struct ATSC_extended_channel_name_descriptor read_ATSC_extended_channel_name_descriptor(const u8 *);
-
-#define ATSC_SERVICE_LOCATION_DESCRIPTOR_ID 0xA1
-struct ATSC_service_location_descriptor {
- u8 descriptor_tag : 8;
- u8 descriptor_length : 8;
- u8 reserved : 3;
- u16 PCR_PID :13;
- u8 number_elements : 8;
-} PACKED;
-struct ATSC_service_location_descriptor read_ATSC_service_location_descriptor(const u8 *);
-
-struct ATSC_service_location_element {
- u8 stream_type : 8;
- u8 reserved : 3;
- u16 elementary_PID :13;
- u32 ISO_639_language_code :24;
-} PACKED;
-struct ATSC_service_location_element read_ATSC_service_location_element(const u8 *);
-
-struct tvct_channel {
- u16 short_name0 :16;
- u16 short_name1 :16;
- u16 short_name2 :16;
- u16 short_name3 :16;
- u16 short_name4 :16;
- u16 short_name5 :16;
- u16 short_name6 :16;
- u8 reserved0 : 4;
- u16 major_channel_number :10;
- u16 minor_channel_number :10;
- u8 modulation_mode : 8;
- u32 carrier_frequency :32;
- u16 channel_TSID :16;
- u16 program_number :16;
- u8 ETM_location : 2;
- u8 access_controlled : 1;
- u8 hidden : 1;
- u8 reserved1 : 2;
- u8 hide_guide : 1;
- u8 reserved2 : 3;
- u8 service_type : 6;
- u16 source_id :16;
- u8 reserved3 : 6;
- u16 descriptors_length :10;
-} PACKED;
-struct tvct_channel read_tvct_channel(const u8 *);
-
-#endif
diff --git a/tools/scan_modified/scan/diseqc.c b/tools/scan_modified/scan/diseqc.c
deleted file mode 100644
index a337e0a..0000000
--- a/tools/scan_modified/scan/diseqc.c
+++ /dev/null
@@ -1,108 +0,0 @@
-#include <linux/dvb/frontend.h>
-#include <sys/ioctl.h>
-#include <time.h>
-
-#include "scan.h"
-#include "diseqc.h"
-
-
-struct diseqc_cmd switch_cmds[] = {
- { { { 0xe0, 0x10, 0x38, 0xf0, 0x00, 0x00 }, 4 }, 0 },
- { { { 0xe0, 0x10, 0x38, 0xf2, 0x00, 0x00 }, 4 }, 0 },
- { { { 0xe0, 0x10, 0x38, 0xf1, 0x00, 0x00 }, 4 }, 0 },
- { { { 0xe0, 0x10, 0x38, 0xf3, 0x00, 0x00 }, 4 }, 0 },
- { { { 0xe0, 0x10, 0x38, 0xf4, 0x00, 0x00 }, 4 }, 0 },
- { { { 0xe0, 0x10, 0x38, 0xf6, 0x00, 0x00 }, 4 }, 0 },
- { { { 0xe0, 0x10, 0x38, 0xf5, 0x00, 0x00 }, 4 }, 0 },
- { { { 0xe0, 0x10, 0x38, 0xf7, 0x00, 0x00 }, 4 }, 0 },
- { { { 0xe0, 0x10, 0x38, 0xf8, 0x00, 0x00 }, 4 }, 0 },
- { { { 0xe0, 0x10, 0x38, 0xfa, 0x00, 0x00 }, 4 }, 0 },
- { { { 0xe0, 0x10, 0x38, 0xf9, 0x00, 0x00 }, 4 }, 0 },
- { { { 0xe0, 0x10, 0x38, 0xfb, 0x00, 0x00 }, 4 }, 0 },
- { { { 0xe0, 0x10, 0x38, 0xfc, 0x00, 0x00 }, 4 }, 0 },
- { { { 0xe0, 0x10, 0x38, 0xfe, 0x00, 0x00 }, 4 }, 0 },
- { { { 0xe0, 0x10, 0x38, 0xfd, 0x00, 0x00 }, 4 }, 0 },
- { { { 0xe0, 0x10, 0x38, 0xff, 0x00, 0x00 }, 4 }, 0 }
-};
-
-
-/*--------------------------------------------------------------------------*/
-
-static inline
-void msleep(uint32_t msec)
-{
- struct timespec req = { msec / 1000, 1000000 * (msec % 1000) };
-
- while (nanosleep(&req, &req))
- ;
-}
-
-#define printf(x...)
-
-
-int diseqc_send_msg (int fd, fe_sec_voltage_t v, struct diseqc_cmd **cmd,
- fe_sec_tone_mode_t t, fe_sec_mini_cmd_t b)
-{
- int err;
-
- if ((err = ioctl(fd, FE_SET_TONE, SEC_TONE_OFF)))
- return err;
-
- if ((err = ioctl(fd, FE_SET_VOLTAGE, v)))
- return err;
-
- msleep(15);
- while (*cmd) {
- debug("DiSEqC: %02x %02x %02x %02x %02x %02x\n",
- (*cmd)->cmd.msg[0], (*cmd)->cmd.msg[1],
- (*cmd)->cmd.msg[2], (*cmd)->cmd.msg[3],
- (*cmd)->cmd.msg[4], (*cmd)->cmd.msg[5]);
-
- if ((err = ioctl(fd, FE_DISEQC_SEND_MASTER_CMD, &(*cmd)->cmd)))
- return err;
-
- msleep((*cmd)->wait);
- cmd++;
- }
-
- //debug(" %s ", v == SEC_VOLTAGE_13 ? "SEC_VOLTAGE_13" :
- // v == SEC_VOLTAGE_18 ? "SEC_VOLTAGE_18" : "???");
-
- //debug(" %s ", b == SEC_MINI_A ? "SEC_MINI_A" :
- // b == SEC_MINI_B ? "SEC_MINI_B" : "???");
-
- //debug(" %s\n", t == SEC_TONE_ON ? "SEC_TONE_ON" :
- // t == SEC_TONE_OFF ? "SEC_TONE_OFF" : "???");
-
- msleep(15);
-
- if ((err = ioctl(fd, FE_DISEQC_SEND_BURST, b)))
- return err;
-
- msleep(15);
-
- return ioctl(fd, FE_SET_TONE, t);
-}
-
-
-int setup_switch (int frontend_fd, int switch_pos, int voltage_18, int hiband)
-{
- struct diseqc_cmd *cmd[2] = { NULL, NULL };
- int i = 4 * switch_pos + 2 * hiband + (voltage_18 ? 1 : 0);
-
- verbose("DiSEqC: switch pos %i, %sV, %sband (index %d)\n",
- switch_pos, voltage_18 ? "18" : "13", hiband ? "hi" : "lo", i);
-
- if (i < 0 || i >= (int) (sizeof(switch_cmds)/sizeof(struct diseqc_cmd)))
- return -EINVAL;
-
- cmd[0] = &switch_cmds[i];
-
- return diseqc_send_msg (frontend_fd,
- i % 2 ? SEC_VOLTAGE_18 : SEC_VOLTAGE_13,
- cmd,
- (i/2) % 2 ? SEC_TONE_ON : SEC_TONE_OFF,
- (i/4) % 2 ? SEC_MINI_B : SEC_MINI_A);
-}
-
-
diff --git a/tools/scan_modified/scan/diseqc.h b/tools/scan_modified/scan/diseqc.h
deleted file mode 100644
index d44d99b..0000000
--- a/tools/scan_modified/scan/diseqc.h
+++ /dev/null
@@ -1,25 +0,0 @@
-#ifndef __DISEQC_H__
-#define __DISEQC_H__
-
-#include <stdint.h>
-#include <linux/dvb/frontend.h>
-
-
-struct diseqc_cmd {
- struct dvb_diseqc_master_cmd cmd;
- uint32_t wait;
-};
-
-
-extern int diseqc_send_msg (int fd, fe_sec_voltage_t v, struct diseqc_cmd **cmd,
- fe_sec_tone_mode_t t, fe_sec_mini_cmd_t b);
-
-
-/**
- * set up the switch to position/voltage/tone
- */
-extern int setup_switch (int frontend_fd, int switch_pos, int voltage_18, int freq);
-
-
-#endif
-
diff --git a/tools/scan_modified/scan/dump-mumudvb.c b/tools/scan_modified/scan/dump-mumudvb.c
deleted file mode 100644
index 2fe3de8..0000000
--- a/tools/scan_modified/scan/dump-mumudvb.c
+++ /dev/null
@@ -1,206 +0,0 @@
-#include <stdio.h>
-#include "dump-mumudvb.h"
-#include <linux/dvb/frontend.h>
-
-
-static const char *inv_name [] = {
- "0",
- "1",
- "999"
-};
-
-static const char *fec_name [] = {
- "0",
- "12",
- "23",
- "34",
- "45",
- "56",
- "67",
- "78",
- "89",
- "999"
-};
-
-static const char *qam_name [] = {
- "0",
- "16",
- "32",
- "64",
- "128",
- "256",
- "999"
-};
-
-
-static const char *bw_name [] = {
- "8",
- "7",
- "6",
- "999"
-};
-
-
-static const char *mode_name [] = {
- "2",
- "8",
- "999"
-};
-
-static const char *guard_name [] = {
- "32",
- "16",
- "8",
- "4",
- "999"
-};
-
-
-static const char *hierarchy_name [] = {
- "0",
- "1",
- "2",
- "4",
- "999"
-};
-
-static const char *west_east_flag_name [] = {
- "W",
- "E"
-};
-
-void mumudvb_dump_dvb_parameters (FILE *f, fe_type_t type,
- struct dvb_frontend_parameters *p,
- char polarity, int orbital_pos, int we_flag)
-{
-
- switch (type) {
- case FE_QPSK:
- fprintf (f, "#QPSK Modulation : DVB-S. Satellite : S%i.%i%s\n", orbital_pos/10,
- orbital_pos % 10, west_east_flag_name[we_flag]);
- fprintf (f, "freq=%i\n", p->frequency / 1000);
- fprintf (f, "pol=%c\n", polarity);
- fprintf (f, "srate=%i\n", p->u.qpsk.symbol_rate / 1000);
- break;
-
- case FE_QAM:
- fprintf (f, "#QAM Modulation : Probably DVB-C ---------- Not Tested ----------- \n");
- fprintf (f, "%i:", p->frequency / 1000000);
- fprintf (f, "M%s:C:", qam_name[p->u.qam.modulation]);
- fprintf (f, "%i:", p->u.qam.symbol_rate / 1000);
- break;
-
- case FE_OFDM:
- fprintf (f, "#OFDM Modulation : DVB-T\n");
- fprintf (f, "#QAM : %s ", qam_name[p->u.ofdm.constellation]);
- fprintf (f, "Inversion : %s ", inv_name[p->inversion]);
- fprintf (f, "Coderate HP : %s ", fec_name[p->u.ofdm.code_rate_HP]);
- fprintf (f, "Coderate LP : %s ", fec_name[p->u.ofdm.code_rate_LP]);
- fprintf (f, "Guard interval : %s ", guard_name[p->u.ofdm.guard_interval]);
- fprintf (f, "Transmission mode : %s ", mode_name[p->u.ofdm.transmission_mode]);
- fprintf (f, "Hierarchy : %s ", hierarchy_name[p->u.ofdm.hierarchy_information]);
- fprintf (f, "\n");
- if(p->frequency>=0xfffffff)
- fprintf (f, "#==========WARNING=============\n#The network provider probably returned the wrong frequency\n#You have to set manually the freq= option\n\n");
- else
- fprintf (f, "freq=%i\n", p->frequency );
- fprintf (f, "bandwith=%sMhz\n", bw_name[p->u.ofdm.bandwidth]);
- fprintf (f, "qam=auto\n");
- fprintf (f, "trans_mode=auto\n");
- fprintf (f, "guardinterval=auto\n");
- fprintf (f, "coderate=auto\n");
- // fprintf (f, ":T:27500:");
- break;
-
- case FE_ATSC:
- fprintf (f, "%i:", p->frequency / 1000);
- fprintf (f, "VDR does not support ATSC at this time");
- break;
-
- default:
- fprintf (f, "Modulation : %d\n", type);
- ;
- };
-
-}
-
-void mumudvb_dump_service_parameter_set (FILE *f,
- const char *service_name,
- const char *provider_name,
- fe_type_t type,
- struct dvb_frontend_parameters *p,
- char polarity,
- int video_pid,
- int pcr_pid,
- uint16_t *audio_pid,
- char audio_lang[][4],
- int audio_num,
- int teletext_pid,
- int scrambled,
- int ac3_pid,
- int service_id,
- int network_id,
- int transport_stream_id,
- int orbital_pos,
- int we_flag,
- int ca_select,
- int channel_num,
- int channel_num_mumudvb,
- int pmt_pid,
- int subtitling_pid)
-{
- int i;
-
- if (channel_num_mumudvb == 0)
- {
- fprintf (f, "#This is an automatically generated config file for mumudvb\n#Check if the ip adresses are good for you\n#You might also have to ad the card=n parameter with n the number of your DVB adapter\n\n");
- mumudvb_dump_dvb_parameters (f, type, p, polarity, orbital_pos, we_flag);
- }
- if ((video_pid || audio_pid[0]) && ((ca_select > 0) || ((ca_select == 0) && (scrambled == 0)))) {
- fprintf (f, "\n#Channel : \"%s\" Provider : \"%s\" Number : %d\n", service_name, provider_name, channel_num);
- fprintf (f, "ip=239.200.200.2%02i\n",channel_num_mumudvb);
- fprintf (f, "port=1234\n");
- fprintf (f, "name=");
- if (audio_lang && audio_lang[0][0])
- fprintf (f, "%.4s ", audio_lang[0]);
- fprintf (f, "%s\n", service_name);
-
- fprintf (f, "#Pids are the following : PMT ");
- if ((pcr_pid != video_pid) && (video_pid > 0)) fprintf (f, "Video PCR ");
- else if (video_pid > 0) fprintf (f, "Video ");
- for (i = 0; i < audio_num; i++)
- {
- if(audio_pid[i]) fprintf (f, "Audio ");
- }
- if (ac3_pid) fprintf (f, "AC3 ");
- if (teletext_pid) fprintf (f, "Text ");
- if (subtitling_pid) fprintf (f, "SUB ");
- fprintf (f, "\n");
- fprintf (f, "pids=");
- fprintf (f, "%i ", pmt_pid);
- if ((pcr_pid != video_pid) && (video_pid > 0))
- fprintf (f, "%i %i", video_pid, pcr_pid);
- else if (video_pid > 0)
- fprintf (f, "%i", video_pid);
- if(audio_pid[0])
- fprintf (f, " %i", audio_pid[0]);
- for (i = 1; i < audio_num; i++)
- {
- if(audio_pid[i])
- fprintf (f, " %i", audio_pid[i]);
- }
- if (ac3_pid)
- {
- fprintf (f, " %i", ac3_pid);
- }
- if (scrambled == 1) scrambled = ca_select;
- if (teletext_pid)
- fprintf (f, " %d", teletext_pid);
- if (subtitling_pid)
- fprintf (f, " %d", subtitling_pid);
- // fprintf (f, ":%d:%d:%d:%d:%d:0", teletext_pid, scrambled,
- // service_id, network_id, transport_stream_id);
- fprintf (f, "\n");
- }
-}
-
diff --git a/tools/scan_modified/scan/dump-mumudvb.h b/tools/scan_modified/scan/dump-mumudvb.h
deleted file mode 100644
index edda287..0000000
--- a/tools/scan_modified/scan/dump-mumudvb.h
+++ /dev/null
@@ -1,39 +0,0 @@
-#ifndef __DUMP_MUMUDVB_H__
-#define __DUMP_MUMUDVB_H__
-
-#include <stdint.h>
-#include <linux/dvb/frontend.h>
-
-extern
-void mumudvb_dump_dvb_parameters (FILE *f, fe_type_t type,
- struct dvb_frontend_parameters *p,
- char polarity, int orbital_pos, int we_flag);
-
-extern
-void mumudvb_dump_service_parameter_set (FILE *f,
- const char *service_name,
- const char *provider_name,
- fe_type_t type,
- struct dvb_frontend_parameters *p,
- char polarity,
- int video_pid,
- int pcr_pid,
- uint16_t *audio_pid,
- char audio_lang[][4],
- int audio_num,
- int teletext_pid,
- int scrambled,
- int ac3_pid,
- int service_id,
- int network_id,
- int transport_stream_id,
- int orbital_pos,
- int we_flag,
- int ca_select,
- int channel_num,
- int channel_num_mumudvb,
- int pmt_pid,
- int subtitling_pid);
-
-#endif
-
diff --git a/tools/scan_modified/scan/dump-vdr.c b/tools/scan_modified/scan/dump-vdr.c
deleted file mode 100644
index f030c93..0000000
--- a/tools/scan_modified/scan/dump-vdr.c
+++ /dev/null
@@ -1,183 +0,0 @@
-#include <stdio.h>
-#include "dump-vdr.h"
-#include <linux/dvb/frontend.h>
-
-
-static const char *inv_name [] = {
- "0",
- "1",
- "999"
-};
-
-static const char *fec_name [] = {
- "0",
- "12",
- "23",
- "34",
- "45",
- "56",
- "67",
- "78",
- "89",
- "999"
-};
-
-static const char *qam_name [] = {
- "0",
- "16",
- "32",
- "64",
- "128",
- "256",
- "999"
-};
-
-
-static const char *bw_name [] = {
- "8",
- "7",
- "6",
- "999"
-};
-
-
-static const char *mode_name [] = {
- "2",
- "8",
- "999"
-};
-
-static const char *guard_name [] = {
- "32",
- "16",
- "8",
- "4",
- "999"
-};
-
-
-static const char *hierarchy_name [] = {
- "0",
- "1",
- "2",
- "4",
- "999"
-};
-
-static const char *west_east_flag_name [] = {
- "W",
- "E"
-};
-
-void vdr_dump_dvb_parameters (FILE *f, fe_type_t type,
- struct dvb_frontend_parameters *p,
- char polarity, int orbital_pos, int we_flag)
-{
- switch (type) {
- case FE_QPSK:
- fprintf (f, "%i:", p->frequency / 1000);
- fprintf (f, "%c:", polarity);
- fprintf (f, "S%i.%i%s:", orbital_pos/10,
- orbital_pos % 10, west_east_flag_name[we_flag]);
- fprintf (f, "%i:", p->u.qpsk.symbol_rate / 1000);
- break;
-
- case FE_QAM:
- fprintf (f, "%i:", p->frequency / 1000000);
- fprintf (f, "M%s:C:", qam_name[p->u.qam.modulation]);
- fprintf (f, "%i:", p->u.qam.symbol_rate / 1000);
- break;
-
- case FE_OFDM:
- fprintf (f, "%i:", p->frequency / 1000);
- fprintf (f, "I%s", inv_name[p->inversion]);
- fprintf (f, "B%s", bw_name[p->u.ofdm.bandwidth]);
- fprintf (f, "C%s", fec_name[p->u.ofdm.code_rate_HP]);
- fprintf (f, "D%s", fec_name[p->u.ofdm.code_rate_LP]);
- fprintf (f, "M%s", qam_name[p->u.ofdm.constellation]);
- fprintf (f, "T%s", mode_name[p->u.ofdm.transmission_mode]);
- fprintf (f, "G%s", guard_name[p->u.ofdm.guard_interval]);
- fprintf (f, "Y%s", hierarchy_name[p->u.ofdm.hierarchy_information]);
- fprintf (f, ":T:27500:");
- break;
-
- case FE_ATSC:
- fprintf (f, "%i:", p->frequency / 1000);
- fprintf (f, "VDR does not support ATSC at this time");
- break;
-
- default:
- ;
- };
-}
-
-void vdr_dump_service_parameter_set (FILE *f,
- const char *service_name,
- const char *provider_name,
- fe_type_t type,
- struct dvb_frontend_parameters *p,
- char polarity,
- int video_pid,
- int pcr_pid,
- uint16_t *audio_pid,
- char audio_lang[][4],
- int audio_num,
- int teletext_pid,
- int scrambled,
- int ac3_pid,
- int service_id,
- int network_id,
- int transport_stream_id,
- int orbital_pos,
- int we_flag,
- int dump_provider,
- int ca_select,
- int vdr_version,
- int dump_channum,
- int channel_num)
-{
- int i;
-
- if ((video_pid || audio_pid[0]) && ((ca_select > 0) || ((ca_select == 0) && (scrambled == 0)))) {
- if (vdr_version <= 2) {
- audio_lang = NULL;
- network_id = 0;
- transport_stream_id = 0;
- }
- if ((dump_channum == 1) && (channel_num > 0))
- fprintf(f, ":@%i\n", channel_num);
- if (vdr_version >= 3)
- fprintf (f, "%s;%s:", service_name, provider_name);
- else
- {
- if (dump_provider == 1)
- fprintf (f, "%s - ", provider_name);
- fprintf (f, "%s:", service_name);
- }
- vdr_dump_dvb_parameters (f, type, p, polarity, orbital_pos, we_flag);
- if ((pcr_pid != video_pid) && (video_pid > 0))
- fprintf (f, "%i+%i:", video_pid, pcr_pid);
- else
- fprintf (f, "%i:", video_pid);
- fprintf (f, "%i", audio_pid[0]);
- if (audio_lang && audio_lang[0][0])
- fprintf (f, "=%.4s", audio_lang[0]);
- for (i = 1; i < audio_num; i++)
- {
- fprintf (f, ",%i", audio_pid[i]);
- if (audio_lang && audio_lang[i][0])
- fprintf (f, "=%.4s", audio_lang[i]);
- }
- if (ac3_pid)
- {
- fprintf (f, ";%i", ac3_pid);
- if (audio_lang && audio_lang[0][0])
- fprintf (f, "=%.4s", audio_lang[0]);
- }
- if (scrambled == 1) scrambled = ca_select;
- fprintf (f, ":%d:%d:%d:%d:%d:0", teletext_pid, scrambled,
- service_id, network_id, transport_stream_id);
- fprintf (f, "\n");
- }
-}
-
diff --git a/tools/scan_modified/scan/dump-vdr.h b/tools/scan_modified/scan/dump-vdr.h
deleted file mode 100644
index 13bd05a..0000000
--- a/tools/scan_modified/scan/dump-vdr.h
+++ /dev/null
@@ -1,39 +0,0 @@
-#ifndef __DUMP_VDR_H__
-#define __DUMP_VDR_H__
-
-#include <stdint.h>
-#include <linux/dvb/frontend.h>
-
-extern
-void vdr_dump_dvb_parameters (FILE *f, fe_type_t type,
- struct dvb_frontend_parameters *p,
- char polarity, int orbital_pos, int we_flag);
-
-extern
-void vdr_dump_service_parameter_set (FILE *f,
- const char *service_name,
- const char *provider_name,
- fe_type_t type,
- struct dvb_frontend_parameters *p,
- char polarity,
- int video_pid,
- int pcr_pid,
- uint16_t *audio_pid,
- char audio_lang[][4],
- int audio_num,
- int teletext_pid,
- int scrambled,
- int ac3_pid,
- int service_id,
- int network_id,
- int transport_stream_id,
- int orbital_pos,
- int we_flag,
- int dump_provider,
- int ca_select,
- int vdr_version,
- int dump_channum,
- int channel_num);
-
-#endif
-
diff --git a/tools/scan_modified/scan/dump-zap.c b/tools/scan_modified/scan/dump-zap.c
deleted file mode 100644
index 83505b9..0000000
--- a/tools/scan_modified/scan/dump-zap.c
+++ /dev/null
@@ -1,126 +0,0 @@
-#include <stdio.h>
-#include <linux/dvb/frontend.h>
-#include "dump-zap.h"
-
-static const char *inv_name [] = {
- "INVERSION_OFF",
- "INVERSION_ON",
- "INVERSION_AUTO"
-};
-
-static const char *fec_name [] = {
- "FEC_NONE",
- "FEC_1_2",
- "FEC_2_3",
- "FEC_3_4",
- "FEC_4_5",
- "FEC_5_6",
- "FEC_6_7",
- "FEC_7_8",
- "FEC_8_9",
- "FEC_AUTO"
-};
-
-
-static const char *qam_name [] = {
- "QPSK",
- "QAM_16",
- "QAM_32",
- "QAM_64",
- "QAM_128",
- "QAM_256",
- "QAM_AUTO",
- "8VSB",
- "16VSB",
-};
-
-
-static const char *bw_name [] = {
- "BANDWIDTH_8_MHZ",
- "BANDWIDTH_7_MHZ",
- "BANDWIDTH_6_MHZ",
- "BANDWIDTH_AUTO"
-};
-
-
-static const char *mode_name [] = {
- "TRANSMISSION_MODE_2K",
- "TRANSMISSION_MODE_8K",
- "TRANSMISSION_MODE_AUTO"
-};
-
-static const char *guard_name [] = {
- "GUARD_INTERVAL_1_32",
- "GUARD_INTERVAL_1_16",
- "GUARD_INTERVAL_1_8",
- "GUARD_INTERVAL_1_4",
- "GUARD_INTERVAL_AUTO"
-};
-
-
-static const char *hierarchy_name [] = {
- "HIERARCHY_NONE",
- "HIERARCHY_1",
- "HIERARCHY_2",
- "HIERARCHY_4",
- "HIERARCHY_AUTO"
-};
-
-
-void zap_dump_dvb_parameters (FILE *f, fe_type_t type, struct dvb_frontend_parameters *p, char polarity, int sat_number)
-{
- switch (type) {
- case FE_QPSK:
- fprintf (f, "%i:", p->frequency / 1000); /* channels.conf wants MHz */
- fprintf (f, "%c:", polarity);
- fprintf (f, "%d:", sat_number);
- fprintf (f, "%i", p->u.qpsk.symbol_rate / 1000); /* channels.conf wants kBaud */
- /*fprintf (f, "%s", fec_name[p->u.qpsk.fec_inner]);*/
- break;
-
- case FE_QAM:
- fprintf (f, "%i:", p->frequency);
- fprintf (f, "%s:", inv_name[p->inversion]);
- 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]);
- break;
-
- case FE_OFDM:
- fprintf (f, "%i:", p->frequency);
- fprintf (f, "%s:", inv_name[p->inversion]);
- fprintf (f, "%s:", bw_name[p->u.ofdm.bandwidth]);
- fprintf (f, "%s:", fec_name[p->u.ofdm.code_rate_HP]);
- fprintf (f, "%s:", fec_name[p->u.ofdm.code_rate_LP]);
- fprintf (f, "%s:", qam_name[p->u.ofdm.constellation]);
- fprintf (f, "%s:", mode_name[p->u.ofdm.transmission_mode]);
- fprintf (f, "%s:", guard_name[p->u.ofdm.guard_interval]);
- fprintf (f, "%s", hierarchy_name[p->u.ofdm.hierarchy_information]);
- break;
-
- case FE_ATSC:
- fprintf (f, "%i:", p->frequency);
- fprintf (f, "%s", qam_name[p->u.vsb.modulation]);
- break;
-
- default:
- ;
- };
-}
-
-void zap_dump_service_parameter_set (FILE *f,
- const char *service_name,
- fe_type_t type,
- struct dvb_frontend_parameters *p,
- char polarity,
- int sat_number,
- uint16_t video_pid,
- uint16_t *audio_pid,
- uint16_t service_id)
-{
- fprintf (f, "%s:", service_name);
- zap_dump_dvb_parameters (f, type, p, polarity, sat_number);
- fprintf (f, ":%i:%i:%i", video_pid, audio_pid[0], service_id);
- fprintf (f, "\n");
-}
-
diff --git a/tools/scan_modified/scan/dump-zap.h b/tools/scan_modified/scan/dump-zap.h
deleted file mode 100644
index 6763dc2..0000000
--- a/tools/scan_modified/scan/dump-zap.h
+++ /dev/null
@@ -1,20 +0,0 @@
-#ifndef __DUMP_ZAP_H__
-#define __DUMP_ZAP_H__
-
-#include <stdint.h>
-#include <linux/dvb/frontend.h>
-
-extern void zap_dump_dvb_parameters (FILE *f, fe_type_t type,
- struct dvb_frontend_parameters *t, char polarity, int sat);
-
-extern void zap_dump_service_parameter_set (FILE *f,
- const char *service_name,
- fe_type_t type,
- struct dvb_frontend_parameters *t,
- char polarity, int sat,
- uint16_t video_pid,
- uint16_t *audio_pid,
- uint16_t service_id);
-
-#endif
-
diff --git a/tools/scan_modified/scan/dvb-c/at-Vienna b/tools/scan_modified/scan/dvb-c/at-Vienna
deleted file mode 100644
index 2c3d29c..0000000
--- a/tools/scan_modified/scan/dvb-c/at-Vienna
+++ /dev/null
@@ -1,3 +0,0 @@
-# Kabel Vienna
-# freq sr fec mod
-C 377750000 6900000 NONE QAM256
diff --git a/tools/scan_modified/scan/dvb-c/ch-unknown b/tools/scan_modified/scan/dvb-c/ch-unknown
deleted file mode 100644
index a9852d1..0000000
--- a/tools/scan_modified/scan/dvb-c/ch-unknown
+++ /dev/null
@@ -1,3 +0,0 @@
-# Kabel Suisse
-# freq sr fec mod
-C 530000000 6900000 NONE QAM64
diff --git a/tools/scan_modified/scan/dvb-c/de-Berlin b/tools/scan_modified/scan/dvb-c/de-Berlin
deleted file mode 100644
index 4a53b74..0000000
--- a/tools/scan_modified/scan/dvb-c/de-Berlin
+++ /dev/null
@@ -1,4 +0,0 @@
-# Kabel Berlin
-# freq sr fec mod
-C 394000000 6900000 NONE QAM64
-C 113000000 6900000 NONE QAM64
diff --git a/tools/scan_modified/scan/dvb-c/de-iesy b/tools/scan_modified/scan/dvb-c/de-iesy
deleted file mode 100644
index a289951..0000000
--- a/tools/scan_modified/scan/dvb-c/de-iesy
+++ /dev/null
@@ -1,3 +0,0 @@
-# Kabel iesy
-# freq sr fec mod
-C 410000000 6900000 NONE QAM64
diff --git a/tools/scan_modified/scan/dvb-c/fi-3ktv b/tools/scan_modified/scan/dvb-c/fi-3ktv
deleted file mode 100644
index 55ccfd6..0000000
--- a/tools/scan_modified/scan/dvb-c/fi-3ktv
+++ /dev/null
@@ -1,3 +0,0 @@
-# 3KTV
-# freq sr fec mod
-C 306000000 6875000 NONE QAM64
diff --git a/tools/scan_modified/scan/dvb-c/fi-vaasa-oncable b/tools/scan_modified/scan/dvb-c/fi-vaasa-oncable
deleted file mode 100644
index 380ccf7..0000000
--- a/tools/scan_modified/scan/dvb-c/fi-vaasa-oncable
+++ /dev/null
@@ -1,13 +0,0 @@
-# OnCable (Finland / Vaasa)
-# freq sr fec mod
-C 386000000 6875000 NONE QAM64
-C 394000000 6875000 NONE QAM64
-C 143000000 6875000 NONE QAM64
-C 434000000 6875000 NONE QAM64
-C 362000000 6875000 NONE QAM64
-C 418000000 6875000 NONE QAM64
-C 426000000 6875000 NONE QAM64
-C 314000000 6875000 NONE QAM64
-C 410000000 6875000 NONE QAM64
-C 442000000 6875000 NONE QAM64
-C 306000000 6875000 NONE QAM64
diff --git a/tools/scan_modified/scan/dvb-s/Astra-19.2E b/tools/scan_modified/scan/dvb-s/Astra-19.2E
deleted file mode 100644
index 74e1b59..0000000
--- a/tools/scan_modified/scan/dvb-s/Astra-19.2E
+++ /dev/null
@@ -1,3 +0,0 @@
-# Astra 19.2E SDT info service transponder
-# freq pol sr fec
-S 12551500 V 22000000 5/6
diff --git a/tools/scan_modified/scan/dvb-s/Hispasat-30.0W b/tools/scan_modified/scan/dvb-s/Hispasat-30.0W
deleted file mode 100644
index 2c200b5..0000000
--- a/tools/scan_modified/scan/dvb-s/Hispasat-30.0W
+++ /dev/null
@@ -1,6 +0,0 @@
-# Hispasat 30.0W
-# freq pol sr fec
-S 11539000 V 24500000 5/6
-S 11931000 H 27500000 3/4
-S 12015000 V 27500000 3/4
-S 12567000 H 19850000 3/4
diff --git a/tools/scan_modified/scan/dvb-s/Hotbird-13.0E b/tools/scan_modified/scan/dvb-s/Hotbird-13.0E
deleted file mode 100644
index f2168da..0000000
--- a/tools/scan_modified/scan/dvb-s/Hotbird-13.0E
+++ /dev/null
@@ -1,3 +0,0 @@
-# EUTELSAT SkyPlex, Hotbird 13E
-# freq pol sr fec
-S 12539000 H 27500000 3/4
diff --git a/tools/scan_modified/scan/dvb-s/PAS-43.0W b/tools/scan_modified/scan/dvb-s/PAS-43.0W
deleted file mode 100644
index fab84c5..0000000
--- a/tools/scan_modified/scan/dvb-s/PAS-43.0W
+++ /dev/null
@@ -1,6 +0,0 @@
-# PAS 6/6B/3R at 43.0W
-# freq pol sr fec
-S 12578000 H 19850000 3/4
-S 12584000 V 27500000 3/4
-S 12606000 H 6616000 3/4
-S 12665000 H 19850000 7/8
diff --git a/tools/scan_modified/scan/dvb-s/Sirius-5.0E b/tools/scan_modified/scan/dvb-s/Sirius-5.0E
deleted file mode 100644
index ec4e4ea..0000000
--- a/tools/scan_modified/scan/dvb-s/Sirius-5.0E
+++ /dev/null
@@ -1,5 +0,0 @@
-# Sirius 5.0E
-# freq pol sr fec
-S 11823000 V 27500000 3/4
-S 11977000 V 27500000 3/4
-S 12054000 V 27500000 3/4
diff --git a/tools/scan_modified/scan/dvb-s/Telecom2-8.0W b/tools/scan_modified/scan/dvb-s/Telecom2-8.0W
deleted file mode 100644
index 91678b4..0000000
--- a/tools/scan_modified/scan/dvb-s/Telecom2-8.0W
+++ /dev/null
@@ -1,4 +0,0 @@
-# Telecom2 8.0W
-# freq pol sr fec
-S 11635000 H 6800000 5/6
-S 12687000 V 1879000 3/4
diff --git a/tools/scan_modified/scan/dvb-s/Telstar12-15.0W b/tools/scan_modified/scan/dvb-s/Telstar12-15.0W
deleted file mode 100644
index 529b91f..0000000
--- a/tools/scan_modified/scan/dvb-s/Telstar12-15.0W
+++ /dev/null
@@ -1,4 +0,0 @@
-# Telstar 12 15.0W
-# freq pol sr fec
-S 12041000 H 3256000 2/3
-S 12520000 V 8700000 1/2
diff --git a/tools/scan_modified/scan/dvb-s/Thor-1.0W b/tools/scan_modified/scan/dvb-s/Thor-1.0W
deleted file mode 100644
index 1f8f1d2..0000000
--- a/tools/scan_modified/scan/dvb-s/Thor-1.0W
+++ /dev/null
@@ -1,8 +0,0 @@
-# Thor 1.0W
-# freq pol sr fec
-S 11247000 V 24500000 7/8
-S 11293000 H 24500000 7/8
-S 11325000 H 24500000 7/8
-S 12054000 H 28000000 7/8
-S 12169000 H 28000000 7/8
-S 12226000 V 28000000 7/8
diff --git a/tools/scan_modified/scan/dvb-s/Turksat-42.0E b/tools/scan_modified/scan/dvb-s/Turksat-42.0E
deleted file mode 100644
index 1ac7fd8..0000000
--- a/tools/scan_modified/scan/dvb-s/Turksat-42.0E
+++ /dev/null
@@ -1,4 +0,0 @@
-# Turksat 42.0E
-# freq pol sr fec
-S 11594000 H 4557000 5/6
-S 10978000 V 2344000 3/4
diff --git a/tools/scan_modified/scan/dvb-t/au-Darwin b/tools/scan_modified/scan/dvb-t/au-Darwin
deleted file mode 100644
index 522bb1d..0000000
--- a/tools/scan_modified/scan/dvb-t/au-Darwin
+++ /dev/null
@@ -1,5 +0,0 @@
-# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy
-T 543625000 7MHz 3/4 NONE QAM64 8k 1/16 NONE
-T 550500000 7MHz 2/3 NONE QAM64 8k 1/8 NONE
-T 536625000 7MHz 2/3 NONE QAM64 8k 1/8 NONE
-T 557625000 7MHz 2/3 NONE QAM64 8k 1/8 NONE
diff --git a/tools/scan_modified/scan/dvb-t/au-canberra b/tools/scan_modified/scan/dvb-t/au-canberra
deleted file mode 100644
index 5e71b07..0000000
--- a/tools/scan_modified/scan/dvb-t/au-canberra
+++ /dev/null
@@ -1,12 +0,0 @@
-# Australia / Canberra / Woden
-# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy
-# ABC
-T 205625000 7MHz 3/4 3/4 QAM64 8k 1/16 NONE
-# Seven
-T 177500000 7MHz 2/3 NONE QAM64 8k 1/8 NONE
-# Nine
-T 191625000 7MHz 3/4 NONE QAM64 8k 1/16 NONE
-# Ten
-T 219500000 7MHz 3/4 1/2 QAM64 8k 1/16 NONE
-# SBS
-T 543500000 7MHz 2/3 NONE QAM64 8k 1/8 NONE
diff --git a/tools/scan_modified/scan/dvb-t/au-sydney_north_shore b/tools/scan_modified/scan/dvb-t/au-sydney_north_shore
deleted file mode 100644
index 0bb6dd4..0000000
--- a/tools/scan_modified/scan/dvb-t/au-sydney_north_shore
+++ /dev/null
@@ -1,12 +0,0 @@
-# Australia / Sydney / North Shore (aka Artarmon/Gore Hill)
-# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy
-# ABC
-T 226500000 7MHz 3/4 NONE QAM64 8k 1/16 NONE
-# Seven
-T 177500000 7MHz 2/3 NONE QAM64 8k 1/8 NONE
-# Nine
-T 191625000 7MHz 3/4 NONE QAM64 8k 1/16 NONE
-# Ten
-T 219500000 7MHz 3/4 NONE QAM64 8k 1/16 NONE
-# SBS
-T 571500000 7MHz 2/3 NONE QAM64 8k 1/8 NONE
diff --git a/tools/scan_modified/scan/dvb-t/au-unknown b/tools/scan_modified/scan/dvb-t/au-unknown
deleted file mode 100644
index 9f96d9e..0000000
--- a/tools/scan_modified/scan/dvb-t/au-unknown
+++ /dev/null
@@ -1,3 +0,0 @@
-# Australia ABC
-# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy
-T 226500000 7MHz 2/3 NONE QAM64 8k 1/8 NONE
diff --git a/tools/scan_modified/scan/dvb-t/de-Berlin b/tools/scan_modified/scan/dvb-t/de-Berlin
deleted file mode 100644
index 416bd11..0000000
--- a/tools/scan_modified/scan/dvb-t/de-Berlin
+++ /dev/null
@@ -1,5 +0,0 @@
-# DVB-T Berlin
-# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy
-T 522000000 8MHz 2/3 NONE QAM16 8k 1/8 NONE # ard / rbb
-T 570000000 8MHz 2/3 NONE QAM16 8k 1/8 NONE # zdf
-T 658000000 8MHz 2/3 NONE QAM16 8k 1/8 NONE # t-systems
diff --git a/tools/scan_modified/scan/dvb-t/es-Collserola b/tools/scan_modified/scan/dvb-t/es-Collserola
deleted file mode 100644
index 04ffe54..0000000
--- a/tools/scan_modified/scan/dvb-t/es-Collserola
+++ /dev/null
@@ -1,6 +0,0 @@
-# DVB-T Collserola (Barcelona)
-# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy
-T 650000000 8MHz 2/3 2/3 QAM64 8k 1/32 NONE # C43: tvc
-T 794000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # C61: tve, t5, a3, c+
-T 834000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # C66: veotv, nettv
-
diff --git a/tools/scan_modified/scan/dvb-t/fi-Espoo b/tools/scan_modified/scan/dvb-t/fi-Espoo
deleted file mode 100644
index dd0619b..0000000
--- a/tools/scan_modified/scan/dvb-t/fi-Espoo
+++ /dev/null
@@ -1,3 +0,0 @@
-# Espoo A-mux (Digita Finland)
-# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy
-T 562000000 8MHz 2/3 NONE QAM64 8k 1/8 NONE
diff --git a/tools/scan_modified/scan/dvb-t/fi-Tampere b/tools/scan_modified/scan/dvb-t/fi-Tampere
deleted file mode 100644
index 7e59894..0000000
--- a/tools/scan_modified/scan/dvb-t/fi-Tampere
+++ /dev/null
@@ -1,6 +0,0 @@
-# Tampere DVB-T (Digita Finland)
-# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy
-T 578000000 8MHz 2/3 NONE QAM64 8k 1/8 NONE
-T 490000000 8MHz 2/3 NONE QAM64 8k 1/8 NONE
-T 770000000 8MHz 2/3 NONE QAM64 8k 1/8 NONE
-
diff --git a/tools/scan_modified/scan/dvb-t/fi-Turku b/tools/scan_modified/scan/dvb-t/fi-Turku
deleted file mode 100644
index 5f2d9b4..0000000
--- a/tools/scan_modified/scan/dvb-t/fi-Turku
+++ /dev/null
@@ -1,3 +0,0 @@
-# Turku A-mux (Digita Finland)
-# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy
-T 714000000 8MHz 2/3 NONE QAM64 8k 1/8 NONE
diff --git a/tools/scan_modified/scan/dvb-t/nl-AlphenaandenRijn b/tools/scan_modified/scan/dvb-t/nl-AlphenaandenRijn
deleted file mode 100644
index f95d3a4..0000000
--- a/tools/scan_modified/scan/dvb-t/nl-AlphenaandenRijn
+++ /dev/null
@@ -1,7 +0,0 @@
-# Digitenne (Alphen aan den Rijn, The Netherlands)
-# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy
-T 474000000 8MHz 1/2 NONE QAM64 8k 1/4 NONE
-T 578000000 8MHz 1/2 NONE QAM64 8k 1/4 NONE
-T 722000000 8MHz 1/2 NONE QAM64 8k 1/4 NONE
-T 762000000 8MHz 1/2 NONE QAM64 8k 1/4 NONE
-T 818000000 8MHz 1/2 NONE QAM64 8k 1/4 NONE
diff --git a/tools/scan_modified/scan/dvb-t/nl-Randstad b/tools/scan_modified/scan/dvb-t/nl-Randstad
deleted file mode 100644
index da1a74d..0000000
--- a/tools/scan_modified/scan/dvb-t/nl-Randstad
+++ /dev/null
@@ -1,7 +0,0 @@
-# Digitenne (Randstad, The Netherlands)
-# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy
-T 474000000 8MHz 1/2 NONE QAM64 8k 1/4 NONE
-T 490000000 8MHz 1/2 NONE QAM64 8k 1/4 NONE
-T 578000000 8MHz 1/2 NONE QAM64 8k 1/4 NONE
-T 762000000 8MHz 1/2 NONE QAM64 8k 1/4 NONE
-T 818000000 8MHz 1/2 NONE QAM64 8k 1/4 NONE
diff --git a/tools/scan_modified/scan/dvb-t/se-Gavle b/tools/scan_modified/scan/dvb-t/se-Gavle
deleted file mode 100644
index 04fe333..0000000
--- a/tools/scan_modified/scan/dvb-t/se-Gavle
+++ /dev/null
@@ -1,6 +0,0 @@
-# Gavle (Senda/Boxer Sweden)
-# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy
-T 674000000 8MHz 2/3 NONE QAM64 8k 1/8 NONE
-T 498000000 8MHz 2/3 NONE QAM64 8k 1/8 NONE
-T 562000000 8MHz 2/3 NONE QAM64 8k 1/8 NONE
-T 706000000 8MHz 2/3 NONE QAM64 8k 1/8 NONE
diff --git a/tools/scan_modified/scan/dvb-t/uk-BlackHill b/tools/scan_modified/scan/dvb-t/uk-BlackHill
deleted file mode 100644
index 17eae72..0000000
--- a/tools/scan_modified/scan/dvb-t/uk-BlackHill
+++ /dev/null
@@ -1,3 +0,0 @@
-# uk BlackHill
-# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy
-T 634167000 8MHz 2/3 NONE QAM64 2k 1/32 NONE
diff --git a/tools/scan_modified/scan/dvb-t/uk-CrystalPalace b/tools/scan_modified/scan/dvb-t/uk-CrystalPalace
deleted file mode 100644
index 9586b25..0000000
--- a/tools/scan_modified/scan/dvb-t/uk-CrystalPalace
+++ /dev/null
@@ -1,3 +0,0 @@
-# Crystal Palace
-# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy
-T 505833333 8MHz 3/4 NONE QAM16 2k 1/32 NONE
diff --git a/tools/scan_modified/scan/dvb-t/uk-Hannington b/tools/scan_modified/scan/dvb-t/uk-Hannington
deleted file mode 100644
index 0bbbfdd..0000000
--- a/tools/scan_modified/scan/dvb-t/uk-Hannington
+++ /dev/null
@@ -1,3 +0,0 @@
-# Hannington, North Hampshire
-# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy
-T 706000000 8MHz 3/4 NONE QAM16 2k 1/32 NONE
diff --git a/tools/scan_modified/scan/dvb-t/uk-Oxford b/tools/scan_modified/scan/dvb-t/uk-Oxford
deleted file mode 100644
index 035603e..0000000
--- a/tools/scan_modified/scan/dvb-t/uk-Oxford
+++ /dev/null
@@ -1,3 +0,0 @@
-# Oxford
-# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy
-T 578000000 8MHz 2/3 NONE QAM64 2k 1/32 NONE
diff --git a/tools/scan_modified/scan/dvb-t/uk-PontopPike b/tools/scan_modified/scan/dvb-t/uk-PontopPike
deleted file mode 100644
index c24ba92..0000000
--- a/tools/scan_modified/scan/dvb-t/uk-PontopPike
+++ /dev/null
@@ -1,3 +0,0 @@
-# Pontop Pike, UK
-# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy
-T 690000000 8MHz 1/2 NONE QAM16 2k 1/32 NONE
diff --git a/tools/scan_modified/scan/dvb-t/uk-Redruth b/tools/scan_modified/scan/dvb-t/uk-Redruth
deleted file mode 100644
index 84dcb9a..0000000
--- a/tools/scan_modified/scan/dvb-t/uk-Redruth
+++ /dev/null
@@ -1,3 +0,0 @@
-# Redruth, Cornwall
-# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy
-T 618000000 8MHz 3/4 NONE QAM16 2k 1/32 NONE
diff --git a/tools/scan_modified/scan/dvb-t/uk-Reigate b/tools/scan_modified/scan/dvb-t/uk-Reigate
deleted file mode 100644
index add0d8b..0000000
--- a/tools/scan_modified/scan/dvb-t/uk-Reigate
+++ /dev/null
@@ -1,3 +0,0 @@
-# Reigate
-# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy
-T 554000000 8MHz 2/3 NONE QAM64 2k 1/32 NONE
diff --git a/tools/scan_modified/scan/dvb-t/uk-Rowridge b/tools/scan_modified/scan/dvb-t/uk-Rowridge
deleted file mode 100644
index c0c72a0..0000000
--- a/tools/scan_modified/scan/dvb-t/uk-Rowridge
+++ /dev/null
@@ -1,3 +0,0 @@
-# Rowridge, Isle of Wight
-# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy
-T 489833333 8MHz 3/4 NONE QAM16 2k 1/32 NONE
diff --git a/tools/scan_modified/scan/dvb-t/uk-SandyHeath b/tools/scan_modified/scan/dvb-t/uk-SandyHeath
deleted file mode 100644
index 05d0474..0000000
--- a/tools/scan_modified/scan/dvb-t/uk-SandyHeath
+++ /dev/null
@@ -1,3 +0,0 @@
-# Sandy Heath
-# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy
-T 641833334 8MHz 2/3 NONE QAM64 2k 1/32 NONE
diff --git a/tools/scan_modified/scan/dvb-t/uk-Storeton b/tools/scan_modified/scan/dvb-t/uk-Storeton
deleted file mode 100644
index 5c93ee9..0000000
--- a/tools/scan_modified/scan/dvb-t/uk-Storeton
+++ /dev/null
@@ -1,3 +0,0 @@
-# Storeton, Wirral
-# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy
-T 546167000 8MHz 3/4 NONE QAM16 2k 1/32 NONE
diff --git a/tools/scan_modified/scan/dvb-t/uk-WinterHill b/tools/scan_modified/scan/dvb-t/uk-WinterHill
deleted file mode 100644
index b000623..0000000
--- a/tools/scan_modified/scan/dvb-t/uk-WinterHill
+++ /dev/null
@@ -1,3 +0,0 @@
-# Winter Hill, North-West England
-# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy
-T 754166670 8MHz 3/4 NONE QAM16 2k 1/32 NONE
diff --git a/tools/scan_modified/scan/include/linux/dvb/audio.h b/tools/scan_modified/scan/include/linux/dvb/audio.h
deleted file mode 100644
index 58956c3..0000000
--- a/tools/scan_modified/scan/include/linux/dvb/audio.h
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * audio.h
- *
- * Copyright (C) 2000 Ralph Metzler <ralph at convergence.de>
- * & Marcus Metzler <marcus at convergence.de>
- for convergence integrated media GmbH
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Lesser Public License
- * as published by the Free Software Foundation; either version 2.1
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef _DVBAUDIO_H_
-#define _DVBAUDIO_H_
-
-#ifdef __KERNEL__
-#include <linux/types.h>
-#else
-#include <stdint.h>
-#endif
-
-
-typedef enum {
- AUDIO_SOURCE_DEMUX, /* Select the demux as the main source */
- AUDIO_SOURCE_MEMORY /* Select internal memory as the main source */
-} audio_stream_source_t;
-
-
-typedef enum {
- AUDIO_STOPPED, /* Device is stopped */
- AUDIO_PLAYING, /* Device is currently playing */
- AUDIO_PAUSED /* Device is paused */
-} audio_play_state_t;
-
-
-typedef enum {
- AUDIO_STEREO,
- AUDIO_MONO_LEFT,
- AUDIO_MONO_RIGHT
-} audio_channel_select_t;
-
-
-typedef struct audio_mixer {
- unsigned int volume_left;
- unsigned int volume_right;
- // what else do we need? bass, pass-through, ...
-} audio_mixer_t;
-
-
-typedef struct audio_status {
- int AV_sync_state; /* sync audio and video? */
- int mute_state; /* audio is muted */
- audio_play_state_t play_state; /* current playback state */
- audio_stream_source_t stream_source; /* current stream source */
- audio_channel_select_t channel_select; /* currently selected channel */
- int bypass_mode; /* pass on audio data to */
- audio_mixer_t mixer_state; /* current mixer state */
-} audio_status_t; /* separate decoder hardware */
-
-
-typedef
-struct audio_karaoke{ /* if Vocal1 or Vocal2 are non-zero, they get mixed */
- int vocal1; /* into left and right t at 70% each */
- int vocal2; /* if both, Vocal1 and Vocal2 are non-zero, Vocal1 gets*/
- int melody; /* mixed into the left channel and */
- /* Vocal2 into the right channel at 100% each. */
- /* if Melody is non-zero, the melody channel gets mixed*/
-} audio_karaoke_t; /* into left and right */
-
-
-typedef uint16_t audio_attributes_t;
-/* bits: descr. */
-/* 15-13 audio coding mode (0=ac3, 2=mpeg1, 3=mpeg2ext, 4=LPCM, 6=DTS, */
-/* 12 multichannel extension */
-/* 11-10 audio type (0=not spec, 1=language included) */
-/* 9- 8 audio application mode (0=not spec, 1=karaoke, 2=surround) */
-/* 7- 6 Quantization / DRC (mpeg audio: 1=DRC exists)(lpcm: 0=16bit, */
-/* 5- 4 Sample frequency fs (0=48kHz, 1=96kHz) */
-/* 2- 0 number of audio channels (n+1 channels) */
-
-
-/* for GET_CAPABILITIES and SET_FORMAT, the latter should only set one bit */
-#define AUDIO_CAP_DTS 1
-#define AUDIO_CAP_LPCM 2
-#define AUDIO_CAP_MP1 4
-#define AUDIO_CAP_MP2 8
-#define AUDIO_CAP_MP3 16
-#define AUDIO_CAP_AAC 32
-#define AUDIO_CAP_OGG 64
-#define AUDIO_CAP_SDDS 128
-#define AUDIO_CAP_AC3 256
-
-#define AUDIO_STOP _IO('o', 1)
-#define AUDIO_PLAY _IO('o', 2)
-#define AUDIO_PAUSE _IO('o', 3)
-#define AUDIO_CONTINUE _IO('o', 4)
-#define AUDIO_SELECT_SOURCE _IO('o', 5)
-#define AUDIO_SET_MUTE _IO('o', 6)
-#define AUDIO_SET_AV_SYNC _IO('o', 7)
-#define AUDIO_SET_BYPASS_MODE _IO('o', 8)
-#define AUDIO_CHANNEL_SELECT _IO('o', 9)
-#define AUDIO_GET_STATUS _IOR('o', 10, audio_status_t)
-
-#define AUDIO_GET_CAPABILITIES _IOR('o', 11, unsigned int)
-#define AUDIO_CLEAR_BUFFER _IO('o', 12)
-#define AUDIO_SET_ID _IO('o', 13)
-#define AUDIO_SET_MIXER _IOW('o', 14, audio_mixer_t)
-#define AUDIO_SET_STREAMTYPE _IO('o', 15)
-#define AUDIO_SET_EXT_ID _IO('o', 16)
-#define AUDIO_SET_ATTRIBUTES _IOW('o', 17, audio_attributes_t)
-#define AUDIO_SET_KARAOKE _IOW('o', 18, audio_karaoke_t)
-
-#endif /* _DVBAUDIO_H_ */
-
diff --git a/tools/scan_modified/scan/include/linux/dvb/ca.h b/tools/scan_modified/scan/include/linux/dvb/ca.h
deleted file mode 100644
index 026e5c3..0000000
--- a/tools/scan_modified/scan/include/linux/dvb/ca.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * ca.h
- *
- * Copyright (C) 2000 Ralph Metzler <ralph at convergence.de>
- * & Marcus Metzler <marcus at convergence.de>
- for convergence integrated media GmbH
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Lesser Public License
- * as published by the Free Software Foundation; either version 2.1
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef _DVBCA_H_
-#define _DVBCA_H_
-
-/* slot interface types and info */
-
-typedef struct ca_slot_info {
- int num; /* slot number */
-
- int type; /* CA interface this slot supports */
-#define CA_CI 1 /* CI high level interface */
-#define CA_CI_LINK 2 /* CI link layer level interface */
-#define CA_CI_PHYS 4 /* CI physical layer level interface */
-#define CA_DESCR 8 /* built-in descrambler */
-#define CA_SC 128 /* simple smart card interface */
-
- unsigned int flags;
-#define CA_CI_MODULE_PRESENT 1 /* module (or card) inserted */
-#define CA_CI_MODULE_READY 2
-} ca_slot_info_t;
-
-
-/* descrambler types and info */
-
-typedef struct ca_descr_info {
- unsigned int num; /* number of available descramblers (keys) */
- unsigned int type; /* type of supported scrambling system */
-#define CA_ECD 1
-#define CA_NDS 2
-#define CA_DSS 4
-} ca_descr_info_t;
-
-typedef struct ca_caps {
- unsigned int slot_num; /* total number of CA card and module slots */
- unsigned int slot_type; /* OR of all supported types */
- unsigned int descr_num; /* total number of descrambler slots (keys) */
- unsigned int descr_type; /* OR of all supported types */
-} ca_caps_t;
-
-/* a message to/from a CI-CAM */
-typedef struct ca_msg {
- unsigned int index;
- unsigned int type;
- unsigned int length;
- unsigned char msg[256];
-} ca_msg_t;
-
-typedef struct ca_descr {
- unsigned int index;
- unsigned int parity; /* 0 == even, 1 == odd */
- unsigned char cw[8];
-} ca_descr_t;
-
-typedef struct ca_pid {
- unsigned int pid;
- int index; /* -1 == disable*/
-} ca_pid_t;
-
-#define CA_RESET _IO('o', 128)
-#define CA_GET_CAP _IOR('o', 129, ca_caps_t)
-#define CA_GET_SLOT_INFO _IOR('o', 130, ca_slot_info_t)
-#define CA_GET_DESCR_INFO _IOR('o', 131, ca_descr_info_t)
-#define CA_GET_MSG _IOR('o', 132, ca_msg_t)
-#define CA_SEND_MSG _IOW('o', 133, ca_msg_t)
-#define CA_SET_DESCR _IOW('o', 134, ca_descr_t)
-#define CA_SET_PID _IOW('o', 135, ca_pid_t)
-
-#endif
-
diff --git a/tools/scan_modified/scan/include/linux/dvb/dmx.h b/tools/scan_modified/scan/include/linux/dvb/dmx.h
deleted file mode 100644
index 62e6217..0000000
--- a/tools/scan_modified/scan/include/linux/dvb/dmx.h
+++ /dev/null
@@ -1,181 +0,0 @@
-/*
- * dmx.h
- *
- * Copyright (C) 2000 Marcus Metzler <marcus at convergence.de>
- * & Ralph Metzler <ralph at convergence.de>
- for convergence integrated media GmbH
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef _DVBDMX_H_
-#define _DVBDMX_H_
-
-#include <asm/types.h>
-#ifdef __KERNEL__
-#include <linux/time.h>
-#else
-#include <time.h>
-#endif
-
-
-#define DMX_FILTER_SIZE 16
-
-typedef enum
-{
- DMX_OUT_DECODER, /* Streaming directly to decoder. */
- DMX_OUT_TAP, /* Output going to a memory buffer */
- /* (to be retrieved via the read command).*/
- DMX_OUT_TS_TAP /* Output multiplexed into a new TS */
- /* (to be retrieved by reading from the */
- /* logical DVR device). */
-} dmx_output_t;
-
-
-typedef enum
-{
- DMX_IN_FRONTEND, /* Input from a front-end device. */
- DMX_IN_DVR /* Input from the logical DVR device. */
-} dmx_input_t;
-
-
-typedef enum
-{
- DMX_PES_AUDIO0,
- DMX_PES_VIDEO0,
- DMX_PES_TELETEXT0,
- DMX_PES_SUBTITLE0,
- DMX_PES_PCR0,
-
- DMX_PES_AUDIO1,
- DMX_PES_VIDEO1,
- DMX_PES_TELETEXT1,
- DMX_PES_SUBTITLE1,
- DMX_PES_PCR1,
-
- DMX_PES_AUDIO2,
- DMX_PES_VIDEO2,
- DMX_PES_TELETEXT2,
- DMX_PES_SUBTITLE2,
- DMX_PES_PCR2,
-
- DMX_PES_AUDIO3,
- DMX_PES_VIDEO3,
- DMX_PES_TELETEXT3,
- DMX_PES_SUBTITLE3,
- DMX_PES_PCR3,
-
- DMX_PES_OTHER
-} dmx_pes_type_t;
-
-#define DMX_PES_AUDIO DMX_PES_AUDIO0
-#define DMX_PES_VIDEO DMX_PES_VIDEO0
-#define DMX_PES_TELETEXT DMX_PES_TELETEXT0
-#define DMX_PES_SUBTITLE DMX_PES_SUBTITLE0
-#define DMX_PES_PCR DMX_PES_PCR0
-
-
-typedef enum
-{
- DMX_SCRAMBLING_EV,
- DMX_FRONTEND_EV
-} dmx_event_t;
-
-
-typedef enum
-{
- DMX_SCRAMBLING_OFF,
- DMX_SCRAMBLING_ON
-} dmx_scrambling_status_t;
-
-
-typedef struct dmx_filter
-{
- __u8 filter[DMX_FILTER_SIZE];
- __u8 mask[DMX_FILTER_SIZE];
- __u8 mode[DMX_FILTER_SIZE];
-} dmx_filter_t;
-
-
-struct dmx_sct_filter_params
-{
- __u16 pid;
- dmx_filter_t filter;
- __u32 timeout;
- __u32 flags;
-#define DMX_CHECK_CRC 1
-#define DMX_ONESHOT 2
-#define DMX_IMMEDIATE_START 4
-#define DMX_KERNEL_CLIENT 0x8000
-};
-
-
-struct dmx_pes_filter_params
-{
- __u16 pid;
- dmx_input_t input;
- dmx_output_t output;
- dmx_pes_type_t pes_type;
- __u32 flags;
-};
-
-
-struct dmx_event
-{
- dmx_event_t event;
- time_t timeStamp;
- union
- {
- dmx_scrambling_status_t scrambling;
- } u;
-};
-
-typedef struct dmx_caps {
- __u32 caps;
- int num_decoders;
-} dmx_caps_t;
-
-typedef enum {
- DMX_SOURCE_FRONT0 = 0,
- DMX_SOURCE_FRONT1,
- DMX_SOURCE_FRONT2,
- DMX_SOURCE_FRONT3,
- DMX_SOURCE_DVR0 = 16,
- DMX_SOURCE_DVR1,
- DMX_SOURCE_DVR2,
- DMX_SOURCE_DVR3
-} dmx_source_t;
-
-struct dmx_stc {
- unsigned int num; /* input : which STC? 0..N */
- unsigned int base; /* output: divisor for stc to get 90 kHz clock */
- __u64 stc; /* output: stc in 'base'*90 kHz units */
-};
-
-
-#define DMX_START _IO('o', 41)
-#define DMX_STOP _IO('o', 42)
-#define DMX_SET_FILTER _IOW('o', 43, struct dmx_sct_filter_params)
-#define DMX_SET_PES_FILTER _IOW('o', 44, struct dmx_pes_filter_params)
-#define DMX_SET_BUFFER_SIZE _IO('o', 45)
-#define DMX_GET_EVENT _IOR('o', 46, struct dmx_event)
-#define DMX_GET_PES_PIDS _IOR('o', 47, __u16[5])
-#define DMX_GET_CAPS _IOR('o', 48, dmx_caps_t)
-#define DMX_SET_SOURCE _IOW('o', 49, dmx_source_t)
-#define DMX_GET_STC _IOWR('o', 50, struct dmx_stc)
-
-#endif /*_DVBDMX_H_*/
-
diff --git a/tools/scan_modified/scan/include/linux/dvb/frontend.h b/tools/scan_modified/scan/include/linux/dvb/frontend.h
deleted file mode 100644
index d41df70..0000000
--- a/tools/scan_modified/scan/include/linux/dvb/frontend.h
+++ /dev/null
@@ -1,267 +0,0 @@
-/*
- * frontend.h
- *
- * Copyright (C) 2000 Marcus Metzler <marcus at convergence.de>
- * Ralph Metzler <ralph at convergence.de>
- * Holger Waechtler <holger at convergence.de>
- * Andre Draszik <ad at convergence.de>
- * for convergence integrated media GmbH
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef _DVBFRONTEND_H_
-#define _DVBFRONTEND_H_
-
-#include <asm/types.h>
-
-
-typedef enum fe_type {
- FE_QPSK,
- FE_QAM,
- FE_OFDM,
- FE_ATSC
-} fe_type_t;
-
-
-typedef enum fe_caps {
- FE_IS_STUPID = 0,
- FE_CAN_INVERSION_AUTO = 0x1,
- FE_CAN_FEC_1_2 = 0x2,
- FE_CAN_FEC_2_3 = 0x4,
- FE_CAN_FEC_3_4 = 0x8,
- FE_CAN_FEC_4_5 = 0x10,
- FE_CAN_FEC_5_6 = 0x20,
- FE_CAN_FEC_6_7 = 0x40,
- FE_CAN_FEC_7_8 = 0x80,
- FE_CAN_FEC_8_9 = 0x100,
- FE_CAN_FEC_AUTO = 0x200,
- FE_CAN_QPSK = 0x400,
- FE_CAN_QAM_16 = 0x800,
- FE_CAN_QAM_32 = 0x1000,
- FE_CAN_QAM_64 = 0x2000,
- FE_CAN_QAM_128 = 0x4000,
- FE_CAN_QAM_256 = 0x8000,
- FE_CAN_QAM_AUTO = 0x10000,
- FE_CAN_TRANSMISSION_MODE_AUTO = 0x20000,
- FE_CAN_BANDWIDTH_AUTO = 0x40000,
- FE_CAN_GUARD_INTERVAL_AUTO = 0x80000,
- FE_CAN_HIERARCHY_AUTO = 0x100000,
- FE_CAN_8VSB = 0x200000,
- FE_CAN_16VSB = 0x400000,
- FE_NEEDS_BENDING = 0x20000000, // not supported anymore, don't use (frontend requires frequency bending)
- FE_CAN_RECOVER = 0x40000000, // frontend can recover from a cable unplug automatically
- FE_CAN_MUTE_TS = 0x80000000 // frontend can stop spurious TS data output
-} fe_caps_t;
-
-
-struct dvb_frontend_info {
- char name[128];
- fe_type_t type;
- __u32 frequency_min;
- __u32 frequency_max;
- __u32 frequency_stepsize;
- __u32 frequency_tolerance;
- __u32 symbol_rate_min;
- __u32 symbol_rate_max;
- __u32 symbol_rate_tolerance; /* ppm */
- __u32 notifier_delay; /* DEPRECATED */
- fe_caps_t caps;
-};
-
-
-/**
- * Check out the DiSEqC bus spec available on http://www.eutelsat.org/ for
- * the meaning of this struct...
- */
-struct dvb_diseqc_master_cmd {
- __u8 msg [6]; /* { framing, address, command, data [3] } */
- __u8 msg_len; /* valid values are 3...6 */
-};
-
-
-struct dvb_diseqc_slave_reply {
- __u8 msg [4]; /* { framing, data [3] } */
- __u8 msg_len; /* valid values are 0...4, 0 means no msg */
- int timeout; /* return from ioctl after timeout ms with */
-}; /* errorcode when no message was received */
-
-
-typedef enum fe_sec_voltage {
- SEC_VOLTAGE_13,
- SEC_VOLTAGE_18,
- SEC_VOLTAGE_OFF
-} fe_sec_voltage_t;
-
-
-typedef enum fe_sec_tone_mode {
- SEC_TONE_ON,
- SEC_TONE_OFF
-} fe_sec_tone_mode_t;
-
-
-typedef enum fe_sec_mini_cmd {
- SEC_MINI_A,
- SEC_MINI_B
-} fe_sec_mini_cmd_t;
-
-
-typedef enum fe_status {
- FE_HAS_SIGNAL = 0x01, /* found something above the noise level */
- FE_HAS_CARRIER = 0x02, /* found a DVB signal */
- FE_HAS_VITERBI = 0x04, /* FEC is stable */
- FE_HAS_SYNC = 0x08, /* found sync bytes */
- FE_HAS_LOCK = 0x10, /* everything's working... */
- FE_TIMEDOUT = 0x20, /* no lock within the last ~2 seconds */
- FE_REINIT = 0x40 /* frontend was reinitialized, */
-} fe_status_t; /* application is recommended to reset */
- /* DiSEqC, tone and parameters */
-
-typedef enum fe_spectral_inversion {
- INVERSION_OFF,
- INVERSION_ON,
- INVERSION_AUTO
-} fe_spectral_inversion_t;
-
-
-typedef enum fe_code_rate {
- FEC_NONE = 0,
- FEC_1_2,
- FEC_2_3,
- FEC_3_4,
- FEC_4_5,
- FEC_5_6,
- FEC_6_7,
- FEC_7_8,
- FEC_8_9,
- FEC_AUTO
-} fe_code_rate_t;
-
-
-typedef enum fe_modulation {
- QPSK,
- QAM_16,
- QAM_32,
- QAM_64,
- QAM_128,
- QAM_256,
- QAM_AUTO,
- VSB_8,
- VSB_16
-} fe_modulation_t;
-
-typedef enum fe_transmit_mode {
- TRANSMISSION_MODE_2K,
- TRANSMISSION_MODE_8K,
- TRANSMISSION_MODE_AUTO
-} fe_transmit_mode_t;
-
-typedef enum fe_bandwidth {
- BANDWIDTH_8_MHZ,
- BANDWIDTH_7_MHZ,
- BANDWIDTH_6_MHZ,
- BANDWIDTH_AUTO
-} fe_bandwidth_t;
-
-
-typedef enum fe_guard_interval {
- GUARD_INTERVAL_1_32,
- GUARD_INTERVAL_1_16,
- GUARD_INTERVAL_1_8,
- GUARD_INTERVAL_1_4,
- GUARD_INTERVAL_AUTO
-} fe_guard_interval_t;
-
-
-typedef enum fe_hierarchy {
- HIERARCHY_NONE,
- HIERARCHY_1,
- HIERARCHY_2,
- HIERARCHY_4,
- HIERARCHY_AUTO
-} fe_hierarchy_t;
-
-
-struct dvb_qpsk_parameters {
- __u32 symbol_rate; /* symbol rate in Symbols per second */
- fe_code_rate_t fec_inner; /* forward error correction (see above) */
-};
-
-struct dvb_qam_parameters {
- __u32 symbol_rate; /* symbol rate in Symbols per second */
- fe_code_rate_t fec_inner; /* forward error correction (see above) */
- fe_modulation_t modulation; /* modulation type (see above) */
-};
-
-struct dvb_vsb_parameters {
- fe_modulation_t modulation; /* modulation type (see above) */
-};
-
-struct dvb_ofdm_parameters {
- fe_bandwidth_t bandwidth;
- fe_code_rate_t code_rate_HP; /* high priority stream code rate */
- fe_code_rate_t code_rate_LP; /* low priority stream code rate */
- fe_modulation_t constellation; /* modulation type (see above) */
- fe_transmit_mode_t transmission_mode;
- fe_guard_interval_t guard_interval;
- fe_hierarchy_t hierarchy_information;
-};
-
-
-struct dvb_frontend_parameters {
- __u32 frequency; /* (absolute) frequency in Hz for QAM/OFDM/ATSC */
- /* intermediate frequency in kHz for QPSK */
- fe_spectral_inversion_t inversion;
- union {
- struct dvb_qpsk_parameters qpsk;
- struct dvb_qam_parameters qam;
- struct dvb_ofdm_parameters ofdm;
- struct dvb_vsb_parameters vsb;
- } u;
-};
-
-
-struct dvb_frontend_event {
- fe_status_t status;
- struct dvb_frontend_parameters parameters;
-};
-
-
-
-#define FE_GET_INFO _IOR('o', 61, struct dvb_frontend_info)
-
-#define FE_DISEQC_RESET_OVERLOAD _IO('o', 62)
-#define FE_DISEQC_SEND_MASTER_CMD _IOW('o', 63, struct dvb_diseqc_master_cmd)
-#define FE_DISEQC_RECV_SLAVE_REPLY _IOR('o', 64, struct dvb_diseqc_slave_reply)
-#define FE_DISEQC_SEND_BURST _IO('o', 65) /* fe_sec_mini_cmd_t */
-
-#define FE_SET_TONE _IO('o', 66) /* fe_sec_tone_mode_t */
-#define FE_SET_VOLTAGE _IO('o', 67) /* fe_sec_voltage_t */
-#define FE_ENABLE_HIGH_LNB_VOLTAGE _IO('o', 68) /* int */
-
-#define FE_READ_STATUS _IOR('o', 69, fe_status_t)
-#define FE_READ_BER _IOR('o', 70, __u32)
-#define FE_READ_SIGNAL_STRENGTH _IOR('o', 71, __u16)
-#define FE_READ_SNR _IOR('o', 72, __u16)
-#define FE_READ_UNCORRECTED_BLOCKS _IOR('o', 73, __u32)
-
-#define FE_SET_FRONTEND _IOW('o', 76, struct dvb_frontend_parameters)
-#define FE_GET_FRONTEND _IOR('o', 77, struct dvb_frontend_parameters)
-#define FE_GET_EVENT _IOR('o', 78, struct dvb_frontend_event)
-
-#define FE_DISHNETWORK_SEND_LEGACY_CMD _IO('o', 80) /* unsigned int */
-
-#endif /*_DVBFRONTEND_H_*/
diff --git a/tools/scan_modified/scan/include/linux/dvb/net.h b/tools/scan_modified/scan/include/linux/dvb/net.h
deleted file mode 100644
index 4b8fa51..0000000
--- a/tools/scan_modified/scan/include/linux/dvb/net.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * net.h
- *
- * Copyright (C) 2000 Marcus Metzler <marcus at convergence.de>
- * & Ralph Metzler <ralph at convergence.de>
- for convergence integrated media GmbH
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef _DVBNET_H_
-#define _DVBNET_H_
-
-#include <asm/types.h>
-
-
-struct dvb_net_if {
- __u16 pid;
- __u16 if_num;
-};
-
-
-#define NET_ADD_IF _IOWR('o', 52, struct dvb_net_if)
-#define NET_REMOVE_IF _IO('o', 53)
-#define NET_GET_IF _IOWR('o', 54, struct dvb_net_if)
-
-#endif /*_DVBNET_H_*/
-
diff --git a/tools/scan_modified/scan/include/linux/dvb/osd.h b/tools/scan_modified/scan/include/linux/dvb/osd.h
deleted file mode 100644
index 0d81439..0000000
--- a/tools/scan_modified/scan/include/linux/dvb/osd.h
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * osd.h
- *
- * Copyright (C) 2001 Ralph Metzler <ralph at convergence.de>
- * & Marcus Metzler <marcus at convergence.de>
- for convergence integrated media GmbH
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Lesser Public License
- * as published by the Free Software Foundation; either version 2.1
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef _DVBOSD_H_
-#define _DVBOSD_H_
-
-typedef enum {
- // All functions return -2 on "not open"
- OSD_Close=1, // ()
- // Disables OSD and releases the buffers
- // returns 0 on success
- OSD_Open, // (x0,y0,x1,y1,BitPerPixel[2/4/8](color&0x0F),mix[0..15](color&0xF0))
- // Opens OSD with this size and bit depth
- // returns 0 on success, -1 on DRAM allocation error, -2 on "already open"
- OSD_Show, // ()
- // enables OSD mode
- // returns 0 on success
- OSD_Hide, // ()
- // disables OSD mode
- // returns 0 on success
- OSD_Clear, // ()
- // Sets all pixel to color 0
- // returns 0 on success
- OSD_Fill, // (color)
- // Sets all pixel to color <col>
- // returns 0 on success
- OSD_SetColor, // (color,R{x0},G{y0},B{x1},opacity{y1})
- // set palette entry <num> to <r,g,b>, <mix> and <trans> apply
- // R,G,B: 0..255
- // R=Red, G=Green, B=Blue
- // opacity=0: pixel opacity 0% (only video pixel shows)
- // opacity=1..254: pixel opacity as specified in header
- // opacity=255: pixel opacity 100% (only OSD pixel shows)
- // returns 0 on success, -1 on error
- OSD_SetPalette, // (firstcolor{color},lastcolor{x0},data)
- // Set a number of entries in the palette
- // sets the entries "firstcolor" through "lastcolor" from the array "data"
- // data has 4 byte for each color:
- // R,G,B, and a opacity value: 0->transparent, 1..254->mix, 255->pixel
- OSD_SetTrans, // (transparency{color})
- // Sets transparency of mixed pixel (0..15)
- // returns 0 on success
- OSD_SetPixel, // (x0,y0,color)
- // sets pixel <x>,<y> to color number <col>
- // returns 0 on success, -1 on error
- OSD_GetPixel, // (x0,y0)
- // returns color number of pixel <x>,<y>, or -1
- OSD_SetRow, // (x0,y0,x1,data)
- // fills pixels x0,y through x1,y with the content of data[]
- // returns 0 on success, -1 on clipping all pixel (no pixel drawn)
- OSD_SetBlock, // (x0,y0,x1,y1,increment{color},data)
- // fills pixels x0,y0 through x1,y1 with the content of data[]
- // inc contains the width of one line in the data block,
- // inc<=0 uses blockwidth as linewidth
- // returns 0 on success, -1 on clipping all pixel
- OSD_FillRow, // (x0,y0,x1,color)
- // fills pixels x0,y through x1,y with the color <col>
- // returns 0 on success, -1 on clipping all pixel
- OSD_FillBlock, // (x0,y0,x1,y1,color)
- // fills pixels x0,y0 through x1,y1 with the color <col>
- // returns 0 on success, -1 on clipping all pixel
- OSD_Line, // (x0,y0,x1,y1,color)
- // draw a line from x0,y0 to x1,y1 with the color <col>
- // returns 0 on success
- OSD_Query, // (x0,y0,x1,y1,xasp{color}}), yasp=11
- // fills parameters with the picture dimensions and the pixel aspect ratio
- // returns 0 on success
- OSD_Test, // ()
- // draws a test picture. for debugging purposes only
- // returns 0 on success
-// TODO: remove "test" in final version
- OSD_Text, // (x0,y0,size,color,text)
- OSD_SetWindow, // (x0) set window with number 0<x0<8 as current
- OSD_MoveWindow, // move current window to (x0, y0)
-} OSD_Command;
-
-typedef struct osd_cmd_s {
- OSD_Command cmd;
- int x0;
- int y0;
- int x1;
- int y1;
- int color;
- void *data;
-} osd_cmd_t;
-
-
-#define OSD_SEND_CMD _IOW('o', 160, osd_cmd_t)
-
-#endif
-
diff --git a/tools/scan_modified/scan/include/linux/dvb/version.h b/tools/scan_modified/scan/include/linux/dvb/version.h
deleted file mode 100644
index 54e256e..0000000
--- a/tools/scan_modified/scan/include/linux/dvb/version.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * version.h
- *
- * Copyright (C) 2000 Holger Waechtler <holger at convergence.de>
- * for convergence integrated media GmbH
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef _DVBVERSION_H_
-#define _DVBVERSION_H_
-
-#define DVB_API_VERSION 3
-
-#endif /*_DVBVERSION_H_*/
-
diff --git a/tools/scan_modified/scan/include/linux/dvb/video.h b/tools/scan_modified/scan/include/linux/dvb/video.h
deleted file mode 100644
index a8b6008..0000000
--- a/tools/scan_modified/scan/include/linux/dvb/video.h
+++ /dev/null
@@ -1,199 +0,0 @@
-/*
- * video.h
- *
- * Copyright (C) 2000 Marcus Metzler <marcus at convergence.de>
- * & Ralph Metzler <ralph at convergence.de>
- for convergence integrated media GmbH
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef _DVBVIDEO_H_
-#define _DVBVIDEO_H_
-
-#ifdef __KERNEL__
-#include <linux/types.h>
-#else
-#include <stdint.h>
-#include <time.h>
-#endif
-
-
-typedef enum {
- VIDEO_FORMAT_4_3, /* Select 4:3 format */
- VIDEO_FORMAT_16_9, /* Select 16:9 format. */
- VIDEO_FORMAT_221_1 /* 2.21:1 */
-} video_format_t;
-
-
-typedef enum {
- VIDEO_SYSTEM_PAL,
- VIDEO_SYSTEM_NTSC,
- VIDEO_SYSTEM_PALN,
- VIDEO_SYSTEM_PALNc,
- VIDEO_SYSTEM_PALM,
- VIDEO_SYSTEM_NTSC60,
- VIDEO_SYSTEM_PAL60,
- VIDEO_SYSTEM_PALM60
-} video_system_t;
-
-
-typedef enum {
- VIDEO_PAN_SCAN, /* use pan and scan format */
- VIDEO_LETTER_BOX, /* use letterbox format */
- VIDEO_CENTER_CUT_OUT /* use center cut out format */
-} video_displayformat_t;
-
-typedef struct {
- int w;
- int h;
- video_format_t aspect_ratio;
-} video_size_t;
-
-typedef enum {
- VIDEO_SOURCE_DEMUX, /* Select the demux as the main source */
- VIDEO_SOURCE_MEMORY /* If this source is selected, the stream
- comes from the user through the write
- system call */
-} video_stream_source_t;
-
-
-typedef enum {
- VIDEO_STOPPED, /* Video is stopped */
- VIDEO_PLAYING, /* Video is currently playing */
- VIDEO_FREEZED /* Video is freezed */
-} video_play_state_t;
-
-
-struct video_event {
- int32_t type;
-#define VIDEO_EVENT_SIZE_CHANGED 1
- time_t timestamp;
- union {
- video_size_t size;
- } u;
-};
-
-
-struct video_status {
- int video_blank; /* blank video on freeze? */
- video_play_state_t play_state; /* current state of playback */
- video_stream_source_t stream_source; /* current source (demux/memory) */
- video_format_t video_format; /* current aspect ratio of stream*/
- video_displayformat_t display_format;/* selected cropping mode */
-};
-
-
-struct video_still_picture {
- char *iFrame; /* pointer to a single iframe in memory */
- int32_t size;
-};
-
-
-typedef
-struct video_highlight {
- int active; /* 1=show highlight, 0=hide highlight */
- uint8_t contrast1; /* 7- 4 Pattern pixel contrast */
- /* 3- 0 Background pixel contrast */
- uint8_t contrast2; /* 7- 4 Emphasis pixel-2 contrast */
- /* 3- 0 Emphasis pixel-1 contrast */
- uint8_t color1; /* 7- 4 Pattern pixel color */
- /* 3- 0 Background pixel color */
- uint8_t color2; /* 7- 4 Emphasis pixel-2 color */
- /* 3- 0 Emphasis pixel-1 color */
- uint32_t ypos; /* 23-22 auto action mode */
- /* 21-12 start y */
- /* 9- 0 end y */
- uint32_t xpos; /* 23-22 button color number */
- /* 21-12 start x */
- /* 9- 0 end x */
-} video_highlight_t;
-
-
-typedef struct video_spu {
- int active;
- int stream_id;
-} video_spu_t;
-
-
-typedef struct video_spu_palette { /* SPU Palette information */
- int length;
- uint8_t *palette;
-} video_spu_palette_t;
-
-
-typedef struct video_navi_pack {
- int length; /* 0 ... 1024 */
- uint8_t data[1024];
-} video_navi_pack_t;
-
-
-typedef uint16_t video_attributes_t;
-/* bits: descr. */
-/* 15-14 Video compression mode (0=MPEG-1, 1=MPEG-2) */
-/* 13-12 TV system (0=525/60, 1=625/50) */
-/* 11-10 Aspect ratio (0=4:3, 3=16:9) */
-/* 9- 8 permitted display mode on 4:3 monitor (0=both, 1=only pan-sca */
-/* 7 line 21-1 data present in GOP (1=yes, 0=no) */
-/* 6 line 21-2 data present in GOP (1=yes, 0=no) */
-/* 5- 3 source resolution (0=720x480/576, 1=704x480/576, 2=352x480/57 */
-/* 2 source letterboxed (1=yes, 0=no) */
-/* 0 film/camera mode (0=camera, 1=film (625/50 only)) */
-
-
-/* bit definitions for capabilities: */
-/* can the hardware decode MPEG1 and/or MPEG2? */
-#define VIDEO_CAP_MPEG1 1
-#define VIDEO_CAP_MPEG2 2
-/* can you send a system and/or program stream to video device?
- (you still have to open the video and the audio device but only
- send the stream to the video device) */
-#define VIDEO_CAP_SYS 4
-#define VIDEO_CAP_PROG 8
-/* can the driver also handle SPU, NAVI and CSS encoded data?
- (CSS API is not present yet) */
-#define VIDEO_CAP_SPU 16
-#define VIDEO_CAP_NAVI 32
-#define VIDEO_CAP_CSS 64
-
-
-#define VIDEO_STOP _IO('o', 21)
-#define VIDEO_PLAY _IO('o', 22)
-#define VIDEO_FREEZE _IO('o', 23)
-#define VIDEO_CONTINUE _IO('o', 24)
-#define VIDEO_SELECT_SOURCE _IO('o', 25)
-#define VIDEO_SET_BLANK _IO('o', 26)
-#define VIDEO_GET_STATUS _IOR('o', 27, struct video_status)
-#define VIDEO_GET_EVENT _IOR('o', 28, struct video_event)
-#define VIDEO_SET_DISPLAY_FORMAT _IO('o', 29)
-#define VIDEO_STILLPICTURE _IOW('o', 30, struct video_still_picture)
-#define VIDEO_FAST_FORWARD _IO('o', 31)
-#define VIDEO_SLOWMOTION _IO('o', 32)
-#define VIDEO_GET_CAPABILITIES _IOR('o', 33, unsigned int)
-#define VIDEO_CLEAR_BUFFER _IO('o', 34)
-#define VIDEO_SET_ID _IO('o', 35)
-#define VIDEO_SET_STREAMTYPE _IO('o', 36)
-#define VIDEO_SET_FORMAT _IO('o', 37)
-#define VIDEO_SET_SYSTEM _IO('o', 38)
-#define VIDEO_SET_HIGHLIGHT _IOW('o', 39, video_highlight_t)
-#define VIDEO_SET_SPU _IOW('o', 50, video_spu_t)
-#define VIDEO_SET_SPU_PALETTE _IOW('o', 51, video_spu_palette_t)
-#define VIDEO_GET_NAVI _IOR('o', 52, video_navi_pack_t)
-#define VIDEO_SET_ATTRIBUTES _IO('o', 53)
-#define VIDEO_GET_SIZE _IOR('o', 55, video_size_t)
-
-#endif /*_DVBVIDEO_H_*/
-
diff --git a/tools/scan_modified/scan/list.h b/tools/scan_modified/scan/list.h
deleted file mode 100644
index 6032c22..0000000
--- a/tools/scan_modified/scan/list.h
+++ /dev/null
@@ -1,140 +0,0 @@
-#ifndef _LIST_H
-#define _LIST_H
-
-
-/*
- * Simple doubly linked list implementation.
- *
- * Some of the internal functions ("__xxx") are useful when
- * manipulating whole lists rather than single entries, as
- * sometimes we already know the next/prev entries and we can
- * generate better code by using them directly rather than
- * using the generic single-entry routines.
- */
-
-struct list_head {
- struct list_head *next, *prev;
-};
-
-#define LIST_HEAD_INIT(name) { &(name), &(name) }
-
-#define LIST_HEAD(name) \
- struct list_head name = LIST_HEAD_INIT(name)
-
-#define INIT_LIST_HEAD(ptr) do { \
- (ptr)->next = (ptr); (ptr)->prev = (ptr); \
-} while (0)
-
-/*
- * Insert a new entry between two known consecutive entries.
- *
- * This is only for internal list manipulation where we know
- * the prev/next entries already!
- */
-static __inline__ void __list_add(struct list_head * new,
- struct list_head * prev,
- struct list_head * next)
-{
- next->prev = new;
- new->next = next;
- new->prev = prev;
- prev->next = new;
-}
-
-/**
- * list_add - add a new entry
- * @new: new entry to be added
- * @head: list head to add it after
- *
- * Insert a new entry after the specified head.
- * This is good for implementing stacks.
- */
-static __inline__ void list_add(struct list_head *new, struct list_head *head)
-{
- __list_add(new, head, head->next);
-}
-
-/**
- * list_add_tail - add a new entry
- * @new: new entry to be added
- * @head: list head to add it before
- *
- * Insert a new entry before the specified head.
- * This is useful for implementing queues.
- */
-static __inline__ void list_add_tail(struct list_head *new, struct list_head *head)
-{
- __list_add(new, head->prev, head);
-}
-
-/*
- * Delete a list entry by making the prev/next entries
- * point to each other.
- *
- * This is only for internal list manipulation where we know
- * the prev/next entries already!
- */
-static __inline__ void __list_del(struct list_head * prev,
- struct list_head * next)
-{
- next->prev = prev;
- prev->next = next;
-}
-
-/**
- * list_del - deletes entry from list.
- * @entry: the element to delete from the list.
- * Note: list_empty on entry does not return true after this, the entry is in an undefined state.
- */
-static __inline__ void list_del(struct list_head *entry)
-{
- __list_del(entry->prev, entry->next);
-}
-
-/**
- * list_del_init - deletes entry from list and reinitialize it.
- * @entry: the element to delete from the list.
- */
-static __inline__ void list_del_init(struct list_head *entry)
-{
- __list_del(entry->prev, entry->next);
- INIT_LIST_HEAD(entry);
-}
-
-/**
- * list_empty - tests whether a list is empty
- * @head: the list to test.
- */
-static __inline__ int list_empty(struct list_head *head)
-{
- return head->next == head;
-}
-
-/**
- * list_entry - get the struct for this entry
- * @ptr: the &struct list_head pointer.
- * @type: the type of the struct this is embedded in.
- * @member: the name of the list_struct within the struct.
- */
-#define list_entry(ptr, type, member) \
- ((type *)((char *)(ptr)-(unsigned long)(&((type *)0)->member)))
-
-/**
- * list_for_each - iterate over a list
- * @pos: the &struct list_head to use as a loop counter.
- * @head: the head for your list.
- */
-#define list_for_each(pos, head) \
- for (pos = (head)->next; pos != (head); pos = pos->next)
-
-/**
- * list_for_each_safe - iterate over a list safe against removal of list entry
- * @pos: the &struct list_head to use as a loop counter.
- * @n: another &struct list_head to use as temporary storage
- * @head: the head for your list.
- */
-#define list_for_each_safe(pos, n, head) \
- for (pos = (head)->next, n = pos->next; pos != (head); \
- pos = n, n = pos->next)
-
-#endif
diff --git a/tools/scan_modified/scan/lnb.c b/tools/scan_modified/scan/lnb.c
deleted file mode 100644
index e30c1d6..0000000
--- a/tools/scan_modified/scan/lnb.c
+++ /dev/null
@@ -1,108 +0,0 @@
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include "lnb.h"
-
-static char *univ_desc[] = {
- "Europe",
- "10800 to 11800 MHz and 11600 to 12700 Mhz",
- "Dual LO, loband 9750, hiband 10600 MHz",
- (char *)NULL };
-
-static char *dbs_desc[] = {
- "Expressvu, North America",
- "12200 to 12700 MHz",
- "Single LO, 11250 MHz",
- (char *)NULL };
-
-static char *standard_desc[] = {
- "10945 to 11450 Mhz",
- "Single LO, 10000 Mhz",
- (char *)NULL };
-
-static char *enhan_desc[] = {
- "Astra",
- "10700 to 11700 MHz",
- "Single LO, 9750 MHz",
- (char *)NULL };
-
-static char *cband_desc[] = {
- "Big Dish - Monopoint LNBf",
- "3700 to 4200 MHz",
- "Single LO, 5150 Mhz",
- (char *)NULL };
-
-static char *cmulti_desc[] = {
- "Big Dish - Multipoint LNBf",
- "3700 to 4200 MHz",
- "Dual LO, 5150/5750 Mhz",
- (char *)NULL };
-
-static struct lnb_types_st lnbs[] = {
- {"UNIVERSAL", univ_desc, 9750, 10600, 11700 },
- {"DBS", dbs_desc, 11250, 0, 0 },
- {"STANDARD", standard_desc, 10000, 0, 0 },
- {"ENHANCED", enhan_desc, 9750, 0, 0 },
- {"C-BAND", cband_desc, 5150, 0, 0 },
- {"C-MULTI", cmulti_desc, 5150, 5750, 0 }
-};
-
-/* Enumerate through standard types of LNB's until NULL returned.
- * Increment curno each time
- */
-
-struct lnb_types_st *
-lnb_enum(int curno)
-{
- if (curno >= (int) (sizeof(lnbs) / sizeof(lnbs[0])))
- return (struct lnb_types_st *)NULL;
- return &lnbs[curno];
-}
-
-/* Decode an lnb type, for example given on a command line
- * If alpha and standard type, e.g. "Universal" then match that
- * otherwise low[,high[,switch]]
- */
-
-int
-lnb_decode(char *str, struct lnb_types_st *lnbp)
-{
-int i;
-char *cp, *np;
-
- memset(lnbp, 0, sizeof(*lnbp));
- cp = str;
- while(*cp && isspace(*cp))
- cp++;
- if (isalpha(*cp)) {
- for (i = 0; i < (int) (sizeof(lnbs) / sizeof(lnbs[0])); i++) {
- if (!strcasecmp(lnbs[i].name, cp)) {
- *lnbp = lnbs[i];
- return 1;
- }
- }
- return -1;
- }
- if (*cp == '\0' || !isdigit(*cp))
- return -1;
- lnbp->low_val = strtoul(cp, &np, 0);
- if (lnbp->low_val == 0)
- return -1;
- cp = np;
- while(*cp && (isspace(*cp) || *cp == ','))
- cp++;
- if (*cp == '\0')
- return 1;
- if (!isdigit(*cp))
- return -1;
- lnbp->high_val = strtoul(cp, &np, 0);
- cp = np;
- while(*cp && (isspace(*cp) || *cp == ','))
- cp++;
- if (*cp == '\0')
- return 1;
- if (!isdigit(*cp))
- return -1;
- lnbp->switch_val = strtoul(cp, NULL, 0);
- return 1;
-}
diff --git a/tools/scan_modified/scan/lnb.h b/tools/scan_modified/scan/lnb.h
deleted file mode 100644
index f78b7a6..0000000
--- a/tools/scan_modified/scan/lnb.h
+++ /dev/null
@@ -1,24 +0,0 @@
-
-struct lnb_types_st {
- char *name;
- char **desc;
- unsigned long low_val;
- unsigned long high_val; /* zero indicates no hiband */
- unsigned long switch_val; /* zero indicates no hiband */
-};
-
-/* Enumerate through standard types of LNB's until NULL returned.
- * Increment curno each time
- */
-
-struct lnb_types_st *
-lnb_enum(int curno);
-
-/* Decode an lnb type, for example given on a command line
- * If alpha and standard type, e.g. "Universal" then match that
- * otherwise low[,high[,switch]]
- */
-
-int
-lnb_decode(char *str, struct lnb_types_st *lnbp);
-
diff --git a/tools/scan_modified/scan/scan.c b/tools/scan_modified/scan/scan.c
deleted file mode 100644
index 9c03b80..0000000
--- a/tools/scan_modified/scan/scan.c
+++ /dev/null
@@ -1,2331 +0,0 @@
-/*
- * Simple MPEG parser to achieve network/service information.
- *
- * refered standards:
- *
- * ETSI EN 300 468
- * ETSI TR 101 211
- * ETSI ETR 211
- * ITU-T H.222.0
- *
- * 2005-05-10 - Basic ATSC PSIP parsing support added
- * ATSC Standard Revision B (A65/B)
- *
- * Thanks to Sean Device from Triveni for providing access to ATSC signals
- * and to Kevin Fowlks for his independent ATSC scanning tool.
- *
- * Please contribute: It is possible that some descriptors for ATSC are
- * not parsed yet and thus the result won't be complete.
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/ioctl.h>
-#include <sys/poll.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <time.h>
-#include <errno.h>
-#include <signal.h>
-#include <assert.h>
-#include <glob.h>
-#include <ctype.h>
-
-#include <linux/dvb/frontend.h>
-#include <linux/dvb/dmx.h>
-
-#include "list.h"
-#include "diseqc.h"
-#include "dump-zap.h"
-#include "dump-vdr.h"
-#include "dump-mumudvb.h"
-#include "scan.h"
-#include "lnb.h"
-
-#include "atsc_psip_section.h"
-
-static char demux_devname[80];
-
-static struct dvb_frontend_info fe_info = {
- .type = -1
-};
-
-int verbosity = 2;
-
-static int long_timeout;
-static int current_tp_only;
-static int get_other_nits;
-static int vdr_dump_provider;
-static int vdr_dump_channum;
-static int no_ATSC_PSIP;
-static int ATSC_type=1;
-static int ca_select = 1;
-static int serv_select = 7;
-static int vdr_version = 2;
-static struct lnb_types_st lnb_type;
-static int unique_anon_services;
-
-static enum fe_spectral_inversion spectral_inversion = INVERSION_AUTO;
-
-enum table_type {
- PAT,
- PMT,
- SDT,
- NIT
-};
-
-enum format {
- OUTPUT_ZAP,
- OUTPUT_VDR,
- OUTPUT_PIDS,
- OUTPUT_MUMUDVB
-};
-static enum format output_format = OUTPUT_ZAP;
-static int output_format_set = 0;
-
-
-enum polarisation {
- POLARISATION_HORIZONTAL = 0x00,
- POLARISATION_VERTICAL = 0x01,
- POLARISATION_CIRCULAR_LEFT = 0x02,
- POLARISATION_CIRCULAR_RIGHT = 0x03
-};
-
-enum running_mode {
- RM_NOT_RUNNING = 0x01,
- RM_STARTS_SOON = 0x02,
- RM_PAUSING = 0x03,
- RM_RUNNING = 0x04
-};
-
-#define AUDIO_CHAN_MAX (32)
-#define CA_SYSTEM_ID_MAX (16)
-
-struct service {
- struct list_head list;
- int transport_stream_id;
- int service_id;
- char *provider_name;
- char *service_name;
- uint16_t pmt_pid;
- uint16_t pcr_pid;
- uint16_t video_pid;
- uint16_t audio_pid[AUDIO_CHAN_MAX];
- char audio_lang[AUDIO_CHAN_MAX][4];
- int audio_num;
- uint16_t ca_id[CA_SYSTEM_ID_MAX];
- int ca_num;
- uint16_t teletext_pid;
- uint16_t subtitling_pid;
- uint16_t ac3_pid;
- unsigned int type : 8;
- unsigned int scrambled : 1;
- enum running_mode running;
- void *priv;
- int channel_num;
-};
-
-struct transponder {
- struct list_head list;
- struct list_head services;
- int network_id;
- int transport_stream_id;
- enum fe_type type;
- struct dvb_frontend_parameters param;
- enum polarisation polarisation; /* only for DVB-S */
- int orbital_pos; /* only for DVB-S */
- unsigned int we_flag : 1; /* West/East Flag - only for DVB-S */
- unsigned int scan_done : 1;
- unsigned int last_tuning_failed : 1;
- unsigned int other_frequency_flag : 1; /* DVB-T */
- unsigned int wrong_frequency : 1; /* DVB-T with other_frequency_flag */
- int n_other_f;
- uint32_t *other_f; /* DVB-T freqeuency-list descriptor */
-};
-
-
-struct section_buf {
- struct list_head list;
- const char *dmx_devname;
- unsigned int run_once : 1;
- unsigned int segmented : 1; /* segmented by table_id_ext */
- int fd;
- int pid;
- int table_id;
- int table_id_ext;
- int section_version_number;
- uint8_t section_done[32];
- int sectionfilter_done;
- unsigned char buf[1024];
- time_t timeout;
- time_t start_time;
- time_t running_time;
- struct section_buf *next_seg; /* this is used to handle
- * segmented tables (like NIT-other)
- */
-};
-
-static LIST_HEAD(scanned_transponders);
-static LIST_HEAD(new_transponders);
-static struct transponder *current_tp;
-
-
-static void dump_dvb_parameters (FILE *f, struct transponder *p);
-
-static void setup_filter (struct section_buf* s, const char *dmx_devname,
- int pid, int tid, int tid_ext,
- int run_once, int segmented, int timeout);
-static void add_filter (struct section_buf *s);
-
-static const char * fe_type2str(fe_type_t t);
-
-/* According to the DVB standards, the combination of network_id and
- * transport_stream_id should be unique, but in real life the satellite
- * operators and broadcasters don't care enough to coordinate
- * the numbering. Thus we identify TPs by frequency (dvbscan handles only
- * one satellite at a time). Further complication: Different NITs on
- * one satellite sometimes list the same TP with slightly different
- * frequencies, so we have to search within some bandwidth.
- */
-static struct transponder *alloc_transponder(uint32_t frequency)
-{
- struct transponder *tp = calloc(1, sizeof(*tp));
-
- tp->param.frequency = frequency;
- INIT_LIST_HEAD(&tp->list);
- INIT_LIST_HEAD(&tp->services);
- list_add_tail(&tp->list, &new_transponders);
- return tp;
-}
-
-static int is_same_transponder(uint32_t f1, uint32_t f2)
-{
- uint32_t diff;
- if (f1 == f2)
- return 1;
- diff = (f1 > f2) ? (f1 - f2) : (f2 - f1);
- //FIXME: use symbolrate etc. to estimate bandwidth
- if (diff < 2000) {
- debug("f1 = %u is same TP as f2 = %u\n", f1, f2);
- return 1;
- }
- return 0;
-}
-
-static struct transponder *find_transponder(uint32_t frequency)
-{
- struct list_head *pos;
- struct transponder *tp;
-
- list_for_each(pos, &scanned_transponders) {
- tp = list_entry(pos, struct transponder, list);
- if (current_tp_only)
- return tp;
- if (is_same_transponder(tp->param.frequency, frequency))
- return tp;
- }
- list_for_each(pos, &new_transponders) {
- tp = list_entry(pos, struct transponder, list);
- if (is_same_transponder(tp->param.frequency, frequency))
- return tp;
- }
- return NULL;
-}
-
-static void copy_transponder(struct transponder *d, struct transponder *s)
-{
- d->network_id = s->network_id;
- d->transport_stream_id = s->transport_stream_id;
- d->type = s->type;
- memcpy(&d->param, &s->param, sizeof(d->param));
- d->polarisation = s->polarisation;
- d->orbital_pos = s->orbital_pos;
- d->we_flag = s->we_flag;
- d->scan_done = s->scan_done;
- d->last_tuning_failed = s->last_tuning_failed;
- d->other_frequency_flag = s->other_frequency_flag;
- d->n_other_f = s->n_other_f;
- if (d->n_other_f) {
- d->other_f = calloc(d->n_other_f, sizeof(uint32_t));
- memcpy(d->other_f, s->other_f, d->n_other_f * sizeof(uint32_t));
- }
- else
- d->other_f = NULL;
-}
-
-/* service_ids are guaranteed to be unique within one TP
- * (the DVB standards say theay should be unique within one
- * network, but in real life...)
- */
-static struct service *alloc_service(struct transponder *tp, int service_id)
-{
- struct service *s = calloc(1, sizeof(*s));
- INIT_LIST_HEAD(&s->list);
- s->service_id = service_id;
- s->transport_stream_id = tp->transport_stream_id;
- list_add_tail(&s->list, &tp->services);
- return s;
-}
-
-static struct service *find_service(struct transponder *tp, int service_id)
-{
- struct list_head *pos;
- struct service *s;
-
- list_for_each(pos, &tp->services) {
- s = list_entry(pos, struct service, list);
- if (s->service_id == service_id)
- return s;
- }
- return NULL;
-}
-
-
-static void parse_ca_identifier_descriptor (const unsigned char *buf,
- struct service *s)
-{
- unsigned char len = buf [1];
- unsigned int i;
-
- buf += 2;
-
- if (len > sizeof(s->ca_id)) {
- len = sizeof(s->ca_id);
- warning("too many CA system ids\n");
- }
- memcpy(s->ca_id, buf, len);
- for (i = 0; i < len / sizeof(s->ca_id[0]); i++)
- moreverbose(" CA ID 0x%04x\n", s->ca_id[i]);
-}
-
-
-static void parse_iso639_language_descriptor (const unsigned char *buf, struct service *s)
-{
- unsigned char len = buf [1];
-
- buf += 2;
-
- if (len >= 4) {
- debug(" LANG=%.3s %d\n", buf, buf[3]);
- memcpy(s->audio_lang[s->audio_num], buf, 3);
-#if 0
- /* seems like the audio_type is wrong all over the place */
- //if (buf[3] == 0) -> normal
- if (buf[3] == 1)
- s->audio_lang[s->audio_num][3] = '!'; /* clean effects (no language) */
- else if (buf[3] == 2)
- s->audio_lang[s->audio_num][3] = '?'; /* for the hearing impaired */
- else if (buf[3] == 3)
- s->audio_lang[s->audio_num][3] = '+'; /* visually impaired commentary */
-#endif
- }
-}
-
-static void parse_network_name_descriptor (const unsigned char *buf, void *dummy)
-{
- (void)dummy;
-
- unsigned char len = buf [1];
-
- info("Network Name '%.*s'\n", len, buf + 2);
-}
-
-static void parse_terrestrial_uk_channel_number (const unsigned char *buf, void *dummy)
-{
- (void)dummy;
-
- int i, n, channel_num, service_id;
- struct list_head *p1, *p2;
- struct transponder *t;
- struct service *s;
-
- // 32 bits per record
- n = buf[1] / 4;
- if (n < 1)
- return;
-
- // desc id, desc len, (service id, service number)
- buf += 2;
- for (i = 0; i < n; i++) {
- service_id = (buf[0]<<8)|(buf[1]&0xff);
- channel_num = ((buf[2]&0x03)<<8)|(buf[3]&0xff);
- debug("Service ID 0x%x has channel number %d ", service_id, channel_num);
- list_for_each(p1, &scanned_transponders) {
- t = list_entry(p1, struct transponder, list);
- list_for_each(p2, &t->services) {
- s = list_entry(p2, struct service, list);
- if (s->service_id == service_id)
- s->channel_num = channel_num;
- }
- }
- buf += 4;
- }
-}
-
-
-static long bcd32_to_cpu (const int b0, const int b1, const int b2, const int b3)
-{
- return ((b0 >> 4) & 0x0f) * 10000000 + (b0 & 0x0f) * 1000000 +
- ((b1 >> 4) & 0x0f) * 100000 + (b1 & 0x0f) * 10000 +
- ((b2 >> 4) & 0x0f) * 1000 + (b2 & 0x0f) * 100 +
- ((b3 >> 4) & 0x0f) * 10 + (b3 & 0x0f);
-}
-
-
-static const fe_code_rate_t fec_tab [8] = {
- FEC_AUTO, FEC_1_2, FEC_2_3, FEC_3_4,
- FEC_5_6, FEC_7_8, FEC_NONE, FEC_NONE
-};
-
-
-static const fe_modulation_t qam_tab [6] = {
- QAM_AUTO, QAM_16, QAM_32, QAM_64, QAM_128, QAM_256
-};
-
-
-static void parse_cable_delivery_system_descriptor (const unsigned char *buf,
- struct transponder *t)
-{
- if (!t) {
- warning("cable_delivery_system_descriptor outside transport stream definition (ignored)\n");
- return;
- }
- t->type = FE_QAM;
-
- t->param.frequency = bcd32_to_cpu (buf[2], buf[3], buf[4], buf[5]);
- t->param.frequency *= 100;
- t->param.u.qam.fec_inner = fec_tab[buf[12] & 0x07];
- t->param.u.qam.symbol_rate = 10 * bcd32_to_cpu (buf[9],
- buf[10],
- buf[11],
- buf[12] & 0xf0);
- if ((buf[8] & 0x0f) > 5)
- t->param.u.qam.modulation = QAM_AUTO;
- else
- t->param.u.qam.modulation = qam_tab[buf[8] & 0x0f];
- t->param.inversion = spectral_inversion;
-
- if (verbosity >= 5) {
- debug("%#04x/%#04x ", t->network_id, t->transport_stream_id);
- dump_dvb_parameters (stderr, t);
- if (t->scan_done)
- dprintf(5, " (done)");
- if (t->last_tuning_failed)
- dprintf(5, " (tuning failed)");
- dprintf(5, "\n");
- }
-}
-
-static void parse_satellite_delivery_system_descriptor (const unsigned char *buf,
- struct transponder *t)
-{
- if (!t) {
- warning("satellite_delivery_system_descriptor outside transport stream definition (ignored)\n");
- return;
- }
- t->type = FE_QPSK;
- t->param.frequency = 10 * bcd32_to_cpu (buf[2], buf[3], buf[4], buf[5]);
- t->param.u.qpsk.fec_inner = fec_tab[buf[12] & 0x07];
- t->param.u.qpsk.symbol_rate = 10 * bcd32_to_cpu (buf[9],
- buf[10],
- buf[11],
- buf[12] & 0xf0);
-
- t->polarisation = (buf[8] >> 5) & 0x03;
- t->param.inversion = spectral_inversion;
-
- t->orbital_pos = bcd32_to_cpu (0x00, 0x00, buf[6], buf[7]);
- t->we_flag = buf[8] >> 7;
-
- if (verbosity >= 5) {
- debug("%#04x/%#04x ", t->network_id, t->transport_stream_id);
- dump_dvb_parameters (stderr, t);
- if (t->scan_done)
- dprintf(5, " (done)");
- if (t->last_tuning_failed)
- dprintf(5, " (tuning failed)");
- dprintf(5, "\n");
- }
-}
-
-
-static void parse_terrestrial_delivery_system_descriptor (const unsigned char *buf,
- struct transponder *t)
-{
- static const fe_modulation_t m_tab [] = { QPSK, QAM_16, QAM_64, QAM_AUTO };
- static const fe_code_rate_t ofec_tab [8] = { FEC_1_2, FEC_2_3, FEC_3_4,
- FEC_5_6, FEC_7_8 };
- struct dvb_ofdm_parameters *o;
-
- if (!t) {
- warning("terrestrial_delivery_system_descriptor outside transport stream definition (ignored)\n");
- return;
- }
- o = &t->param.u.ofdm;
- t->type = FE_OFDM;
-
- t->param.frequency = (buf[2] << 24) | (buf[3] << 16);
- t->param.frequency |= (buf[4] << 8) | buf[5];
- t->param.frequency *= 10;
- t->param.inversion = spectral_inversion;
-
- o->bandwidth = BANDWIDTH_8_MHZ + ((buf[6] >> 5) & 0x3);
- o->constellation = m_tab[(buf[7] >> 6) & 0x3];
- o->hierarchy_information = HIERARCHY_NONE + ((buf[7] >> 3) & 0x3);
-
- if ((buf[7] & 0x7) > 4)
- o->code_rate_HP = FEC_AUTO;
- else
- o->code_rate_HP = ofec_tab [buf[7] & 0x7];
-
- if (((buf[8] >> 5) & 0x7) > 4)
- o->code_rate_LP = FEC_AUTO;
- else
- o->code_rate_LP = ofec_tab [(buf[8] >> 5) & 0x7];
-
- o->guard_interval = GUARD_INTERVAL_1_32 + ((buf[8] >> 3) & 0x3);
-
- o->transmission_mode = (buf[8] & 0x2) ?
- TRANSMISSION_MODE_8K :
- TRANSMISSION_MODE_2K;
-
- t->other_frequency_flag = (buf[8] & 0x01);
-
- if (verbosity >= 5) {
- debug("%#04x/%#04x ", t->network_id, t->transport_stream_id);
- dump_dvb_parameters (stderr, t);
- if (t->scan_done)
- dprintf(5, " (done)");
- if (t->last_tuning_failed)
- dprintf(5, " (tuning failed)");
- dprintf(5, "\n");
- }
-}
-
-static void parse_frequency_list_descriptor (const unsigned char *buf,
- struct transponder *t)
-{
- int n, i;
- typeof(*t->other_f) f;
-
- if (!t) {
- warning("frequency_list_descriptor outside transport stream definition (ignored)\n");
- return;
- }
- if (t->other_f)
- return;
-
- n = (buf[1] - 1) / 4;
- if (n < 1 || (buf[2] & 0x03) != 3)
- return;
-
- t->other_f = calloc(n, sizeof(*t->other_f));
- t->n_other_f = n;
- buf += 3;
- for (i = 0; i < n; i++) {
- f = (buf[0] << 24) | (buf[1] << 16) | (buf[2] << 8) | buf[3];
- t->other_f[i] = f * 10;
- buf += 4;
- }
-
-}
-
-static void parse_service_descriptor (const unsigned char *buf, struct service *s)
-{
- unsigned char len;
- unsigned char *src, *dest;
-
- s->type = buf[2];
-
- buf += 3;
- len = *buf;
- buf++;
-
- if (s->provider_name)
- free (s->provider_name);
-
- s->provider_name = malloc (len + 1);
- memcpy (s->provider_name, buf, len);
- s->provider_name[len] = '\0';
-
- /* remove control characters (FIXME: handle short/long name) */
- /* FIXME: handle character set correctly (e.g. via iconv)
- * c.f. EN 300 468 annex A */
- for (src = dest = (unsigned char *) s->provider_name; *src; src++)
- if (*src >= 0x20 && (*src < 0x80 || *src > 0x9f))
- *dest++ = *src;
- *dest = '\0';
- if (!s->provider_name[0]) {
- /* zap zero length names */
- free (s->provider_name);
- s->provider_name = 0;
- }
-
- if (s->service_name)
- free (s->service_name);
-
- buf += len;
- len = *buf;
- buf++;
-
- s->service_name = malloc (len + 1);
- memcpy (s->service_name, buf, len);
- s->service_name[len] = '\0';
-
- /* remove control characters (FIXME: handle short/long name) */
- /* FIXME: handle character set correctly (e.g. via iconv)
- * c.f. EN 300 468 annex A */
- for (src = dest = (unsigned char *) s->service_name; *src; src++)
- if (*src >= 0x20 && (*src < 0x80 || *src > 0x9f))
- *dest++ = *src;
- *dest = '\0';
- if (!s->service_name[0]) {
- /* zap zero length names */
- free (s->service_name);
- s->service_name = 0;
- }
-
- info("0x%04x 0x%04x: pmt_pid 0x%04x %s -- %s (%s%s)\n",
- s->transport_stream_id,
- s->service_id,
- s->pmt_pid,
- s->provider_name, s->service_name,
- s->running == RM_NOT_RUNNING ? "not running" :
- s->running == RM_STARTS_SOON ? "starts soon" :
- s->running == RM_PAUSING ? "pausing" :
- s->running == RM_RUNNING ? "running" : "???",
- s->scrambled ? ", scrambled" : "");
-}
-
-static int find_descriptor(uint8_t tag, const unsigned char *buf,
- int descriptors_loop_len,
- const unsigned char **desc, int *desc_len)
-{
- while (descriptors_loop_len > 0) {
- unsigned char descriptor_tag = buf[0];
- unsigned char descriptor_len = buf[1] + 2;
-
- if (!descriptor_len) {
- warning("descriptor_tag == 0x%02x, len is 0\n", descriptor_tag);
- break;
- }
-
- if (tag == descriptor_tag) {
- if (desc)
- *desc = buf;
- if (desc_len)
- *desc_len = descriptor_len;
- return 1;
- }
-
- buf += descriptor_len;
- descriptors_loop_len -= descriptor_len;
- }
- return 0;
-}
-
-static void parse_descriptors(enum table_type t, const unsigned char *buf,
- int descriptors_loop_len, void *data)
-{
- while (descriptors_loop_len > 0) {
- unsigned char descriptor_tag = buf[0];
- unsigned char descriptor_len = buf[1] + 2;
-
- if (!descriptor_len) {
- warning("descriptor_tag == 0x%02x, len is 0\n", descriptor_tag);
- break;
- }
-
- switch (descriptor_tag) {
- case 0x0a:
- if (t == PMT)
- parse_iso639_language_descriptor (buf, data);
- break;
-
- case 0x40:
- if (t == NIT)
- parse_network_name_descriptor (buf, data);
- break;
-
- case 0x43:
- if (t == NIT)
- parse_satellite_delivery_system_descriptor (buf, data);
- break;
-
- case 0x44:
- if (t == NIT)
- parse_cable_delivery_system_descriptor (buf, data);
- break;
-
- case 0x48:
- if (t == SDT)
- parse_service_descriptor (buf, data);
- break;
-
- case 0x53:
- if (t == SDT)
- parse_ca_identifier_descriptor (buf, data);
- break;
-
- case 0x5a:
- if (t == NIT)
- parse_terrestrial_delivery_system_descriptor (buf, data);
- break;
-
- case 0x62:
- if (t == NIT)
- parse_frequency_list_descriptor (buf, data);
- break;
-
- case 0x83:
- /* 0x83 is in the privately defined range of descriptor tags,
- * so we parse this only if the user says so to avoid
- * problems when 0x83 is something entirely different... */
- if (t == NIT && vdr_dump_channum)
- parse_terrestrial_uk_channel_number (buf, data);
- break;
-
- default:
- verbosedebug("skip descriptor 0x%02x\n", descriptor_tag);
- };
-
- buf += descriptor_len;
- descriptors_loop_len -= descriptor_len;
- }
-}
-
-
-static void parse_pat(const unsigned char *buf, int section_length,
- int transport_stream_id)
-{
- (void)transport_stream_id;
-
- while (section_length > 0) {
- struct service *s;
- int service_id = (buf[0] << 8) | buf[1];
-
- if (service_id == 0)
- goto skip; /* nit pid entry */
-
- /* SDT might have been parsed first... */
- s = find_service(current_tp, service_id);
- if (!s)
- s = alloc_service(current_tp, service_id);
- s->pmt_pid = ((buf[2] & 0x1f) << 8) | buf[3];
- if (!s->priv && s->pmt_pid) {
- s->priv = malloc(sizeof(struct section_buf));
- setup_filter(s->priv, demux_devname,
- s->pmt_pid, 0x02, s->service_id, 1, 0, 5);
-
- add_filter (s->priv);
- }
-
-skip:
- buf += 4;
- section_length -= 4;
- };
-}
-
-
-static void parse_pmt (const unsigned char *buf, int section_length, int service_id)
-{
- int program_info_len;
- struct service *s;
- char msg_buf[14 * AUDIO_CHAN_MAX + 1];
- char *tmp;
- int i;
-
- s = find_service (current_tp, service_id);
- if (!s) {
- error("PMT for serivce_id 0x%04x was not in PAT\n", service_id);
- return;
- }
-
- s->pcr_pid = ((buf[0] & 0x1f) << 8) | buf[1];
-
- program_info_len = ((buf[2] & 0x0f) << 8) | buf[3];
-
- buf += program_info_len + 4;
- section_length -= program_info_len + 4;
-
- while (section_length >= 5) {
- int ES_info_len = ((buf[3] & 0x0f) << 8) | buf[4];
- int elementary_pid = ((buf[1] & 0x1f) << 8) | buf[2];
-
- switch (buf[0]) {
- case 0x01:
- case 0x02:
- case 0x1b: /* H.264 video stream */
- moreverbose(" VIDEO : PID 0x%04x\n", elementary_pid);
- if (s->video_pid == 0)
- s->video_pid = elementary_pid;
- break;
- case 0x03:
- case 0x81: /* Audio per ATSC A/53B [2] Annex B */
- case 0x0f: /* ADTS Audio Stream - usually AAC */
- case 0x11: /* ISO/IEC 14496-3 Audio with LATM transport */
- case 0x04:
- moreverbose(" AUDIO : PID 0x%04x\n", elementary_pid);
- if (s->audio_num < AUDIO_CHAN_MAX) {
- s->audio_pid[s->audio_num] = elementary_pid;
- parse_descriptors (PMT, buf + 5, ES_info_len, s);
- s->audio_num++;
- }
- else
- warning("more than %i audio channels, truncating\n",
- AUDIO_CHAN_MAX);
- break;
- case 0x06:
- if (find_descriptor(0x56, buf + 5, ES_info_len, NULL, NULL)) {
- moreverbose(" TELETEXT : PID 0x%04x\n", elementary_pid);
- s->teletext_pid = elementary_pid;
- break;
- }
- else if (find_descriptor(0x59, buf + 5, ES_info_len, NULL, NULL)) {
- /* Note: The subtitling descriptor can also signal
- * teletext subtitling, but then the teletext descriptor
- * will also be present; so we can be quite confident
- * that we catch DVB subtitling streams only here, w/o
- * parsing the descriptor. */
- moreverbose(" SUBTITLING: PID 0x%04x\n", elementary_pid);
- s->subtitling_pid = elementary_pid;
- break;
- }
- else if (find_descriptor(0x6a, buf + 5, ES_info_len, NULL, NULL)) {
- moreverbose(" AC3 : PID 0x%04x\n", elementary_pid);
- s->ac3_pid = elementary_pid;
- break;
- }
- /* fall through */
- default:
- moreverbose(" OTHER : PID 0x%04x TYPE 0x%02x\n", elementary_pid, buf[0]);
- };
-
- buf += ES_info_len + 5;
- section_length -= ES_info_len + 5;
- };
-
-
- tmp = msg_buf;
- tmp += sprintf(tmp, "0x%04x (%.4s)", s->audio_pid[0], s->audio_lang[0]);
-
- if (s->audio_num > AUDIO_CHAN_MAX) {
- warning("more than %i audio channels: %i, truncating to %i\n",
- AUDIO_CHAN_MAX, s->audio_num, AUDIO_CHAN_MAX);
- s->audio_num = AUDIO_CHAN_MAX;
- }
-
- for (i=1; i<s->audio_num; i++)
- tmp += sprintf(tmp, ", 0x%04x (%.4s)", s->audio_pid[i], s->audio_lang[i]);
-
- debug("0x%04x 0x%04x: %s -- %s, pmt_pid 0x%04x, vpid 0x%04x, apid %s\n",
- s->transport_stream_id,
- s->service_id,
- s->provider_name, s->service_name,
- s->pmt_pid, s->video_pid, msg_buf);
-}
-
-
-static void parse_nit (const unsigned char *buf, int section_length, int network_id)
-{
- int descriptors_loop_len = ((buf[0] & 0x0f) << 8) | buf[1];
-
- if (section_length < descriptors_loop_len + 4)
- {
- warning("section too short: network_id == 0x%04x, section_length == %i, "
- "descriptors_loop_len == %i\n",
- network_id, section_length, descriptors_loop_len);
- return;
- }
-
- parse_descriptors (NIT, buf + 2, descriptors_loop_len, NULL);
-
- section_length -= descriptors_loop_len + 4;
- buf += descriptors_loop_len + 4;
-
- while (section_length > 6) {
- int transport_stream_id = (buf[0] << 8) | buf[1];
- struct transponder *t, tn;
-
- descriptors_loop_len = ((buf[4] & 0x0f) << 8) | buf[5];
-
- if (section_length < descriptors_loop_len + 4)
- {
- warning("section too short: transport_stream_id == 0x%04x, "
- "section_length == %i, descriptors_loop_len == %i\n",
- transport_stream_id, section_length,
- descriptors_loop_len);
- break;
- }
-
- debug("transport_stream_id 0x%04x\n", transport_stream_id);
-
- memset(&tn, 0, sizeof(tn));
- tn.type = -1;
- tn.network_id = network_id;
- tn.transport_stream_id = transport_stream_id;
-
- parse_descriptors (NIT, buf + 6, descriptors_loop_len, &tn);
-
- if (tn.type == fe_info.type) {
- /* only add if develivery_descriptor matches FE type */
- t = find_transponder(tn.param.frequency);
- if (!t)
- t = alloc_transponder(tn.param.frequency);
- copy_transponder(t, &tn);
- }
-
- section_length -= descriptors_loop_len + 6;
- buf += descriptors_loop_len + 6;
- }
-}
-
-
-static void parse_sdt (const unsigned char *buf, int section_length,
- int transport_stream_id)
-{
- (void)transport_stream_id;
-
- buf += 3; /* skip original network id + reserved field */
-
- while (section_length >= 5) {
- int service_id = (buf[0] << 8) | buf[1];
- int descriptors_loop_len = ((buf[3] & 0x0f) << 8) | buf[4];
- struct service *s;
-
- if (section_length < descriptors_loop_len || !descriptors_loop_len)
- {
- warning("section too short: service_id == 0x%02x, section_length == %i, "
- "descriptors_loop_len == %i\n",
- service_id, section_length,
- descriptors_loop_len);
- break;
- }
-
- s = find_service(current_tp, service_id);
- if (!s)
- /* maybe PAT has not yet been parsed... */
- s = alloc_service(current_tp, service_id);
-
- s->running = (buf[3] >> 5) & 0x7;
- s->scrambled = (buf[3] >> 4) & 1;
-
- parse_descriptors (SDT, buf + 5, descriptors_loop_len, s);
-
- section_length -= descriptors_loop_len + 5;
- buf += descriptors_loop_len + 5;
- };
-}
-
-/* ATSC PSIP VCT */
-static void parse_atsc_service_loc_desc(struct service *s,const unsigned char *buf)
-{
- struct ATSC_service_location_descriptor d = read_ATSC_service_location_descriptor(buf);
- int i;
- unsigned char *b = (unsigned char *) buf+5;
-
- s->pcr_pid = d.PCR_PID;
- for (i=0; i < d.number_elements; i++) {
- struct ATSC_service_location_element e = read_ATSC_service_location_element(b);
- switch (e.stream_type) {
- case 0x02: /* video */
- s->video_pid = e.elementary_PID;
- moreverbose(" VIDEO : PID 0x%04x\n", e.elementary_PID);
- break;
- case 0x81: /* ATSC audio */
- if (s->audio_num < AUDIO_CHAN_MAX) {
- s->audio_pid[s->audio_num] = e.elementary_PID;
- s->audio_lang[s->audio_num][0] = (e.ISO_639_language_code >> 16) & 0xff;
- s->audio_lang[s->audio_num][1] = (e.ISO_639_language_code >> 8) & 0xff;
- s->audio_lang[s->audio_num][2] = e.ISO_639_language_code & 0xff;
- s->audio_num++;
- }
- moreverbose(" AUDIO : PID 0x%04x lang: %s\n",e.elementary_PID,s->audio_lang[s->audio_num-1]);
-
- break;
- default:
- warning("unhandled stream_type: %x\n",e.stream_type);
- break;
- };
- b += 6;
- }
-}
-
-static void parse_atsc_ext_chan_name_desc(struct service *s,const unsigned char *buf)
-{
- unsigned char *b = (unsigned char *) buf+2;
- int i,j;
- int num_str = b[0];
-
- b++;
- for (i = 0; i < num_str; i++) {
- int num_seg = b[3];
- b += 4; /* skip lang code */
- for (j = 0; j < num_seg; j++) {
- int comp_type = b[0],/* mode = b[1],*/ num_bytes = b[2];
-
- switch (comp_type) {
- case 0x00:
- if (s->service_name)
- free(s->service_name);
- s->service_name = malloc(num_bytes * sizeof(char) + 1);
- memcpy(s->service_name,&b[3],num_bytes);
- s->service_name[num_bytes] = '\0';
- break;
- default:
- warning("compressed strings are not supported yet\n");
- break;
- }
- b += 3 + num_bytes;
- }
- }
-}
-
-static void parse_psip_descriptors(struct service *s,const unsigned char *buf,int len)
-{
- unsigned char *b = (unsigned char *) buf;
- int desc_len;
- while (len > 0) {
- desc_len = b[1];
- switch (b[0]) {
- case ATSC_SERVICE_LOCATION_DESCRIPTOR_ID:
- parse_atsc_service_loc_desc(s,b);
- break;
- case ATSC_EXTENDED_CHANNEL_NAME_DESCRIPTOR_ID:
- parse_atsc_ext_chan_name_desc(s,b);
- break;
- default:
- warning("unhandled psip descriptor: %02x\n",b[0]);
- break;
- }
- b += 2 + desc_len;
- len -= 2 + desc_len;
- }
-}
-
-static void parse_psip_vct (const unsigned char *buf, int section_length,
- int table_id, int transport_stream_id)
-{
- (void)section_length;
- (void)table_id;
- (void)transport_stream_id;
-
-/* int protocol_version = buf[0];*/
- int num_channels_in_section = buf[1];
- int i;
- int pseudo_id = 0xffff;
- unsigned char *b = (unsigned char *) buf + 2;
-
- for (i = 0; i < num_channels_in_section; i++) {
- struct service *s;
- struct tvct_channel ch = read_tvct_channel(b);
-
- switch (ch.service_type) {
- case 0x01:
- info("analog channels won't be put info channels.conf\n");
- break;
- case 0x02: /* ATSC TV */
- case 0x03: /* ATSC Radio */
- break;
- case 0x04: /* ATSC Data */
- default:
- continue;
- }
-
- if (ch.program_number == 0)
- ch.program_number = --pseudo_id;
-
- s = find_service(current_tp, ch.program_number);
- if (!s)
- s = alloc_service(current_tp, ch.program_number);
-
- if (s->service_name)
- free(s->service_name);
-
- s->service_name = malloc(7*sizeof(unsigned char));
- /* TODO find a better solution to convert UTF-16 */
- s->service_name[0] = ch.short_name0;
- s->service_name[1] = ch.short_name1;
- s->service_name[2] = ch.short_name2;
- s->service_name[3] = ch.short_name3;
- s->service_name[4] = ch.short_name4;
- s->service_name[5] = ch.short_name5;
- s->service_name[6] = ch.short_name6;
-
- parse_psip_descriptors(s,&b[32],ch.descriptors_length);
-
- s->channel_num = ch.major_channel_number << 10 | ch.minor_channel_number;
-
- if (ch.hidden) {
- s->running = RM_NOT_RUNNING;
- info("service is not running, pseudo program_number.");
- } else {
- s->running = RM_RUNNING;
- info("service is running.");
- }
-
- info(" Channel number: %d:%d. Name: '%s'\n",
- ch.major_channel_number, ch.minor_channel_number,s->service_name);
-
- b += 32 + ch.descriptors_length;
- }
-}
-
-static int get_bit (uint8_t *bitfield, int bit)
-{
- return (bitfield[bit/8] >> (bit % 8)) & 1;
-}
-
-static void set_bit (uint8_t *bitfield, int bit)
-{
- bitfield[bit/8] |= 1 << (bit % 8);
-}
-
-
-/**
- * returns 0 when more sections are expected
- * 1 when all sections are read on this pid
- * -1 on invalid table id
- */
-static int parse_section (struct section_buf *s)
-{
- const unsigned char *buf = s->buf;
- int table_id;
- int section_length;
- int table_id_ext;
- int section_version_number;
- int section_number;
- int last_section_number;
- int i;
-
- table_id = buf[0];
-
- if (s->table_id != table_id)
- return -1;
-
- section_length = ((buf[1] & 0x0f) << 8) | buf[2];
-
- table_id_ext = (buf[3] << 8) | buf[4];
- section_version_number = (buf[5] >> 1) & 0x1f;
- section_number = buf[6];
- last_section_number = buf[7];
-
- if (s->segmented && s->table_id_ext != -1 && s->table_id_ext != table_id_ext) {
- /* find or allocate actual section_buf matching table_id_ext */
- while (s->next_seg) {
- s = s->next_seg;
- if (s->table_id_ext == table_id_ext)
- break;
- }
- if (s->table_id_ext != table_id_ext) {
- assert(s->next_seg == NULL);
- s->next_seg = calloc(1, sizeof(struct section_buf));
- s->next_seg->segmented = s->segmented;
- s->next_seg->run_once = s->run_once;
- s->next_seg->timeout = s->timeout;
- s = s->next_seg;
- s->table_id = table_id;
- s->table_id_ext = table_id_ext;
- s->section_version_number = section_version_number;
- }
- }
-
- if (s->section_version_number != section_version_number ||
- s->table_id_ext != table_id_ext) {
- struct section_buf *next_seg = s->next_seg;
-
- if (s->section_version_number != -1 && s->table_id_ext != -1)
- debug("section version_number or table_id_ext changed "
- "%d -> %d / %04x -> %04x\n",
- s->section_version_number, section_version_number,
- s->table_id_ext, table_id_ext);
- s->table_id_ext = table_id_ext;
- s->section_version_number = section_version_number;
- s->sectionfilter_done = 0;
- memset (s->section_done, 0, sizeof(s->section_done));
- s->next_seg = next_seg;
- }
-
- buf += 8; /* past generic table header */
- section_length -= 5 + 4; /* header + crc */
- if (section_length < 0) {
- warning("truncated section (PID 0x%04x, lenght %d)",
- s->pid, section_length + 9);
- return 0;
- }
-
- if (!get_bit(s->section_done, section_number)) {
- set_bit (s->section_done, section_number);
-
- debug("pid 0x%02x tid 0x%02x table_id_ext 0x%04x, "
- "%i/%i (version %i)\n",
- s->pid, table_id, table_id_ext, section_number,
- last_section_number, section_version_number);
-
- switch (table_id) {
- case 0x00:
- verbose("PAT\n");
- parse_pat (buf, section_length, table_id_ext);
- break;
-
- case 0x02:
- verbose("PMT 0x%04x for service 0x%04x\n", s->pid, table_id_ext);
- parse_pmt (buf, section_length, table_id_ext);
- break;
-
- case 0x41:
- verbose("////////////////////////////////////////////// NIT other\n");
- case 0x40:
- verbose("NIT (%s TS)\n", table_id == 0x40 ? "actual":"other");
- parse_nit (buf, section_length, table_id_ext);
- break;
-
- case 0x42:
- case 0x46:
- verbose("SDT (%s TS)\n", table_id == 0x42 ? "actual":"other");
- parse_sdt (buf, section_length, table_id_ext);
- break;
-
- case 0xc8:
- case 0xc9:
- verbose("ATSC VCT\n");
- parse_psip_vct(buf, section_length, table_id, table_id_ext);
- break;
- default:
- ;
- };
-
- for (i = 0; i <= last_section_number; i++)
- if (get_bit (s->section_done, i) == 0)
- break;
-
- if (i > last_section_number)
- s->sectionfilter_done = 1;
- }
-
- if (s->segmented) {
- /* always wait for timeout; this is because we don't now how
- * many segments there are
- */
- return 0;
- }
- else if (s->sectionfilter_done)
- return 1;
-
- return 0;
-}
-
-
-static int read_sections (struct section_buf *s)
-{
- int section_length, count;
-
- if (s->sectionfilter_done && !s->segmented)
- return 1;
-
- /* the section filter API guarantess that we get one full section
- * per read(), provided that the buffer is large enough (it is)
- */
- if (((count = read (s->fd, s->buf, sizeof(s->buf))) < 0) && errno == EOVERFLOW)
- count = read (s->fd, s->buf, sizeof(s->buf));
- if (count < 0) {
- errorn("read_sections: read error");
- return -1;
- }
-
- if (count < 4)
- return -1;
-
- section_length = ((s->buf[1] & 0x0f) << 8) | s->buf[2];
-
- if (count != section_length + 3)
- return -1;
-
- if (parse_section(s) == 1)
- return 1;
-
- return 0;
-}
-
-
-static LIST_HEAD(running_filters);
-static LIST_HEAD(waiting_filters);
-static int n_running;
-#define MAX_RUNNING 27
-static struct pollfd poll_fds[MAX_RUNNING];
-static struct section_buf* poll_section_bufs[MAX_RUNNING];
-
-
-static void setup_filter (struct section_buf* s, const char *dmx_devname,
- int pid, int tid, int tid_ext,
- int run_once, int segmented, int timeout)
-{
- memset (s, 0, sizeof(struct section_buf));
-
- s->fd = -1;
- s->dmx_devname = dmx_devname;
- s->pid = pid;
- s->table_id = tid;
-
- s->run_once = run_once;
- s->segmented = segmented;
-
- if (long_timeout)
- s->timeout = 5 * timeout;
- else
- s->timeout = timeout;
-
- s->table_id_ext = tid_ext;
- s->section_version_number = -1;
-
- INIT_LIST_HEAD (&s->list);
-}
-
-static void update_poll_fds(void)
-{
- struct list_head *p;
- struct section_buf* s;
- int i;
-
- memset(poll_section_bufs, 0, sizeof(poll_section_bufs));
- for (i = 0; i < MAX_RUNNING; i++)
- poll_fds[i].fd = -1;
- i = 0;
- list_for_each (p, &running_filters) {
- if (i >= MAX_RUNNING)
- fatal("too many poll_fds\n");
- s = list_entry (p, struct section_buf, list);
- if (s->fd == -1)
- fatal("s->fd == -1 on running_filters\n");
- verbosedebug("poll fd %d\n", s->fd);
- poll_fds[i].fd = s->fd;
- poll_fds[i].events = POLLIN;
- poll_fds[i].revents = 0;
- poll_section_bufs[i] = s;
- i++;
- }
- if (i != n_running)
- fatal("n_running is hosed\n");
-}
-
-static int start_filter (struct section_buf* s)
-{
- struct dmx_sct_filter_params f;
-
- if (n_running >= MAX_RUNNING)
- goto err0;
- if ((s->fd = open (s->dmx_devname, O_RDWR | O_NONBLOCK)) < 0)
- goto err0;
-
- verbosedebug("start filter pid 0x%04x table_id 0x%02x\n", s->pid, s->table_id);
-
- memset(&f, 0, sizeof(f));
-
- f.pid = (uint16_t) s->pid;
-
- if (s->table_id < 0x100 && s->table_id > 0) {
- f.filter.filter[0] = (uint8_t) s->table_id;
- f.filter.mask[0] = 0xff;
- }
- if (s->table_id_ext < 0x10000 && s->table_id_ext > 0) {
- f.filter.filter[1] = (uint8_t) ((s->table_id_ext >> 8) & 0xff);
- f.filter.filter[2] = (uint8_t) (s->table_id_ext & 0xff);
- f.filter.mask[1] = 0xff;
- f.filter.mask[2] = 0xff;
- }
-
- f.timeout = 0;
- f.flags = DMX_IMMEDIATE_START | DMX_CHECK_CRC;
-
- if (ioctl(s->fd, DMX_SET_FILTER, &f) == -1) {
- errorn ("ioctl DMX_SET_FILTER failed");
- goto err1;
- }
-
- s->sectionfilter_done = 0;
- time(&s->start_time);
-
- list_del_init (&s->list); /* might be in waiting filter list */
- list_add (&s->list, &running_filters);
-
- n_running++;
- update_poll_fds();
-
- return 0;
-
-err1:
- ioctl (s->fd, DMX_STOP);
- close (s->fd);
-err0:
- return -1;
-}
-
-
-static void stop_filter (struct section_buf *s)
-{
- verbosedebug("stop filter pid 0x%04x\n", s->pid);
- ioctl (s->fd, DMX_STOP);
- close (s->fd);
- s->fd = -1;
- list_del (&s->list);
- s->running_time += time(NULL) - s->start_time;
-
- n_running--;
- update_poll_fds();
-}
-
-
-static void add_filter (struct section_buf *s)
-{
- verbosedebug("add filter pid 0x%04x\n", s->pid);
- if (start_filter (s))
- list_add_tail (&s->list, &waiting_filters);
-}
-
-
-static void remove_filter (struct section_buf *s)
-{
- verbosedebug("remove filter pid 0x%04x\n", s->pid);
- stop_filter (s);
-
- while (!list_empty(&waiting_filters)) {
- struct list_head *next = waiting_filters.next;
- s = list_entry (next, struct section_buf, list);
- if (start_filter (s))
- break;
- };
-}
-
-
-static void read_filters (void)
-{
- struct section_buf *s;
- int i, n, done;
-
- n = poll(poll_fds, n_running, 1000);
- if (n == -1)
- errorn("poll");
-
- for (i = 0; i < n_running; i++) {
- s = poll_section_bufs[i];
- if (!s)
- fatal("poll_section_bufs[%d] is NULL\n", i);
- if (poll_fds[i].revents)
- done = read_sections (s) == 1;
- else
- done = 0; /* timeout */
- if (done || time(NULL) > s->start_time + s->timeout) {
- if (s->run_once) {
- if (done)
- verbosedebug("filter done pid 0x%04x\n", s->pid);
- else
- warning("filter timeout pid 0x%04x\n", s->pid);
- remove_filter (s);
- }
- }
- }
-}
-
-
-static int mem_is_zero (const void *mem, int size)
-{
- const char *p = mem;
- int i;
-
- for (i=0; i<size; i++) {
- if (p[i] != 0x00)
- return 0;
- }
-
- return 1;
-}
-
-
-static int switch_pos = 0;
-
-static int __tune_to_transponder (int frontend_fd, struct transponder *t)
-{
- struct dvb_frontend_parameters p;
- fe_status_t s;
- int i;
-
- current_tp = t;
-
- if (mem_is_zero (&t->param, sizeof(struct dvb_frontend_parameters)))
- return -1;
-
- memcpy (&p, &t->param, sizeof(struct dvb_frontend_parameters));
-
- if (verbosity >= 1) {
- dprintf(1, ">>> tune to: ");
- dump_dvb_parameters (stderr, t);
- if (t->last_tuning_failed)
- dprintf(1, " (tuning failed)");
- dprintf(1, "\n");
- }
-
- if (t->type == FE_QPSK) {
- int hiband = 0;
-
- if (lnb_type.switch_val && lnb_type.high_val &&
- p.frequency >= lnb_type.switch_val)
- hiband = 1;
-
- setup_switch (frontend_fd,
- switch_pos,
- t->polarisation == POLARISATION_VERTICAL ? 0 : 1,
- hiband);
- usleep(50000);
- if (hiband)
- p.frequency = abs(p.frequency - lnb_type.high_val);
- else
- p.frequency = abs(p.frequency - lnb_type.low_val);
- }
-
- if (ioctl(frontend_fd, FE_SET_FRONTEND, &p) == -1) {
- errorn("Setting frontend parameters failed");
- return -1;
- }
-
- for (i = 0; i < 10; i++) {
- usleep (200000);
-
- if (ioctl(frontend_fd, FE_READ_STATUS, &s) == -1) {
- errorn("FE_READ_STATUS failed");
- return -1;
- }
-
- verbose(">>> tuning status == 0x%02x\n", s);
-
- if (s & FE_HAS_LOCK) {
- t->last_tuning_failed = 0;
- return 0;
- }
- }
-
- warning(">>> tuning failed!!!\n");
-
- t->last_tuning_failed = 1;
-
- return -1;
-}
-
-static int tune_to_transponder (int frontend_fd, struct transponder *t)
-{
- /* move TP from "new" to "scanned" list */
- list_del_init(&t->list);
- list_add_tail(&t->list, &scanned_transponders);
- t->scan_done = 1;
-
- if (t->type != fe_info.type) {
- warning("frontend type (%s) is not compatible with requested tuning type (%s)\n",
- fe_type2str(fe_info.type),fe_type2str(t->type));
- /* ignore cable descriptors in sat NIT and vice versa */
- t->last_tuning_failed = 1;
- return -1;
- }
-
- if (__tune_to_transponder (frontend_fd, t) == 0)
- return 0;
-
- return __tune_to_transponder (frontend_fd, t);
-}
-
-
-static int tune_to_next_transponder (int frontend_fd)
-{
- struct list_head *pos, *tmp;
- struct transponder *t, *to;
- uint32_t freq;
-
- list_for_each_safe(pos, tmp, &new_transponders) {
- t = list_entry (pos, struct transponder, list);
-retry:
- if (tune_to_transponder (frontend_fd, t) == 0)
- return 0;
-next:
- if (t->other_frequency_flag && t->other_f && t->n_other_f) {
- /* check if the alternate freqeuncy is really new to us */
- freq = t->other_f[t->n_other_f - 1];
- t->n_other_f--;
- if (find_transponder(freq))
- goto next;
-
- /* remember tuning to the old frequency failed */
- to = calloc(1, sizeof(*to));
- to->param.frequency = t->param.frequency;
- to->wrong_frequency = 1;
- INIT_LIST_HEAD(&to->list);
- INIT_LIST_HEAD(&to->services);
- list_add_tail(&to->list, &scanned_transponders);
- copy_transponder(to, t);
-
- t->param.frequency = freq;
- info("retrying with f=%d\n", t->param.frequency);
- goto retry;
- }
- }
- return -1;
-}
-
-struct strtab {
- const char *str;
- int val;
-};
-static int str2enum(const char *str, const struct strtab *tab, int deflt)
-{
- while (tab->str) {
- if (!strcmp(tab->str, str))
- return tab->val;
- tab++;
- }
- error("invalid enum value '%s'\n", str);
- return deflt;
-}
-
-static const char * enum2str(int v, const struct strtab *tab, const char *deflt)
-{
- while (tab->str) {
- if (v == tab->val)
- return tab->str;
- tab++;
- }
- error("invalid enum value '%d'\n", v);
- return deflt;
-}
-
-static enum fe_code_rate str2fec(const char *fec)
-{
- struct strtab fectab[] = {
- { "NONE", FEC_NONE },
- { "1/2", FEC_1_2 },
- { "2/3", FEC_2_3 },
- { "3/4", FEC_3_4 },
- { "4/5", FEC_4_5 },
- { "5/6", FEC_5_6 },
- { "6/7", FEC_6_7 },
- { "7/8", FEC_7_8 },
- { "8/9", FEC_8_9 },
- { "AUTO", FEC_AUTO },
- { NULL, 0 }
- };
- return str2enum(fec, fectab, FEC_AUTO);
-}
-
-static enum fe_modulation str2qam(const char *qam)
-{
- struct strtab qamtab[] = {
- { "QPSK", QPSK },
- { "QAM16", QAM_16 },
- { "QAM32", QAM_32 },
- { "QAM64", QAM_64 },
- { "QAM128", QAM_128 },
- { "QAM256", QAM_256 },
- { "AUTO", QAM_AUTO },
- { "8VSB", VSB_8 },
- { "16VSB", VSB_16 },
- { NULL, 0 }
- };
- return str2enum(qam, qamtab, QAM_AUTO);
-}
-
-static enum fe_bandwidth str2bandwidth(const char *bw)
-{
- struct strtab bwtab[] = {
- { "8MHz", BANDWIDTH_8_MHZ },
- { "7MHz", BANDWIDTH_7_MHZ },
- { "6MHz", BANDWIDTH_6_MHZ },
- { "AUTO", BANDWIDTH_AUTO },
- { NULL, 0 }
- };
- return str2enum(bw, bwtab, BANDWIDTH_AUTO);
-}
-
-static enum fe_transmit_mode str2mode(const char *mode)
-{
- struct strtab modetab[] = {
- { "2k", TRANSMISSION_MODE_2K },
- { "8k", TRANSMISSION_MODE_8K },
- { "AUTO", TRANSMISSION_MODE_AUTO },
- { NULL, 0 }
- };
- return str2enum(mode, modetab, TRANSMISSION_MODE_AUTO);
-}
-
-static enum fe_guard_interval str2guard(const char *guard)
-{
- struct strtab guardtab[] = {
- { "1/32", GUARD_INTERVAL_1_32 },
- { "1/16", GUARD_INTERVAL_1_16 },
- { "1/8", GUARD_INTERVAL_1_8 },
- { "1/4", GUARD_INTERVAL_1_4 },
- { "AUTO", GUARD_INTERVAL_AUTO },
- { NULL, 0 }
- };
- return str2enum(guard, guardtab, GUARD_INTERVAL_AUTO);
-}
-
-static enum fe_hierarchy str2hier(const char *hier)
-{
- struct strtab hiertab[] = {
- { "NONE", HIERARCHY_NONE },
- { "1", HIERARCHY_1 },
- { "2", HIERARCHY_2 },
- { "4", HIERARCHY_4 },
- { "AUTO", HIERARCHY_AUTO },
- { NULL, 0 }
- };
- return str2enum(hier, hiertab, HIERARCHY_AUTO);
-}
-
-static const char * fe_type2str(fe_type_t t)
-{
- struct strtab typetab[] = {
- { "QPSK", FE_QPSK,},
- { "QAM", FE_QAM, },
- { "OFDM", FE_OFDM,},
- { "ATSC", FE_ATSC,},
- { NULL, 0 }
- };
-
- return enum2str(t, typetab, "UNK");
-}
-
-static int tune_initial (int frontend_fd, const char *initial)
-{
- FILE *inif;
- unsigned int f, sr;
- char buf[200];
- char pol[20], fec[20], qam[20], bw[20], fec2[20], mode[20], guard[20], hier[20];
- struct transponder *t;
-
- inif = fopen(initial, "r");
- if (!inif) {
- error("cannot open '%s': %d %m\n", initial, errno);
- return -1;
- }
- while (fgets(buf, sizeof(buf), inif)) {
- if (buf[0] == '#' || buf[0] == '\n')
- ;
- else if (sscanf(buf, "S %u %1[HVLR] %u %4s\n", &f, pol, &sr, fec) == 4) {
- t = alloc_transponder(f);
- t->type = FE_QPSK;
- switch(pol[0]) {
- case 'H':
- case 'L':
- t->polarisation = POLARISATION_HORIZONTAL;
- break;
- default:
- t->polarisation = POLARISATION_VERTICAL;;
- break;
- }
- t->param.inversion = spectral_inversion;
- t->param.u.qpsk.symbol_rate = sr;
- t->param.u.qpsk.fec_inner = str2fec(fec);
- info("initial transponder %u %c %u %d\n",
- t->param.frequency,
- pol[0], sr,
- t->param.u.qpsk.fec_inner);
- }
- else if (sscanf(buf, "C %u %u %4s %6s\n", &f, &sr, fec, qam) == 4) {
- t = alloc_transponder(f);
- t->type = FE_QAM;
- t->param.inversion = spectral_inversion;
- t->param.u.qam.symbol_rate = sr;
- t->param.u.qam.fec_inner = str2fec(fec);
- t->param.u.qam.modulation = str2qam(qam);
- info("initial transponder %u %u %d %d\n",
- t->param.frequency,
- sr,
- t->param.u.qam.fec_inner,
- t->param.u.qam.modulation);
- }
- else if (sscanf(buf, "T %u %4s %4s %4s %7s %4s %4s %4s\n",
- &f, bw, fec, fec2, qam, mode, guard, hier) == 8) {
- t = alloc_transponder(f);
- t->type = FE_OFDM;
- t->param.inversion = spectral_inversion;
- t->param.u.ofdm.bandwidth = str2bandwidth(bw);
- t->param.u.ofdm.code_rate_HP = str2fec(fec);
- if (t->param.u.ofdm.code_rate_HP == FEC_NONE)
- t->param.u.ofdm.code_rate_HP = FEC_AUTO;
- t->param.u.ofdm.code_rate_LP = str2fec(fec2);
- if (t->param.u.ofdm.code_rate_LP == FEC_NONE)
- t->param.u.ofdm.code_rate_LP = FEC_AUTO;
- t->param.u.ofdm.constellation = str2qam(qam);
- t->param.u.ofdm.transmission_mode = str2mode(mode);
- t->param.u.ofdm.guard_interval = str2guard(guard);
- t->param.u.ofdm.hierarchy_information = str2hier(hier);
- info("initial transponder %u %d %d %d %d %d %d %d\n",
- t->param.frequency,
- t->param.u.ofdm.bandwidth,
- t->param.u.ofdm.code_rate_HP,
- t->param.u.ofdm.code_rate_LP,
- t->param.u.ofdm.constellation,
- t->param.u.ofdm.transmission_mode,
- t->param.u.ofdm.guard_interval,
- t->param.u.ofdm.hierarchy_information);
- }
- else if (sscanf(buf, "A %u %7s\n",
- &f,qam) == 2) {
- t = alloc_transponder(f);
- t->type = FE_ATSC;
- t->param.u.vsb.modulation = str2qam(qam);
- } else
- error("cannot parse'%s'\n", buf);
- }
-
- fclose(inif);
-
- return tune_to_next_transponder(frontend_fd);
-}
-
-
-static void scan_tp_atsc(void)
-{
- struct section_buf s0,s1,s2;
-
- if (no_ATSC_PSIP) {
- setup_filter(&s0, demux_devname, 0x00, 0x00, -1, 1, 0, 5); /* PAT */
- add_filter(&s0);
- } else {
- if (ATSC_type & 0x1) {
- setup_filter(&s0, demux_devname, 0x1ffb, 0xc8, -1, 1, 0, 5); /* terrestrial VCT */
- add_filter(&s0);
- }
- if (ATSC_type & 0x2) {
- setup_filter(&s1, demux_devname, 0x1ffb, 0xc9, -1, 1, 0, 5); /* cable VCT */
- add_filter(&s1);
- }
- setup_filter(&s2, demux_devname, 0x00, 0x00, -1, 1, 0, 5); /* PAT */
- add_filter(&s2);
- }
-
- do {
- read_filters ();
- } while (!(list_empty(&running_filters) &&
- list_empty(&waiting_filters)));
-}
-
-static void scan_tp_dvb (void)
-{
- struct section_buf s0;
- struct section_buf s1;
- struct section_buf s2;
- struct section_buf s3;
-
- /**
- * filter timeouts > min repetition rates specified in ETR211
- */
- setup_filter (&s0, demux_devname, 0x00, 0x00, -1, 1, 0, 5); /* PAT */
- setup_filter (&s1, demux_devname, 0x11, 0x42, -1, 1, 0, 5); /* SDT */
-
- add_filter (&s0);
- add_filter (&s1);
-
- if (!current_tp_only || output_format != OUTPUT_PIDS) {
- setup_filter (&s2, demux_devname, 0x10, 0x40, -1, 1, 0, 15); /* NIT */
- add_filter (&s2);
- if (get_other_nits) {
- /* get NIT-others
- * Note: There is more than one NIT-other: one per
- * network, separated by the network_id.
- */
- setup_filter (&s3, demux_devname, 0x10, 0x41, -1, 1, 1, 15);
- add_filter (&s3);
- }
- }
-
- do {
- read_filters ();
- } while (!(list_empty(&running_filters) &&
- list_empty(&waiting_filters)));
-}
-
-static void scan_tp(void)
-{
- switch(fe_info.type) {
- case FE_QPSK:
- case FE_QAM:
- case FE_OFDM:
- scan_tp_dvb();
- break;
- case FE_ATSC:
- scan_tp_atsc();
- break;
- default:
- break;
- }
-}
-
-static void scan_network (int frontend_fd, const char *initial)
-{
- if (tune_initial (frontend_fd, initial) < 0) {
- error("initial tuning failed\n");
- return;
- }
-
- do {
- scan_tp();
- } while (tune_to_next_transponder(frontend_fd) == 0);
-}
-
-
-static void pids_dump_service_parameter_set(FILE *f, struct service *s)
-{
- int i;
-
- fprintf(f, "%-24.24s (0x%04x) %02x: ", s->service_name, s->service_id, s->type);
- if (!s->pcr_pid || (s->type > 2))
- fprintf(f, " ");
- else if (s->pcr_pid == s->video_pid)
- fprintf(f, "PCR == V ");
- else if ((s->audio_num == 1) && (s->pcr_pid == s->audio_pid[0]))
- fprintf(f, "PCR == A ");
- else
- fprintf(f, "PCR 0x%04x ", s->pcr_pid);
- if (s->video_pid)
- fprintf(f, "V 0x%04x", s->video_pid);
- else
- fprintf(f, " ");
- if (s->audio_num)
- fprintf(f, " A");
- for (i = 0; i < s->audio_num; i++) {
- fprintf(f, " 0x%04x", s->audio_pid[i]);
- if (s->audio_lang[i][0])
- fprintf(f, " (%.3s)", s->audio_lang[i]);
- else if (s->audio_num == 1)
- fprintf(f, " ");
- }
- if (s->teletext_pid)
- fprintf(f, " TT 0x%04x", s->teletext_pid);
- if (s->ac3_pid)
- fprintf(f, " AC3 0x%04x", s->ac3_pid);
- if (s->subtitling_pid)
- fprintf(f, " SUB 0x%04x", s->subtitling_pid);
- fprintf(f, "\n");
-}
-
-static char sat_polarisation (struct transponder *t)
-{
- return t->polarisation == POLARISATION_VERTICAL ? 'v' : 'h';
-}
-
-static int sat_number (struct transponder *t)
-{
- (void) t;
-
- return switch_pos;
-}
-
-static void dump_lists (void)
-{
- struct list_head *p1, *p2;
- struct transponder *t;
- struct service *s;
- int n = 0, i;
- char sn[20];
- int anon_services = 0;
- int channel_num_mumudvb = 0;
-
- list_for_each(p1, &scanned_transponders) {
- t = list_entry(p1, struct transponder, list);
- if (t->wrong_frequency)
- continue;
- list_for_each(p2, &t->services) {
- n++;
- }
- }
- info("dumping lists (%d services)\n", n);
-
- list_for_each(p1, &scanned_transponders) {
- t = list_entry(p1, struct transponder, list);
- if (t->wrong_frequency)
- continue;
- channel_num_mumudvb = 0;
- list_for_each(p2, &t->services) {
- s = list_entry(p2, struct service, list);
-
- if (!s->service_name) {
- /* not in SDT */
- if (unique_anon_services)
- snprintf(sn, sizeof(sn), "[%03x-%04x]",
- anon_services, s->service_id);
- else
- snprintf(sn, sizeof(sn), "[%04x]",
- s->service_id);
- s->service_name = strdup(sn);
- anon_services++;
- }
- /* ':' is field separator in szap and vdr service lists */
- for (i = 0; s->service_name[i]; i++) {
- if (s->service_name[i] == ':')
- s->service_name[i] = ' ';
- }
- for (i = 0; s->provider_name && s->provider_name[i]; i++) {
- if (s->provider_name[i] == ':')
- s->provider_name[i] = ' ';
- }
- if (s->video_pid && !(serv_select & 1))
- continue; /* no TV services */
- if (!s->video_pid && s->audio_num && !(serv_select & 2))
- continue; /* no radio services */
- if (!s->video_pid && !s->audio_num && !(serv_select & 4))
- continue; /* no data/other services */
- if (s->scrambled && !ca_select)
- continue; /* FTA only */
- switch (output_format)
- {
- case OUTPUT_PIDS:
- pids_dump_service_parameter_set (stdout, s);
- break;
- case OUTPUT_VDR:
- vdr_dump_service_parameter_set (stdout,
- s->service_name,
- s->provider_name,
- t->type,
- &t->param,
- sat_polarisation(t),
- s->video_pid,
- s->pcr_pid,
- s->audio_pid,
- s->audio_lang,
- s->audio_num,
- s->teletext_pid,
- s->scrambled,
- //FIXME: s->subtitling_pid
- s->ac3_pid,
- s->service_id,
- t->network_id,
- s->transport_stream_id,
- t->orbital_pos,
- t->we_flag,
- vdr_dump_provider,
- ca_select,
- vdr_version,
- vdr_dump_channum,
- s->channel_num);
- break;
- case OUTPUT_MUMUDVB:
- mumudvb_dump_service_parameter_set (stdout,
- s->service_name,
- s->provider_name,
- t->type,
- &t->param,
- sat_polarisation(t),
- s->video_pid,
- s->pcr_pid,
- s->audio_pid,
- s->audio_lang,
- s->audio_num,
- s->teletext_pid,
- s->scrambled,
- //FIXME: s->subtitling_pid
- s->ac3_pid,
- s->service_id,
- t->network_id,
- s->transport_stream_id,
- t->orbital_pos,
- t->we_flag,
- ca_select,
- s->channel_num,
- channel_num_mumudvb,
- s->pmt_pid,
- s->subtitling_pid);
- channel_num_mumudvb++;
- break;
- case OUTPUT_ZAP:
- zap_dump_service_parameter_set (stdout,
- s->service_name,
- t->type,
- &t->param,
- sat_polarisation(t),
- sat_number(t),
- s->video_pid,
- s->audio_pid,
- s->service_id);
- default:
- break;
- }
- }
- }
- info("Done.\n");
-}
-
-static void show_existing_tuning_data_files(void)
-{
-#ifndef DATADIR
-#define DATADIR "/usr/local/share"
-#endif
- static const char* prefixlist[] = { DATADIR "/dvb", "/etc/dvb",
- DATADIR "/doc/packages/dvb", 0 };
- unsigned int i;
- const char **prefix;
- fprintf(stderr, "initial tuning data files:\n");
- for (prefix = prefixlist; *prefix; prefix++) {
- glob_t globbuf;
- char* globspec = malloc (strlen(*prefix)+9);
- strcpy (globspec, *prefix); strcat (globspec, "/dvb-?/*");
- if (! glob (globspec, 0, 0, &globbuf)) {
- for (i=0; i < globbuf.gl_pathc; i++)
- fprintf(stderr, " file: %s\n", globbuf.gl_pathv[i]);
- }
- free (globspec);
- globfree (&globbuf);
- }
-}
-
-static void handle_sigint(int sig)
-{
- (void)sig;
- error("interrupted by SIGINT, dumping partial result...\n");
- dump_lists();
- exit(2);
-}
-
-static const char *usage = "\n"
- "usage: %s [options...] [-c | initial-tuning-data-file]\n"
- " atsc/dvbscan doesn't do frequency scans, hence it needs initial\n"
- " tuning data for at least one transponder/channel.\n"
- " -c scan on currently tuned transponder only\n"
- " -v verbose (repeat for more)\n"
- " -q quiet (repeat for less)\n"
- " -a N use DVB /dev/dvb/adapterN/\n"
- " -f N use DVB /dev/dvb/adapter?/frontendN\n"
- " -d N use DVB /dev/dvb/adapter?/demuxN\n"
- " -s N use DiSEqC switch position N (DVB-S only)\n"
- " -i N spectral inversion setting (0: off, 1: on, 2: auto [default])\n"
- " -n evaluate NIT-other for full network scan (slow!)\n"
- " -5 multiply all filter timeouts by factor 5\n"
- " for non-DVB-compliant section repitition rates\n"
- " -o fmt output format: 'zap' (default), 'vdr', 'mumudvb' or 'pids' (default with -c)\n"
- " -x N Conditional Axcess, (default 1)\n"
- " N=0 gets only FTA channels\n"
- " N=xxx sets ca field in vdr output to :xxx:\n"
- " -t N Service select, Combined bitfield parameter.\n"
- " 1 = TV, 2 = Radio, 4 = Other, (default 7)\n"
- " -p for vdr output format: dump provider name\n"
- " -e N VDR version, default 2 for VDR-1.2.x\n"
- " ANYTHING ELSE GIVES NONZERO NIT and TID\n"
- " Vdr version 1.3.x and up implies -p.\n"
- " -l lnb-type (DVB-S Only) (use -l help to print types) or \n"
- " -l low[,high[,switch]] in Mhz\n"
- " -u UK DVB-T Freeview channel numbering for VDR\n\n"
- " -P do not use ATSC PSIP tables for scanning\n"
- " (but only PAT and PMT) (applies for ATSC only)\n"
- " -A N check for ATSC 1=Terrestrial [default], 2=Cable or 3=both\n"
- " -U Uniquely name unknown services\n";
-
-void
-bad_usage(char *pname, int problem)
-{
- int i;
- struct lnb_types_st *lnbp;
- char **cp;
-
- switch (problem) {
- default:
- case 0:
- fprintf (stderr, usage, pname);
- break;
- case 1:
- i = 0;
- fprintf(stderr, "-l <lnb-type> or -l low[,high[,switch]] in Mhz\n"
- "where <lnb-type> is:\n");
- while(NULL != (lnbp = lnb_enum(i))) {
- fprintf (stderr, "%s\n", lnbp->name);
- for (cp = lnbp->desc; *cp ; cp++) {
- fprintf (stderr, " %s\n", *cp);
- }
- i++;
- }
- break;
- case 2:
- show_existing_tuning_data_files();
- fprintf (stderr, usage, pname);
- }
-}
-
-int main (int argc, char **argv)
-{
- char frontend_devname [80];
- int adapter = 0, frontend = 0, demux = 0;
- int opt, i;
- int frontend_fd;
- int fe_open_mode;
- const char *initial = NULL;
-
- if (argc <= 1) {
- bad_usage(argv[0], 2);
- return -1;
- }
-
- /* start with default lnb type */
- lnb_type = *lnb_enum(0);
- while ((opt = getopt(argc, argv, "5cnpa:f:d:s:o:x:e:t:i:l:vquPA:U")) != -1) {
- switch (opt) {
- case 'a':
- adapter = strtoul(optarg, NULL, 0);
- break;
- case 'c':
- current_tp_only = 1;
- if (!output_format_set)
- output_format = OUTPUT_PIDS;
- break;
- case 'n':
- get_other_nits = 1;
- break;
- case 'd':
- demux = strtoul(optarg, NULL, 0);
- break;
- case 'f':
- frontend = strtoul(optarg, NULL, 0);
- break;
- case 'p':
- vdr_dump_provider = 1;
- break;
- case 's':
- switch_pos = strtoul(optarg, NULL, 0);
- break;
- case 'o':
- if (strcmp(optarg, "zap") == 0) output_format = OUTPUT_ZAP;
- else if (strcmp(optarg, "vdr") == 0) output_format = OUTPUT_VDR;
- else if (strcmp(optarg, "pids") == 0) output_format = OUTPUT_PIDS;
- else if (strcmp(optarg, "mumudvb") == 0) output_format = OUTPUT_MUMUDVB;
- else {
- bad_usage(argv[0], 0);
- return -1;
- }
- output_format_set = 1;
- break;
- case '5':
- long_timeout = 1;
- break;
- case 'x':
- ca_select = strtoul(optarg, NULL, 0);
- break;
- case 'e':
- vdr_version = strtoul(optarg, NULL, 0);
- break;
- case 't':
- serv_select = strtoul(optarg, NULL, 0);
- break;
- case 'i':
- spectral_inversion = strtoul(optarg, NULL, 0);
- break;
- case 'l':
- if (lnb_decode(optarg, &lnb_type) < 0) {
- bad_usage(argv[0], 1);
- return -1;
- }
- break;
- case 'v':
- verbosity++;
- break;
- case 'q':
- if (--verbosity < 0)
- verbosity = 0;
- break;
- case 'u':
- vdr_dump_channum = 1;
- break;
- case 'P':
- no_ATSC_PSIP = 1;
- break;
- case 'A':
- ATSC_type = strtoul(optarg,NULL,0);
- if (ATSC_type == 0 || ATSC_type > 3) {
- bad_usage(argv[0], 1);
- return -1;
- }
-
- break;
- case 'U':
- unique_anon_services = 1;
- break;
- default:
- bad_usage(argv[0], 0);
- return -1;
- };
- }
-
- if (optind < argc)
- initial = argv[optind];
- if ((!initial && !current_tp_only) || (initial && current_tp_only) ||
- (spectral_inversion > 2)) {
- bad_usage(argv[0], 0);
- return -1;
- }
- lnb_type.low_val *= 1000; /* convert to kiloherz */
- lnb_type.high_val *= 1000; /* convert to kiloherz */
- lnb_type.switch_val *= 1000; /* convert to kiloherz */
- if (switch_pos >= 4) {
- fprintf (stderr, "switch position needs to be < 4!\n");
- return -1;
- }
- if (initial)
- info("scanning %s\n", initial);
-
- snprintf (frontend_devname, sizeof(frontend_devname),
- "/dev/dvb/adapter%i/frontend%i", adapter, frontend);
-
- snprintf (demux_devname, sizeof(demux_devname),
- "/dev/dvb/adapter%i/demux%i", adapter, demux);
- info("using '%s' and '%s'\n", frontend_devname, demux_devname);
-
- for (i = 0; i < MAX_RUNNING; i++)
- poll_fds[i].fd = -1;
-
- fe_open_mode = current_tp_only ? O_RDONLY : O_RDWR;
- if ((frontend_fd = open (frontend_devname, fe_open_mode)) < 0)
- fatal("failed to open '%s': %d %m\n", frontend_devname, errno);
- /* determine FE type and caps */
- if (ioctl(frontend_fd, FE_GET_INFO, &fe_info) == -1)
- fatal("FE_GET_INFO failed: %d %m\n", errno);
-
- if ((spectral_inversion == INVERSION_AUTO ) &&
- !(fe_info.caps & FE_CAN_INVERSION_AUTO)) {
- info("Frontend can not do INVERSION_AUTO, trying INVERSION_OFF instead\n");
- spectral_inversion = INVERSION_OFF;
- }
-
- signal(SIGINT, handle_sigint);
-
- if (current_tp_only) {
- current_tp = alloc_transponder(0); /* dummy */
- /* move TP from "new" to "scanned" list */
- list_del_init(¤t_tp->list);
- list_add_tail(¤t_tp->list, &scanned_transponders);
- current_tp->scan_done = 1;
- scan_tp ();
- }
- else
- scan_network (frontend_fd, initial);
-
- close (frontend_fd);
-
- dump_lists ();
-
- return 0;
-}
-
-static void dump_dvb_parameters (FILE *f, struct transponder *t)
-{
- switch (output_format) {
- case OUTPUT_PIDS:
- case OUTPUT_VDR:
- case OUTPUT_MUMUDVB:
- vdr_dump_dvb_parameters(f, t->type, &t->param,
- sat_polarisation (t), t->orbital_pos, t->we_flag);
- break;
- case OUTPUT_ZAP:
- zap_dump_dvb_parameters (f, t->type, &t->param,
- sat_polarisation (t), sat_number (t));
- break;
- default:
- break;
- }
-}
diff --git a/tools/scan_modified/scan/scan.h b/tools/scan_modified/scan/scan.h
deleted file mode 100644
index 8209076..0000000
--- a/tools/scan_modified/scan/scan.h
+++ /dev/null
@@ -1,29 +0,0 @@
-#ifndef __SCAN_H__
-#define __SCAN_H__
-
-#include <stdio.h>
-#include <errno.h>
-
-extern int verbosity;
-
-#define dprintf(level, fmt...) \
- do { \
- if (level <= verbosity) \
- fprintf(stderr, fmt); \
- } while (0)
-
-#define dpprintf(level, fmt, args...) \
- dprintf(level, "%s:%d: " fmt, __FUNCTION__, __LINE__ , ##args)
-
-#define fatal(fmt, args...) do { dpprintf(-1, "FATAL: " fmt , ##args); exit(1); } while(0)
-#define error(msg...) dprintf(0, "ERROR: " msg)
-#define errorn(msg) dprintf(0, "%s:%d: ERROR: " msg ": %d %m\n", __FUNCTION__, __LINE__, errno)
-#define warning(msg...) dprintf(1, "WARNING: " msg)
-#define info(msg...) dprintf(2, msg)
-#define verbose(msg...) dprintf(3, msg)
-#define moreverbose(msg...) dprintf(4, msg)
-#define debug(msg...) dpprintf(5, msg)
-#define verbosedebug(msg...) dpprintf(6, msg)
-
-#endif
-
diff --git a/tools/scan_modified/scan/section.c b/tools/scan_modified/scan/section.c
deleted file mode 100644
index 8e49947..0000000
--- a/tools/scan_modified/scan/section.c
+++ /dev/null
@@ -1,25 +0,0 @@
-#include "section.h"
-
-/* shamelessly stolen from dvbsnoop, but modified */
-u32 getBits (const u8 *buf, int startbit, int bitlen)
-{
- const u8 *b;
- u32 mask,tmp_long;
- int bitHigh,i;
-
- b = &buf[startbit / 8];
- startbit %= 8;
-
- bitHigh = 8;
- tmp_long = b[0];
- for (i = 0; i < ((bitlen-1) >> 3); i++) {
- tmp_long <<= 8;
- tmp_long |= b[i+1];
- bitHigh += 8;
- }
-
- startbit = bitHigh - startbit - bitlen;
- tmp_long = tmp_long >> startbit;
- mask = (1ULL << bitlen) - 1;
- return tmp_long & mask;
-}
diff --git a/tools/scan_modified/scan/section.h b/tools/scan_modified/scan/section.h
deleted file mode 100644
index 88e9570..0000000
--- a/tools/scan_modified/scan/section.h
+++ /dev/null
@@ -1,14 +0,0 @@
-#ifndef __SECTION_H__
-#define __SECTION_H__
-
-#include <stdio.h>
-
-#define u8 unsigned char
-#define u16 unsigned short
-#define u32 unsigned int
-
-#define PACKED __attribute((packed))
-
-u32 getBits (const u8 *buf, int startbit, int bitlen);
-
-#endif
diff --git a/tools/ts_pids.c b/tools/ts_pids.c
deleted file mode 100644
index 07cce84..0000000
--- a/tools/ts_pids.c
+++ /dev/null
@@ -1,54 +0,0 @@
-/* A simple filter (stdin -> stdout) to extract multiple streams from a
- multiplexed TS. Specify the PID on the command-line
-
- Updated 29th January 2003 - Added some error checking and reporting.
-*/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-
-int main(int argc, char **argv)
-{
- int pid,n;
- int filters[8192];
- unsigned int i=0;
- unsigned int j=0;
- unsigned char buf[188];
- unsigned char my_cc[8192];
- int errors=0;
- FILE *rapport;
-
- for (i=0;i<8192;i++) { filters[i]=0; my_cc[i]=0xff;}
-
- if((rapport=fopen("./pids.txt", "a")) != NULL)
- {
- n=fread(buf,1,188,stdin);
- i=1;
- while (n==188&&i<200000) {
- if (buf[0]!=0x47) {
- // TO DO: Re-sync.
- fprintf(stderr,"FATAL ERROR IN STREAM AT PACKET %d\n",i);
- // exit;
- }
- pid=(((buf[1] & 0x1f) << 8) | buf[2]);
- if (my_cc[pid]==0xff) my_cc[pid]=buf[3]&0x0f;
-
- filters[pid]++;
-
- n=fread(buf,1,188,stdin);
- i++;
- }
- for(pid=0;pid<8192;pid++)
- {
- if(filters[pid])
- fprintf(rapport,"Pid trouve : %d vu %d fois soit %f %% du flux total\n",pid,filters[pid],100.*filters[pid]/i);
- }
- fclose(rapport);
- fprintf(stderr,"Read %d packets, wrote %d.\n",i,j);
- fprintf(stderr,"%d incontinuity errors.\n",errors);
- }
-
-
- return(0);
-}
--
Mumudvb packaging
More information about the pkg-vdr-dvb-changes
mailing list