From d303632efed839aa7bd7a8a743da08a75665020d Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sat, 3 Feb 2001 16:28:03 +0100 Subject: [PATCH] Implemented TT PID --- CONTRIBUTORS | 11 +++++++---- FORMATS | 3 ++- HISTORY | 4 ++++ config.c | 18 +++++++++++++----- config.h | 3 ++- dvbapi.c | 7 ++++--- dvbapi.h | 4 ++-- i18n.c | 7 ++++++- menu.c | 3 ++- 9 files changed, 42 insertions(+), 18 deletions(-) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index d9a1d4bf..e3c8e20c 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -40,13 +40,16 @@ Bastian Guse for writing the FORMATS entry for timers.conf Matthias Schniedermeyer - for implementing the 'MarkInstantRecord' setup option. + for implementing the 'MarkInstantRecord' setup option Miha Setina - for translating the OSD texts to the Slovenian language. + for translating the OSD texts to the Slovenian language Alberto Carraro - for translating the OSD texts to the Italian language. + for translating the OSD texts to the Italian language Deti Fliegl - for implementing the 'CurrentChannel' setup parameter. + for implementing the 'CurrentChannel' setup parameter + +Dave Chapman + for implementing support for the teletext PID diff --git a/FORMATS b/FORMATS index a2ab7c11..f1b64ffd 100644 --- a/FORMATS +++ b/FORMATS @@ -13,7 +13,7 @@ Video Disk Recorder File Formats A "channel definition" is a line with channel data, where the fields are separated by ':' characters: - Example: "RTL:12188:h:1:27500:163:104:0:12003" + Example: "RTL:12188:h:1:27500:163:104:0:0:12003" The fields in a channel definition have the following meaning (from left to right): @@ -26,6 +26,7 @@ Video Disk Recorder File Formats - Symbol rate - Video PID - Audio PID + - Teletext PID - Conditional Access (0 = Free To Air, 1 = can be decrypted by the first DVB card, 2 = can be decrypted by the second DVB card) - Program Number diff --git a/HISTORY b/HISTORY index 287006fd..55037971 100644 --- a/HISTORY +++ b/HISTORY @@ -371,3 +371,7 @@ Video Disk Recorder Revision History first non-blank character of a menu item is a digit in the range 1..9, that item can be selected by pressing the respective numeric key on the remote control. +- The channel data in 'channels.conf' now contains the teletext PID (thanks to + Dave Chapman). Existing files will be read normally (and the teletext PID set + to 0), but once they are written back (due to some channel editing) the file + will have the new format. diff --git a/config.c b/config.c index 5838c68c..d4d3daf0 100644 --- a/config.c +++ b/config.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: config.c 1.39 2001/01/14 15:29:15 kls Exp $ + * $Id: config.c 1.40 2001/02/03 16:19:42 kls Exp $ */ #include "config.h" @@ -199,6 +199,7 @@ cChannel::cChannel(const cChannel *Channel) srate = Channel ? Channel->srate : 27500; vpid = Channel ? Channel->vpid : 255; apid = Channel ? Channel->apid : 256; + tpid = Channel ? Channel->tpid : 32; ca = Channel ? Channel->ca : 0; pnr = Channel ? Channel->pnr : 0; groupSep = Channel ? Channel->groupSep : false; @@ -216,7 +217,7 @@ const char *cChannel::ToText(cChannel *Channel) if (Channel->groupSep) asprintf(&buffer, ":%s\n", s); else - asprintf(&buffer, "%s:%d:%c:%d:%d:%d:%d:%d:%d\n", s, Channel->frequency, Channel->polarization, Channel->diseqc, Channel->srate, Channel->vpid, Channel->apid, Channel->ca, Channel->pnr); + asprintf(&buffer, "%s:%d:%c:%d:%d:%d:%d:%d:%d:%d\n", s, Channel->frequency, Channel->polarization, Channel->diseqc, Channel->srate, Channel->vpid, Channel->apid, Channel->tpid, Channel->ca, Channel->pnr); return buffer; } @@ -239,8 +240,15 @@ bool cChannel::Parse(const char *s) } else { groupSep = false; - int fields = sscanf(s, "%a[^:]:%d:%c:%d:%d:%d:%d:%d:%d", &buffer, &frequency, &polarization, &diseqc, &srate, &vpid, &apid, &ca, &pnr); - if (fields == 9) { + //XXX + int fields = sscanf(s, "%a[^:]:%d:%c:%d:%d:%d:%d:%d:%d:%d", &buffer, &frequency, &polarization, &diseqc, &srate, &vpid, &apid, &tpid, &ca, &pnr); + if (fields >= 9) { + if (fields == 9) { + // allow reading of old format + pnr = ca; + ca = tpid; + tpid = 0; + } strn0cpy(name, buffer, MaxChannelName); delete buffer; } @@ -265,7 +273,7 @@ bool cChannel::Switch(cDvbApi *DvbApi, bool Log) isyslog(LOG_INFO, "switching to channel %d", number); } for (int i = 3; i--;) { - if (DvbApi->SetChannel(number, frequency, polarization, diseqc, srate, vpid, apid, ca, pnr)) + if (DvbApi->SetChannel(number, frequency, polarization, diseqc, srate, vpid, apid, tpid, ca, pnr)) return true; esyslog(LOG_ERR, "retrying"); } diff --git a/config.h b/config.h index d2b4940a..8f44e56e 100644 --- a/config.h +++ b/config.h @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: config.h 1.39 2001/02/02 15:22:47 kls Exp $ + * $Id: config.h 1.40 2001/02/03 15:55:45 kls Exp $ */ #ifndef __CONFIG_H @@ -93,6 +93,7 @@ public: int srate; int vpid; int apid; + int tpid; int ca; int pnr; int number; // Sequence number assigned on load diff --git a/dvbapi.c b/dvbapi.c index f0b909b1..f29e5a4b 100644 --- a/dvbapi.c +++ b/dvbapi.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: dvbapi.c 1.55 2001/02/02 15:35:44 kls Exp $ + * $Id: dvbapi.c 1.56 2001/02/03 16:00:23 kls Exp $ */ #include "dvbapi.h" @@ -2170,7 +2170,7 @@ void cDvbApi::Flush(void) #endif } -bool cDvbApi::SetChannel(int ChannelNumber, int FrequencyMHz, char Polarization, int Diseqc, int Srate, int Vpid, int Apid, int Ca, int Pnr) +bool cDvbApi::SetChannel(int ChannelNumber, int FrequencyMHz, char Polarization, int Diseqc, int Srate, int Vpid, int Apid, int Tpid, int Ca, int Pnr) { if (videoDev >= 0) { cThreadLock ThreadLock(siProcessor); // makes sure the siProcessor won't access the vbi-device while switching @@ -2192,6 +2192,7 @@ bool cDvbApi::SetChannel(int ChannelNumber, int FrequencyMHz, char Polarization, front.volt = (Polarization == 'v' || Polarization == 'V') ? 0 : 1; front.video_pid = Vpid; front.audio_pid = Apid; + front.tt_pid = Tpid; front.fec = 8; front.AFC = 1; ioctl(videoDev, VIDIOCSFRONTEND, &front); @@ -2205,7 +2206,7 @@ bool cDvbApi::SetChannel(int ChannelNumber, int FrequencyMHz, char Polarization, cDvbApi *CaDvbApi = GetDvbApi(Ca, 0); if (CaDvbApi) { if (!CaDvbApi->Recording()) { - if (CaDvbApi->SetChannel(ChannelNumber, FrequencyMHz, Polarization, Diseqc, Srate, Vpid, Apid, Ca, Pnr)) + if (CaDvbApi->SetChannel(ChannelNumber, FrequencyMHz, Polarization, Diseqc, Srate, Vpid, Apid, Tpid, Ca, Pnr)) transferringFromDvbApi = CaDvbApi->StartTransfer(videoDev); } } diff --git a/dvbapi.h b/dvbapi.h index ea92a040..c7c8fb40 100644 --- a/dvbapi.h +++ b/dvbapi.h @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: dvbapi.h 1.31 2001/02/02 15:21:30 kls Exp $ + * $Id: dvbapi.h 1.32 2001/02/03 15:59:35 kls Exp $ */ #ifndef __DVBAPI_H @@ -167,7 +167,7 @@ public: private: int currentChannel; public: - bool SetChannel(int ChannelNumber, int FrequencyMHz, char Polarization, int Diseqc, int Srate, int Vpid, int Apid, int Ca, int Pnr); + bool SetChannel(int ChannelNumber, int FrequencyMHz, char Polarization, int Diseqc, int Srate, int Vpid, int Apid, int Tpid, int Ca, int Pnr); static int CurrentChannel(void) { return PrimaryDvbApi ? PrimaryDvbApi->currentChannel : 0; } int Channel(void) { return currentChannel; } diff --git a/i18n.c b/i18n.c index cf1785f3..90dd010d 100644 --- a/i18n.c +++ b/i18n.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: i18n.c 1.8 2001/01/06 16:17:39 kls Exp $ + * $Id: i18n.c 1.9 2001/02/03 16:06:04 kls Exp $ * * Slovenian translations provided by Miha Setina * Italian translations provided by Alberto Carraro @@ -253,6 +253,11 @@ const tPhrase Phrases[] = { "Apid", "Apid", }, + { "Tpid", + "Tpid", + "Tpid", + "Tpid", + }, { "CA", "CA", "CA", diff --git a/menu.c b/menu.c index beae81cb..b20b89d1 100644 --- a/menu.c +++ b/menu.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: menu.c 1.61 2001/02/03 15:32:47 kls Exp $ + * $Id: menu.c 1.62 2001/02/03 16:05:31 kls Exp $ */ #include "menu.h" @@ -541,6 +541,7 @@ cMenuEditChannel::cMenuEditChannel(int Index) Add(new cMenuEditIntItem( tr("Srate"), &data.srate, 22000, 27500)); //TODO exact limits - toggle??? Add(new cMenuEditIntItem( tr("Vpid"), &data.vpid, 0, 10000)); //TODO exact limits??? Add(new cMenuEditIntItem( tr("Apid"), &data.apid, 0, 10000)); //TODO exact limits??? + Add(new cMenuEditIntItem( tr("Tpid"), &data.tpid, 0, 10000)); //TODO exact limits??? Add(new cMenuEditIntItem( tr("CA"), &data.ca, 0, cDvbApi::NumDvbApis)); Add(new cMenuEditIntItem( tr("Pnr"), &data.pnr, 0)); }