From 610c5600df98b35226536ffe92b1fd231128c7d4 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sun, 1 Apr 2001 18:00:00 +0200 Subject: =?UTF-8?q?Version=200.72=20-=20Fixed=20SVDRP=20commands=20LSTC=20?= =?UTF-8?q?and=20LSTT=20to=20make=20them=20return=20an=20error=20message?= =?UTF-8?q?=20if=20=20=20no=20channels=20or=20timers=20are=20defined.=20-?= =?UTF-8?q?=20Enhanced=20'channels.conf.cable'=20(thanks=20to=20Hans-Peter?= =?UTF-8?q?=20Raschke).=20-=20Fixed=20switching=20to=20another=20channel?= =?UTF-8?q?=20via=20the=20EPG=20while=20a=20recording=20is=20being=20=20?= =?UTF-8?q?=20replayed.=20-=20Fixed=20a=20memory=20leak=20in=20the=20EIT?= =?UTF-8?q?=20processor=20that=20happened=20when=20the=20system=20time=20?= =?UTF-8?q?=20=20was=20set.=20-=20Removed=20some=20redundant=20code=20from?= =?UTF-8?q?=20the=20cListBase=20destructor.=20-=20Fixed=20internationaliza?= =?UTF-8?q?tion=20of=20some=20Main=20menu=20texts.=20-=20Updated=20'channe?= =?UTF-8?q?ls.conf'=20after=20the=20recent=20changes=20of=20Premiere=20Wor?= =?UTF-8?q?ld=20(thanks=20=20=20to=20Axel=20Gruber).=20-=20Redesigned=20th?= =?UTF-8?q?e=20ring=20buffer=20to=20make=20it=20work=20with=20two=20separa?= =?UTF-8?q?te=20threads=20for=20=20=20input=20and=20output=20(also=20prepa?= =?UTF-8?q?red=20for=20using=20a=20remultiplexer).=20-=20Fixed=20setting?= =?UTF-8?q?=20system=20time=20from=20transponders.=20-=20Fixed=20a=20segfa?= =?UTF-8?q?ult=20in=20the=20Schedule=20menu=20in=20case=20there=20is=20no?= =?UTF-8?q?=20EPG=20information.=20-=20The=20'runvdr'=20script=20now=20kil?= =?UTF-8?q?ls=20any=20leftover=20vdr=20threads=20before=20restarting=20it.?= =?UTF-8?q?=20-=20Fixed=20a=20problem=20with=20Daylight=20Saving=20Time=20?= =?UTF-8?q?when=20displaying=20the=20times=20of=20=20=20recordings.=20-=20?= =?UTF-8?q?Added=20Dutch=20language=20texts=20(thanks=20to=20Arnold=20Nies?= =?UTF-8?q?sen).=20-=20The=20new=20command=20line=20option=20-t=20can=20be?= =?UTF-8?q?=20used=20to=20set=20the=20controlling=20terminal=20=20=20(than?= =?UTF-8?q?ks=20to=20J=FCrgen=20Sauer).=20This=20is=20especially=20useful?= =?UTF-8?q?=20when=20starting=20VDR=20through=20=20=20an=20entry=20in=20/e?= =?UTF-8?q?tc/inittab=20(see=20INSTALL).=20-=20Since=20the=20CAM=20module?= =?UTF-8?q?=20only=20works=20if=20it=20is=20installed=20in=20the=20"highes?= =?UTF-8?q?t"=20DVB=20card,=20=20=20recordings=20now=20search=20for=20a=20?= =?UTF-8?q?free=20DVB=20card=20from=20lowest=20to=20highest=20index=20(as?= =?UTF-8?q?=20=20=20opposed=20to=20the=20previous=20"highest=20to=20lowest?= =?UTF-8?q?"=20search)=20in=20order=20to=20not=20use=20the=20=20=20CAM=20c?= =?UTF-8?q?ard=20for=20FTA=20recordings=20unless=20necessary.=20This=20is?= =?UTF-8?q?=20only=20important=20for=20=20=20systems=20with=20three=20or?= =?UTF-8?q?=20more=20DVB=20cards.=20-=20Added=20the=20"statdvb2vdr"=20tool?= =?UTF-8?q?=20from=20Hans-Peter=20Raschke.=20-=20Fixed=20a=20segfault=20th?= =?UTF-8?q?at=20sometimes=20happened=20when=20killing=20VDR.=20-=20VDR=20n?= =?UTF-8?q?ow=20returns=20an=20exit=20status=20of=20'2'=20in=20case=20of?= =?UTF-8?q?=20an=20error=20at=20startup,=20instead=20=20=20of=20terminatin?= =?UTF-8?q?g=20with=20'abort()'=20(which=20caused=20a=20core=20dump).=20-?= =?UTF-8?q?=20SVDRP=20now=20also=20works=20with=20clients=20that=20don't?= =?UTF-8?q?=20do=20line=20buffering=20(like=20the=20=20=20Windows=20'telne?= =?UTF-8?q?t').=20-=20Empty=20lines=20in=20config=20files=20no=20longer=20?= =?UTF-8?q?cause=20error=20messages.=20-=20New=20SVDRP=20command=20LSTE=20?= =?UTF-8?q?to=20list=20the=20EPG=20data.=20-=20The=20SVDRP=20HELP=20comman?= =?UTF-8?q?d=20now=20prints=20the=20topics=20in=20several=20columns.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Tools/statdvb2vdr/ch.pl | 250 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 250 insertions(+) create mode 100644 Tools/statdvb2vdr/ch.pl (limited to 'Tools/statdvb2vdr') diff --git a/Tools/statdvb2vdr/ch.pl b/Tools/statdvb2vdr/ch.pl new file mode 100644 index 0000000..91e918d --- /dev/null +++ b/Tools/statdvb2vdr/ch.pl @@ -0,0 +1,250 @@ +#!/usr/bin/perl + +# Reads the file statdvb.dat produced by the Siemens windows +# software (1.50), which contains the scanned channels of an +# DVB-C (-S). The file ist located in the windows directory. +# +# Output is suitable for VDR (channels.conf). Only tested for +# the cable version. Should work with slight modifications for +# the sat version. +# +# 8. März 2001 - Hans-Peter Raschke + + +# file structure derived from "DvbGlobalDef.h" of the Siemens +# DVB kit. + +# typedef int TABLETYPE; +# enum TunStandard +# { +# PAL_BG, //B/G stereo or mono +# PAL_I, //I mono (with Nicam stereo) +# PAL_DK, //D/K mono +# SECAM_L, //L mono (with Nicam stereo) +# SECAM_LI, //Secam L’ (with Nicam stereo) +# SECAM_DK, +# SECAM_BG, +# NTSC_M, +# DVB_C, +# DVB_S, +# DVB_T +# }; +# +# typedef struct TunProgDataTag //xx bytes+1string +# { +# int nNumber; //logical number of the program +# DWORD dwFrequency; //frequency in khz +# CString csName; //name of the program +# TunStandard eStandard; //standard of the program +# DWORD dwExtraInfo; //specific info, like teletext,reserved data +# //0x8 == external input 1-CVBS +# //0x10 == external input 2-Y/C +# //0x20 == scrambled Program stream +# //0x40 == ASTRA Sattable +# //0x80 == Eutelsat Sattable +# //0xC0 == Sattable from File +# //0x100 == Pulsed switch to other satellite dish +# //0x1000-0xF000 = Other Satellite Nr(if Sattable from File) +# //Digital only params beginning from here +# WORD ProgNr; //DVB Nr for the prog (PAS related) +# WORD wTS_ID; //Transport-Stream ID orig. +# WORD wNW_ID; //Network ID orig. +# WORD wService_ID; //Service /Programm Id +# BYTE nModulation; //Modulation-Type QAM,QPSK,other +# BYTE nFEC_outerinner; //outer(high nibble) and inner(low n.) +# DWORD dwSymbolrate; //in symbol/s +# BOOL b22kHz; //east or west(TRUE) position in Sat +# BOOL bVertical_pos; //horizontal or vertical(TRUE) position in SAT +# BYTE nProgtype; //type of service (e.g. tv, radio) +# WORD wVideo_PID; //video-pid of the channel +# WORD wAudio_PID; //audio-pid of the channel +# WORD wPMT_PID; //PID of the associated PMT +# WORD wTxt_PID; //teletext PID for the program +# WORD wSubtitling_PID; //subtitling PID for the program +# WORD wData_PID; //PID for data broadcast +# BYTE nIPFilter; //filter for different ip's +# DWORD dwReserved1; //Shows some extended Information LOWORD=DataBroadcast_Id, +# //MSB showing Databroadcast, (HIWORD & 0xFF)=ComponentTag from the stream ident desc +# DWORD dwReserved2; //reserved dword +# }DVBTunProgData; +# + +use strict; +use FileHandle; + +# for a full dump +my @varNames = ("nNumber", # logical number of the program + "dwFrequency", # frequency in khz + "csName", # name of the program + "eStandard", # standard of the program + "dwExtraInfo", # specific info, like teletext,reserved data + # 0x8 == external input 1-CVBS + # 0x10 == external input 2-Y/C + # 0x20 == scrambled Program stream + # 0x40 == ASTRA Sattable + # 0x80 == Eutelsat Sattable + # 0xC0 == Sattable from File + # 0x100 == Pulsed switch to other satellite dish + # 0x1000-0xF000 = Other Satellite Nr(if Sattable from File) + "ProgNr", # DVB Nr for the prog (PAS related) + "wTS_ID", # Transport-Stream ID orig. + "wNW_ID", # Network ID orig. + "wService_ID", # Service /Programm Id + "nModulation", # Modulation-Type QAM,QPSK,other + "nFEC_outerinner", # outer(high nibble) and inner(low n.) + "dwSymbolrate", # in symbol/s + "b22kHz", # east or west(TRUE) position in Sat + "bVertical_pos", # horizontal or vertical(TRUE) position in SAT + "nProgtype", # type of service (e.g. tv, radio) + "wVideo_PID", # video-pid of the channel + "wAudio_PID", # audio-pid of the channel + "wPMT_PID", # PID of the associated PMT + "wTxt_PID", # teletext PID for the program + "wSubtitling_PID", # subtitling PID for the program + "wData_PID"); # PID for data broadcast + +my @outVar = ("csName", + "dwFrequency", + "bVertical_pos", + "b22kHz", + "dwSymbolrate", + "wVideo_PID", + "wAudio_PID", + "wTxt_PID", + "dwExtraInfo", + "ProgNr"); + +# channels that need a valid smartcard +my @addCrypted = ("Extreme Sport", + "Bloomberg", + "Fashion TV", + "BET ON JAZZ", + "LANDSCAPE", + "Einstein", + "Single TV"); + +my @chNames = (); # list of scanned channels +my $camNo = 1; # number of CI/CAM to use +my %chData; # all channel data +my $buff; # input buffer +my $fh = new FileHandle("$ARGV[0]") or die "Datei $ARGV[0] nicht gefunden!"; + +binmode($fh); # could be run on windows +$fh->seek(4, 0); # skip id + +my $chCnt = 0; +while (!$fh->eof()) { + $chCnt++; + + last if ($fh->read($buff, 7) != 7); + my ($nNumber, + $dwFrequency, + $sLen + ) = unpack("SLC", $buff); + + last if ($fh->read($buff, $sLen) != $sLen); + my ($csName) = unpack("A$sLen", $buff); + $csName =~ s/:/./g; + $csName =~ s/^\s+//; + $csName =~ s/\s+$//; + + last if ($fh->read($buff, 54) != 54); + my ($eStandard, + $dwExtraInfo, + $ProgNr, + $wTS_ID, + $wNW_ID, + $wService_ID, + $nModulation, + $nFEC_outerinner, + $dwSymbolrate, + $b22kHz, + $bVertical_pos, + $nProgtype, + $wVideo_PID, + $wAudio_PID, + $wPMT_PID, + $wTxt_PID, + $wSubtitling_PID, + $wData_PID + ) = unpack("LLSSSSCCLLLCSSSSSS", $buff); + + # some modifications for VDR + $dwFrequency /= 1000; + $bVertical_pos = $bVertical_pos ? "v" : "h"; + $dwSymbolrate /= 1000; + $dwExtraInfo = ($dwExtraInfo == 32 || grep(($_ cmp $csName) == 0, @addCrypted)) ? $camNo : 0; + + my $x = 1; + my $orgName = $csName; + while (exists($chData{$csName})) { + $csName = "$orgName" . "_$x"; + $x++; + } + push(@chNames, $csName); + + my %tmp = ("nNumber" => $nNumber, + "dwFrequency" => $dwFrequency, + "csName" => $orgName, + "eStandard" => $eStandard, + "dwExtraInfo" => $dwExtraInfo, + "ProgNr" => $ProgNr, + "wTS_ID" => $wTS_ID, + "wNW_ID" => $wNW_ID, + "wService_ID" => $wService_ID, + "nModulation" => $nModulation, + "nFEC_outerinner" => $nFEC_outerinner, + "dwSymbolrate" => $dwSymbolrate, + "b22kHz" => $b22kHz, + "bVertical_pos" => $bVertical_pos, + "nProgtype" => $nProgtype, + "wVideo_PID" => $wVideo_PID, + "wAudio_PID" => $wAudio_PID, + "wPMT_PID" => $wPMT_PID, + "wTxt_PID" => $wTxt_PID, + "wSubtitling_PID" => $wSubtitling_PID, + "wData_PID" => $wData_PID); + $chData{$csName} = {%tmp}; +} + +print STDERR "$chCnt channels found!\n"; + +# now we print the channels.conf +# crypted TV +print ":verschlüsselte Fernsehprogramme\n"; +for my $n (@chNames) { + my %tmp = %{$chData{$n}}; + printChannel($chData{$n}) if ($tmp{"nProgtype"} == 1 && $tmp{"dwExtraInfo"}); +} + +# TV +print ":Fernsehprogramme\n"; +for my $n (@chNames) { + my %tmp = %{$chData{$n}}; + printChannel($chData{$n}) if ($tmp{"nProgtype"} == 1 && !$tmp{"dwExtraInfo"}); +} + +# crypted radio +print ":verschlüsselte Radioprogramme\n"; +for my $n (@chNames) { + my %tmp = %{$chData{$n}}; + printChannel($chData{$n}) if ($tmp{"nProgtype"} == 2 && $tmp{"dwExtraInfo"}); +} + +# radio +print ":Radioprogramme\n"; +for my $n (@chNames) { + my %tmp = %{$chData{$n}}; + printChannel($chData{$n}) if ($tmp{"nProgtype"} == 2 && !$tmp{"dwExtraInfo"}); +} + +sub printChannel { + my $p = shift; + my @tmp = (); + + for my $n (@outVar) { + push(@tmp, ${$p}{$n}); + } + + print join(":", @tmp), "\n"; +} -- cgit v1.2.3