From 3b143dbbd1c469c2b8ca90cf3857ada9bd05972d Mon Sep 17 00:00:00 2001 From: Tobias Grimm Date: Sun, 18 Apr 2010 02:55:00 +0200 Subject: Fixed channel retune triggering in VDR patch and updated patch to 1.7.14 (Dropped 1.7.12 and 1.7.13 patch) --- HISTORY | 4 + .../0001-Record-teletext-subtitles.patch | 242 ---- ...-option-to-enable-teletext-subtitle-recor.patch | 698 ----------- ...l-configuration-of-teletetxt-subtitle-pag.patch | 139 --- .../0004-Decrypt-teletext-stream.patch | 35 - ...-Capture-teletext-subtitle-pages-from-PMT.patch | 92 -- .../0006-Ttxtsubs-plugin-hook.patch | 256 ---- .../0001-Record-teletext-subtitles.patch | 243 ---- ...-option-to-enable-teletext-subtitle-recor.patch | 470 -------- ...l-configuration-of-teletetxt-subtitle-pag.patch | 139 --- .../0004-Decrypt-teletext-stream.patch | 35 - ...-Capture-teletext-subtitle-pages-from-PMT.patch | 92 -- .../0006-Ttxtsubs-plugin-hook.patch | 256 ---- .../0001-Record-teletext-subtitles.patch | 243 ++++ ...-option-to-enable-teletext-subtitle-recor.patch | 470 ++++++++ ...l-configuration-of-teletetxt-subtitle-pag.patch | 142 +++ .../0004-Decrypt-teletext-stream.patch | 35 + ...-Capture-teletext-subtitle-pages-from-PMT.patch | 92 ++ .../0006-Ttxtsubs-plugin-hook.patch | 256 ++++ patches/vdr-1.7.12-ttxtsubs.patch | 1274 -------------------- patches/vdr-1.7.13-ttxtsubs.patch | 1047 ---------------- patches/vdr-1.7.14-ttxtsubs.patch | 1047 ++++++++++++++++ 22 files changed, 2289 insertions(+), 5018 deletions(-) delete mode 100644 patches/patch-set.1.7.12/0001-Record-teletext-subtitles.patch delete mode 100644 patches/patch-set.1.7.12/0002-Added-setup-option-to-enable-teletext-subtitle-recor.patch delete mode 100644 patches/patch-set.1.7.12/0003-Allow-manual-configuration-of-teletetxt-subtitle-pag.patch delete mode 100644 patches/patch-set.1.7.12/0004-Decrypt-teletext-stream.patch delete mode 100644 patches/patch-set.1.7.12/0005-Capture-teletext-subtitle-pages-from-PMT.patch delete mode 100644 patches/patch-set.1.7.12/0006-Ttxtsubs-plugin-hook.patch delete mode 100644 patches/patch-set.1.7.13/0001-Record-teletext-subtitles.patch delete mode 100644 patches/patch-set.1.7.13/0002-Added-setup-option-to-enable-teletext-subtitle-recor.patch delete mode 100644 patches/patch-set.1.7.13/0003-Allow-manual-configuration-of-teletetxt-subtitle-pag.patch delete mode 100644 patches/patch-set.1.7.13/0004-Decrypt-teletext-stream.patch delete mode 100644 patches/patch-set.1.7.13/0005-Capture-teletext-subtitle-pages-from-PMT.patch delete mode 100644 patches/patch-set.1.7.13/0006-Ttxtsubs-plugin-hook.patch create mode 100644 patches/patch-set.1.7.14/0001-Record-teletext-subtitles.patch create mode 100644 patches/patch-set.1.7.14/0002-Added-setup-option-to-enable-teletext-subtitle-recor.patch create mode 100644 patches/patch-set.1.7.14/0003-Allow-manual-configuration-of-teletetxt-subtitle-pag.patch create mode 100644 patches/patch-set.1.7.14/0004-Decrypt-teletext-stream.patch create mode 100644 patches/patch-set.1.7.14/0005-Capture-teletext-subtitle-pages-from-PMT.patch create mode 100644 patches/patch-set.1.7.14/0006-Ttxtsubs-plugin-hook.patch delete mode 100644 patches/vdr-1.7.12-ttxtsubs.patch delete mode 100644 patches/vdr-1.7.13-ttxtsubs.patch create mode 100644 patches/vdr-1.7.14-ttxtsubs.patch diff --git a/HISTORY b/HISTORY index f8cefa1..467e673 100644 --- a/HISTORY +++ b/HISTORY @@ -1,6 +1,10 @@ VDR Plugin 'ttxtsubs' Revision History -------------------------------------- +2010-04-xx: Version 0.2.2 +- Fixed channel retune triggering in VDR patch and updated patch to 1.7.14 + (Dropped 1.7.12 and 1.7.13 patch) + 2010-03-06: Version 0.2.1 - Added Estonian translation by Arthur Konovalov (Closes #271) - Finnish translation updated by Rolf Ahrenberg diff --git a/patches/patch-set.1.7.12/0001-Record-teletext-subtitles.patch b/patches/patch-set.1.7.12/0001-Record-teletext-subtitles.patch deleted file mode 100644 index e1a08f8..0000000 --- a/patches/patch-set.1.7.12/0001-Record-teletext-subtitles.patch +++ /dev/null @@ -1,242 +0,0 @@ -From f10d7d8469b1c50f32e884743034c14dd16fae76 Mon Sep 17 00:00:00 2001 -From: etobi -Date: Fri, 12 Feb 2010 21:55:04 +0100 -Subject: [PATCH 1/6] Record teletext subtitles - ---- - channels.c | 20 ++++++++++++++++++++ - channels.h | 16 ++++++++++++++++ - pat.c | 18 +++++++++++++++++- - receiver.c | 2 +- - remux.c | 29 +++++++++++++++++++++++++++++ - remux.h | 3 +++ - 6 files changed, 86 insertions(+), 2 deletions(-) - -diff --git a/channels.c b/channels.c -index c14df19..863eab0 100644 ---- a/channels.c -+++ b/channels.c -@@ -551,6 +551,26 @@ void cChannel::SetSubtitlingDescriptors(uchar *SubtitlingTypes, uint16_t *Compos - } - } - -+void cChannel::SetTeletextSubtitlePages(tTeletextSubtitlePage pages[], int numberOfPages) -+{ -+ int mod = CHANNELMOD_NONE; -+ if (totalTtxtSubtitlePages != numberOfPages) -+ mod |= CHANNELMOD_PIDS; -+ totalTtxtSubtitlePages = 0; -+ for (int i = 0; (i < numberOfPages) && (totalTtxtSubtitlePages < MAXTXTPAGES); i++) { -+ if (teletextSubtitlePages[totalTtxtSubtitlePages].ttxtMagazine != pages[i].ttxtMagazine || -+ teletextSubtitlePages[totalTtxtSubtitlePages].ttxtPage != pages[i].ttxtPage || -+ teletextSubtitlePages[totalTtxtSubtitlePages].ttxtType != pages[i].ttxtType || -+ strcmp(teletextSubtitlePages[totalTtxtSubtitlePages].ttxtLanguage, pages[i].ttxtLanguage)) { -+ mod |= CHANNELMOD_PIDS; -+ teletextSubtitlePages[totalTtxtSubtitlePages] = pages[i]; -+ } -+ totalTtxtSubtitlePages++; -+ } -+ modification |= mod; -+ Channels.SetModified(); -+} -+ - void cChannel::SetCaIds(const int *CaIds) - { - if (caids[0] && caids[0] <= CA_USER_MAX) -diff --git a/channels.h b/channels.h -index b465f6a..60973b7 100644 ---- a/channels.h -+++ b/channels.h -@@ -35,6 +35,7 @@ - #define MAXDPIDS 16 // dolby (AC3 + DTS) - #define MAXSPIDS 32 // subtitles - #define MAXCAIDS 8 // conditional access -+#define MAXTXTPAGES 8 // teletext pages - - #define MAXLANGCODE1 4 // a 3 letter language code, zero terminated - #define MAXLANGCODE2 8 // up to two 3 letter language codes, separated by '+' and zero terminated -@@ -92,6 +93,16 @@ public: - static const tChannelID InvalidID; - }; - -+struct tTeletextSubtitlePage { -+ tTeletextSubtitlePage(void) { ttxtPage = ttxtMagazine = 0; ttxtType = 0x02; strcpy(ttxtLanguage, "und"); } -+ tTeletextSubtitlePage(int page) { ttxtMagazine = (page / 100) & 0x7; ttxtPage = (((page % 100) / 10) << 4) + (page % 10); ttxtType = 0x02; strcpy(ttxtLanguage, "und"); } -+ char ttxtLanguage[MAXLANGCODE1]; -+ uchar ttxtPage; -+ uchar ttxtMagazine; -+ uchar ttxtType; -+ int PageNumber(void) const { return BCDCHARTOINT(ttxtMagazine) * 100 + BCDCHARTOINT(ttxtPage); } -+ }; -+ - class cChannel; - - class cLinkChannel : public cListObject { -@@ -133,6 +144,8 @@ private: - uint16_t compositionPageIds[MAXSPIDS]; - uint16_t ancillaryPageIds[MAXSPIDS]; - int tpid; -+ int totalTtxtSubtitlePages; -+ tTeletextSubtitlePage teletextSubtitlePages[MAXTXTPAGES]; - int caids[MAXCAIDS + 1]; // list is zero-terminated - int nid; - int tid; -@@ -192,6 +205,8 @@ public: - uint16_t CompositionPageId(int i) const { return (0 <= i && i < MAXSPIDS) ? compositionPageIds[i] : uint16_t(0); } - uint16_t AncillaryPageId(int i) const { return (0 <= i && i < MAXSPIDS) ? ancillaryPageIds[i] : uint16_t(0); } - int Tpid(void) const { return tpid; } -+ const tTeletextSubtitlePage *TeletextSubtitlePages() const { return teletextSubtitlePages; } -+ int TotalTeletextSubtitlePages() const { return totalTtxtSubtitlePages; } - const int *Caids(void) const { return caids; } - int Ca(int Index = 0) const { return Index < MAXCAIDS ? caids[Index] : 0; } - int Nid(void) const { return nid; } -@@ -228,6 +243,7 @@ public: - void SetName(const char *Name, const char *ShortName, const char *Provider); - void SetPortalName(const char *PortalName); - void SetPids(int Vpid, int Ppid, int Vtype, int *Apids, char ALangs[][MAXLANGCODE2], int *Dpids, char DLangs[][MAXLANGCODE2], int *Spids, char SLangs[][MAXLANGCODE2], int Tpid); -+ void SetTeletextSubtitlePages(tTeletextSubtitlePage pages[], int numberOfPages); - void SetCaIds(const int *CaIds); // list must be zero-terminated - void SetCaDescriptors(int Level); - void SetLinkChannels(cLinkChannels *LinkChannels); -diff --git a/pat.c b/pat.c -index 9b3ded6..ff25501 100644 ---- a/pat.c -+++ b/pat.c -@@ -341,6 +341,8 @@ void cPatFilter::Process(u_short Pid, u_char Tid, const u_char *Data, int Length - char DLangs[MAXDPIDS][MAXLANGCODE2] = { "" }; - char SLangs[MAXSPIDS][MAXLANGCODE2] = { "" }; - int Tpid = 0; -+ tTeletextSubtitlePage TeletextSubtitlePages[MAXTXTPAGES]; -+ int NumTPages = 0; - int NumApids = 0; - int NumDpids = 0; - int NumSpids = 0; -@@ -426,8 +428,21 @@ void cPatFilter::Process(u_short Pid, u_char Tid, const u_char *Data, int Length - NumSpids++; - } - break; -- case SI::TeletextDescriptorTag: -+ case SI::TeletextDescriptorTag: { - Tpid = esPid; -+ SI::TeletextDescriptor *sd = (SI::TeletextDescriptor *)d; -+ SI::TeletextDescriptor::Teletext ttxt; -+ for (SI::Loop::Iterator it; sd->teletextLoop.getNext(ttxt, it); ) { -+ bool isSubtitlePage = (ttxt.getTeletextType() == 0x02) || (ttxt.getTeletextType() == 0x05); -+ if ((NumTPages < MAXTXTPAGES) && ttxt.languageCode[0] && isSubtitlePage) { -+ strn0cpy(TeletextSubtitlePages[NumTPages].ttxtLanguage, I18nNormalizeLanguageCode(ttxt.languageCode), MAXLANGCODE1); -+ TeletextSubtitlePages[NumTPages].ttxtPage = ttxt.getTeletextPageNumber(); -+ TeletextSubtitlePages[NumTPages].ttxtMagazine = ttxt.getTeletextMagazineNumber(); -+ TeletextSubtitlePages[NumTPages].ttxtType = ttxt.getTeletextType(); -+ NumTPages++; -+ } -+ } -+ } - break; - case SI::ISO639LanguageDescriptorTag: { - SI::ISO639LanguageDescriptor *ld = (SI::ISO639LanguageDescriptor *)d; -@@ -458,6 +473,7 @@ void cPatFilter::Process(u_short Pid, u_char Tid, const u_char *Data, int Length - } - if (Setup.UpdateChannels >= 2) { - Channel->SetPids(Vpid, Ppid, Vtype, Apids, ALangs, Dpids, DLangs, Spids, SLangs, Tpid); -+ Channel->SetTeletextSubtitlePages(TeletextSubtitlePages, NumTPages); - Channel->SetCaIds(CaDescriptors->CaIds()); - Channel->SetSubtitlingDescriptors(SubtitlingTypes, CompositionPageIds, AncillaryPageIds); - } -diff --git a/receiver.c b/receiver.c -index f922e98..dab95b3 100644 ---- a/receiver.c -+++ b/receiver.c -@@ -82,7 +82,7 @@ bool cReceiver::SetPids(const cChannel *Channel) - (Channel->Ppid() == Channel->Vpid() || AddPid(Channel->Ppid())) && - AddPids(Channel->Apids()) && - (!Setup.UseDolbyDigital || AddPids(Channel->Dpids())) && -- AddPids(Channel->Spids()); -+ AddPids(Channel->Spids()) && AddPid(Channel->Tpid()); - } - return true; - } -diff --git a/remux.c b/remux.c -index 070a06a..b5c7a06 100644 ---- a/remux.c -+++ b/remux.c -@@ -215,6 +215,29 @@ int cPatPmtGenerator::MakeSubtitlingDescriptor(uchar *Target, const char *Langua - return i; - } - -+int cPatPmtGenerator::MakeTeletextDescriptor(uchar *Target, const tTeletextSubtitlePage *pages, int pageCount) -+{ -+ int i = 0, j = 0; -+ Target[i++] = SI::TeletextDescriptorTag; -+ int l = i; -+ Target[i++] = 0x00; // length -+ for (int n = 0; n < pageCount; n++) { -+ const char* Language = pages[n].ttxtLanguage; -+ Target[i++] = *Language++; -+ Target[i++] = *Language++; -+ Target[i++] = *Language++; -+ Target[i++] = (pages[n].ttxtType << 3) + pages[n].ttxtMagazine; -+ Target[i++] = pages[n].ttxtPage; -+ j++; -+ } -+ if (j > 0) { -+ Target[l] = j * 5; // update length -+ IncEsInfoLength(i); -+ return i; -+ } -+ return 0; -+} -+ - int cPatPmtGenerator::MakeLanguageDescriptor(uchar *Target, const char *Language) - { - int i = 0; -@@ -296,6 +319,7 @@ void cPatPmtGenerator::GeneratePmt(const cChannel *Channel) - if (Channel) { - int Vpid = Channel->Vpid(); - int Ppid = Channel->Ppid(); -+ int Tpid = Channel->Tpid(); - uchar *p = buf; - int i = 0; - p[i++] = 0x02; // table id -@@ -330,6 +354,10 @@ void cPatPmtGenerator::GeneratePmt(const cChannel *Channel) - i += MakeStream(buf + i, 0x06, Channel->Spid(n)); - i += MakeSubtitlingDescriptor(buf + i, Channel->Slang(n), Channel->SubtitlingType(n), Channel->CompositionPageId(n), Channel->AncillaryPageId(n)); - } -+ if (Tpid) { -+ i += MakeStream(buf + i, 0x06, Tpid); -+ i += MakeTeletextDescriptor(buf + i, Channel->TeletextSubtitlePages(), Channel->TotalTeletextSubtitlePages()); -+ } - - int sl = i - SectionLength - 2 + 4; // -2 = SectionLength storage, +4 = length of CRC - buf[SectionLength] |= (sl >> 8) & 0x0F; -@@ -493,6 +521,7 @@ void cPatPmtParser::ParsePmt(const uchar *Data, int Length) - spids[0] = 0; - atypes[0] = 0; - dtypes[0] = 0; -+ totalTtxtSubtitlePages = 0; - SI::PMT::Stream stream; - for (SI::Loop::Iterator it; Pmt.streamLoop.getNext(stream, it); ) { - dbgpatpmt(" stream type = %02X, pid = %d", stream.getStreamType(), stream.getPid()); -diff --git a/remux.h b/remux.h -index 1115c4a..5ee6722 100644 ---- a/remux.h -+++ b/remux.h -@@ -170,6 +170,7 @@ protected: - int MakeStream(uchar *Target, uchar Type, int Pid); - int MakeAC3Descriptor(uchar *Target); - int MakeSubtitlingDescriptor(uchar *Target, const char *Language, uchar SubtitlingType, uint16_t CompositionPageId, uint16_t AncillaryPageId); -+ int MakeTeletextDescriptor(uchar *Target, const tTeletextSubtitlePage *pages, int pageCount); - int MakeLanguageDescriptor(uchar *Target, const char *Language); - int MakeCRC(uchar *Target, const uchar *Data, int Length); - void GeneratePmtPid(const cChannel *Channel); -@@ -227,6 +228,8 @@ private: - uint16_t compositionPageIds[MAXSPIDS]; - uint16_t ancillaryPageIds[MAXSPIDS]; - bool updatePrimaryDevice; -+ int totalTtxtSubtitlePages; -+ tTeletextSubtitlePage teletextSubtitlePages[MAXTXTPAGES]; - protected: - int SectionLength(const uchar *Data, int Length) { return (Length >= 3) ? ((int(Data[1]) & 0x0F) << 8)| Data[2] : 0; } - public: --- -1.6.6.1 - diff --git a/patches/patch-set.1.7.12/0002-Added-setup-option-to-enable-teletext-subtitle-recor.patch b/patches/patch-set.1.7.12/0002-Added-setup-option-to-enable-teletext-subtitle-recor.patch deleted file mode 100644 index f86edff..0000000 --- a/patches/patch-set.1.7.12/0002-Added-setup-option-to-enable-teletext-subtitle-recor.patch +++ /dev/null @@ -1,698 +0,0 @@ -From 9c5503214af1b7f22840708f3621ce8b8c640bdc Mon Sep 17 00:00:00 2001 -From: etobi -Date: Sat, 13 Feb 2010 14:42:30 +0100 -Subject: [PATCH 2/6] Added setup option to enable teletext subtitle recording - ---- - MANUAL | 3 +++ - config.c | 3 +++ - config.h | 1 + - menu.c | 1 + - po/ca_ES.po | 5 ++++- - po/cs_CZ.po | 5 ++++- - po/da_DK.po | 5 ++++- - po/de_DE.po | 7 +++++-- - po/el_GR.po | 5 ++++- - po/es_ES.po | 5 ++++- - po/et_EE.po | 5 ++++- - po/fi_FI.po | 5 ++++- - po/fr_FR.po | 5 ++++- - po/hr_HR.po | 5 ++++- - po/hu_HU.po | 5 ++++- - po/it_IT.po | 5 ++++- - po/lt_LT.po | 5 ++++- - po/nl_NL.po | 5 ++++- - po/nn_NO.po | 5 ++++- - po/pl_PL.po | 5 ++++- - po/pt_PT.po | 5 ++++- - po/ro_RO.po | 5 ++++- - po/ru_RU.po | 5 ++++- - po/sk_SK.po | 5 ++++- - po/sl_SI.po | 5 ++++- - po/sv_SE.po | 5 ++++- - po/tr_TR.po | 5 ++++- - po/uk_UA.po | 5 ++++- - po/zh_CN.po | 5 ++++- - receiver.c | 3 ++- - 30 files changed, 111 insertions(+), 27 deletions(-) - -diff --git a/MANUAL b/MANUAL -index 405f6a8..d1ce1f9 100644 ---- a/MANUAL -+++ b/MANUAL -@@ -721,6 +721,9 @@ Version 1.6 - background transparency. By default the values as broadcast - are used. - -+ Record Teletext Subtitles = no -+ If set to 'yes', teletext subtitles will be recorded. -+ - LNB: - - SLOF = 11700 The switching frequency (in MHz) between low and -diff --git a/config.c b/config.c -index acdf4c4..29377d9 100644 ---- a/config.c -+++ b/config.c -@@ -333,6 +333,7 @@ cSetup::cSetup(void) - MarginStop = 10; - AudioLanguages[0] = -1; - DisplaySubtitles = 0; -+ SupportTeletext = 0; - SubtitleLanguages[0] = -1; - SubtitleOffset = 0; - SubtitleFgTransparency = 0; -@@ -521,6 +522,7 @@ bool cSetup::Parse(const char *Name, const char *Value) - else if (!strcasecmp(Name, "MarginStop")) MarginStop = atoi(Value); - else if (!strcasecmp(Name, "AudioLanguages")) return ParseLanguages(Value, AudioLanguages); - else if (!strcasecmp(Name, "DisplaySubtitles")) DisplaySubtitles = atoi(Value); -+ else if (!strcasecmp(Name, "SupportTeletext")) SupportTeletext = atoi(Value); - else if (!strcasecmp(Name, "SubtitleLanguages")) return ParseLanguages(Value, SubtitleLanguages); - else if (!strcasecmp(Name, "SubtitleOffset")) SubtitleOffset = atoi(Value); - else if (!strcasecmp(Name, "SubtitleFgTransparency")) SubtitleFgTransparency = atoi(Value); -@@ -614,6 +616,7 @@ bool cSetup::Save(void) - Store("MarginStop", MarginStop); - StoreLanguages("AudioLanguages", AudioLanguages); - Store("DisplaySubtitles", DisplaySubtitles); -+ Store("SupportTeletext", SupportTeletext); - StoreLanguages("SubtitleLanguages", SubtitleLanguages); - Store("SubtitleOffset", SubtitleOffset); - Store("SubtitleFgTransparency", SubtitleFgTransparency); -diff --git a/config.h b/config.h -index be1d7bd..e7b094d 100644 ---- a/config.h -+++ b/config.h -@@ -235,6 +235,7 @@ public: - int MarginStart, MarginStop; - int AudioLanguages[I18N_MAX_LANGUAGES + 1]; - int DisplaySubtitles; -+ int SupportTeletext; - int SubtitleLanguages[I18N_MAX_LANGUAGES + 1]; - int SubtitleOffset; - int SubtitleFgTransparency, SubtitleBgTransparency; -diff --git a/menu.c b/menu.c -index 7ddf0cf..35fa9c3 100644 ---- a/menu.c -+++ b/menu.c -@@ -2790,6 +2790,7 @@ void cMenuSetupDVB::Setup(void) - Add(new cMenuEditIntItem( tr("Setup.DVB$Subtitle foreground transparency"), &data.SubtitleFgTransparency, 0, 9)); - Add(new cMenuEditIntItem( tr("Setup.DVB$Subtitle background transparency"), &data.SubtitleBgTransparency, 0, 10)); - } -+ Add(new cMenuEditBoolItem(tr("Setup.DVB$Enable teletext support"), &data.SupportTeletext)); - - SetCurrent(Get(current)); - Display(); -diff --git a/po/ca_ES.po b/po/ca_ES.po -index fcdf672..cc137c0 100644 ---- a/po/ca_ES.po -+++ b/po/ca_ES.po -@@ -10,7 +10,7 @@ msgid "" - msgstr "" - "Project-Id-Version: VDR 1.6.0\n" - "Report-Msgid-Bugs-To: \n" --"POT-Creation-Date: 2010-01-17 16:18+0100\n" -+"POT-Creation-Date: 2010-02-14 17:47+0100\n" - "PO-Revision-Date: 2008-03-02 19:02+0100\n" - "Last-Translator: Luca Olivetti \n" - "Language-Team: Catalanian\n" -@@ -934,6 +934,9 @@ msgstr "Transpar - msgid "Setup.DVB$Subtitle background transparency" - msgstr "Transparncia fons subttols" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "" -+ - msgid "LNB" - msgstr "Configuraci de l'LNB" - -diff --git a/po/cs_CZ.po b/po/cs_CZ.po -index 3bbd6eb..9802516 100644 ---- a/po/cs_CZ.po -+++ b/po/cs_CZ.po -@@ -8,7 +8,7 @@ msgid "" - msgstr "" - "Project-Id-Version: VDR 1.6.0\n" - "Report-Msgid-Bugs-To: \n" --"POT-Creation-Date: 2010-01-17 16:18+0100\n" -+"POT-Creation-Date: 2010-02-14 17:47+0100\n" - "PO-Revision-Date: 2008-02-28 15:00+0200\n" - "Last-Translator: Vladimr Brta , Ji Dobr \n" - "Language-Team: Czech\n" -@@ -932,6 +932,9 @@ msgstr "Pr - msgid "Setup.DVB$Subtitle background transparency" - msgstr "Prhlednost pozad titulk" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "" -+ - msgid "LNB" - msgstr "LNB" - -diff --git a/po/da_DK.po b/po/da_DK.po -index fbad909..740486d 100644 ---- a/po/da_DK.po -+++ b/po/da_DK.po -@@ -7,7 +7,7 @@ msgid "" - msgstr "" - "Project-Id-Version: VDR 1.6.0\n" - "Report-Msgid-Bugs-To: \n" --"POT-Creation-Date: 2010-01-17 16:18+0100\n" -+"POT-Creation-Date: 2010-02-14 17:47+0100\n" - "PO-Revision-Date: 2007-08-12 14:17+0200\n" - "Last-Translator: Mogens Elneff \n" - "Language-Team: Danish\n" -@@ -931,6 +931,9 @@ msgstr "Undertekst forgrundsgennemsigtighed" - msgid "Setup.DVB$Subtitle background transparency" - msgstr "Undertekst baggrundsgennemsigtighed" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "" -+ - msgid "LNB" - msgstr "LNB" - -diff --git a/po/de_DE.po b/po/de_DE.po -index ad6401b..8e93111 100644 ---- a/po/de_DE.po -+++ b/po/de_DE.po -@@ -7,8 +7,8 @@ msgid "" - msgstr "" - "Project-Id-Version: VDR 1.6.0\n" - "Report-Msgid-Bugs-To: \n" --"POT-Creation-Date: 2010-01-17 16:18+0100\n" --"PO-Revision-Date: 2010-01-16 16:46+0100\n" -+"POT-Creation-Date: 2010-02-14 17:47+0100\n" -+"PO-Revision-Date: 2010-02-14 17:50+0100\n" - "Last-Translator: Klaus Schmidinger \n" - "Language-Team: German\n" - "MIME-Version: 1.0\n" -@@ -931,6 +931,9 @@ msgstr "Untertitel-Transparenz Vordergrund" - msgid "Setup.DVB$Subtitle background transparency" - msgstr "Untertitel-Transparenz Hintergrund" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "Videotext-Untersttzung aktivieren" -+ - msgid "LNB" - msgstr "LNB" - -diff --git a/po/el_GR.po b/po/el_GR.po -index e8382b8..72d966a 100644 ---- a/po/el_GR.po -+++ b/po/el_GR.po -@@ -7,7 +7,7 @@ msgid "" - msgstr "" - "Project-Id-Version: VDR 1.6.0\n" - "Report-Msgid-Bugs-To: \n" --"POT-Creation-Date: 2010-01-17 16:18+0100\n" -+"POT-Creation-Date: 2010-02-14 17:47+0100\n" - "PO-Revision-Date: 2007-08-12 14:17+0200\n" - "Last-Translator: Dimitrios Dimitrakos \n" - "Language-Team: Greek\n" -@@ -931,6 +931,9 @@ msgstr "" - msgid "Setup.DVB$Subtitle background transparency" - msgstr "" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "" -+ - msgid "LNB" - msgstr "LNB" - -diff --git a/po/es_ES.po b/po/es_ES.po -index d2bf5b0..0eb591e 100644 ---- a/po/es_ES.po -+++ b/po/es_ES.po -@@ -8,7 +8,7 @@ msgid "" - msgstr "" - "Project-Id-Version: VDR 1.6.0\n" - "Report-Msgid-Bugs-To: \n" --"POT-Creation-Date: 2010-01-17 16:18+0100\n" -+"POT-Creation-Date: 2010-02-14 17:47+0100\n" - "PO-Revision-Date: 2008-03-02 19:02+0100\n" - "Last-Translator: Luca Olivetti \n" - "Language-Team: Spanish\n" -@@ -932,6 +932,9 @@ msgstr "Transparencia primer plano subt - msgid "Setup.DVB$Subtitle background transparency" - msgstr "Transparencia fondo subttulos" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "" -+ - msgid "LNB" - msgstr "LNB" - -diff --git a/po/et_EE.po b/po/et_EE.po -index 97e2aee..4190c63 100644 ---- a/po/et_EE.po -+++ b/po/et_EE.po -@@ -7,7 +7,7 @@ msgid "" - msgstr "" - "Project-Id-Version: VDR 1.6.0\n" - "Report-Msgid-Bugs-To: \n" --"POT-Creation-Date: 2010-01-17 16:18+0100\n" -+"POT-Creation-Date: 2010-02-14 17:47+0100\n" - "PO-Revision-Date: 2007-08-12 14:17+0200\n" - "Last-Translator: Arthur Konovalov \n" - "Language-Team: Estonian\n" -@@ -931,6 +931,9 @@ msgstr "Subtiitri l - msgid "Setup.DVB$Subtitle background transparency" - msgstr "Subtiitri tausta lbipaistvus" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "Teleteksti tugi" -+ - msgid "LNB" - msgstr "LNB" - -diff --git a/po/fi_FI.po b/po/fi_FI.po -index 916b51e..034de64 100644 ---- a/po/fi_FI.po -+++ b/po/fi_FI.po -@@ -10,7 +10,7 @@ msgid "" - msgstr "" - "Project-Id-Version: VDR 1.6.0\n" - "Report-Msgid-Bugs-To: \n" --"POT-Creation-Date: 2010-01-17 16:18+0100\n" -+"POT-Creation-Date: 2010-02-14 17:47+0100\n" - "PO-Revision-Date: 2007-08-15 15:52+0200\n" - "Last-Translator: Rolf Ahrenberg \n" - "Language-Team: Finnish\n" -@@ -934,6 +934,9 @@ msgstr "Tekstityksen l - msgid "Setup.DVB$Subtitle background transparency" - msgstr "Tekstityksen taustan lpinkyvyys" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "Salli teksti-TV-tuki" -+ - msgid "LNB" - msgstr "LNB" - -diff --git a/po/fr_FR.po b/po/fr_FR.po -index 4c4dcce..dc35127 100644 ---- a/po/fr_FR.po -+++ b/po/fr_FR.po -@@ -13,7 +13,7 @@ msgid "" - msgstr "" - "Project-Id-Version: VDR 1.6.0\n" - "Report-Msgid-Bugs-To: \n" --"POT-Creation-Date: 2010-01-17 16:18+0100\n" -+"POT-Creation-Date: 2010-02-14 17:47+0100\n" - "PO-Revision-Date: 2008-02-27 18:14+0100\n" - "Last-Translator: Jean-Claude Repetto \n" - "Language-Team: French\n" -@@ -937,6 +937,9 @@ msgstr "Transparence de l'avant-plan" - msgid "Setup.DVB$Subtitle background transparency" - msgstr "Transparence du fond" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "" -+ - msgid "LNB" - msgstr "LNB" - -diff --git a/po/hr_HR.po b/po/hr_HR.po -index b7cf5a0..b04cbb5 100644 ---- a/po/hr_HR.po -+++ b/po/hr_HR.po -@@ -9,7 +9,7 @@ msgid "" - msgstr "" - "Project-Id-Version: VDR 1.6.0\n" - "Report-Msgid-Bugs-To: \n" --"POT-Creation-Date: 2010-01-17 16:18+0100\n" -+"POT-Creation-Date: 2010-02-14 17:47+0100\n" - "PO-Revision-Date: 2008-03-17 19:00+0100\n" - "Last-Translator: Adrian Caval \n" - "Language-Team: Croatian\n" -@@ -933,6 +933,9 @@ msgstr "Transparentnost titla" - msgid "Setup.DVB$Subtitle background transparency" - msgstr "Transparentnost pozadine titla" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "" -+ - msgid "LNB" - msgstr "LNB" - -diff --git a/po/hu_HU.po b/po/hu_HU.po -index d09c8dd..570efbb 100644 ---- a/po/hu_HU.po -+++ b/po/hu_HU.po -@@ -10,7 +10,7 @@ msgid "" - msgstr "" - "Project-Id-Version: VDR 1.6.0\n" - "Report-Msgid-Bugs-To: \n" --"POT-Creation-Date: 2010-01-17 16:18+0100\n" -+"POT-Creation-Date: 2010-02-14 17:47+0100\n" - "PO-Revision-Date: 2007-12-01 21:42+0200\n" - "Last-Translator: Istvn Fley \n" - "Language-Team: Hungarian\n" -@@ -934,6 +934,9 @@ msgstr "Felirat transzparenci - msgid "Setup.DVB$Subtitle background transparency" - msgstr "Felirat htternek transzparencija" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "" -+ - msgid "LNB" - msgstr "LNB" - -diff --git a/po/it_IT.po b/po/it_IT.po -index 3a8f2e2..48d9f14 100644 ---- a/po/it_IT.po -+++ b/po/it_IT.po -@@ -11,7 +11,7 @@ msgid "" - msgstr "" - "Project-Id-Version: VDR 1.6.0\n" - "Report-Msgid-Bugs-To: \n" --"POT-Creation-Date: 2010-01-17 16:18+0100\n" -+"POT-Creation-Date: 2010-02-14 17:47+0100\n" - "PO-Revision-Date: 2010-01-12 23:53+0100\n" - "Last-Translator: Diego Pierotto \n" - "Language-Team: Italian\n" -@@ -938,6 +938,9 @@ msgstr "Trasparenza sottotitoli" - msgid "Setup.DVB$Subtitle background transparency" - msgstr "Trasparenza sfondo sottotitoli" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "" -+ - msgid "LNB" - msgstr "LNB" - -diff --git a/po/lt_LT.po b/po/lt_LT.po -index 93583c5..a9370f5 100644 ---- a/po/lt_LT.po -+++ b/po/lt_LT.po -@@ -7,7 +7,7 @@ msgid "" - msgstr "" - "Project-Id-Version: VDR 1.7.9\n" - "Report-Msgid-Bugs-To: \n" --"POT-Creation-Date: 2010-01-17 16:18+0100\n" -+"POT-Creation-Date: 2010-02-14 17:47+0100\n" - "PO-Revision-Date: 2009-10-17 14:19+0200\n" - "Last-Translator: Valdemaras Pipiras \n" - "Language-Team: Lithuanian\n" -@@ -931,6 +931,9 @@ msgstr "Subtitrų priekinio vaizdo permatomumas" - msgid "Setup.DVB$Subtitle background transparency" - msgstr "Subtitrų fono permatomumas" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "" -+ - msgid "LNB" - msgstr "Konverteris (LNB)" - -diff --git a/po/nl_NL.po b/po/nl_NL.po -index fdfaf8d..68de220 100644 ---- a/po/nl_NL.po -+++ b/po/nl_NL.po -@@ -11,7 +11,7 @@ msgid "" - msgstr "" - "Project-Id-Version: VDR 1.6.0\n" - "Report-Msgid-Bugs-To: \n" --"POT-Creation-Date: 2010-01-17 16:18+0100\n" -+"POT-Creation-Date: 2010-02-14 17:47+0100\n" - "PO-Revision-Date: 2008-02-26 17:20+0100\n" - "Last-Translator: Johan Schuring \n" - "Language-Team: Dutch\n" -@@ -935,6 +935,9 @@ msgstr "Transparantie voorgrond ondertiteling" - msgid "Setup.DVB$Subtitle background transparency" - msgstr "Transparantie achtergrond ondertiteling" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "" -+ - msgid "LNB" - msgstr "LNB" - -diff --git a/po/nn_NO.po b/po/nn_NO.po -index 1f50117..2e08b7e 100644 ---- a/po/nn_NO.po -+++ b/po/nn_NO.po -@@ -8,7 +8,7 @@ msgid "" - msgstr "" - "Project-Id-Version: VDR 1.6.0\n" - "Report-Msgid-Bugs-To: \n" --"POT-Creation-Date: 2010-01-17 16:18+0100\n" -+"POT-Creation-Date: 2010-02-14 17:47+0100\n" - "PO-Revision-Date: 2007-08-12 14:17+0200\n" - "Last-Translator: Truls Slevigen \n" - "Language-Team: Norwegian\n" -@@ -932,6 +932,9 @@ msgstr "" - msgid "Setup.DVB$Subtitle background transparency" - msgstr "" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "" -+ - msgid "LNB" - msgstr "LNB" - -diff --git a/po/pl_PL.po b/po/pl_PL.po -index 038d058..70335d2 100644 ---- a/po/pl_PL.po -+++ b/po/pl_PL.po -@@ -8,7 +8,7 @@ msgid "" - msgstr "" - "Project-Id-Version: VDR 1.6.0\n" - "Report-Msgid-Bugs-To: \n" --"POT-Creation-Date: 2010-01-17 16:18+0100\n" -+"POT-Creation-Date: 2010-02-14 17:47+0100\n" - "PO-Revision-Date: 2008-03-09 12:59+0100\n" - "Last-Translator: Michael Rakowski \n" - "Language-Team: Polish\n" -@@ -932,6 +932,9 @@ msgstr "Prze - msgid "Setup.DVB$Subtitle background transparency" - msgstr "Przerocze podtytuw: To" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "" -+ - msgid "LNB" - msgstr "LNB" - -diff --git a/po/pt_PT.po b/po/pt_PT.po -index e409581..c9ea089 100644 ---- a/po/pt_PT.po -+++ b/po/pt_PT.po -@@ -7,7 +7,7 @@ msgid "" - msgstr "" - "Project-Id-Version: VDR 1.6.0\n" - "Report-Msgid-Bugs-To: \n" --"POT-Creation-Date: 2010-01-17 16:18+0100\n" -+"POT-Creation-Date: 2010-02-14 17:47+0100\n" - "PO-Revision-Date: 2008-03-18 17:04+0100\n" - "Last-Translator: anonymous\n" - "Language-Team: Portuguese\n" -@@ -931,6 +931,9 @@ msgstr "Transpar - msgid "Setup.DVB$Subtitle background transparency" - msgstr "Transparncia de background das legendas" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "" -+ - msgid "LNB" - msgstr "LNB" - -diff --git a/po/ro_RO.po b/po/ro_RO.po -index f52a7d8..a4714f6 100644 ---- a/po/ro_RO.po -+++ b/po/ro_RO.po -@@ -8,7 +8,7 @@ msgid "" - msgstr "" - "Project-Id-Version: VDR 1.6.0\n" - "Report-Msgid-Bugs-To: \n" --"POT-Creation-Date: 2010-01-17 16:18+0100\n" -+"POT-Creation-Date: 2010-02-14 17:47+0100\n" - "PO-Revision-Date: 2008-02-25 00:39+0100\n" - "Last-Translator: Lucian Muresan \n" - "Language-Team: Romanian\n" -@@ -934,6 +934,9 @@ msgstr "Transparen - msgid "Setup.DVB$Subtitle background transparency" - msgstr "Transparena fundalului subtitrrii" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "" -+ - msgid "LNB" - msgstr "LNB" - -diff --git a/po/ru_RU.po b/po/ru_RU.po -index c6d6aca..8c7907e 100644 ---- a/po/ru_RU.po -+++ b/po/ru_RU.po -@@ -8,7 +8,7 @@ msgid "" - msgstr "" - "Project-Id-Version: VDR 1.6.0\n" - "Report-Msgid-Bugs-To: \n" --"POT-Creation-Date: 2010-01-17 16:18+0100\n" -+"POT-Creation-Date: 2010-02-14 17:47+0100\n" - "PO-Revision-Date: 2008-12-15 14:37+0100\n" - "Last-Translator: Oleg Roitburd \n" - "Language-Team: Russian\n" -@@ -932,6 +932,9 @@ msgstr " - msgid "Setup.DVB$Subtitle background transparency" - msgstr " " - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "" -+ - msgid "LNB" - msgstr "" - -diff --git a/po/sk_SK.po b/po/sk_SK.po -index c66132a..8414523 100644 ---- a/po/sk_SK.po -+++ b/po/sk_SK.po -@@ -8,7 +8,7 @@ msgid "" - msgstr "" - "Project-Id-Version: VDR 1.6.0\n" - "Report-Msgid-Bugs-To: \n" --"POT-Creation-Date: 2010-01-17 16:18+0100\n" -+"POT-Creation-Date: 2010-02-14 17:47+0100\n" - "PO-Revision-Date: 2009-09-30 12:50+0100\n" - "Last-Translator: Milan Hrala \n" - "Language-Team: Slovak\n" -@@ -932,6 +932,9 @@ msgstr "Prieh - msgid "Setup.DVB$Subtitle background transparency" - msgstr "Priehadnos pozadia titulkov" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "" -+ - msgid "LNB" - msgstr "LNB" - -diff --git a/po/sl_SI.po b/po/sl_SI.po -index 2c20440..1682a16 100644 ---- a/po/sl_SI.po -+++ b/po/sl_SI.po -@@ -8,7 +8,7 @@ msgid "" - msgstr "" - "Project-Id-Version: VDR 1.6.0\n" - "Report-Msgid-Bugs-To: \n" --"POT-Creation-Date: 2010-01-17 16:18+0100\n" -+"POT-Creation-Date: 2010-02-14 17:47+0100\n" - "PO-Revision-Date: 2008-02-28 19:44+0100\n" - "Last-Translator: Matjaz Thaler \n" - "Language-Team: Slovenian\n" -@@ -932,6 +932,9 @@ msgstr "Transparentnost podnapisov" - msgid "Setup.DVB$Subtitle background transparency" - msgstr "Transparentnost ozadja podnapisov" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "" -+ - msgid "LNB" - msgstr "LNB" - -diff --git a/po/sv_SE.po b/po/sv_SE.po -index 4ac9a0f..1f55853 100644 ---- a/po/sv_SE.po -+++ b/po/sv_SE.po -@@ -10,7 +10,7 @@ msgid "" - msgstr "" - "Project-Id-Version: VDR 1.6.0\n" - "Report-Msgid-Bugs-To: \n" --"POT-Creation-Date: 2010-01-17 16:18+0100\n" -+"POT-Creation-Date: 2010-02-14 17:47+0100\n" - "PO-Revision-Date: 2008-03-12 18:25+0100\n" - "Last-Translator: Magnus Andersson \n" - "Language-Team: Swedish\n" -@@ -934,6 +934,9 @@ msgstr "Transparent f - msgid "Setup.DVB$Subtitle background transparency" - msgstr "Transparent bakgrund textremsa" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "" -+ - msgid "LNB" - msgstr "LNB" - -diff --git a/po/tr_TR.po b/po/tr_TR.po -index 02a9642..abce6da 100644 ---- a/po/tr_TR.po -+++ b/po/tr_TR.po -@@ -7,7 +7,7 @@ msgid "" - msgstr "" - "Project-Id-Version: VDR 1.6.0\n" - "Report-Msgid-Bugs-To: \n" --"POT-Creation-Date: 2010-01-17 16:18+0100\n" -+"POT-Creation-Date: 2010-02-14 17:47+0100\n" - "PO-Revision-Date: 2008-02-28 00:33+0100\n" - "Last-Translator: Oktay Yolgeen \n" - "Language-Team: Turkish\n" -@@ -931,6 +931,9 @@ msgstr "Altyaz - msgid "Setup.DVB$Subtitle background transparency" - msgstr "Altyaz arka effaflk" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "" -+ - msgid "LNB" - msgstr "LNB" - -diff --git a/po/uk_UA.po b/po/uk_UA.po -index 7e3010c..d52f3ea 100644 ---- a/po/uk_UA.po -+++ b/po/uk_UA.po -@@ -7,7 +7,7 @@ msgid "" - msgstr "" - "Project-Id-Version: VDR 1.7.7\n" - "Report-Msgid-Bugs-To: \n" --"POT-Creation-Date: 2010-01-17 16:18+0100\n" -+"POT-Creation-Date: 2010-02-14 17:47+0100\n" - "PO-Revision-Date: 2009-05-31 13:17+0200\n" - "Last-Translator: Yarema aka Knedlyk \n" - "Language-Team: Ukrainian\n" -@@ -931,6 +931,9 @@ msgstr "Прозорість переднього плану субтитрів" - msgid "Setup.DVB$Subtitle background transparency" - msgstr "Прозорість заднього плану субтитрів" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "" -+ - msgid "LNB" - msgstr "Конвертер" - -diff --git a/po/zh_CN.po b/po/zh_CN.po -index 1d12f71..482b487 100644 ---- a/po/zh_CN.po -+++ b/po/zh_CN.po -@@ -7,7 +7,7 @@ msgid "" - msgstr "" - "Project-Id-Version: VDR 1.6.0\n" - "Report-Msgid-Bugs-To: \n" --"POT-Creation-Date: 2010-01-17 16:18+0100\n" -+"POT-Creation-Date: 2010-02-14 17:47+0100\n" - "PO-Revision-Date: 2009-09-23 23:50+0800\n" - "Last-Translator: Nan Feng \n" - "Language-Team: Chinese\n" -@@ -934,6 +934,9 @@ msgstr "字幕前景透明度" - msgid "Setup.DVB$Subtitle background transparency" - msgstr "字幕背景透明度" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "" -+ - msgid "LNB" - msgstr "切换器设置" - -diff --git a/receiver.c b/receiver.c -index dab95b3..8bfb36e 100644 ---- a/receiver.c -+++ b/receiver.c -@@ -82,7 +82,8 @@ bool cReceiver::SetPids(const cChannel *Channel) - (Channel->Ppid() == Channel->Vpid() || AddPid(Channel->Ppid())) && - AddPids(Channel->Apids()) && - (!Setup.UseDolbyDigital || AddPids(Channel->Dpids())) && -- AddPids(Channel->Spids()) && AddPid(Channel->Tpid()); -+ AddPids(Channel->Spids()) && -+ (!Setup.SupportTeletext || AddPid(Channel->Tpid())); - } - return true; - } --- -1.6.6.1 - diff --git a/patches/patch-set.1.7.12/0003-Allow-manual-configuration-of-teletetxt-subtitle-pag.patch b/patches/patch-set.1.7.12/0003-Allow-manual-configuration-of-teletetxt-subtitle-pag.patch deleted file mode 100644 index f96c97f..0000000 --- a/patches/patch-set.1.7.12/0003-Allow-manual-configuration-of-teletetxt-subtitle-pag.patch +++ /dev/null @@ -1,139 +0,0 @@ -From d9df9449ab20a37789d6c771a118e551941433f4 Mon Sep 17 00:00:00 2001 -From: etobi -Date: Fri, 12 Feb 2010 21:56:41 +0100 -Subject: [PATCH 3/6] Allow manual configuration of teletetxt subtitle pages in channels.conf - ---- - channels.c | 51 +++++++++++++++++++++++++++++++++++++++++++++++---- - channels.h | 1 + - vdr.5 | 7 +++++++ - 3 files changed, 55 insertions(+), 4 deletions(-) - -diff --git a/channels.c b/channels.c -index 863eab0..197588c 100644 ---- a/channels.c -+++ b/channels.c -@@ -556,7 +556,7 @@ void cChannel::SetTeletextSubtitlePages(tTeletextSubtitlePage pages[], int numbe - int mod = CHANNELMOD_NONE; - if (totalTtxtSubtitlePages != numberOfPages) - mod |= CHANNELMOD_PIDS; -- totalTtxtSubtitlePages = 0; -+ totalTtxtSubtitlePages = fixedTtxtSubtitlePages; - for (int i = 0; (i < numberOfPages) && (totalTtxtSubtitlePages < MAXTXTPAGES); i++) { - if (teletextSubtitlePages[totalTtxtSubtitlePages].ttxtMagazine != pages[i].ttxtMagazine || - teletextSubtitlePages[totalTtxtSubtitlePages].ttxtPage != pages[i].ttxtPage || -@@ -778,11 +778,22 @@ cString cChannel::ToText(const cChannel *Channel) - q += IntArrayToString(q, Channel->dpids, 10, Channel->dlangs); - } - *q = 0; -+ const int TBufferSize = 5 + 1 + (MAXTXTPAGES * (3 + 1 + MAXLANGCODE1 + 1)) + 10; // '12345;150=deu,151=fin,...', +10: paranoia -+ char tpidbuf[TBufferSize]; -+ q = tpidbuf; -+ q += snprintf(q, sizeof(tpidbuf), "%d", Channel->tpid); -+ if (Channel->fixedTtxtSubtitlePages > 0) { -+ q += snprintf(q, sizeof(tpidbuf) - (q - tpidbuf), ";"); -+ for (int i = 0; i < Channel->fixedTtxtSubtitlePages; ++i) { -+ tTeletextSubtitlePage page = Channel->teletextSubtitlePages[i]; -+ q += snprintf(q, sizeof(tpidbuf) - (q - tpidbuf), "%d=%s", page.PageNumber(), page.ttxtLanguage); -+ } -+ } - char caidbuf[MAXCAIDS * 5 + 10]; // 5: 4 digits plus delimiting ',', 10: paranoia - q = caidbuf; - q += IntArrayToString(q, Channel->caids, 16); - *q = 0; -- buffer = cString::sprintf("%s:%d:%s:%s:%d:%s:%s:%d:%s:%d:%d:%d:%d\n", FullName, Channel->frequency, *Channel->ParametersToString(), *cSource::ToString(Channel->source), Channel->srate, vpidbuf, apidbuf, Channel->tpid, caidbuf, Channel->sid, Channel->nid, Channel->tid, Channel->rid); -+ buffer = cString::sprintf("%s:%d:%s:%s:%d:%s:%s:%s:%s:%d:%d:%d:%d\n", FullName, Channel->frequency, *Channel->ParametersToString(), *cSource::ToString(Channel->source), Channel->srate, vpidbuf, apidbuf, tpidbuf, caidbuf, Channel->sid, Channel->nid, Channel->tid, Channel->rid); - } - return buffer; - } -@@ -816,8 +827,9 @@ bool cChannel::Parse(const char *s) - char *parambuf = NULL; - char *vpidbuf = NULL; - char *apidbuf = NULL; -+ char *tpidbuf = NULL; - char *caidbuf = NULL; -- int fields = sscanf(s, "%a[^:]:%d :%a[^:]:%a[^:] :%d :%a[^:]:%a[^:]:%d :%a[^:]:%d :%d :%d :%d ", &namebuf, &frequency, ¶mbuf, &sourcebuf, &srate, &vpidbuf, &apidbuf, &tpid, &caidbuf, &sid, &nid, &tid, &rid); -+ int fields = sscanf(s, "%a[^:]:%d :%a[^:]:%a[^:] :%d :%a[^:]:%a[^:]:%a[^:]:%a[^:]:%d :%d :%d :%d ", &namebuf, &frequency, ¶mbuf, &sourcebuf, &srate, &vpidbuf, &apidbuf, &tpidbuf, &caidbuf, &sid, &nid, &tid, &rid); - if (fields >= 9) { - if (fields == 9) { - // allow reading of old format -@@ -899,7 +911,37 @@ bool cChannel::Parse(const char *s) - } - dpids[NumDpids] = 0; - } -- -+ if (tpidbuf) { -+ char *p; -+ fixedTtxtSubtitlePages = 0; -+ // 2001;150=deu,151=fin -+ if ((p = strchr(tpidbuf, ';')) != NULL) { -+ char *q, *strtok_next; -+ *p++ = 0; -+ while ((q = strtok_r(p, ",", &strtok_next)) != NULL) { -+ if (fixedTtxtSubtitlePages < MAXTXTPAGES) { -+ int page; -+ char *l = strchr(q, '='); -+ if (l) -+ *l++ = 0; -+ if (sscanf(q, "%d", &page) == 1) { -+ teletextSubtitlePages[fixedTtxtSubtitlePages] = tTeletextSubtitlePage(page); -+ if (l) -+ strn0cpy(teletextSubtitlePages[fixedTtxtSubtitlePages].ttxtLanguage, l, MAXLANGCODE1); -+ fixedTtxtSubtitlePages++; -+ } -+ else -+ esyslog("ERROR: invalid Teletext page!"); // no need to set ok to 'false' -+ } -+ else -+ esyslog("ERROR: too many Teletext pages!"); // no need to set ok to 'false' -+ p = NULL; -+ } -+ totalTtxtSubtitlePages = fixedTtxtSubtitlePages; -+ } -+ if (sscanf(tpidbuf, "%d", &tpid) != 1) -+ return false; -+ } - if (caidbuf) { - char *p = caidbuf; - char *q; -@@ -936,6 +978,7 @@ bool cChannel::Parse(const char *s) - free(sourcebuf); - free(vpidbuf); - free(apidbuf); -+ free(tpidbuf); - free(caidbuf); - free(namebuf); - if (!GetChannelID().Valid()) { -diff --git a/channels.h b/channels.h -index 60973b7..897c8cd 100644 ---- a/channels.h -+++ b/channels.h -@@ -144,6 +144,7 @@ private: - uint16_t compositionPageIds[MAXSPIDS]; - uint16_t ancillaryPageIds[MAXSPIDS]; - int tpid; -+ int fixedTtxtSubtitlePages; - int totalTtxtSubtitlePages; - tTeletextSubtitlePage teletextSubtitlePages[MAXTXTPAGES]; - int caids[MAXCAIDS + 1]; // list is zero-terminated -diff --git a/vdr.5 b/vdr.5 -index 4b2cb90..c7da844 100644 ---- a/vdr.5 -+++ b/vdr.5 -@@ -207,6 +207,13 @@ can be indicated by adding a second language code, delimited by a '+' sign, as i - .TP - .B TPID - The teletext PID. -+ -+Fixed teletext subtitling pages can be defined separated by a semicolon. -+The pages (separated by commas) can contain ISO 639 language codes, delimited -+by a '=' sign, as in -+ -+.B ...:2001;150=deu,151=fin:... -+ - .TP - .B Conditional access - A hexadecimal integer defining how this channel can be accessed: --- -1.6.6.1 - diff --git a/patches/patch-set.1.7.12/0004-Decrypt-teletext-stream.patch b/patches/patch-set.1.7.12/0004-Decrypt-teletext-stream.patch deleted file mode 100644 index 9a400cb..0000000 --- a/patches/patch-set.1.7.12/0004-Decrypt-teletext-stream.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 4aa97b006d4bc74728e01525cf4e3758ae7f06d5 Mon Sep 17 00:00:00 2001 -From: etobi -Date: Sun, 14 Feb 2010 01:30:34 +0100 -Subject: [PATCH 4/6] Decrypt teletext stream - ---- - ci.c | 5 +++++ - 1 files changed, 5 insertions(+), 0 deletions(-) - -diff --git a/ci.c b/ci.c -index 6c7b031..22fda9f 100644 ---- a/ci.c -+++ b/ci.c -@@ -1911,6 +1911,8 @@ void cCamSlot::AddChannel(const cChannel *Channel) - AddPid(Channel->Sid(), *Apid, STREAM_TYPE_AUDIO); - for (const int *Dpid = Channel->Dpids(); *Dpid; Dpid++) - AddPid(Channel->Sid(), *Dpid, STREAM_TYPE_DOLBY); -+ if (Channel->Tpid() && Setup.SupportTeletext) -+ AddPid(Channel->Sid(), Channel->Tpid(), STREAM_TYPE_DOLBY); - } - } - -@@ -1932,6 +1934,9 @@ bool cCamSlot::CanDecrypt(const cChannel *Channel) - CaPmt.AddPid(*Apid, STREAM_TYPE_AUDIO); - for (const int *Dpid = Channel->Dpids(); *Dpid; Dpid++) - CaPmt.AddPid(*Dpid, STREAM_TYPE_DOLBY); -+ if (Channel->Tpid() && Setup.SupportTeletext) { -+ CaPmt.AddPid(Channel->Tpid(), STREAM_TYPE_DOLBY); // FIXME: STREAM_TYPE_DOLBY should probably be renamed STREAM_TYPE_PRIVATE -+ } - cas->SendPMT(&CaPmt); - cTimeMs Timeout(QUERY_REPLY_TIMEOUT); - do { --- -1.6.6.1 - diff --git a/patches/patch-set.1.7.12/0005-Capture-teletext-subtitle-pages-from-PMT.patch b/patches/patch-set.1.7.12/0005-Capture-teletext-subtitle-pages-from-PMT.patch deleted file mode 100644 index fb67873..0000000 --- a/patches/patch-set.1.7.12/0005-Capture-teletext-subtitle-pages-from-PMT.patch +++ /dev/null @@ -1,92 +0,0 @@ -From dcfcfc9320e84d652cb19c9eb3b29ea249873dc0 Mon Sep 17 00:00:00 2001 -From: etobi -Date: Fri, 12 Feb 2010 22:06:19 +0100 -Subject: [PATCH 5/6] Capture teletext subtitle pages from PMT - ---- - remux.c | 24 ++++++++++++++++++++++++ - remux.h | 5 +++++ - 2 files changed, 29 insertions(+), 0 deletions(-) - -diff --git a/remux.c b/remux.c -index b5c7a06..ead63ea 100644 ---- a/remux.c -+++ b/remux.c -@@ -431,6 +431,7 @@ void cPatPmtParser::Reset(void) - pmtPid = -1; - vpid = vtype = 0; - ppid = 0; -+ tpid = 0; - } - - void cPatPmtParser::ParsePat(const uchar *Data, int Length) -@@ -516,6 +517,7 @@ void cPatPmtParser::ParsePmt(const uchar *Data, int Length) - int NumSpids = 0; - vpid = vtype = 0; - ppid = 0; -+ tpid = 0; - apids[0] = 0; - dpids[0] = 0; - spids[0] = 0; -@@ -615,6 +617,28 @@ void cPatPmtParser::ParsePmt(const uchar *Data, int Length) - spids[NumSpids]= 0; - } - break; -+ case SI::TeletextDescriptorTag: { -+ dbgpatpmt(" teletext"); -+ tpid = stream.getPid(); -+ SI::TeletextDescriptor *sd = (SI::TeletextDescriptor *)d; -+ SI::TeletextDescriptor::Teletext ttxt; -+ if (totalTtxtSubtitlePages < MAXTXTPAGES) { -+ for (SI::Loop::Iterator it; sd->teletextLoop.getNext(ttxt, it); ) { -+ bool isSubtitlePage = (ttxt.getTeletextType() == 0x02) || (ttxt.getTeletextType() == 0x05); -+ if (isSubtitlePage && ttxt.languageCode[0]) { -+ dbgpatpmt(" '%s:%x.%x'", ttxt.languageCode, ttxt.getTeletextMagazineNumber(), ttxt.getTeletextPageNumber()); -+ strn0cpy(teletextSubtitlePages[totalTtxtSubtitlePages].ttxtLanguage, I18nNormalizeLanguageCode(ttxt.languageCode), MAXLANGCODE1); -+ teletextSubtitlePages[totalTtxtSubtitlePages].ttxtPage = ttxt.getTeletextPageNumber(); -+ teletextSubtitlePages[totalTtxtSubtitlePages].ttxtMagazine = ttxt.getTeletextMagazineNumber(); -+ teletextSubtitlePages[totalTtxtSubtitlePages].ttxtType = ttxt.getTeletextType(); -+ totalTtxtSubtitlePages++; -+ if (totalTtxtSubtitlePages >= MAXTXTPAGES) -+ break; -+ } -+ } -+ } -+ } -+ break; - case SI::ISO639LanguageDescriptorTag: { - SI::ISO639LanguageDescriptor *ld = (SI::ISO639LanguageDescriptor *)d; - dbgpatpmt(" '%s'", ld->languageCode); -diff --git a/remux.h b/remux.h -index 5ee6722..390236a 100644 ---- a/remux.h -+++ b/remux.h -@@ -216,6 +216,7 @@ private: - int vpid; - int ppid; - int vtype; -+ int tpid; - int apids[MAXAPIDS + 1]; // list is zero-terminated - int atypes[MAXAPIDS + 1]; // list is zero-terminated - char alangs[MAXAPIDS][MAXLANGCODE2]; -@@ -262,6 +263,9 @@ public: - int Vtype(void) const { return vtype; } - ///< Returns the video stream type as defined by the current PMT, or 0 if no video - ///< stream type has been detected, yet. -+ int Tpid(void) { return tpid; } -+ ///< Returns the teletext pid as defined by the current PMT, or 0 if no teletext -+ ///< pid has been detected, yet. - const int *Apids(void) const { return apids; } - const int *Dpids(void) const { return dpids; } - const int *Spids(void) const { return spids; } -@@ -276,6 +280,7 @@ public: - uchar SubtitlingType(int i) const { return (0 <= i && i < MAXSPIDS) ? subtitlingTypes[i] : uchar(0); } - uint16_t CompositionPageId(int i) const { return (0 <= i && i < MAXSPIDS) ? compositionPageIds[i] : uint16_t(0); } - uint16_t AncillaryPageId(int i) const { return (0 <= i && i < MAXSPIDS) ? ancillaryPageIds[i] : uint16_t(0); } -+ const tTeletextSubtitlePage* TeletextSubtitlePages() const { return teletextSubtitlePages; } - }; - - // TS to PES converter: --- -1.6.6.1 - diff --git a/patches/patch-set.1.7.12/0006-Ttxtsubs-plugin-hook.patch b/patches/patch-set.1.7.12/0006-Ttxtsubs-plugin-hook.patch deleted file mode 100644 index 4cb6aa7..0000000 --- a/patches/patch-set.1.7.12/0006-Ttxtsubs-plugin-hook.patch +++ /dev/null @@ -1,256 +0,0 @@ -From adbf4fa18bc775ade6a7ffefbbcbeeba66d35348 Mon Sep 17 00:00:00 2001 -From: etobi -Date: Sat, 13 Feb 2010 00:28:21 +0100 -Subject: [PATCH 6/6] Ttxtsubs plugin hook - ---- - Makefile | 2 + - device.c | 20 ++++++++++++++++ - device.h | 1 + - pat.c | 6 +++++ - remux.h | 3 +- - vdrttxtsubshooks.c | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++ - vdrttxtsubshooks.h | 46 ++++++++++++++++++++++++++++++++++++++ - 7 files changed, 140 insertions(+), 1 deletions(-) - create mode 100644 vdrttxtsubshooks.c - create mode 100644 vdrttxtsubshooks.h - -diff --git a/Makefile b/Makefile -index 01408cb..b280030 100644 ---- a/Makefile -+++ b/Makefile -@@ -43,6 +43,8 @@ OBJS = audio.o channels.o ci.o config.o cutter.o device.o diseqc.o dvbdevice.o d - skinclassic.o skins.o skinsttng.o sources.o spu.o status.o svdrp.o themes.o thread.o\ - timers.o tools.o transfer.o vdr.o videodir.o - -+OBJS += vdrttxtsubshooks.o -+ - ifndef NO_KBD - DEFINES += -DREMOTE_KBD - endif -diff --git a/device.c b/device.c -index cb31b83..fb4c655 100644 ---- a/device.c -+++ b/device.c -@@ -18,6 +18,7 @@ - #include "receiver.h" - #include "status.h" - #include "transfer.h" -+#include "vdrttxtsubshooks.h" - - // --- cLiveSubtitle --------------------------------------------------------- - -@@ -1190,6 +1191,13 @@ int cDevice::PlayPesPacket(const uchar *Data, int Length, bool VideoOnly) - } - break; - case 0xBD: { // private stream 1 -+ // EBU Teletext data, ETSI EN 300 472 -+ // if PES data header length = 24 and data_identifier = 0x10..0x1F (EBU Data) -+ if (Data[8] == 0x24 && Data[45] >= 0x10 && Data[45] < 0x20) { -+ cVDRTtxtsubsHookListener::Hook()->PlayerTeletextData((uint8_t*)Data, Length); -+ break; -+ } -+ - int PayloadOffset = Data[8] + 9; - - // Compatibility mode for old subtitles plugin: -@@ -1349,6 +1357,7 @@ int cDevice::PlayTs(const uchar *Data, int Length, bool VideoOnly) - tsToPesVideo.Reset(); - tsToPesAudio.Reset(); - tsToPesSubtitle.Reset(); -+ tsToPesTeletext.Reset(); - } - else if (Length < TS_SIZE) { - esyslog("ERROR: skipped %d bytes of TS fragment", Length); -@@ -1394,6 +1403,17 @@ int cDevice::PlayTs(const uchar *Data, int Length, bool VideoOnly) - if (!VideoOnly || HasIBPTrickSpeed()) - PlayTsSubtitle(Data, TS_SIZE); - } -+ else if (Pid == patPmtParser.Tpid()) { -+ if (!VideoOnly || HasIBPTrickSpeed()) { -+ int l; -+ tsToPesTeletext.PutTs(Data, Length); -+ if (const uchar *p = tsToPesTeletext.GetPes(l)) { -+ if ((l > 45) && (p[0] == 0x00) && (p[1] == 0x00) && (p[2] == 0x01) && (p[3] == 0xbd) && (p[8] == 0x24) && (p[45] >= 0x10) && (p[45] < 0x20)) -+ cVDRTtxtsubsHookListener::Hook()->PlayerTeletextData((uchar *)p, l, false, patPmtParser.TeletextSubtitlePages(), patPmtParser.TotalTeletextSubtitlePages()); -+ tsToPesTeletext.Reset(); -+ } -+ } -+ } - } - } - else if (Pid == patPmtParser.Ppid()) { -diff --git a/device.h b/device.h -index 897de2a..2e36351 100644 ---- a/device.h -+++ b/device.h -@@ -499,6 +499,7 @@ private: - cTsToPes tsToPesVideo; - cTsToPes tsToPesAudio; - cTsToPes tsToPesSubtitle; -+ cTsToPes tsToPesTeletext; - bool isPlayingVideo; - protected: - const cPatPmtParser *PatPmtParser(void) const { return &patPmtParser; } -diff --git a/pat.c b/pat.c -index ff25501..c6e7834 100644 ---- a/pat.c -+++ b/pat.c -@@ -13,6 +13,7 @@ - #include "libsi/section.h" - #include "libsi/descriptor.h" - #include "thread.h" -+#include "vdrttxtsubshooks.h" - - #define PMT_SCAN_TIMEOUT 10 // seconds - -@@ -473,6 +474,11 @@ void cPatFilter::Process(u_short Pid, u_char Tid, const u_char *Data, int Length - } - if (Setup.UpdateChannels >= 2) { - Channel->SetPids(Vpid, Ppid, Vtype, Apids, ALangs, Dpids, DLangs, Spids, SLangs, Tpid); -+ if (NumTPages < MAXTXTPAGES) { -+ int manualPageNumber = cVDRTtxtsubsHookListener::Hook()->ManualPageNumber(Channel); -+ if (manualPageNumber) -+ TeletextSubtitlePages[NumTPages++] = tTeletextSubtitlePage(manualPageNumber); -+ } - Channel->SetTeletextSubtitlePages(TeletextSubtitlePages, NumTPages); - Channel->SetCaIds(CaDescriptors->CaIds()); - Channel->SetSubtitlingDescriptors(SubtitlingTypes, CompositionPageIds, AncillaryPageIds); -diff --git a/remux.h b/remux.h -index 390236a..7bf712e 100644 ---- a/remux.h -+++ b/remux.h -@@ -280,7 +280,8 @@ public: - uchar SubtitlingType(int i) const { return (0 <= i && i < MAXSPIDS) ? subtitlingTypes[i] : uchar(0); } - uint16_t CompositionPageId(int i) const { return (0 <= i && i < MAXSPIDS) ? compositionPageIds[i] : uint16_t(0); } - uint16_t AncillaryPageId(int i) const { return (0 <= i && i < MAXSPIDS) ? ancillaryPageIds[i] : uint16_t(0); } -- const tTeletextSubtitlePage* TeletextSubtitlePages() const { return teletextSubtitlePages; } -+ const tTeletextSubtitlePage *TeletextSubtitlePages() const { return teletextSubtitlePages; } -+ int TotalTeletextSubtitlePages() const { return totalTtxtSubtitlePages; } - }; - - // TS to PES converter: -diff --git a/vdrttxtsubshooks.c b/vdrttxtsubshooks.c -new file mode 100644 -index 0000000..2471788 ---- /dev/null -+++ b/vdrttxtsubshooks.c -@@ -0,0 +1,63 @@ -+/* -+ * vdr-ttxtsubs - A plugin for the Linux Video Disk Recorder -+ * Copyright (c) 2003 - 2008 Ragnar Sundblad -+ * -+ * 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., -+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -+ * -+ */ -+ -+#include -+#include -+#include -+ -+#include "vdrttxtsubshooks.h" -+ -+// XXX Really should be a list... -+static cVDRTtxtsubsHookListener *gListener; -+ -+// ------ class cVDRTtxtsubsHookProxy ------ -+ -+class cVDRTtxtsubsHookProxy : public cVDRTtxtsubsHookListener -+{ -+ public: -+ virtual void HideOSD(void) { if(gListener) gListener->HideOSD(); }; -+ virtual void ShowOSD(void) { if(gListener) gListener->ShowOSD(); }; -+ virtual void PlayerTeletextData(uint8_t *p, int length, bool IsPesRecording, const struct tTeletextSubtitlePage teletextSubtitlePages[] = NULL, int pageCount = 0) -+ { if(gListener) gListener->PlayerTeletextData(p, length, IsPesRecording, teletextSubtitlePages, pageCount); }; -+ virtual int ManualPageNumber(const cChannel *channel) -+ { if(gListener) return gListener->ManualPageNumber(channel); else return 0; }; -+}; -+ -+ -+// ------ class cVDRTtxtsubsHookListener ------ -+ -+cVDRTtxtsubsHookListener::~cVDRTtxtsubsHookListener() -+{ -+ gListener = 0; -+} -+ -+void cVDRTtxtsubsHookListener::HookAttach(void) -+{ -+ gListener = this; -+ //printf("cVDRTtxtsubsHookListener::HookAttach\n"); -+} -+ -+static cVDRTtxtsubsHookProxy gProxy; -+ -+cVDRTtxtsubsHookListener *cVDRTtxtsubsHookListener::Hook(void) -+{ -+ return &gProxy; -+} -+ -diff --git a/vdrttxtsubshooks.h b/vdrttxtsubshooks.h -new file mode 100644 -index 0000000..2f97969 ---- /dev/null -+++ b/vdrttxtsubshooks.h -@@ -0,0 +1,46 @@ -+/* -+ * vdr-ttxtsubs - A plugin for the Linux Video Disk Recorder -+ * Copyright (c) 2003 - 2008 Ragnar Sundblad -+ * -+ * 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., -+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -+ * -+ */ -+ -+#ifndef __VDRTTXTSUBSHOOKS_H -+#define __VDRTTXTSUBSHOOKS_H -+ -+#define TTXTSUBSVERSNUM 2 -+ -+class cDevice; -+class cChannel; -+struct tTeletextSubtitlePage; -+ -+class cVDRTtxtsubsHookListener { -+ public: -+ cVDRTtxtsubsHookListener(void) {}; -+ virtual ~cVDRTtxtsubsHookListener(); -+ -+ void HookAttach(void); -+ -+ virtual void HideOSD(void) {}; -+ virtual void ShowOSD(void) {}; -+ virtual void PlayerTeletextData(uint8_t *p, int length, bool IsPesRecording = true, const struct tTeletextSubtitlePage teletextSubtitlePages[] = NULL, int pageCount = 0) {}; -+ virtual int ManualPageNumber(const cChannel *channel) { return 0; }; -+ -+ // used by VDR to call hook listeners -+ static cVDRTtxtsubsHookListener *Hook(void); -+}; -+ -+#endif --- -1.6.6.1 - diff --git a/patches/patch-set.1.7.13/0001-Record-teletext-subtitles.patch b/patches/patch-set.1.7.13/0001-Record-teletext-subtitles.patch deleted file mode 100644 index 9c64a20..0000000 --- a/patches/patch-set.1.7.13/0001-Record-teletext-subtitles.patch +++ /dev/null @@ -1,243 +0,0 @@ -From 1f1ab074fe9a467ffe87c4deac62ee7c418fbe6b Mon Sep 17 00:00:00 2001 -From: etobi -Date: Fri, 12 Feb 2010 21:55:04 +0100 -Subject: [PATCH 1/6] Record teletext subtitles - ---- - channels.c | 20 ++++++++++++++++++++ - channels.h | 16 ++++++++++++++++ - pat.c | 18 +++++++++++++++++- - receiver.c | 3 ++- - remux.c | 29 +++++++++++++++++++++++++++++ - remux.h | 3 +++ - 6 files changed, 87 insertions(+), 2 deletions(-) - -diff --git a/channels.c b/channels.c -index a694d54..f0b8a13 100644 ---- a/channels.c -+++ b/channels.c -@@ -365,6 +365,26 @@ void cChannel::SetSubtitlingDescriptors(uchar *SubtitlingTypes, uint16_t *Compos - } - } - -+void cChannel::SetTeletextSubtitlePages(tTeletextSubtitlePage pages[], int numberOfPages) -+{ -+ int mod = CHANNELMOD_NONE; -+ if (totalTtxtSubtitlePages != numberOfPages) -+ mod |= CHANNELMOD_PIDS; -+ totalTtxtSubtitlePages = 0; -+ for (int i = 0; (i < numberOfPages) && (totalTtxtSubtitlePages < MAXTXTPAGES); i++) { -+ if (teletextSubtitlePages[totalTtxtSubtitlePages].ttxtMagazine != pages[i].ttxtMagazine || -+ teletextSubtitlePages[totalTtxtSubtitlePages].ttxtPage != pages[i].ttxtPage || -+ teletextSubtitlePages[totalTtxtSubtitlePages].ttxtType != pages[i].ttxtType || -+ strcmp(teletextSubtitlePages[totalTtxtSubtitlePages].ttxtLanguage, pages[i].ttxtLanguage)) { -+ mod |= CHANNELMOD_PIDS; -+ teletextSubtitlePages[totalTtxtSubtitlePages] = pages[i]; -+ } -+ totalTtxtSubtitlePages++; -+ } -+ modification |= mod; -+ Channels.SetModified(); -+} -+ - void cChannel::SetCaIds(const int *CaIds) - { - if (caids[0] && caids[0] <= CA_USER_MAX) -diff --git a/channels.h b/channels.h -index 4ed1358..defb6bc 100644 ---- a/channels.h -+++ b/channels.h -@@ -35,6 +35,7 @@ - #define MAXDPIDS 16 // dolby (AC3 + DTS) - #define MAXSPIDS 32 // subtitles - #define MAXCAIDS 8 // conditional access -+#define MAXTXTPAGES 8 // teletext pages - - #define MAXLANGCODE1 4 // a 3 letter language code, zero terminated - #define MAXLANGCODE2 8 // up to two 3 letter language codes, separated by '+' and zero terminated -@@ -71,6 +72,16 @@ public: - static const tChannelID InvalidID; - }; - -+struct tTeletextSubtitlePage { -+ tTeletextSubtitlePage(void) { ttxtPage = ttxtMagazine = 0; ttxtType = 0x02; strcpy(ttxtLanguage, "und"); } -+ tTeletextSubtitlePage(int page) { ttxtMagazine = (page / 100) & 0x7; ttxtPage = (((page % 100) / 10) << 4) + (page % 10); ttxtType = 0x02; strcpy(ttxtLanguage, "und"); } -+ char ttxtLanguage[MAXLANGCODE1]; -+ uchar ttxtPage; -+ uchar ttxtMagazine; -+ uchar ttxtType; -+ int PageNumber(void) const { return BCDCHARTOINT(ttxtMagazine) * 100 + BCDCHARTOINT(ttxtPage); } -+ }; -+ - class cChannel; - - class cLinkChannel : public cListObject { -@@ -113,6 +124,8 @@ private: - uint16_t compositionPageIds[MAXSPIDS]; - uint16_t ancillaryPageIds[MAXSPIDS]; - int tpid; -+ int totalTtxtSubtitlePages; -+ tTeletextSubtitlePage teletextSubtitlePages[MAXTXTPAGES]; - int caids[MAXCAIDS + 1]; // list is zero-terminated - int nid; - int tid; -@@ -160,6 +173,8 @@ public: - uint16_t CompositionPageId(int i) const { return (0 <= i && i < MAXSPIDS) ? compositionPageIds[i] : uint16_t(0); } - uint16_t AncillaryPageId(int i) const { return (0 <= i && i < MAXSPIDS) ? ancillaryPageIds[i] : uint16_t(0); } - int Tpid(void) const { return tpid; } -+ const tTeletextSubtitlePage *TeletextSubtitlePages() const { return teletextSubtitlePages; } -+ int TotalTeletextSubtitlePages() const { return totalTtxtSubtitlePages; } - const int *Caids(void) const { return caids; } - int Ca(int Index = 0) const { return Index < MAXCAIDS ? caids[Index] : 0; } - int Nid(void) const { return nid; } -@@ -184,6 +199,7 @@ public: - void SetName(const char *Name, const char *ShortName, const char *Provider); - void SetPortalName(const char *PortalName); - void SetPids(int Vpid, int Ppid, int Vtype, int *Apids, char ALangs[][MAXLANGCODE2], int *Dpids, char DLangs[][MAXLANGCODE2], int *Spids, char SLangs[][MAXLANGCODE2], int Tpid); -+ void SetTeletextSubtitlePages(tTeletextSubtitlePage pages[], int numberOfPages); - void SetCaIds(const int *CaIds); // list must be zero-terminated - void SetCaDescriptors(int Level); - void SetLinkChannels(cLinkChannels *LinkChannels); -diff --git a/pat.c b/pat.c -index 9b3ded6..ff25501 100644 ---- a/pat.c -+++ b/pat.c -@@ -341,6 +341,8 @@ void cPatFilter::Process(u_short Pid, u_char Tid, const u_char *Data, int Length - char DLangs[MAXDPIDS][MAXLANGCODE2] = { "" }; - char SLangs[MAXSPIDS][MAXLANGCODE2] = { "" }; - int Tpid = 0; -+ tTeletextSubtitlePage TeletextSubtitlePages[MAXTXTPAGES]; -+ int NumTPages = 0; - int NumApids = 0; - int NumDpids = 0; - int NumSpids = 0; -@@ -426,8 +428,21 @@ void cPatFilter::Process(u_short Pid, u_char Tid, const u_char *Data, int Length - NumSpids++; - } - break; -- case SI::TeletextDescriptorTag: -+ case SI::TeletextDescriptorTag: { - Tpid = esPid; -+ SI::TeletextDescriptor *sd = (SI::TeletextDescriptor *)d; -+ SI::TeletextDescriptor::Teletext ttxt; -+ for (SI::Loop::Iterator it; sd->teletextLoop.getNext(ttxt, it); ) { -+ bool isSubtitlePage = (ttxt.getTeletextType() == 0x02) || (ttxt.getTeletextType() == 0x05); -+ if ((NumTPages < MAXTXTPAGES) && ttxt.languageCode[0] && isSubtitlePage) { -+ strn0cpy(TeletextSubtitlePages[NumTPages].ttxtLanguage, I18nNormalizeLanguageCode(ttxt.languageCode), MAXLANGCODE1); -+ TeletextSubtitlePages[NumTPages].ttxtPage = ttxt.getTeletextPageNumber(); -+ TeletextSubtitlePages[NumTPages].ttxtMagazine = ttxt.getTeletextMagazineNumber(); -+ TeletextSubtitlePages[NumTPages].ttxtType = ttxt.getTeletextType(); -+ NumTPages++; -+ } -+ } -+ } - break; - case SI::ISO639LanguageDescriptorTag: { - SI::ISO639LanguageDescriptor *ld = (SI::ISO639LanguageDescriptor *)d; -@@ -458,6 +473,7 @@ void cPatFilter::Process(u_short Pid, u_char Tid, const u_char *Data, int Length - } - if (Setup.UpdateChannels >= 2) { - Channel->SetPids(Vpid, Ppid, Vtype, Apids, ALangs, Dpids, DLangs, Spids, SLangs, Tpid); -+ Channel->SetTeletextSubtitlePages(TeletextSubtitlePages, NumTPages); - Channel->SetCaIds(CaDescriptors->CaIds()); - Channel->SetSubtitlingDescriptors(SubtitlingTypes, CompositionPageIds, AncillaryPageIds); - } -diff --git a/receiver.c b/receiver.c -index 58dda78..a2c6781 100644 ---- a/receiver.c -+++ b/receiver.c -@@ -82,7 +82,8 @@ bool cReceiver::SetPids(const cChannel *Channel) - (Channel->Ppid() == Channel->Vpid() || AddPid(Channel->Ppid())) && - AddPids(Channel->Apids()) && - AddPids(Channel->Dpids()) && -- AddPids(Channel->Spids()); -+ AddPids(Channel->Spids()) && -+ AddPid(Channel->Tpid()); - } - return true; - } -diff --git a/remux.c b/remux.c -index 2532c63..33b744a 100644 ---- a/remux.c -+++ b/remux.c -@@ -215,6 +215,29 @@ int cPatPmtGenerator::MakeSubtitlingDescriptor(uchar *Target, const char *Langua - return i; - } - -+int cPatPmtGenerator::MakeTeletextDescriptor(uchar *Target, const tTeletextSubtitlePage *pages, int pageCount) -+{ -+ int i = 0, j = 0; -+ Target[i++] = SI::TeletextDescriptorTag; -+ int l = i; -+ Target[i++] = 0x00; // length -+ for (int n = 0; n < pageCount; n++) { -+ const char* Language = pages[n].ttxtLanguage; -+ Target[i++] = *Language++; -+ Target[i++] = *Language++; -+ Target[i++] = *Language++; -+ Target[i++] = (pages[n].ttxtType << 3) + pages[n].ttxtMagazine; -+ Target[i++] = pages[n].ttxtPage; -+ j++; -+ } -+ if (j > 0) { -+ Target[l] = j * 5; // update length -+ IncEsInfoLength(i); -+ return i; -+ } -+ return 0; -+} -+ - int cPatPmtGenerator::MakeLanguageDescriptor(uchar *Target, const char *Language) - { - int i = 0; -@@ -296,6 +319,7 @@ void cPatPmtGenerator::GeneratePmt(const cChannel *Channel) - if (Channel) { - int Vpid = Channel->Vpid(); - int Ppid = Channel->Ppid(); -+ int Tpid = Channel->Tpid(); - uchar *p = buf; - int i = 0; - p[i++] = 0x02; // table id -@@ -330,6 +354,10 @@ void cPatPmtGenerator::GeneratePmt(const cChannel *Channel) - i += MakeStream(buf + i, 0x06, Channel->Spid(n)); - i += MakeSubtitlingDescriptor(buf + i, Channel->Slang(n), Channel->SubtitlingType(n), Channel->CompositionPageId(n), Channel->AncillaryPageId(n)); - } -+ if (Tpid) { -+ i += MakeStream(buf + i, 0x06, Tpid); -+ i += MakeTeletextDescriptor(buf + i, Channel->TeletextSubtitlePages(), Channel->TotalTeletextSubtitlePages()); -+ } - - int sl = i - SectionLength - 2 + 4; // -2 = SectionLength storage, +4 = length of CRC - buf[SectionLength] |= (sl >> 8) & 0x0F; -@@ -493,6 +521,7 @@ void cPatPmtParser::ParsePmt(const uchar *Data, int Length) - spids[0] = 0; - atypes[0] = 0; - dtypes[0] = 0; -+ totalTtxtSubtitlePages = 0; - SI::PMT::Stream stream; - for (SI::Loop::Iterator it; Pmt.streamLoop.getNext(stream, it); ) { - dbgpatpmt(" stream type = %02X, pid = %d", stream.getStreamType(), stream.getPid()); -diff --git a/remux.h b/remux.h -index 1115c4a..5ee6722 100644 ---- a/remux.h -+++ b/remux.h -@@ -170,6 +170,7 @@ protected: - int MakeStream(uchar *Target, uchar Type, int Pid); - int MakeAC3Descriptor(uchar *Target); - int MakeSubtitlingDescriptor(uchar *Target, const char *Language, uchar SubtitlingType, uint16_t CompositionPageId, uint16_t AncillaryPageId); -+ int MakeTeletextDescriptor(uchar *Target, const tTeletextSubtitlePage *pages, int pageCount); - int MakeLanguageDescriptor(uchar *Target, const char *Language); - int MakeCRC(uchar *Target, const uchar *Data, int Length); - void GeneratePmtPid(const cChannel *Channel); -@@ -227,6 +228,8 @@ private: - uint16_t compositionPageIds[MAXSPIDS]; - uint16_t ancillaryPageIds[MAXSPIDS]; - bool updatePrimaryDevice; -+ int totalTtxtSubtitlePages; -+ tTeletextSubtitlePage teletextSubtitlePages[MAXTXTPAGES]; - protected: - int SectionLength(const uchar *Data, int Length) { return (Length >= 3) ? ((int(Data[1]) & 0x0F) << 8)| Data[2] : 0; } - public: --- -1.6.6.1 - diff --git a/patches/patch-set.1.7.13/0002-Added-setup-option-to-enable-teletext-subtitle-recor.patch b/patches/patch-set.1.7.13/0002-Added-setup-option-to-enable-teletext-subtitle-recor.patch deleted file mode 100644 index 3b9ba65..0000000 --- a/patches/patch-set.1.7.13/0002-Added-setup-option-to-enable-teletext-subtitle-recor.patch +++ /dev/null @@ -1,470 +0,0 @@ -From e0f3ff726dae4e6a722f5469bec26b7732ee3573 Mon Sep 17 00:00:00 2001 -From: etobi -Date: Sat, 13 Feb 2010 14:42:30 +0100 -Subject: [PATCH 2/6] Added setup option to enable teletext subtitle recording - ---- - MANUAL | 3 +++ - config.c | 3 +++ - config.h | 1 + - menu.c | 1 + - po/ca_ES.po | 3 +++ - po/cs_CZ.po | 3 +++ - po/da_DK.po | 3 +++ - po/de_DE.po | 3 +++ - po/el_GR.po | 3 +++ - po/es_ES.po | 3 +++ - po/et_EE.po | 3 +++ - po/fi_FI.po | 3 +++ - po/fr_FR.po | 3 +++ - po/hr_HR.po | 3 +++ - po/hu_HU.po | 3 +++ - po/it_IT.po | 3 +++ - po/lt_LT.po | 3 +++ - po/nl_NL.po | 3 +++ - po/nn_NO.po | 3 +++ - po/pl_PL.po | 3 +++ - po/pt_PT.po | 3 +++ - po/ro_RO.po | 3 +++ - po/ru_RU.po | 3 +++ - po/sk_SK.po | 3 +++ - po/sl_SI.po | 3 +++ - po/sv_SE.po | 3 +++ - po/tr_TR.po | 3 +++ - po/uk_UA.po | 3 +++ - po/zh_CN.po | 3 +++ - receiver.c | 2 +- - 30 files changed, 84 insertions(+), 1 deletions(-) - -diff --git a/MANUAL b/MANUAL -index ff80f55..533a110 100644 ---- a/MANUAL -+++ b/MANUAL -@@ -721,6 +721,9 @@ Version 1.6 - background transparency. By default the values as broadcast - are used. - -+ Record Teletext Subtitles = no -+ If set to 'yes', teletext subtitles will be recorded. -+ - LNB: - - SLOF = 11700 The switching frequency (in MHz) between low and -diff --git a/config.c b/config.c -index acdf4c4..29377d9 100644 ---- a/config.c -+++ b/config.c -@@ -333,6 +333,7 @@ cSetup::cSetup(void) - MarginStop = 10; - AudioLanguages[0] = -1; - DisplaySubtitles = 0; -+ SupportTeletext = 0; - SubtitleLanguages[0] = -1; - SubtitleOffset = 0; - SubtitleFgTransparency = 0; -@@ -521,6 +522,7 @@ bool cSetup::Parse(const char *Name, const char *Value) - else if (!strcasecmp(Name, "MarginStop")) MarginStop = atoi(Value); - else if (!strcasecmp(Name, "AudioLanguages")) return ParseLanguages(Value, AudioLanguages); - else if (!strcasecmp(Name, "DisplaySubtitles")) DisplaySubtitles = atoi(Value); -+ else if (!strcasecmp(Name, "SupportTeletext")) SupportTeletext = atoi(Value); - else if (!strcasecmp(Name, "SubtitleLanguages")) return ParseLanguages(Value, SubtitleLanguages); - else if (!strcasecmp(Name, "SubtitleOffset")) SubtitleOffset = atoi(Value); - else if (!strcasecmp(Name, "SubtitleFgTransparency")) SubtitleFgTransparency = atoi(Value); -@@ -614,6 +616,7 @@ bool cSetup::Save(void) - Store("MarginStop", MarginStop); - StoreLanguages("AudioLanguages", AudioLanguages); - Store("DisplaySubtitles", DisplaySubtitles); -+ Store("SupportTeletext", SupportTeletext); - StoreLanguages("SubtitleLanguages", SubtitleLanguages); - Store("SubtitleOffset", SubtitleOffset); - Store("SubtitleFgTransparency", SubtitleFgTransparency); -diff --git a/config.h b/config.h -index e4237f7..5a66814 100644 ---- a/config.h -+++ b/config.h -@@ -235,6 +235,7 @@ public: - int MarginStart, MarginStop; - int AudioLanguages[I18N_MAX_LANGUAGES + 1]; - int DisplaySubtitles; -+ int SupportTeletext; - int SubtitleLanguages[I18N_MAX_LANGUAGES + 1]; - int SubtitleOffset; - int SubtitleFgTransparency, SubtitleBgTransparency; -diff --git a/menu.c b/menu.c -index 655eb4c..194b3de 100644 ---- a/menu.c -+++ b/menu.c -@@ -2780,6 +2780,7 @@ void cMenuSetupDVB::Setup(void) - Add(new cMenuEditIntItem( tr("Setup.DVB$Subtitle foreground transparency"), &data.SubtitleFgTransparency, 0, 9)); - Add(new cMenuEditIntItem( tr("Setup.DVB$Subtitle background transparency"), &data.SubtitleBgTransparency, 0, 10)); - } -+ Add(new cMenuEditBoolItem(tr("Setup.DVB$Enable teletext support"), &data.SupportTeletext)); - - SetCurrent(Get(current)); - Display(); -diff --git a/po/ca_ES.po b/po/ca_ES.po -index 40198f8..9ba7e30 100644 ---- a/po/ca_ES.po -+++ b/po/ca_ES.po -@@ -934,6 +934,9 @@ msgstr "Transpar - msgid "Setup.DVB$Subtitle background transparency" - msgstr "Transparncia fons subttols" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "" -+ - msgid "LNB" - msgstr "Configuraci de l'LNB" - -diff --git a/po/cs_CZ.po b/po/cs_CZ.po -index 63b5d1c..0c68400 100644 ---- a/po/cs_CZ.po -+++ b/po/cs_CZ.po -@@ -932,6 +932,9 @@ msgstr "Pr - msgid "Setup.DVB$Subtitle background transparency" - msgstr "Prhlednost pozad titulk" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "" -+ - msgid "LNB" - msgstr "LNB" - -diff --git a/po/da_DK.po b/po/da_DK.po -index 99af59b..fca4669 100644 ---- a/po/da_DK.po -+++ b/po/da_DK.po -@@ -931,6 +931,9 @@ msgstr "Undertekst forgrundsgennemsigtighed" - msgid "Setup.DVB$Subtitle background transparency" - msgstr "Undertekst baggrundsgennemsigtighed" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "" -+ - msgid "LNB" - msgstr "LNB" - -diff --git a/po/de_DE.po b/po/de_DE.po -index 6181eb3..b385571 100644 ---- a/po/de_DE.po -+++ b/po/de_DE.po -@@ -931,6 +931,9 @@ msgstr "Untertitel-Transparenz Vordergrund" - msgid "Setup.DVB$Subtitle background transparency" - msgstr "Untertitel-Transparenz Hintergrund" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "Videotext-Untersttzung aktivieren" -+ - msgid "LNB" - msgstr "LNB" - -diff --git a/po/el_GR.po b/po/el_GR.po -index 70f6e54..ffb73a0 100644 ---- a/po/el_GR.po -+++ b/po/el_GR.po -@@ -931,6 +931,9 @@ msgstr "" - msgid "Setup.DVB$Subtitle background transparency" - msgstr "" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "" -+ - msgid "LNB" - msgstr "LNB" - -diff --git a/po/es_ES.po b/po/es_ES.po -index f78c8cb..5ce2238 100644 ---- a/po/es_ES.po -+++ b/po/es_ES.po -@@ -932,6 +932,9 @@ msgstr "Transparencia primer plano subt - msgid "Setup.DVB$Subtitle background transparency" - msgstr "Transparencia fondo subttulos" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "" -+ - msgid "LNB" - msgstr "LNB" - -diff --git a/po/et_EE.po b/po/et_EE.po -index 047a2f7..09e4b17 100644 ---- a/po/et_EE.po -+++ b/po/et_EE.po -@@ -931,6 +931,9 @@ msgstr "Subtiitri l - msgid "Setup.DVB$Subtitle background transparency" - msgstr "Subtiitri tausta lbipaistvus" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "Teleteksti tugi" -+ - msgid "LNB" - msgstr "LNB" - -diff --git a/po/fi_FI.po b/po/fi_FI.po -index 49af156..17c7003 100644 ---- a/po/fi_FI.po -+++ b/po/fi_FI.po -@@ -934,6 +934,9 @@ msgstr "Tekstityksen l - msgid "Setup.DVB$Subtitle background transparency" - msgstr "Tekstityksen taustan lpinkyvyys" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "Salli teksti-TV-tuki" -+ - msgid "LNB" - msgstr "LNB" - -diff --git a/po/fr_FR.po b/po/fr_FR.po -index 7b23a5e..572902e 100644 ---- a/po/fr_FR.po -+++ b/po/fr_FR.po -@@ -937,6 +937,9 @@ msgstr "Transparence de l'avant-plan" - msgid "Setup.DVB$Subtitle background transparency" - msgstr "Transparence du fond" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "" -+ - msgid "LNB" - msgstr "LNB" - -diff --git a/po/hr_HR.po b/po/hr_HR.po -index 56b1bd8..edb6fee 100644 ---- a/po/hr_HR.po -+++ b/po/hr_HR.po -@@ -933,6 +933,9 @@ msgstr "Transparentnost titla" - msgid "Setup.DVB$Subtitle background transparency" - msgstr "Transparentnost pozadine titla" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "" -+ - msgid "LNB" - msgstr "LNB" - -diff --git a/po/hu_HU.po b/po/hu_HU.po -index 212d2fe..eefc7d7 100644 ---- a/po/hu_HU.po -+++ b/po/hu_HU.po -@@ -934,6 +934,9 @@ msgstr "Felirat transzparenci - msgid "Setup.DVB$Subtitle background transparency" - msgstr "Felirat htternek transzparencija" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "" -+ - msgid "LNB" - msgstr "LNB" - -diff --git a/po/it_IT.po b/po/it_IT.po -index ba7c57c..b2d5c3b 100644 ---- a/po/it_IT.po -+++ b/po/it_IT.po -@@ -938,6 +938,9 @@ msgstr "Trasparenza sottotitoli" - msgid "Setup.DVB$Subtitle background transparency" - msgstr "Trasparenza sfondo sottotitoli" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "" -+ - msgid "LNB" - msgstr "LNB" - -diff --git a/po/lt_LT.po b/po/lt_LT.po -index acf2309..4beb77c 100644 ---- a/po/lt_LT.po -+++ b/po/lt_LT.po -@@ -931,6 +931,9 @@ msgstr "Subtitrų priekinio vaizdo permatomumas" - msgid "Setup.DVB$Subtitle background transparency" - msgstr "Subtitrų fono permatomumas" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "" -+ - msgid "LNB" - msgstr "Konverteris (LNB)" - -diff --git a/po/nl_NL.po b/po/nl_NL.po -index 1e1d382..a25263e 100644 ---- a/po/nl_NL.po -+++ b/po/nl_NL.po -@@ -935,6 +935,9 @@ msgstr "Transparantie voorgrond ondertiteling" - msgid "Setup.DVB$Subtitle background transparency" - msgstr "Transparantie achtergrond ondertiteling" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "" -+ - msgid "LNB" - msgstr "LNB" - -diff --git a/po/nn_NO.po b/po/nn_NO.po -index 11668c7..92fb487 100644 ---- a/po/nn_NO.po -+++ b/po/nn_NO.po -@@ -932,6 +932,9 @@ msgstr "" - msgid "Setup.DVB$Subtitle background transparency" - msgstr "" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "" -+ - msgid "LNB" - msgstr "LNB" - -diff --git a/po/pl_PL.po b/po/pl_PL.po -index d1944cb..0e72f00 100644 ---- a/po/pl_PL.po -+++ b/po/pl_PL.po -@@ -932,6 +932,9 @@ msgstr "Prze - msgid "Setup.DVB$Subtitle background transparency" - msgstr "Przerocze podtytuw: To" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "" -+ - msgid "LNB" - msgstr "LNB" - -diff --git a/po/pt_PT.po b/po/pt_PT.po -index 99d8168..f2aa111 100644 ---- a/po/pt_PT.po -+++ b/po/pt_PT.po -@@ -931,6 +931,9 @@ msgstr "Transpar - msgid "Setup.DVB$Subtitle background transparency" - msgstr "Transparncia de background das legendas" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "" -+ - msgid "LNB" - msgstr "LNB" - -diff --git a/po/ro_RO.po b/po/ro_RO.po -index 31e6b17..380d4db 100644 ---- a/po/ro_RO.po -+++ b/po/ro_RO.po -@@ -934,6 +934,9 @@ msgstr "Transparen - msgid "Setup.DVB$Subtitle background transparency" - msgstr "Transparena fundalului subtitrrii" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "" -+ - msgid "LNB" - msgstr "LNB" - -diff --git a/po/ru_RU.po b/po/ru_RU.po -index 0796c19..418ccdb 100644 ---- a/po/ru_RU.po -+++ b/po/ru_RU.po -@@ -932,6 +932,9 @@ msgstr " - msgid "Setup.DVB$Subtitle background transparency" - msgstr " " - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "" -+ - msgid "LNB" - msgstr "" - -diff --git a/po/sk_SK.po b/po/sk_SK.po -index f53c251..55fdf40 100644 ---- a/po/sk_SK.po -+++ b/po/sk_SK.po -@@ -932,6 +932,9 @@ msgstr "Prieh - msgid "Setup.DVB$Subtitle background transparency" - msgstr "Priehadnos pozadia titulkov" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "" -+ - msgid "LNB" - msgstr "LNB" - -diff --git a/po/sl_SI.po b/po/sl_SI.po -index 88858e5..6135157 100644 ---- a/po/sl_SI.po -+++ b/po/sl_SI.po -@@ -932,6 +932,9 @@ msgstr "Transparentnost podnapisov" - msgid "Setup.DVB$Subtitle background transparency" - msgstr "Transparentnost ozadja podnapisov" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "" -+ - msgid "LNB" - msgstr "LNB" - -diff --git a/po/sv_SE.po b/po/sv_SE.po -index 1c5821b..870bc05 100644 ---- a/po/sv_SE.po -+++ b/po/sv_SE.po -@@ -934,6 +934,9 @@ msgstr "Transparent f - msgid "Setup.DVB$Subtitle background transparency" - msgstr "Transparent bakgrund textremsa" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "" -+ - msgid "LNB" - msgstr "LNB" - -diff --git a/po/tr_TR.po b/po/tr_TR.po -index 763a6b6..6bf7f41 100644 ---- a/po/tr_TR.po -+++ b/po/tr_TR.po -@@ -931,6 +931,9 @@ msgstr "Altyaz - msgid "Setup.DVB$Subtitle background transparency" - msgstr "Altyaz arka effaflk" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "" -+ - msgid "LNB" - msgstr "LNB" - -diff --git a/po/uk_UA.po b/po/uk_UA.po -index 2c080fe..da179a0 100644 ---- a/po/uk_UA.po -+++ b/po/uk_UA.po -@@ -931,6 +931,9 @@ msgstr "Прозорість переднього плану субтитрів" - msgid "Setup.DVB$Subtitle background transparency" - msgstr "Прозорість заднього плану субтитрів" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "" -+ - msgid "LNB" - msgstr "Конвертер" - -diff --git a/po/zh_CN.po b/po/zh_CN.po -index 30d1094..f886ae1 100644 ---- a/po/zh_CN.po -+++ b/po/zh_CN.po -@@ -934,6 +934,9 @@ msgstr "字幕前景透明度" - msgid "Setup.DVB$Subtitle background transparency" - msgstr "字幕背景透明度" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "" -+ - msgid "LNB" - msgstr "切换器设置" - -diff --git a/receiver.c b/receiver.c -index a2c6781..ed28f1b 100644 ---- a/receiver.c -+++ b/receiver.c -@@ -83,7 +83,7 @@ bool cReceiver::SetPids(const cChannel *Channel) - AddPids(Channel->Apids()) && - AddPids(Channel->Dpids()) && - AddPids(Channel->Spids()) && -- AddPid(Channel->Tpid()); -+ (!Setup.SupportTeletext || AddPid(Channel->Tpid())); - } - return true; - } --- -1.6.6.1 - diff --git a/patches/patch-set.1.7.13/0003-Allow-manual-configuration-of-teletetxt-subtitle-pag.patch b/patches/patch-set.1.7.13/0003-Allow-manual-configuration-of-teletetxt-subtitle-pag.patch deleted file mode 100644 index af32607..0000000 --- a/patches/patch-set.1.7.13/0003-Allow-manual-configuration-of-teletetxt-subtitle-pag.patch +++ /dev/null @@ -1,139 +0,0 @@ -From 6c5cd8cbcac2472de40d9fffc26c367c09263f46 Mon Sep 17 00:00:00 2001 -From: etobi -Date: Fri, 12 Feb 2010 21:56:41 +0100 -Subject: [PATCH 3/6] Allow manual configuration of teletetxt subtitle pages in channels.conf - ---- - channels.c | 51 +++++++++++++++++++++++++++++++++++++++++++++++---- - channels.h | 1 + - vdr.5 | 7 +++++++ - 3 files changed, 55 insertions(+), 4 deletions(-) - -diff --git a/channels.c b/channels.c -index f0b8a13..4ba88a5 100644 ---- a/channels.c -+++ b/channels.c -@@ -370,7 +370,7 @@ void cChannel::SetTeletextSubtitlePages(tTeletextSubtitlePage pages[], int numbe - int mod = CHANNELMOD_NONE; - if (totalTtxtSubtitlePages != numberOfPages) - mod |= CHANNELMOD_PIDS; -- totalTtxtSubtitlePages = 0; -+ totalTtxtSubtitlePages = fixedTtxtSubtitlePages; - for (int i = 0; (i < numberOfPages) && (totalTtxtSubtitlePages < MAXTXTPAGES); i++) { - if (teletextSubtitlePages[totalTtxtSubtitlePages].ttxtMagazine != pages[i].ttxtMagazine || - teletextSubtitlePages[totalTtxtSubtitlePages].ttxtPage != pages[i].ttxtPage || -@@ -513,11 +513,22 @@ cString cChannel::ToText(const cChannel *Channel) - q += IntArrayToString(q, Channel->dpids, 10, Channel->dlangs); - } - *q = 0; -+ const int TBufferSize = 5 + 1 + (MAXTXTPAGES * (3 + 1 + MAXLANGCODE1 + 1)) + 10; // '12345;150=deu,151=fin,...', +10: paranoia -+ char tpidbuf[TBufferSize]; -+ q = tpidbuf; -+ q += snprintf(q, sizeof(tpidbuf), "%d", Channel->tpid); -+ if (Channel->fixedTtxtSubtitlePages > 0) { -+ q += snprintf(q, sizeof(tpidbuf) - (q - tpidbuf), ";"); -+ for (int i = 0; i < Channel->fixedTtxtSubtitlePages; ++i) { -+ tTeletextSubtitlePage page = Channel->teletextSubtitlePages[i]; -+ q += snprintf(q, sizeof(tpidbuf) - (q - tpidbuf), "%d=%s", page.PageNumber(), page.ttxtLanguage); -+ } -+ } - char caidbuf[MAXCAIDS * 5 + 10]; // 5: 4 digits plus delimiting ',', 10: paranoia - q = caidbuf; - q += IntArrayToString(q, Channel->caids, 16); - *q = 0; -- buffer = cString::sprintf("%s:%d:%s:%s:%d:%s:%s:%d:%s:%d:%d:%d:%d\n", FullName, Channel->frequency, *Channel->parameters, *cSource::ToString(Channel->source), Channel->srate, vpidbuf, apidbuf, Channel->tpid, caidbuf, Channel->sid, Channel->nid, Channel->tid, Channel->rid); -+ buffer = cString::sprintf("%s:%d:%s:%s:%d:%s:%s:%s:%s:%d:%d:%d:%d\n", FullName, Channel->frequency, *Channel->parameters, *cSource::ToString(Channel->source), Channel->srate, vpidbuf, apidbuf, tpidbuf, caidbuf, Channel->sid, Channel->nid, Channel->tid, Channel->rid); - } - return buffer; - } -@@ -551,8 +562,9 @@ bool cChannel::Parse(const char *s) - char *parambuf = NULL; - char *vpidbuf = NULL; - char *apidbuf = NULL; -+ char *tpidbuf = NULL; - char *caidbuf = NULL; -- int fields = sscanf(s, "%a[^:]:%d :%a[^:]:%a[^:] :%d :%a[^:]:%a[^:]:%d :%a[^:]:%d :%d :%d :%d ", &namebuf, &frequency, ¶mbuf, &sourcebuf, &srate, &vpidbuf, &apidbuf, &tpid, &caidbuf, &sid, &nid, &tid, &rid); -+ int fields = sscanf(s, "%a[^:]:%d :%a[^:]:%a[^:] :%d :%a[^:]:%a[^:]:%a[^:]:%a[^:]:%d :%d :%d :%d ", &namebuf, &frequency, ¶mbuf, &sourcebuf, &srate, &vpidbuf, &apidbuf, &tpidbuf, &caidbuf, &sid, &nid, &tid, &rid); - if (fields >= 9) { - if (fields == 9) { - // allow reading of old format -@@ -635,7 +647,37 @@ bool cChannel::Parse(const char *s) - } - dpids[NumDpids] = 0; - } -- -+ if (tpidbuf) { -+ char *p; -+ fixedTtxtSubtitlePages = 0; -+ // 2001;150=deu,151=fin -+ if ((p = strchr(tpidbuf, ';')) != NULL) { -+ char *q, *strtok_next; -+ *p++ = 0; -+ while ((q = strtok_r(p, ",", &strtok_next)) != NULL) { -+ if (fixedTtxtSubtitlePages < MAXTXTPAGES) { -+ int page; -+ char *l = strchr(q, '='); -+ if (l) -+ *l++ = 0; -+ if (sscanf(q, "%d", &page) == 1) { -+ teletextSubtitlePages[fixedTtxtSubtitlePages] = tTeletextSubtitlePage(page); -+ if (l) -+ strn0cpy(teletextSubtitlePages[fixedTtxtSubtitlePages].ttxtLanguage, l, MAXLANGCODE1); -+ fixedTtxtSubtitlePages++; -+ } -+ else -+ esyslog("ERROR: invalid Teletext page!"); // no need to set ok to 'false' -+ } -+ else -+ esyslog("ERROR: too many Teletext pages!"); // no need to set ok to 'false' -+ p = NULL; -+ } -+ totalTtxtSubtitlePages = fixedTtxtSubtitlePages; -+ } -+ if (sscanf(tpidbuf, "%d", &tpid) != 1) -+ return false; -+ } - if (caidbuf) { - char *p = caidbuf; - char *q; -@@ -672,6 +714,7 @@ bool cChannel::Parse(const char *s) - free(sourcebuf); - free(vpidbuf); - free(apidbuf); -+ free(tpidbuf); - free(caidbuf); - free(namebuf); - if (!GetChannelID().Valid()) { -diff --git a/channels.h b/channels.h -index defb6bc..bce62cd 100644 ---- a/channels.h -+++ b/channels.h -@@ -124,6 +124,7 @@ private: - uint16_t compositionPageIds[MAXSPIDS]; - uint16_t ancillaryPageIds[MAXSPIDS]; - int tpid; -+ int fixedTtxtSubtitlePages; - int totalTtxtSubtitlePages; - tTeletextSubtitlePage teletextSubtitlePages[MAXTXTPAGES]; - int caids[MAXCAIDS + 1]; // list is zero-terminated -diff --git a/vdr.5 b/vdr.5 -index 7f5cce2..7532806 100644 ---- a/vdr.5 -+++ b/vdr.5 -@@ -207,6 +207,13 @@ can be indicated by adding a second language code, delimited by a '+' sign, as i - .TP - .B TPID - The teletext PID. -+ -+Fixed teletext subtitling pages can be defined separated by a semicolon. -+The pages (separated by commas) can contain ISO 639 language codes, delimited -+by a '=' sign, as in -+ -+.B ...:2001;150=deu,151=fin:... -+ - .TP - .B Conditional access - A hexadecimal integer defining how this channel can be accessed: --- -1.6.6.1 - diff --git a/patches/patch-set.1.7.13/0004-Decrypt-teletext-stream.patch b/patches/patch-set.1.7.13/0004-Decrypt-teletext-stream.patch deleted file mode 100644 index 2830913..0000000 --- a/patches/patch-set.1.7.13/0004-Decrypt-teletext-stream.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 89135204866973aa8ff3e432a2a50f8da50bc2a8 Mon Sep 17 00:00:00 2001 -From: etobi -Date: Sun, 14 Feb 2010 01:30:34 +0100 -Subject: [PATCH 4/6] Decrypt teletext stream - ---- - ci.c | 5 +++++ - 1 files changed, 5 insertions(+), 0 deletions(-) - -diff --git a/ci.c b/ci.c -index 6c7b031..22fda9f 100644 ---- a/ci.c -+++ b/ci.c -@@ -1911,6 +1911,8 @@ void cCamSlot::AddChannel(const cChannel *Channel) - AddPid(Channel->Sid(), *Apid, STREAM_TYPE_AUDIO); - for (const int *Dpid = Channel->Dpids(); *Dpid; Dpid++) - AddPid(Channel->Sid(), *Dpid, STREAM_TYPE_DOLBY); -+ if (Channel->Tpid() && Setup.SupportTeletext) -+ AddPid(Channel->Sid(), Channel->Tpid(), STREAM_TYPE_DOLBY); - } - } - -@@ -1932,6 +1934,9 @@ bool cCamSlot::CanDecrypt(const cChannel *Channel) - CaPmt.AddPid(*Apid, STREAM_TYPE_AUDIO); - for (const int *Dpid = Channel->Dpids(); *Dpid; Dpid++) - CaPmt.AddPid(*Dpid, STREAM_TYPE_DOLBY); -+ if (Channel->Tpid() && Setup.SupportTeletext) { -+ CaPmt.AddPid(Channel->Tpid(), STREAM_TYPE_DOLBY); // FIXME: STREAM_TYPE_DOLBY should probably be renamed STREAM_TYPE_PRIVATE -+ } - cas->SendPMT(&CaPmt); - cTimeMs Timeout(QUERY_REPLY_TIMEOUT); - do { --- -1.6.6.1 - diff --git a/patches/patch-set.1.7.13/0005-Capture-teletext-subtitle-pages-from-PMT.patch b/patches/patch-set.1.7.13/0005-Capture-teletext-subtitle-pages-from-PMT.patch deleted file mode 100644 index 496a66f..0000000 --- a/patches/patch-set.1.7.13/0005-Capture-teletext-subtitle-pages-from-PMT.patch +++ /dev/null @@ -1,92 +0,0 @@ -From 82e6f38fbac65f6af70110439dc372563ede60d7 Mon Sep 17 00:00:00 2001 -From: etobi -Date: Fri, 12 Feb 2010 22:06:19 +0100 -Subject: [PATCH 5/6] Capture teletext subtitle pages from PMT - ---- - remux.c | 24 ++++++++++++++++++++++++ - remux.h | 5 +++++ - 2 files changed, 29 insertions(+), 0 deletions(-) - -diff --git a/remux.c b/remux.c -index 33b744a..31367a1 100644 ---- a/remux.c -+++ b/remux.c -@@ -431,6 +431,7 @@ void cPatPmtParser::Reset(void) - pmtPid = -1; - vpid = vtype = 0; - ppid = 0; -+ tpid = 0; - } - - void cPatPmtParser::ParsePat(const uchar *Data, int Length) -@@ -516,6 +517,7 @@ void cPatPmtParser::ParsePmt(const uchar *Data, int Length) - int NumSpids = 0; - vpid = vtype = 0; - ppid = 0; -+ tpid = 0; - apids[0] = 0; - dpids[0] = 0; - spids[0] = 0; -@@ -615,6 +617,28 @@ void cPatPmtParser::ParsePmt(const uchar *Data, int Length) - spids[NumSpids]= 0; - } - break; -+ case SI::TeletextDescriptorTag: { -+ dbgpatpmt(" teletext"); -+ tpid = stream.getPid(); -+ SI::TeletextDescriptor *sd = (SI::TeletextDescriptor *)d; -+ SI::TeletextDescriptor::Teletext ttxt; -+ if (totalTtxtSubtitlePages < MAXTXTPAGES) { -+ for (SI::Loop::Iterator it; sd->teletextLoop.getNext(ttxt, it); ) { -+ bool isSubtitlePage = (ttxt.getTeletextType() == 0x02) || (ttxt.getTeletextType() == 0x05); -+ if (isSubtitlePage && ttxt.languageCode[0]) { -+ dbgpatpmt(" '%s:%x.%x'", ttxt.languageCode, ttxt.getTeletextMagazineNumber(), ttxt.getTeletextPageNumber()); -+ strn0cpy(teletextSubtitlePages[totalTtxtSubtitlePages].ttxtLanguage, I18nNormalizeLanguageCode(ttxt.languageCode), MAXLANGCODE1); -+ teletextSubtitlePages[totalTtxtSubtitlePages].ttxtPage = ttxt.getTeletextPageNumber(); -+ teletextSubtitlePages[totalTtxtSubtitlePages].ttxtMagazine = ttxt.getTeletextMagazineNumber(); -+ teletextSubtitlePages[totalTtxtSubtitlePages].ttxtType = ttxt.getTeletextType(); -+ totalTtxtSubtitlePages++; -+ if (totalTtxtSubtitlePages >= MAXTXTPAGES) -+ break; -+ } -+ } -+ } -+ } -+ break; - case SI::ISO639LanguageDescriptorTag: { - SI::ISO639LanguageDescriptor *ld = (SI::ISO639LanguageDescriptor *)d; - dbgpatpmt(" '%s'", ld->languageCode); -diff --git a/remux.h b/remux.h -index 5ee6722..390236a 100644 ---- a/remux.h -+++ b/remux.h -@@ -216,6 +216,7 @@ private: - int vpid; - int ppid; - int vtype; -+ int tpid; - int apids[MAXAPIDS + 1]; // list is zero-terminated - int atypes[MAXAPIDS + 1]; // list is zero-terminated - char alangs[MAXAPIDS][MAXLANGCODE2]; -@@ -262,6 +263,9 @@ public: - int Vtype(void) const { return vtype; } - ///< Returns the video stream type as defined by the current PMT, or 0 if no video - ///< stream type has been detected, yet. -+ int Tpid(void) { return tpid; } -+ ///< Returns the teletext pid as defined by the current PMT, or 0 if no teletext -+ ///< pid has been detected, yet. - const int *Apids(void) const { return apids; } - const int *Dpids(void) const { return dpids; } - const int *Spids(void) const { return spids; } -@@ -276,6 +280,7 @@ public: - uchar SubtitlingType(int i) const { return (0 <= i && i < MAXSPIDS) ? subtitlingTypes[i] : uchar(0); } - uint16_t CompositionPageId(int i) const { return (0 <= i && i < MAXSPIDS) ? compositionPageIds[i] : uint16_t(0); } - uint16_t AncillaryPageId(int i) const { return (0 <= i && i < MAXSPIDS) ? ancillaryPageIds[i] : uint16_t(0); } -+ const tTeletextSubtitlePage* TeletextSubtitlePages() const { return teletextSubtitlePages; } - }; - - // TS to PES converter: --- -1.6.6.1 - diff --git a/patches/patch-set.1.7.13/0006-Ttxtsubs-plugin-hook.patch b/patches/patch-set.1.7.13/0006-Ttxtsubs-plugin-hook.patch deleted file mode 100644 index cff76c7..0000000 --- a/patches/patch-set.1.7.13/0006-Ttxtsubs-plugin-hook.patch +++ /dev/null @@ -1,256 +0,0 @@ -From 229718398517f0e28eab9a04f248ea1e95dfd2db Mon Sep 17 00:00:00 2001 -From: etobi -Date: Sat, 13 Feb 2010 00:28:21 +0100 -Subject: [PATCH 6/6] Ttxtsubs plugin hook - ---- - Makefile | 2 + - device.c | 20 ++++++++++++++++ - device.h | 1 + - pat.c | 6 +++++ - remux.h | 3 +- - vdrttxtsubshooks.c | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++ - vdrttxtsubshooks.h | 46 ++++++++++++++++++++++++++++++++++++++ - 7 files changed, 140 insertions(+), 1 deletions(-) - create mode 100644 vdrttxtsubshooks.c - create mode 100644 vdrttxtsubshooks.h - -diff --git a/Makefile b/Makefile -index 31f05b0..a45b189 100644 ---- a/Makefile -+++ b/Makefile -@@ -44,6 +44,8 @@ OBJS = audio.o channels.o ci.o config.o cutter.o device.o diseqc.o dvbdevice.o d - skinclassic.o skins.o skinsttng.o sourceparams.o sources.o spu.o status.o svdrp.o themes.o thread.o\ - timers.o tools.o transfer.o vdr.o videodir.o - -+OBJS += vdrttxtsubshooks.o -+ - ifndef NO_KBD - DEFINES += -DREMOTE_KBD - endif -diff --git a/device.c b/device.c -index ac4d6d4..773cf21 100644 ---- a/device.c -+++ b/device.c -@@ -18,6 +18,7 @@ - #include "receiver.h" - #include "status.h" - #include "transfer.h" -+#include "vdrttxtsubshooks.h" - - // --- cLiveSubtitle --------------------------------------------------------- - -@@ -1223,6 +1224,13 @@ int cDevice::PlayPesPacket(const uchar *Data, int Length, bool VideoOnly) - } - break; - case 0xBD: { // private stream 1 -+ // EBU Teletext data, ETSI EN 300 472 -+ // if PES data header length = 24 and data_identifier = 0x10..0x1F (EBU Data) -+ if (Data[8] == 0x24 && Data[45] >= 0x10 && Data[45] < 0x20) { -+ cVDRTtxtsubsHookListener::Hook()->PlayerTeletextData((uint8_t*)Data, Length); -+ break; -+ } -+ - int PayloadOffset = Data[8] + 9; - - // Compatibility mode for old subtitles plugin: -@@ -1382,6 +1390,7 @@ int cDevice::PlayTs(const uchar *Data, int Length, bool VideoOnly) - tsToPesVideo.Reset(); - tsToPesAudio.Reset(); - tsToPesSubtitle.Reset(); -+ tsToPesTeletext.Reset(); - } - else if (Length < TS_SIZE) { - esyslog("ERROR: skipped %d bytes of TS fragment", Length); -@@ -1427,6 +1436,17 @@ int cDevice::PlayTs(const uchar *Data, int Length, bool VideoOnly) - if (!VideoOnly || HasIBPTrickSpeed()) - PlayTsSubtitle(Data, TS_SIZE); - } -+ else if (Pid == patPmtParser.Tpid()) { -+ if (!VideoOnly || HasIBPTrickSpeed()) { -+ int l; -+ tsToPesTeletext.PutTs(Data, Length); -+ if (const uchar *p = tsToPesTeletext.GetPes(l)) { -+ if ((l > 45) && (p[0] == 0x00) && (p[1] == 0x00) && (p[2] == 0x01) && (p[3] == 0xbd) && (p[8] == 0x24) && (p[45] >= 0x10) && (p[45] < 0x20)) -+ cVDRTtxtsubsHookListener::Hook()->PlayerTeletextData((uchar *)p, l, false, patPmtParser.TeletextSubtitlePages(), patPmtParser.TotalTeletextSubtitlePages()); -+ tsToPesTeletext.Reset(); -+ } -+ } -+ } - } - } - else if (Pid == patPmtParser.Ppid()) { -diff --git a/device.h b/device.h -index 9ce814a..426dc8f 100644 ---- a/device.h -+++ b/device.h -@@ -519,6 +519,7 @@ private: - cTsToPes tsToPesVideo; - cTsToPes tsToPesAudio; - cTsToPes tsToPesSubtitle; -+ cTsToPes tsToPesTeletext; - bool isPlayingVideo; - protected: - const cPatPmtParser *PatPmtParser(void) const { return &patPmtParser; } -diff --git a/pat.c b/pat.c -index ff25501..c6e7834 100644 ---- a/pat.c -+++ b/pat.c -@@ -13,6 +13,7 @@ - #include "libsi/section.h" - #include "libsi/descriptor.h" - #include "thread.h" -+#include "vdrttxtsubshooks.h" - - #define PMT_SCAN_TIMEOUT 10 // seconds - -@@ -473,6 +474,11 @@ void cPatFilter::Process(u_short Pid, u_char Tid, const u_char *Data, int Length - } - if (Setup.UpdateChannels >= 2) { - Channel->SetPids(Vpid, Ppid, Vtype, Apids, ALangs, Dpids, DLangs, Spids, SLangs, Tpid); -+ if (NumTPages < MAXTXTPAGES) { -+ int manualPageNumber = cVDRTtxtsubsHookListener::Hook()->ManualPageNumber(Channel); -+ if (manualPageNumber) -+ TeletextSubtitlePages[NumTPages++] = tTeletextSubtitlePage(manualPageNumber); -+ } - Channel->SetTeletextSubtitlePages(TeletextSubtitlePages, NumTPages); - Channel->SetCaIds(CaDescriptors->CaIds()); - Channel->SetSubtitlingDescriptors(SubtitlingTypes, CompositionPageIds, AncillaryPageIds); -diff --git a/remux.h b/remux.h -index 390236a..7bf712e 100644 ---- a/remux.h -+++ b/remux.h -@@ -280,7 +280,8 @@ public: - uchar SubtitlingType(int i) const { return (0 <= i && i < MAXSPIDS) ? subtitlingTypes[i] : uchar(0); } - uint16_t CompositionPageId(int i) const { return (0 <= i && i < MAXSPIDS) ? compositionPageIds[i] : uint16_t(0); } - uint16_t AncillaryPageId(int i) const { return (0 <= i && i < MAXSPIDS) ? ancillaryPageIds[i] : uint16_t(0); } -- const tTeletextSubtitlePage* TeletextSubtitlePages() const { return teletextSubtitlePages; } -+ const tTeletextSubtitlePage *TeletextSubtitlePages() const { return teletextSubtitlePages; } -+ int TotalTeletextSubtitlePages() const { return totalTtxtSubtitlePages; } - }; - - // TS to PES converter: -diff --git a/vdrttxtsubshooks.c b/vdrttxtsubshooks.c -new file mode 100644 -index 0000000..2471788 ---- /dev/null -+++ b/vdrttxtsubshooks.c -@@ -0,0 +1,63 @@ -+/* -+ * vdr-ttxtsubs - A plugin for the Linux Video Disk Recorder -+ * Copyright (c) 2003 - 2008 Ragnar Sundblad -+ * -+ * 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., -+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -+ * -+ */ -+ -+#include -+#include -+#include -+ -+#include "vdrttxtsubshooks.h" -+ -+// XXX Really should be a list... -+static cVDRTtxtsubsHookListener *gListener; -+ -+// ------ class cVDRTtxtsubsHookProxy ------ -+ -+class cVDRTtxtsubsHookProxy : public cVDRTtxtsubsHookListener -+{ -+ public: -+ virtual void HideOSD(void) { if(gListener) gListener->HideOSD(); }; -+ virtual void ShowOSD(void) { if(gListener) gListener->ShowOSD(); }; -+ virtual void PlayerTeletextData(uint8_t *p, int length, bool IsPesRecording, const struct tTeletextSubtitlePage teletextSubtitlePages[] = NULL, int pageCount = 0) -+ { if(gListener) gListener->PlayerTeletextData(p, length, IsPesRecording, teletextSubtitlePages, pageCount); }; -+ virtual int ManualPageNumber(const cChannel *channel) -+ { if(gListener) return gListener->ManualPageNumber(channel); else return 0; }; -+}; -+ -+ -+// ------ class cVDRTtxtsubsHookListener ------ -+ -+cVDRTtxtsubsHookListener::~cVDRTtxtsubsHookListener() -+{ -+ gListener = 0; -+} -+ -+void cVDRTtxtsubsHookListener::HookAttach(void) -+{ -+ gListener = this; -+ //printf("cVDRTtxtsubsHookListener::HookAttach\n"); -+} -+ -+static cVDRTtxtsubsHookProxy gProxy; -+ -+cVDRTtxtsubsHookListener *cVDRTtxtsubsHookListener::Hook(void) -+{ -+ return &gProxy; -+} -+ -diff --git a/vdrttxtsubshooks.h b/vdrttxtsubshooks.h -new file mode 100644 -index 0000000..2f97969 ---- /dev/null -+++ b/vdrttxtsubshooks.h -@@ -0,0 +1,46 @@ -+/* -+ * vdr-ttxtsubs - A plugin for the Linux Video Disk Recorder -+ * Copyright (c) 2003 - 2008 Ragnar Sundblad -+ * -+ * 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., -+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -+ * -+ */ -+ -+#ifndef __VDRTTXTSUBSHOOKS_H -+#define __VDRTTXTSUBSHOOKS_H -+ -+#define TTXTSUBSVERSNUM 2 -+ -+class cDevice; -+class cChannel; -+struct tTeletextSubtitlePage; -+ -+class cVDRTtxtsubsHookListener { -+ public: -+ cVDRTtxtsubsHookListener(void) {}; -+ virtual ~cVDRTtxtsubsHookListener(); -+ -+ void HookAttach(void); -+ -+ virtual void HideOSD(void) {}; -+ virtual void ShowOSD(void) {}; -+ virtual void PlayerTeletextData(uint8_t *p, int length, bool IsPesRecording = true, const struct tTeletextSubtitlePage teletextSubtitlePages[] = NULL, int pageCount = 0) {}; -+ virtual int ManualPageNumber(const cChannel *channel) { return 0; }; -+ -+ // used by VDR to call hook listeners -+ static cVDRTtxtsubsHookListener *Hook(void); -+}; -+ -+#endif --- -1.6.6.1 - diff --git a/patches/patch-set.1.7.14/0001-Record-teletext-subtitles.patch b/patches/patch-set.1.7.14/0001-Record-teletext-subtitles.patch new file mode 100644 index 0000000..a6aca63 --- /dev/null +++ b/patches/patch-set.1.7.14/0001-Record-teletext-subtitles.patch @@ -0,0 +1,243 @@ +From fd637029c261367a1112c29bbe991b7b991384f8 Mon Sep 17 00:00:00 2001 +From: etobi +Date: Fri, 12 Feb 2010 21:55:04 +0100 +Subject: [PATCH 1/6] Record teletext subtitles + +--- + channels.c | 20 ++++++++++++++++++++ + channels.h | 16 ++++++++++++++++ + pat.c | 18 +++++++++++++++++- + receiver.c | 3 ++- + remux.c | 29 +++++++++++++++++++++++++++++ + remux.h | 3 +++ + 6 files changed, 87 insertions(+), 2 deletions(-) + +diff --git a/channels.c b/channels.c +index a694d54..f0b8a13 100644 +--- a/channels.c ++++ b/channels.c +@@ -365,6 +365,26 @@ void cChannel::SetSubtitlingDescriptors(uchar *SubtitlingTypes, uint16_t *Compos + } + } + ++void cChannel::SetTeletextSubtitlePages(tTeletextSubtitlePage pages[], int numberOfPages) ++{ ++ int mod = CHANNELMOD_NONE; ++ if (totalTtxtSubtitlePages != numberOfPages) ++ mod |= CHANNELMOD_PIDS; ++ totalTtxtSubtitlePages = 0; ++ for (int i = 0; (i < numberOfPages) && (totalTtxtSubtitlePages < MAXTXTPAGES); i++) { ++ if (teletextSubtitlePages[totalTtxtSubtitlePages].ttxtMagazine != pages[i].ttxtMagazine || ++ teletextSubtitlePages[totalTtxtSubtitlePages].ttxtPage != pages[i].ttxtPage || ++ teletextSubtitlePages[totalTtxtSubtitlePages].ttxtType != pages[i].ttxtType || ++ strcmp(teletextSubtitlePages[totalTtxtSubtitlePages].ttxtLanguage, pages[i].ttxtLanguage)) { ++ mod |= CHANNELMOD_PIDS; ++ teletextSubtitlePages[totalTtxtSubtitlePages] = pages[i]; ++ } ++ totalTtxtSubtitlePages++; ++ } ++ modification |= mod; ++ Channels.SetModified(); ++} ++ + void cChannel::SetCaIds(const int *CaIds) + { + if (caids[0] && caids[0] <= CA_USER_MAX) +diff --git a/channels.h b/channels.h +index 5c9727f..905a9b4 100644 +--- a/channels.h ++++ b/channels.h +@@ -35,6 +35,7 @@ + #define MAXDPIDS 16 // dolby (AC3 + DTS) + #define MAXSPIDS 32 // subtitles + #define MAXCAIDS 8 // conditional access ++#define MAXTXTPAGES 8 // teletext pages + + #define MAXLANGCODE1 4 // a 3 letter language code, zero terminated + #define MAXLANGCODE2 8 // up to two 3 letter language codes, separated by '+' and zero terminated +@@ -71,6 +72,16 @@ public: + static const tChannelID InvalidID; + }; + ++struct tTeletextSubtitlePage { ++ tTeletextSubtitlePage(void) { ttxtPage = ttxtMagazine = 0; ttxtType = 0x02; strcpy(ttxtLanguage, "und"); } ++ tTeletextSubtitlePage(int page) { ttxtMagazine = (page / 100) & 0x7; ttxtPage = (((page % 100) / 10) << 4) + (page % 10); ttxtType = 0x02; strcpy(ttxtLanguage, "und"); } ++ char ttxtLanguage[MAXLANGCODE1]; ++ uchar ttxtPage; ++ uchar ttxtMagazine; ++ uchar ttxtType; ++ int PageNumber(void) const { return BCDCHARTOINT(ttxtMagazine) * 100 + BCDCHARTOINT(ttxtPage); } ++ }; ++ + class cChannel; + + class cLinkChannel : public cListObject { +@@ -113,6 +124,8 @@ private: + uint16_t compositionPageIds[MAXSPIDS]; + uint16_t ancillaryPageIds[MAXSPIDS]; + int tpid; ++ int totalTtxtSubtitlePages; ++ tTeletextSubtitlePage teletextSubtitlePages[MAXTXTPAGES]; + int caids[MAXCAIDS + 1]; // list is zero-terminated + int nid; + int tid; +@@ -160,6 +173,8 @@ public: + uint16_t CompositionPageId(int i) const { return (0 <= i && i < MAXSPIDS) ? compositionPageIds[i] : uint16_t(0); } + uint16_t AncillaryPageId(int i) const { return (0 <= i && i < MAXSPIDS) ? ancillaryPageIds[i] : uint16_t(0); } + int Tpid(void) const { return tpid; } ++ const tTeletextSubtitlePage *TeletextSubtitlePages() const { return teletextSubtitlePages; } ++ int TotalTeletextSubtitlePages() const { return totalTtxtSubtitlePages; } + const int *Caids(void) const { return caids; } + int Ca(int Index = 0) const { return Index < MAXCAIDS ? caids[Index] : 0; } + int Nid(void) const { return nid; } +@@ -186,6 +201,7 @@ public: + void SetName(const char *Name, const char *ShortName, const char *Provider); + void SetPortalName(const char *PortalName); + void SetPids(int Vpid, int Ppid, int Vtype, int *Apids, char ALangs[][MAXLANGCODE2], int *Dpids, char DLangs[][MAXLANGCODE2], int *Spids, char SLangs[][MAXLANGCODE2], int Tpid); ++ void SetTeletextSubtitlePages(tTeletextSubtitlePage pages[], int numberOfPages); + void SetCaIds(const int *CaIds); // list must be zero-terminated + void SetCaDescriptors(int Level); + void SetLinkChannels(cLinkChannels *LinkChannels); +diff --git a/pat.c b/pat.c +index 0d084e5..684ba81 100644 +--- a/pat.c ++++ b/pat.c +@@ -341,6 +341,8 @@ void cPatFilter::Process(u_short Pid, u_char Tid, const u_char *Data, int Length + char DLangs[MAXDPIDS][MAXLANGCODE2] = { "" }; + char SLangs[MAXSPIDS][MAXLANGCODE2] = { "" }; + int Tpid = 0; ++ tTeletextSubtitlePage TeletextSubtitlePages[MAXTXTPAGES]; ++ int NumTPages = 0; + int NumApids = 0; + int NumDpids = 0; + int NumSpids = 0; +@@ -426,8 +428,21 @@ void cPatFilter::Process(u_short Pid, u_char Tid, const u_char *Data, int Length + NumSpids++; + } + break; +- case SI::TeletextDescriptorTag: ++ case SI::TeletextDescriptorTag: { + Tpid = esPid; ++ SI::TeletextDescriptor *sd = (SI::TeletextDescriptor *)d; ++ SI::TeletextDescriptor::Teletext ttxt; ++ for (SI::Loop::Iterator it; sd->teletextLoop.getNext(ttxt, it); ) { ++ bool isSubtitlePage = (ttxt.getTeletextType() == 0x02) || (ttxt.getTeletextType() == 0x05); ++ if ((NumTPages < MAXTXTPAGES) && ttxt.languageCode[0] && isSubtitlePage) { ++ strn0cpy(TeletextSubtitlePages[NumTPages].ttxtLanguage, I18nNormalizeLanguageCode(ttxt.languageCode), MAXLANGCODE1); ++ TeletextSubtitlePages[NumTPages].ttxtPage = ttxt.getTeletextPageNumber(); ++ TeletextSubtitlePages[NumTPages].ttxtMagazine = ttxt.getTeletextMagazineNumber(); ++ TeletextSubtitlePages[NumTPages].ttxtType = ttxt.getTeletextType(); ++ NumTPages++; ++ } ++ } ++ } + break; + case SI::ISO639LanguageDescriptorTag: { + SI::ISO639LanguageDescriptor *ld = (SI::ISO639LanguageDescriptor *)d; +@@ -481,6 +496,7 @@ void cPatFilter::Process(u_short Pid, u_char Tid, const u_char *Data, int Length + } + if (Setup.UpdateChannels >= 2) { + Channel->SetPids(Vpid, Ppid, Vtype, Apids, ALangs, Dpids, DLangs, Spids, SLangs, Tpid); ++ Channel->SetTeletextSubtitlePages(TeletextSubtitlePages, NumTPages); + Channel->SetCaIds(CaDescriptors->CaIds()); + Channel->SetSubtitlingDescriptors(SubtitlingTypes, CompositionPageIds, AncillaryPageIds); + } +diff --git a/receiver.c b/receiver.c +index 58dda78..a2c6781 100644 +--- a/receiver.c ++++ b/receiver.c +@@ -82,7 +82,8 @@ bool cReceiver::SetPids(const cChannel *Channel) + (Channel->Ppid() == Channel->Vpid() || AddPid(Channel->Ppid())) && + AddPids(Channel->Apids()) && + AddPids(Channel->Dpids()) && +- AddPids(Channel->Spids()); ++ AddPids(Channel->Spids()) && ++ AddPid(Channel->Tpid()); + } + return true; + } +diff --git a/remux.c b/remux.c +index 2532c63..33b744a 100644 +--- a/remux.c ++++ b/remux.c +@@ -215,6 +215,29 @@ int cPatPmtGenerator::MakeSubtitlingDescriptor(uchar *Target, const char *Langua + return i; + } + ++int cPatPmtGenerator::MakeTeletextDescriptor(uchar *Target, const tTeletextSubtitlePage *pages, int pageCount) ++{ ++ int i = 0, j = 0; ++ Target[i++] = SI::TeletextDescriptorTag; ++ int l = i; ++ Target[i++] = 0x00; // length ++ for (int n = 0; n < pageCount; n++) { ++ const char* Language = pages[n].ttxtLanguage; ++ Target[i++] = *Language++; ++ Target[i++] = *Language++; ++ Target[i++] = *Language++; ++ Target[i++] = (pages[n].ttxtType << 3) + pages[n].ttxtMagazine; ++ Target[i++] = pages[n].ttxtPage; ++ j++; ++ } ++ if (j > 0) { ++ Target[l] = j * 5; // update length ++ IncEsInfoLength(i); ++ return i; ++ } ++ return 0; ++} ++ + int cPatPmtGenerator::MakeLanguageDescriptor(uchar *Target, const char *Language) + { + int i = 0; +@@ -296,6 +319,7 @@ void cPatPmtGenerator::GeneratePmt(const cChannel *Channel) + if (Channel) { + int Vpid = Channel->Vpid(); + int Ppid = Channel->Ppid(); ++ int Tpid = Channel->Tpid(); + uchar *p = buf; + int i = 0; + p[i++] = 0x02; // table id +@@ -330,6 +354,10 @@ void cPatPmtGenerator::GeneratePmt(const cChannel *Channel) + i += MakeStream(buf + i, 0x06, Channel->Spid(n)); + i += MakeSubtitlingDescriptor(buf + i, Channel->Slang(n), Channel->SubtitlingType(n), Channel->CompositionPageId(n), Channel->AncillaryPageId(n)); + } ++ if (Tpid) { ++ i += MakeStream(buf + i, 0x06, Tpid); ++ i += MakeTeletextDescriptor(buf + i, Channel->TeletextSubtitlePages(), Channel->TotalTeletextSubtitlePages()); ++ } + + int sl = i - SectionLength - 2 + 4; // -2 = SectionLength storage, +4 = length of CRC + buf[SectionLength] |= (sl >> 8) & 0x0F; +@@ -493,6 +521,7 @@ void cPatPmtParser::ParsePmt(const uchar *Data, int Length) + spids[0] = 0; + atypes[0] = 0; + dtypes[0] = 0; ++ totalTtxtSubtitlePages = 0; + SI::PMT::Stream stream; + for (SI::Loop::Iterator it; Pmt.streamLoop.getNext(stream, it); ) { + dbgpatpmt(" stream type = %02X, pid = %d", stream.getStreamType(), stream.getPid()); +diff --git a/remux.h b/remux.h +index 1115c4a..5ee6722 100644 +--- a/remux.h ++++ b/remux.h +@@ -170,6 +170,7 @@ protected: + int MakeStream(uchar *Target, uchar Type, int Pid); + int MakeAC3Descriptor(uchar *Target); + int MakeSubtitlingDescriptor(uchar *Target, const char *Language, uchar SubtitlingType, uint16_t CompositionPageId, uint16_t AncillaryPageId); ++ int MakeTeletextDescriptor(uchar *Target, const tTeletextSubtitlePage *pages, int pageCount); + int MakeLanguageDescriptor(uchar *Target, const char *Language); + int MakeCRC(uchar *Target, const uchar *Data, int Length); + void GeneratePmtPid(const cChannel *Channel); +@@ -227,6 +228,8 @@ private: + uint16_t compositionPageIds[MAXSPIDS]; + uint16_t ancillaryPageIds[MAXSPIDS]; + bool updatePrimaryDevice; ++ int totalTtxtSubtitlePages; ++ tTeletextSubtitlePage teletextSubtitlePages[MAXTXTPAGES]; + protected: + int SectionLength(const uchar *Data, int Length) { return (Length >= 3) ? ((int(Data[1]) & 0x0F) << 8)| Data[2] : 0; } + public: +-- +1.7.0 + diff --git a/patches/patch-set.1.7.14/0002-Added-setup-option-to-enable-teletext-subtitle-recor.patch b/patches/patch-set.1.7.14/0002-Added-setup-option-to-enable-teletext-subtitle-recor.patch new file mode 100644 index 0000000..3571972 --- /dev/null +++ b/patches/patch-set.1.7.14/0002-Added-setup-option-to-enable-teletext-subtitle-recor.patch @@ -0,0 +1,470 @@ +From e7aefd8eb168fc435318a99f267a6de4ec3281bf Mon Sep 17 00:00:00 2001 +From: etobi +Date: Sat, 13 Feb 2010 14:42:30 +0100 +Subject: [PATCH 2/6] Added setup option to enable teletext subtitle recording + +--- + MANUAL | 3 +++ + config.c | 3 +++ + config.h | 1 + + menu.c | 1 + + po/ca_ES.po | 3 +++ + po/cs_CZ.po | 3 +++ + po/da_DK.po | 3 +++ + po/de_DE.po | 3 +++ + po/el_GR.po | 3 +++ + po/es_ES.po | 3 +++ + po/et_EE.po | 3 +++ + po/fi_FI.po | 3 +++ + po/fr_FR.po | 3 +++ + po/hr_HR.po | 3 +++ + po/hu_HU.po | 3 +++ + po/it_IT.po | 3 +++ + po/lt_LT.po | 3 +++ + po/nl_NL.po | 3 +++ + po/nn_NO.po | 3 +++ + po/pl_PL.po | 3 +++ + po/pt_PT.po | 3 +++ + po/ro_RO.po | 3 +++ + po/ru_RU.po | 3 +++ + po/sk_SK.po | 3 +++ + po/sl_SI.po | 3 +++ + po/sv_SE.po | 3 +++ + po/tr_TR.po | 3 +++ + po/uk_UA.po | 3 +++ + po/zh_CN.po | 3 +++ + receiver.c | 2 +- + 30 files changed, 84 insertions(+), 1 deletions(-) + +diff --git a/MANUAL b/MANUAL +index 3fd528f..01c98b9 100644 +--- a/MANUAL ++++ b/MANUAL +@@ -725,6 +725,9 @@ Version 1.6 + background transparency. By default the values as broadcast + are used. + ++ Record Teletext Subtitles = no ++ If set to 'yes', teletext subtitles will be recorded. ++ + LNB: + + SLOF = 11700 The switching frequency (in MHz) between low and +diff --git a/config.c b/config.c +index aa18ebc..351f56d 100644 +--- a/config.c ++++ b/config.c +@@ -333,6 +333,7 @@ cSetup::cSetup(void) + MarginStop = 10; + AudioLanguages[0] = -1; + DisplaySubtitles = 0; ++ SupportTeletext = 0; + SubtitleLanguages[0] = -1; + SubtitleOffset = 0; + SubtitleFgTransparency = 0; +@@ -523,6 +524,7 @@ bool cSetup::Parse(const char *Name, const char *Value) + else if (!strcasecmp(Name, "MarginStop")) MarginStop = atoi(Value); + else if (!strcasecmp(Name, "AudioLanguages")) return ParseLanguages(Value, AudioLanguages); + else if (!strcasecmp(Name, "DisplaySubtitles")) DisplaySubtitles = atoi(Value); ++ else if (!strcasecmp(Name, "SupportTeletext")) SupportTeletext = atoi(Value); + else if (!strcasecmp(Name, "SubtitleLanguages")) return ParseLanguages(Value, SubtitleLanguages); + else if (!strcasecmp(Name, "SubtitleOffset")) SubtitleOffset = atoi(Value); + else if (!strcasecmp(Name, "SubtitleFgTransparency")) SubtitleFgTransparency = atoi(Value); +@@ -618,6 +620,7 @@ bool cSetup::Save(void) + Store("MarginStop", MarginStop); + StoreLanguages("AudioLanguages", AudioLanguages); + Store("DisplaySubtitles", DisplaySubtitles); ++ Store("SupportTeletext", SupportTeletext); + StoreLanguages("SubtitleLanguages", SubtitleLanguages); + Store("SubtitleOffset", SubtitleOffset); + Store("SubtitleFgTransparency", SubtitleFgTransparency); +diff --git a/config.h b/config.h +index f4996bb..ed355dd 100644 +--- a/config.h ++++ b/config.h +@@ -235,6 +235,7 @@ public: + int MarginStart, MarginStop; + int AudioLanguages[I18N_MAX_LANGUAGES + 1]; + int DisplaySubtitles; ++ int SupportTeletext; + int SubtitleLanguages[I18N_MAX_LANGUAGES + 1]; + int SubtitleOffset; + int SubtitleFgTransparency, SubtitleBgTransparency; +diff --git a/menu.c b/menu.c +index e3b49ce..493d6ed 100644 +--- a/menu.c ++++ b/menu.c +@@ -2788,6 +2788,7 @@ void cMenuSetupDVB::Setup(void) + Add(new cMenuEditIntItem( tr("Setup.DVB$Subtitle foreground transparency"), &data.SubtitleFgTransparency, 0, 9)); + Add(new cMenuEditIntItem( tr("Setup.DVB$Subtitle background transparency"), &data.SubtitleBgTransparency, 0, 10)); + } ++ Add(new cMenuEditBoolItem(tr("Setup.DVB$Enable teletext support"), &data.SupportTeletext)); + + SetCurrent(Get(current)); + Display(); +diff --git a/po/ca_ES.po b/po/ca_ES.po +index 1dd35e3..af5627d 100644 +--- a/po/ca_ES.po ++++ b/po/ca_ES.po +@@ -937,6 +937,9 @@ msgstr "Transpar + msgid "Setup.DVB$Subtitle background transparency" + msgstr "Transparncia fons subttols" + ++msgid "Setup.DVB$Enable teletext support" ++msgstr "" ++ + msgid "LNB" + msgstr "Configuraci de l'LNB" + +diff --git a/po/cs_CZ.po b/po/cs_CZ.po +index e8c6687..68c5202 100644 +--- a/po/cs_CZ.po ++++ b/po/cs_CZ.po +@@ -935,6 +935,9 @@ msgstr "Pr + msgid "Setup.DVB$Subtitle background transparency" + msgstr "Prhlednost pozad titulk" + ++msgid "Setup.DVB$Enable teletext support" ++msgstr "" ++ + msgid "LNB" + msgstr "LNB" + +diff --git a/po/da_DK.po b/po/da_DK.po +index 580d82a..44bb590 100644 +--- a/po/da_DK.po ++++ b/po/da_DK.po +@@ -934,6 +934,9 @@ msgstr "Undertekst forgrundsgennemsigtighed" + msgid "Setup.DVB$Subtitle background transparency" + msgstr "Undertekst baggrundsgennemsigtighed" + ++msgid "Setup.DVB$Enable teletext support" ++msgstr "" ++ + msgid "LNB" + msgstr "LNB" + +diff --git a/po/de_DE.po b/po/de_DE.po +index 42caadc..07e96f6 100644 +--- a/po/de_DE.po ++++ b/po/de_DE.po +@@ -934,6 +934,9 @@ msgstr "Untertitel-Transparenz Vordergrund" + msgid "Setup.DVB$Subtitle background transparency" + msgstr "Untertitel-Transparenz Hintergrund" + ++msgid "Setup.DVB$Enable teletext support" ++msgstr "Videotext-Untersttzung aktivieren" ++ + msgid "LNB" + msgstr "LNB" + +diff --git a/po/el_GR.po b/po/el_GR.po +index 344b641..4206815 100644 +--- a/po/el_GR.po ++++ b/po/el_GR.po +@@ -934,6 +934,9 @@ msgstr "" + msgid "Setup.DVB$Subtitle background transparency" + msgstr "" + ++msgid "Setup.DVB$Enable teletext support" ++msgstr "" ++ + msgid "LNB" + msgstr "LNB" + +diff --git a/po/es_ES.po b/po/es_ES.po +index 4630a3b..a15e452 100644 +--- a/po/es_ES.po ++++ b/po/es_ES.po +@@ -935,6 +935,9 @@ msgstr "Transparencia primer plano subt + msgid "Setup.DVB$Subtitle background transparency" + msgstr "Transparencia fondo subttulos" + ++msgid "Setup.DVB$Enable teletext support" ++msgstr "" ++ + msgid "LNB" + msgstr "LNB" + +diff --git a/po/et_EE.po b/po/et_EE.po +index 803a539..f834e16 100644 +--- a/po/et_EE.po ++++ b/po/et_EE.po +@@ -934,6 +934,9 @@ msgstr "Subtiitri l + msgid "Setup.DVB$Subtitle background transparency" + msgstr "Subtiitri tausta lbipaistvus" + ++msgid "Setup.DVB$Enable teletext support" ++msgstr "Teleteksti tugi" ++ + msgid "LNB" + msgstr "LNB" + +diff --git a/po/fi_FI.po b/po/fi_FI.po +index 70e4d58..f07e5f7 100644 +--- a/po/fi_FI.po ++++ b/po/fi_FI.po +@@ -937,6 +937,9 @@ msgstr "Tekstityksen l + msgid "Setup.DVB$Subtitle background transparency" + msgstr "Tekstityksen taustan lpinkyvyys" + ++msgid "Setup.DVB$Enable teletext support" ++msgstr "Salli teksti-TV-tuki" ++ + msgid "LNB" + msgstr "LNB" + +diff --git a/po/fr_FR.po b/po/fr_FR.po +index 74d8ceb..9437bb4 100644 +--- a/po/fr_FR.po ++++ b/po/fr_FR.po +@@ -940,6 +940,9 @@ msgstr "Transparence de l'avant-plan" + msgid "Setup.DVB$Subtitle background transparency" + msgstr "Transparence du fond" + ++msgid "Setup.DVB$Enable teletext support" ++msgstr "" ++ + msgid "LNB" + msgstr "LNB" + +diff --git a/po/hr_HR.po b/po/hr_HR.po +index 55912e5..60f6483 100644 +--- a/po/hr_HR.po ++++ b/po/hr_HR.po +@@ -936,6 +936,9 @@ msgstr "Transparentnost titla" + msgid "Setup.DVB$Subtitle background transparency" + msgstr "Transparentnost pozadine titla" + ++msgid "Setup.DVB$Enable teletext support" ++msgstr "" ++ + msgid "LNB" + msgstr "LNB" + +diff --git a/po/hu_HU.po b/po/hu_HU.po +index ccc10cc..51e7c0f 100644 +--- a/po/hu_HU.po ++++ b/po/hu_HU.po +@@ -937,6 +937,9 @@ msgstr "Felirat transzparenci + msgid "Setup.DVB$Subtitle background transparency" + msgstr "Felirat htternek transzparencija" + ++msgid "Setup.DVB$Enable teletext support" ++msgstr "" ++ + msgid "LNB" + msgstr "LNB" + +diff --git a/po/it_IT.po b/po/it_IT.po +index c478284..25684ef 100644 +--- a/po/it_IT.po ++++ b/po/it_IT.po +@@ -941,6 +941,9 @@ msgstr "Trasparenza sottotitoli" + msgid "Setup.DVB$Subtitle background transparency" + msgstr "Trasparenza sfondo sottotitoli" + ++msgid "Setup.DVB$Enable teletext support" ++msgstr "" ++ + msgid "LNB" + msgstr "LNB" + +diff --git a/po/lt_LT.po b/po/lt_LT.po +index d79f03f..31b2457 100644 +--- a/po/lt_LT.po ++++ b/po/lt_LT.po +@@ -934,6 +934,9 @@ msgstr "Subtitrų priekinio vaizdo permatomumas" + msgid "Setup.DVB$Subtitle background transparency" + msgstr "Subtitrų fono permatomumas" + ++msgid "Setup.DVB$Enable teletext support" ++msgstr "" ++ + msgid "LNB" + msgstr "Konverteris (LNB)" + +diff --git a/po/nl_NL.po b/po/nl_NL.po +index f4d9120..e9a3679 100644 +--- a/po/nl_NL.po ++++ b/po/nl_NL.po +@@ -938,6 +938,9 @@ msgstr "Transparantie voorgrond ondertiteling" + msgid "Setup.DVB$Subtitle background transparency" + msgstr "Transparantie achtergrond ondertiteling" + ++msgid "Setup.DVB$Enable teletext support" ++msgstr "" ++ + msgid "LNB" + msgstr "LNB" + +diff --git a/po/nn_NO.po b/po/nn_NO.po +index e739b35..82b64be 100644 +--- a/po/nn_NO.po ++++ b/po/nn_NO.po +@@ -935,6 +935,9 @@ msgstr "" + msgid "Setup.DVB$Subtitle background transparency" + msgstr "" + ++msgid "Setup.DVB$Enable teletext support" ++msgstr "" ++ + msgid "LNB" + msgstr "LNB" + +diff --git a/po/pl_PL.po b/po/pl_PL.po +index 9af0227..83a4748 100644 +--- a/po/pl_PL.po ++++ b/po/pl_PL.po +@@ -935,6 +935,9 @@ msgstr "Prze + msgid "Setup.DVB$Subtitle background transparency" + msgstr "Przerocze podtytuw: To" + ++msgid "Setup.DVB$Enable teletext support" ++msgstr "" ++ + msgid "LNB" + msgstr "LNB" + +diff --git a/po/pt_PT.po b/po/pt_PT.po +index edea421..b1158e3 100644 +--- a/po/pt_PT.po ++++ b/po/pt_PT.po +@@ -934,6 +934,9 @@ msgstr "Transpar + msgid "Setup.DVB$Subtitle background transparency" + msgstr "Transparncia de background das legendas" + ++msgid "Setup.DVB$Enable teletext support" ++msgstr "" ++ + msgid "LNB" + msgstr "LNB" + +diff --git a/po/ro_RO.po b/po/ro_RO.po +index ffac7e9..32061de 100644 +--- a/po/ro_RO.po ++++ b/po/ro_RO.po +@@ -937,6 +937,9 @@ msgstr "Transparen + msgid "Setup.DVB$Subtitle background transparency" + msgstr "Transparena fundalului subtitrrii" + ++msgid "Setup.DVB$Enable teletext support" ++msgstr "" ++ + msgid "LNB" + msgstr "LNB" + +diff --git a/po/ru_RU.po b/po/ru_RU.po +index 4409394..0182ee7 100644 +--- a/po/ru_RU.po ++++ b/po/ru_RU.po +@@ -935,6 +935,9 @@ msgstr " + msgid "Setup.DVB$Subtitle background transparency" + msgstr " " + ++msgid "Setup.DVB$Enable teletext support" ++msgstr "" ++ + msgid "LNB" + msgstr "" + +diff --git a/po/sk_SK.po b/po/sk_SK.po +index bedb133..b240231 100644 +--- a/po/sk_SK.po ++++ b/po/sk_SK.po +@@ -935,6 +935,9 @@ msgstr "Prieh + msgid "Setup.DVB$Subtitle background transparency" + msgstr "Priehadnos pozadia titulkov" + ++msgid "Setup.DVB$Enable teletext support" ++msgstr "" ++ + msgid "LNB" + msgstr "LNB" + +diff --git a/po/sl_SI.po b/po/sl_SI.po +index 7f45b02..869d99b 100644 +--- a/po/sl_SI.po ++++ b/po/sl_SI.po +@@ -935,6 +935,9 @@ msgstr "Transparentnost podnapisov" + msgid "Setup.DVB$Subtitle background transparency" + msgstr "Transparentnost ozadja podnapisov" + ++msgid "Setup.DVB$Enable teletext support" ++msgstr "" ++ + msgid "LNB" + msgstr "LNB" + +diff --git a/po/sv_SE.po b/po/sv_SE.po +index 732e179..263c7ff 100644 +--- a/po/sv_SE.po ++++ b/po/sv_SE.po +@@ -937,6 +937,9 @@ msgstr "Transparent f + msgid "Setup.DVB$Subtitle background transparency" + msgstr "Transparent bakgrund textremsa" + ++msgid "Setup.DVB$Enable teletext support" ++msgstr "" ++ + msgid "LNB" + msgstr "LNB" + +diff --git a/po/tr_TR.po b/po/tr_TR.po +index 1a3382c..4e2c68f 100644 +--- a/po/tr_TR.po ++++ b/po/tr_TR.po +@@ -934,6 +934,9 @@ msgstr "Altyaz + msgid "Setup.DVB$Subtitle background transparency" + msgstr "Altyaz arka effaflk" + ++msgid "Setup.DVB$Enable teletext support" ++msgstr "" ++ + msgid "LNB" + msgstr "LNB" + +diff --git a/po/uk_UA.po b/po/uk_UA.po +index a373fb5..5cec5c1 100644 +--- a/po/uk_UA.po ++++ b/po/uk_UA.po +@@ -934,6 +934,9 @@ msgstr "Прозорість переднього плану субтитрів" + msgid "Setup.DVB$Subtitle background transparency" + msgstr "Прозорість заднього плану субтитрів" + ++msgid "Setup.DVB$Enable teletext support" ++msgstr "" ++ + msgid "LNB" + msgstr "Конвертер" + +diff --git a/po/zh_CN.po b/po/zh_CN.po +index 48c4a38..580c190 100644 +--- a/po/zh_CN.po ++++ b/po/zh_CN.po +@@ -937,6 +937,9 @@ msgstr "字幕前景透明度" + msgid "Setup.DVB$Subtitle background transparency" + msgstr "字幕背景透明度" + ++msgid "Setup.DVB$Enable teletext support" ++msgstr "" ++ + msgid "LNB" + msgstr "切换器设置" + +diff --git a/receiver.c b/receiver.c +index a2c6781..ed28f1b 100644 +--- a/receiver.c ++++ b/receiver.c +@@ -83,7 +83,7 @@ bool cReceiver::SetPids(const cChannel *Channel) + AddPids(Channel->Apids()) && + AddPids(Channel->Dpids()) && + AddPids(Channel->Spids()) && +- AddPid(Channel->Tpid()); ++ (!Setup.SupportTeletext || AddPid(Channel->Tpid())); + } + return true; + } +-- +1.7.0 + diff --git a/patches/patch-set.1.7.14/0003-Allow-manual-configuration-of-teletetxt-subtitle-pag.patch b/patches/patch-set.1.7.14/0003-Allow-manual-configuration-of-teletetxt-subtitle-pag.patch new file mode 100644 index 0000000..f90a658 --- /dev/null +++ b/patches/patch-set.1.7.14/0003-Allow-manual-configuration-of-teletetxt-subtitle-pag.patch @@ -0,0 +1,142 @@ +From 7bcbfa881c63c68e7c9bc35132891ae8d7929d75 Mon Sep 17 00:00:00 2001 +From: etobi +Date: Fri, 12 Feb 2010 21:56:41 +0100 +Subject: [PATCH 3/6] Allow manual configuration of teletetxt subtitle pages in channels.conf + +--- + channels.c | 53 ++++++++++++++++++++++++++++++++++++++++++++++++----- + channels.h | 1 + + vdr.5 | 7 +++++++ + 3 files changed, 56 insertions(+), 5 deletions(-) + +diff --git a/channels.c b/channels.c +index f0b8a13..878c5ef 100644 +--- a/channels.c ++++ b/channels.c +@@ -368,9 +368,9 @@ void cChannel::SetSubtitlingDescriptors(uchar *SubtitlingTypes, uint16_t *Compos + void cChannel::SetTeletextSubtitlePages(tTeletextSubtitlePage pages[], int numberOfPages) + { + int mod = CHANNELMOD_NONE; +- if (totalTtxtSubtitlePages != numberOfPages) ++ if (totalTtxtSubtitlePages != (fixedTtxtSubtitlePages + numberOfPages)) + mod |= CHANNELMOD_PIDS; +- totalTtxtSubtitlePages = 0; ++ totalTtxtSubtitlePages = fixedTtxtSubtitlePages; + for (int i = 0; (i < numberOfPages) && (totalTtxtSubtitlePages < MAXTXTPAGES); i++) { + if (teletextSubtitlePages[totalTtxtSubtitlePages].ttxtMagazine != pages[i].ttxtMagazine || + teletextSubtitlePages[totalTtxtSubtitlePages].ttxtPage != pages[i].ttxtPage || +@@ -513,11 +513,22 @@ cString cChannel::ToText(const cChannel *Channel) + q += IntArrayToString(q, Channel->dpids, 10, Channel->dlangs); + } + *q = 0; ++ const int TBufferSize = 5 + 1 + (MAXTXTPAGES * (3 + 1 + MAXLANGCODE1 + 1)) + 10; // '12345;150=deu,151=fin,...', +10: paranoia ++ char tpidbuf[TBufferSize]; ++ q = tpidbuf; ++ q += snprintf(q, sizeof(tpidbuf), "%d", Channel->tpid); ++ if (Channel->fixedTtxtSubtitlePages > 0) { ++ q += snprintf(q, sizeof(tpidbuf) - (q - tpidbuf), ";"); ++ for (int i = 0; i < Channel->fixedTtxtSubtitlePages; ++i) { ++ tTeletextSubtitlePage page = Channel->teletextSubtitlePages[i]; ++ q += snprintf(q, sizeof(tpidbuf) - (q - tpidbuf), "%d=%s", page.PageNumber(), page.ttxtLanguage); ++ } ++ } + char caidbuf[MAXCAIDS * 5 + 10]; // 5: 4 digits plus delimiting ',', 10: paranoia + q = caidbuf; + q += IntArrayToString(q, Channel->caids, 16); + *q = 0; +- buffer = cString::sprintf("%s:%d:%s:%s:%d:%s:%s:%d:%s:%d:%d:%d:%d\n", FullName, Channel->frequency, *Channel->parameters, *cSource::ToString(Channel->source), Channel->srate, vpidbuf, apidbuf, Channel->tpid, caidbuf, Channel->sid, Channel->nid, Channel->tid, Channel->rid); ++ buffer = cString::sprintf("%s:%d:%s:%s:%d:%s:%s:%s:%s:%d:%d:%d:%d\n", FullName, Channel->frequency, *Channel->parameters, *cSource::ToString(Channel->source), Channel->srate, vpidbuf, apidbuf, tpidbuf, caidbuf, Channel->sid, Channel->nid, Channel->tid, Channel->rid); + } + return buffer; + } +@@ -551,8 +562,9 @@ bool cChannel::Parse(const char *s) + char *parambuf = NULL; + char *vpidbuf = NULL; + char *apidbuf = NULL; ++ char *tpidbuf = NULL; + char *caidbuf = NULL; +- int fields = sscanf(s, "%a[^:]:%d :%a[^:]:%a[^:] :%d :%a[^:]:%a[^:]:%d :%a[^:]:%d :%d :%d :%d ", &namebuf, &frequency, ¶mbuf, &sourcebuf, &srate, &vpidbuf, &apidbuf, &tpid, &caidbuf, &sid, &nid, &tid, &rid); ++ int fields = sscanf(s, "%a[^:]:%d :%a[^:]:%a[^:] :%d :%a[^:]:%a[^:]:%a[^:]:%a[^:]:%d :%d :%d :%d ", &namebuf, &frequency, ¶mbuf, &sourcebuf, &srate, &vpidbuf, &apidbuf, &tpidbuf, &caidbuf, &sid, &nid, &tid, &rid); + if (fields >= 9) { + if (fields == 9) { + // allow reading of old format +@@ -635,7 +647,37 @@ bool cChannel::Parse(const char *s) + } + dpids[NumDpids] = 0; + } +- ++ if (tpidbuf) { ++ char *p; ++ fixedTtxtSubtitlePages = 0; ++ // 2001;150=deu,151=fin ++ if ((p = strchr(tpidbuf, ';')) != NULL) { ++ char *q, *strtok_next; ++ *p++ = 0; ++ while ((q = strtok_r(p, ",", &strtok_next)) != NULL) { ++ if (fixedTtxtSubtitlePages < MAXTXTPAGES) { ++ int page; ++ char *l = strchr(q, '='); ++ if (l) ++ *l++ = 0; ++ if (sscanf(q, "%d", &page) == 1) { ++ teletextSubtitlePages[fixedTtxtSubtitlePages] = tTeletextSubtitlePage(page); ++ if (l) ++ strn0cpy(teletextSubtitlePages[fixedTtxtSubtitlePages].ttxtLanguage, l, MAXLANGCODE1); ++ fixedTtxtSubtitlePages++; ++ } ++ else ++ esyslog("ERROR: invalid Teletext page!"); // no need to set ok to 'false' ++ } ++ else ++ esyslog("ERROR: too many Teletext pages!"); // no need to set ok to 'false' ++ p = NULL; ++ } ++ totalTtxtSubtitlePages = fixedTtxtSubtitlePages; ++ } ++ if (sscanf(tpidbuf, "%d", &tpid) != 1) ++ return false; ++ } + if (caidbuf) { + char *p = caidbuf; + char *q; +@@ -672,6 +714,7 @@ bool cChannel::Parse(const char *s) + free(sourcebuf); + free(vpidbuf); + free(apidbuf); ++ free(tpidbuf); + free(caidbuf); + free(namebuf); + if (!GetChannelID().Valid()) { +diff --git a/channels.h b/channels.h +index 905a9b4..be94422 100644 +--- a/channels.h ++++ b/channels.h +@@ -124,6 +124,7 @@ private: + uint16_t compositionPageIds[MAXSPIDS]; + uint16_t ancillaryPageIds[MAXSPIDS]; + int tpid; ++ int fixedTtxtSubtitlePages; + int totalTtxtSubtitlePages; + tTeletextSubtitlePage teletextSubtitlePages[MAXTXTPAGES]; + int caids[MAXCAIDS + 1]; // list is zero-terminated +diff --git a/vdr.5 b/vdr.5 +index dbef7dc..001dfc3 100644 +--- a/vdr.5 ++++ b/vdr.5 +@@ -207,6 +207,13 @@ can be indicated by adding a second language code, delimited by a '+' sign, as i + .TP + .B TPID + The teletext PID. ++ ++Fixed teletext subtitling pages can be defined separated by a semicolon. ++The pages (separated by commas) can contain ISO 639 language codes, delimited ++by a '=' sign, as in ++ ++.B ...:2001;150=deu,151=fin:... ++ + .TP + .B Conditional access + A hexadecimal integer defining how this channel can be accessed: +-- +1.7.0 + diff --git a/patches/patch-set.1.7.14/0004-Decrypt-teletext-stream.patch b/patches/patch-set.1.7.14/0004-Decrypt-teletext-stream.patch new file mode 100644 index 0000000..bb85adc --- /dev/null +++ b/patches/patch-set.1.7.14/0004-Decrypt-teletext-stream.patch @@ -0,0 +1,35 @@ +From 1f4d9228ae8b7b615c347acc3f5903fb038eb380 Mon Sep 17 00:00:00 2001 +From: etobi +Date: Sun, 14 Feb 2010 01:30:34 +0100 +Subject: [PATCH 4/6] Decrypt teletext stream + +--- + ci.c | 5 +++++ + 1 files changed, 5 insertions(+), 0 deletions(-) + +diff --git a/ci.c b/ci.c +index 6c7b031..22fda9f 100644 +--- a/ci.c ++++ b/ci.c +@@ -1911,6 +1911,8 @@ void cCamSlot::AddChannel(const cChannel *Channel) + AddPid(Channel->Sid(), *Apid, STREAM_TYPE_AUDIO); + for (const int *Dpid = Channel->Dpids(); *Dpid; Dpid++) + AddPid(Channel->Sid(), *Dpid, STREAM_TYPE_DOLBY); ++ if (Channel->Tpid() && Setup.SupportTeletext) ++ AddPid(Channel->Sid(), Channel->Tpid(), STREAM_TYPE_DOLBY); + } + } + +@@ -1932,6 +1934,9 @@ bool cCamSlot::CanDecrypt(const cChannel *Channel) + CaPmt.AddPid(*Apid, STREAM_TYPE_AUDIO); + for (const int *Dpid = Channel->Dpids(); *Dpid; Dpid++) + CaPmt.AddPid(*Dpid, STREAM_TYPE_DOLBY); ++ if (Channel->Tpid() && Setup.SupportTeletext) { ++ CaPmt.AddPid(Channel->Tpid(), STREAM_TYPE_DOLBY); // FIXME: STREAM_TYPE_DOLBY should probably be renamed STREAM_TYPE_PRIVATE ++ } + cas->SendPMT(&CaPmt); + cTimeMs Timeout(QUERY_REPLY_TIMEOUT); + do { +-- +1.7.0 + diff --git a/patches/patch-set.1.7.14/0005-Capture-teletext-subtitle-pages-from-PMT.patch b/patches/patch-set.1.7.14/0005-Capture-teletext-subtitle-pages-from-PMT.patch new file mode 100644 index 0000000..7446aed --- /dev/null +++ b/patches/patch-set.1.7.14/0005-Capture-teletext-subtitle-pages-from-PMT.patch @@ -0,0 +1,92 @@ +From 62912232e2b38a1857c0ff279bd61579b1ab85ae Mon Sep 17 00:00:00 2001 +From: etobi +Date: Fri, 12 Feb 2010 22:06:19 +0100 +Subject: [PATCH 5/6] Capture teletext subtitle pages from PMT + +--- + remux.c | 24 ++++++++++++++++++++++++ + remux.h | 5 +++++ + 2 files changed, 29 insertions(+), 0 deletions(-) + +diff --git a/remux.c b/remux.c +index 33b744a..31367a1 100644 +--- a/remux.c ++++ b/remux.c +@@ -431,6 +431,7 @@ void cPatPmtParser::Reset(void) + pmtPid = -1; + vpid = vtype = 0; + ppid = 0; ++ tpid = 0; + } + + void cPatPmtParser::ParsePat(const uchar *Data, int Length) +@@ -516,6 +517,7 @@ void cPatPmtParser::ParsePmt(const uchar *Data, int Length) + int NumSpids = 0; + vpid = vtype = 0; + ppid = 0; ++ tpid = 0; + apids[0] = 0; + dpids[0] = 0; + spids[0] = 0; +@@ -615,6 +617,28 @@ void cPatPmtParser::ParsePmt(const uchar *Data, int Length) + spids[NumSpids]= 0; + } + break; ++ case SI::TeletextDescriptorTag: { ++ dbgpatpmt(" teletext"); ++ tpid = stream.getPid(); ++ SI::TeletextDescriptor *sd = (SI::TeletextDescriptor *)d; ++ SI::TeletextDescriptor::Teletext ttxt; ++ if (totalTtxtSubtitlePages < MAXTXTPAGES) { ++ for (SI::Loop::Iterator it; sd->teletextLoop.getNext(ttxt, it); ) { ++ bool isSubtitlePage = (ttxt.getTeletextType() == 0x02) || (ttxt.getTeletextType() == 0x05); ++ if (isSubtitlePage && ttxt.languageCode[0]) { ++ dbgpatpmt(" '%s:%x.%x'", ttxt.languageCode, ttxt.getTeletextMagazineNumber(), ttxt.getTeletextPageNumber()); ++ strn0cpy(teletextSubtitlePages[totalTtxtSubtitlePages].ttxtLanguage, I18nNormalizeLanguageCode(ttxt.languageCode), MAXLANGCODE1); ++ teletextSubtitlePages[totalTtxtSubtitlePages].ttxtPage = ttxt.getTeletextPageNumber(); ++ teletextSubtitlePages[totalTtxtSubtitlePages].ttxtMagazine = ttxt.getTeletextMagazineNumber(); ++ teletextSubtitlePages[totalTtxtSubtitlePages].ttxtType = ttxt.getTeletextType(); ++ totalTtxtSubtitlePages++; ++ if (totalTtxtSubtitlePages >= MAXTXTPAGES) ++ break; ++ } ++ } ++ } ++ } ++ break; + case SI::ISO639LanguageDescriptorTag: { + SI::ISO639LanguageDescriptor *ld = (SI::ISO639LanguageDescriptor *)d; + dbgpatpmt(" '%s'", ld->languageCode); +diff --git a/remux.h b/remux.h +index 5ee6722..390236a 100644 +--- a/remux.h ++++ b/remux.h +@@ -216,6 +216,7 @@ private: + int vpid; + int ppid; + int vtype; ++ int tpid; + int apids[MAXAPIDS + 1]; // list is zero-terminated + int atypes[MAXAPIDS + 1]; // list is zero-terminated + char alangs[MAXAPIDS][MAXLANGCODE2]; +@@ -262,6 +263,9 @@ public: + int Vtype(void) const { return vtype; } + ///< Returns the video stream type as defined by the current PMT, or 0 if no video + ///< stream type has been detected, yet. ++ int Tpid(void) { return tpid; } ++ ///< Returns the teletext pid as defined by the current PMT, or 0 if no teletext ++ ///< pid has been detected, yet. + const int *Apids(void) const { return apids; } + const int *Dpids(void) const { return dpids; } + const int *Spids(void) const { return spids; } +@@ -276,6 +280,7 @@ public: + uchar SubtitlingType(int i) const { return (0 <= i && i < MAXSPIDS) ? subtitlingTypes[i] : uchar(0); } + uint16_t CompositionPageId(int i) const { return (0 <= i && i < MAXSPIDS) ? compositionPageIds[i] : uint16_t(0); } + uint16_t AncillaryPageId(int i) const { return (0 <= i && i < MAXSPIDS) ? ancillaryPageIds[i] : uint16_t(0); } ++ const tTeletextSubtitlePage* TeletextSubtitlePages() const { return teletextSubtitlePages; } + }; + + // TS to PES converter: +-- +1.7.0 + diff --git a/patches/patch-set.1.7.14/0006-Ttxtsubs-plugin-hook.patch b/patches/patch-set.1.7.14/0006-Ttxtsubs-plugin-hook.patch new file mode 100644 index 0000000..c0023cd --- /dev/null +++ b/patches/patch-set.1.7.14/0006-Ttxtsubs-plugin-hook.patch @@ -0,0 +1,256 @@ +From 2f325a640f1d71222d3d7082776b7e1c55489bbd Mon Sep 17 00:00:00 2001 +From: etobi +Date: Sat, 13 Feb 2010 00:28:21 +0100 +Subject: [PATCH 6/6] Ttxtsubs plugin hook + +--- + Makefile | 2 + + device.c | 20 ++++++++++++++++ + device.h | 1 + + pat.c | 6 +++++ + remux.h | 3 +- + vdrttxtsubshooks.c | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++ + vdrttxtsubshooks.h | 46 ++++++++++++++++++++++++++++++++++++++ + 7 files changed, 140 insertions(+), 1 deletions(-) + create mode 100644 vdrttxtsubshooks.c + create mode 100644 vdrttxtsubshooks.h + +diff --git a/Makefile b/Makefile +index 31f05b0..a45b189 100644 +--- a/Makefile ++++ b/Makefile +@@ -44,6 +44,8 @@ OBJS = audio.o channels.o ci.o config.o cutter.o device.o diseqc.o dvbdevice.o d + skinclassic.o skins.o skinsttng.o sourceparams.o sources.o spu.o status.o svdrp.o themes.o thread.o\ + timers.o tools.o transfer.o vdr.o videodir.o + ++OBJS += vdrttxtsubshooks.o ++ + ifndef NO_KBD + DEFINES += -DREMOTE_KBD + endif +diff --git a/device.c b/device.c +index ac4d6d4..773cf21 100644 +--- a/device.c ++++ b/device.c +@@ -18,6 +18,7 @@ + #include "receiver.h" + #include "status.h" + #include "transfer.h" ++#include "vdrttxtsubshooks.h" + + // --- cLiveSubtitle --------------------------------------------------------- + +@@ -1223,6 +1224,13 @@ int cDevice::PlayPesPacket(const uchar *Data, int Length, bool VideoOnly) + } + break; + case 0xBD: { // private stream 1 ++ // EBU Teletext data, ETSI EN 300 472 ++ // if PES data header length = 24 and data_identifier = 0x10..0x1F (EBU Data) ++ if (Data[8] == 0x24 && Data[45] >= 0x10 && Data[45] < 0x20) { ++ cVDRTtxtsubsHookListener::Hook()->PlayerTeletextData((uint8_t*)Data, Length); ++ break; ++ } ++ + int PayloadOffset = Data[8] + 9; + + // Compatibility mode for old subtitles plugin: +@@ -1382,6 +1390,7 @@ int cDevice::PlayTs(const uchar *Data, int Length, bool VideoOnly) + tsToPesVideo.Reset(); + tsToPesAudio.Reset(); + tsToPesSubtitle.Reset(); ++ tsToPesTeletext.Reset(); + } + else if (Length < TS_SIZE) { + esyslog("ERROR: skipped %d bytes of TS fragment", Length); +@@ -1427,6 +1436,17 @@ int cDevice::PlayTs(const uchar *Data, int Length, bool VideoOnly) + if (!VideoOnly || HasIBPTrickSpeed()) + PlayTsSubtitle(Data, TS_SIZE); + } ++ else if (Pid == patPmtParser.Tpid()) { ++ if (!VideoOnly || HasIBPTrickSpeed()) { ++ int l; ++ tsToPesTeletext.PutTs(Data, Length); ++ if (const uchar *p = tsToPesTeletext.GetPes(l)) { ++ if ((l > 45) && (p[0] == 0x00) && (p[1] == 0x00) && (p[2] == 0x01) && (p[3] == 0xbd) && (p[8] == 0x24) && (p[45] >= 0x10) && (p[45] < 0x20)) ++ cVDRTtxtsubsHookListener::Hook()->PlayerTeletextData((uchar *)p, l, false, patPmtParser.TeletextSubtitlePages(), patPmtParser.TotalTeletextSubtitlePages()); ++ tsToPesTeletext.Reset(); ++ } ++ } ++ } + } + } + else if (Pid == patPmtParser.Ppid()) { +diff --git a/device.h b/device.h +index 9ce814a..426dc8f 100644 +--- a/device.h ++++ b/device.h +@@ -519,6 +519,7 @@ private: + cTsToPes tsToPesVideo; + cTsToPes tsToPesAudio; + cTsToPes tsToPesSubtitle; ++ cTsToPes tsToPesTeletext; + bool isPlayingVideo; + protected: + const cPatPmtParser *PatPmtParser(void) const { return &patPmtParser; } +diff --git a/pat.c b/pat.c +index 684ba81..4541682 100644 +--- a/pat.c ++++ b/pat.c +@@ -13,6 +13,7 @@ + #include "libsi/section.h" + #include "libsi/descriptor.h" + #include "thread.h" ++#include "vdrttxtsubshooks.h" + + #define PMT_SCAN_TIMEOUT 10 // seconds + +@@ -496,6 +497,11 @@ void cPatFilter::Process(u_short Pid, u_char Tid, const u_char *Data, int Length + } + if (Setup.UpdateChannels >= 2) { + Channel->SetPids(Vpid, Ppid, Vtype, Apids, ALangs, Dpids, DLangs, Spids, SLangs, Tpid); ++ if (NumTPages < MAXTXTPAGES) { ++ int manualPageNumber = cVDRTtxtsubsHookListener::Hook()->ManualPageNumber(Channel); ++ if (manualPageNumber) ++ TeletextSubtitlePages[NumTPages++] = tTeletextSubtitlePage(manualPageNumber); ++ } + Channel->SetTeletextSubtitlePages(TeletextSubtitlePages, NumTPages); + Channel->SetCaIds(CaDescriptors->CaIds()); + Channel->SetSubtitlingDescriptors(SubtitlingTypes, CompositionPageIds, AncillaryPageIds); +diff --git a/remux.h b/remux.h +index 390236a..7bf712e 100644 +--- a/remux.h ++++ b/remux.h +@@ -280,7 +280,8 @@ public: + uchar SubtitlingType(int i) const { return (0 <= i && i < MAXSPIDS) ? subtitlingTypes[i] : uchar(0); } + uint16_t CompositionPageId(int i) const { return (0 <= i && i < MAXSPIDS) ? compositionPageIds[i] : uint16_t(0); } + uint16_t AncillaryPageId(int i) const { return (0 <= i && i < MAXSPIDS) ? ancillaryPageIds[i] : uint16_t(0); } +- const tTeletextSubtitlePage* TeletextSubtitlePages() const { return teletextSubtitlePages; } ++ const tTeletextSubtitlePage *TeletextSubtitlePages() const { return teletextSubtitlePages; } ++ int TotalTeletextSubtitlePages() const { return totalTtxtSubtitlePages; } + }; + + // TS to PES converter: +diff --git a/vdrttxtsubshooks.c b/vdrttxtsubshooks.c +new file mode 100644 +index 0000000..2471788 +--- /dev/null ++++ b/vdrttxtsubshooks.c +@@ -0,0 +1,63 @@ ++/* ++ * vdr-ttxtsubs - A plugin for the Linux Video Disk Recorder ++ * Copyright (c) 2003 - 2008 Ragnar Sundblad ++ * ++ * 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., ++ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ * ++ */ ++ ++#include ++#include ++#include ++ ++#include "vdrttxtsubshooks.h" ++ ++// XXX Really should be a list... ++static cVDRTtxtsubsHookListener *gListener; ++ ++// ------ class cVDRTtxtsubsHookProxy ------ ++ ++class cVDRTtxtsubsHookProxy : public cVDRTtxtsubsHookListener ++{ ++ public: ++ virtual void HideOSD(void) { if(gListener) gListener->HideOSD(); }; ++ virtual void ShowOSD(void) { if(gListener) gListener->ShowOSD(); }; ++ virtual void PlayerTeletextData(uint8_t *p, int length, bool IsPesRecording, const struct tTeletextSubtitlePage teletextSubtitlePages[] = NULL, int pageCount = 0) ++ { if(gListener) gListener->PlayerTeletextData(p, length, IsPesRecording, teletextSubtitlePages, pageCount); }; ++ virtual int ManualPageNumber(const cChannel *channel) ++ { if(gListener) return gListener->ManualPageNumber(channel); else return 0; }; ++}; ++ ++ ++// ------ class cVDRTtxtsubsHookListener ------ ++ ++cVDRTtxtsubsHookListener::~cVDRTtxtsubsHookListener() ++{ ++ gListener = 0; ++} ++ ++void cVDRTtxtsubsHookListener::HookAttach(void) ++{ ++ gListener = this; ++ //printf("cVDRTtxtsubsHookListener::HookAttach\n"); ++} ++ ++static cVDRTtxtsubsHookProxy gProxy; ++ ++cVDRTtxtsubsHookListener *cVDRTtxtsubsHookListener::Hook(void) ++{ ++ return &gProxy; ++} ++ +diff --git a/vdrttxtsubshooks.h b/vdrttxtsubshooks.h +new file mode 100644 +index 0000000..2f97969 +--- /dev/null ++++ b/vdrttxtsubshooks.h +@@ -0,0 +1,46 @@ ++/* ++ * vdr-ttxtsubs - A plugin for the Linux Video Disk Recorder ++ * Copyright (c) 2003 - 2008 Ragnar Sundblad ++ * ++ * 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., ++ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ * ++ */ ++ ++#ifndef __VDRTTXTSUBSHOOKS_H ++#define __VDRTTXTSUBSHOOKS_H ++ ++#define TTXTSUBSVERSNUM 2 ++ ++class cDevice; ++class cChannel; ++struct tTeletextSubtitlePage; ++ ++class cVDRTtxtsubsHookListener { ++ public: ++ cVDRTtxtsubsHookListener(void) {}; ++ virtual ~cVDRTtxtsubsHookListener(); ++ ++ void HookAttach(void); ++ ++ virtual void HideOSD(void) {}; ++ virtual void ShowOSD(void) {}; ++ virtual void PlayerTeletextData(uint8_t *p, int length, bool IsPesRecording = true, const struct tTeletextSubtitlePage teletextSubtitlePages[] = NULL, int pageCount = 0) {}; ++ virtual int ManualPageNumber(const cChannel *channel) { return 0; }; ++ ++ // used by VDR to call hook listeners ++ static cVDRTtxtsubsHookListener *Hook(void); ++}; ++ ++#endif +-- +1.7.0 + diff --git a/patches/vdr-1.7.12-ttxtsubs.patch b/patches/vdr-1.7.12-ttxtsubs.patch deleted file mode 100644 index bb49538..0000000 --- a/patches/vdr-1.7.12-ttxtsubs.patch +++ /dev/null @@ -1,1274 +0,0 @@ -diff --git a/MANUAL b/MANUAL -index 405f6a8..d1ce1f9 100644 ---- a/MANUAL -+++ b/MANUAL -@@ -721,6 +721,9 @@ Version 1.6 - background transparency. By default the values as broadcast - are used. - -+ Record Teletext Subtitles = no -+ If set to 'yes', teletext subtitles will be recorded. -+ - LNB: - - SLOF = 11700 The switching frequency (in MHz) between low and -diff --git a/Makefile b/Makefile -index 01408cb..b280030 100644 ---- a/Makefile -+++ b/Makefile -@@ -43,6 +43,8 @@ OBJS = audio.o channels.o ci.o config.o cutter.o device.o diseqc.o dvbdevice.o d - skinclassic.o skins.o skinsttng.o sources.o spu.o status.o svdrp.o themes.o thread.o\ - timers.o tools.o transfer.o vdr.o videodir.o - -+OBJS += vdrttxtsubshooks.o -+ - ifndef NO_KBD - DEFINES += -DREMOTE_KBD - endif -diff --git a/channels.c b/channels.c -index c14df19..197588c 100644 ---- a/channels.c -+++ b/channels.c -@@ -551,6 +551,26 @@ void cChannel::SetSubtitlingDescriptors(uchar *SubtitlingTypes, uint16_t *Compos - } - } - -+void cChannel::SetTeletextSubtitlePages(tTeletextSubtitlePage pages[], int numberOfPages) -+{ -+ int mod = CHANNELMOD_NONE; -+ if (totalTtxtSubtitlePages != numberOfPages) -+ mod |= CHANNELMOD_PIDS; -+ totalTtxtSubtitlePages = fixedTtxtSubtitlePages; -+ for (int i = 0; (i < numberOfPages) && (totalTtxtSubtitlePages < MAXTXTPAGES); i++) { -+ if (teletextSubtitlePages[totalTtxtSubtitlePages].ttxtMagazine != pages[i].ttxtMagazine || -+ teletextSubtitlePages[totalTtxtSubtitlePages].ttxtPage != pages[i].ttxtPage || -+ teletextSubtitlePages[totalTtxtSubtitlePages].ttxtType != pages[i].ttxtType || -+ strcmp(teletextSubtitlePages[totalTtxtSubtitlePages].ttxtLanguage, pages[i].ttxtLanguage)) { -+ mod |= CHANNELMOD_PIDS; -+ teletextSubtitlePages[totalTtxtSubtitlePages] = pages[i]; -+ } -+ totalTtxtSubtitlePages++; -+ } -+ modification |= mod; -+ Channels.SetModified(); -+} -+ - void cChannel::SetCaIds(const int *CaIds) - { - if (caids[0] && caids[0] <= CA_USER_MAX) -@@ -758,11 +778,22 @@ cString cChannel::ToText(const cChannel *Channel) - q += IntArrayToString(q, Channel->dpids, 10, Channel->dlangs); - } - *q = 0; -+ const int TBufferSize = 5 + 1 + (MAXTXTPAGES * (3 + 1 + MAXLANGCODE1 + 1)) + 10; // '12345;150=deu,151=fin,...', +10: paranoia -+ char tpidbuf[TBufferSize]; -+ q = tpidbuf; -+ q += snprintf(q, sizeof(tpidbuf), "%d", Channel->tpid); -+ if (Channel->fixedTtxtSubtitlePages > 0) { -+ q += snprintf(q, sizeof(tpidbuf) - (q - tpidbuf), ";"); -+ for (int i = 0; i < Channel->fixedTtxtSubtitlePages; ++i) { -+ tTeletextSubtitlePage page = Channel->teletextSubtitlePages[i]; -+ q += snprintf(q, sizeof(tpidbuf) - (q - tpidbuf), "%d=%s", page.PageNumber(), page.ttxtLanguage); -+ } -+ } - char caidbuf[MAXCAIDS * 5 + 10]; // 5: 4 digits plus delimiting ',', 10: paranoia - q = caidbuf; - q += IntArrayToString(q, Channel->caids, 16); - *q = 0; -- buffer = cString::sprintf("%s:%d:%s:%s:%d:%s:%s:%d:%s:%d:%d:%d:%d\n", FullName, Channel->frequency, *Channel->ParametersToString(), *cSource::ToString(Channel->source), Channel->srate, vpidbuf, apidbuf, Channel->tpid, caidbuf, Channel->sid, Channel->nid, Channel->tid, Channel->rid); -+ buffer = cString::sprintf("%s:%d:%s:%s:%d:%s:%s:%s:%s:%d:%d:%d:%d\n", FullName, Channel->frequency, *Channel->ParametersToString(), *cSource::ToString(Channel->source), Channel->srate, vpidbuf, apidbuf, tpidbuf, caidbuf, Channel->sid, Channel->nid, Channel->tid, Channel->rid); - } - return buffer; - } -@@ -796,8 +827,9 @@ bool cChannel::Parse(const char *s) - char *parambuf = NULL; - char *vpidbuf = NULL; - char *apidbuf = NULL; -+ char *tpidbuf = NULL; - char *caidbuf = NULL; -- int fields = sscanf(s, "%a[^:]:%d :%a[^:]:%a[^:] :%d :%a[^:]:%a[^:]:%d :%a[^:]:%d :%d :%d :%d ", &namebuf, &frequency, ¶mbuf, &sourcebuf, &srate, &vpidbuf, &apidbuf, &tpid, &caidbuf, &sid, &nid, &tid, &rid); -+ int fields = sscanf(s, "%a[^:]:%d :%a[^:]:%a[^:] :%d :%a[^:]:%a[^:]:%a[^:]:%a[^:]:%d :%d :%d :%d ", &namebuf, &frequency, ¶mbuf, &sourcebuf, &srate, &vpidbuf, &apidbuf, &tpidbuf, &caidbuf, &sid, &nid, &tid, &rid); - if (fields >= 9) { - if (fields == 9) { - // allow reading of old format -@@ -879,7 +911,37 @@ bool cChannel::Parse(const char *s) - } - dpids[NumDpids] = 0; - } -- -+ if (tpidbuf) { -+ char *p; -+ fixedTtxtSubtitlePages = 0; -+ // 2001;150=deu,151=fin -+ if ((p = strchr(tpidbuf, ';')) != NULL) { -+ char *q, *strtok_next; -+ *p++ = 0; -+ while ((q = strtok_r(p, ",", &strtok_next)) != NULL) { -+ if (fixedTtxtSubtitlePages < MAXTXTPAGES) { -+ int page; -+ char *l = strchr(q, '='); -+ if (l) -+ *l++ = 0; -+ if (sscanf(q, "%d", &page) == 1) { -+ teletextSubtitlePages[fixedTtxtSubtitlePages] = tTeletextSubtitlePage(page); -+ if (l) -+ strn0cpy(teletextSubtitlePages[fixedTtxtSubtitlePages].ttxtLanguage, l, MAXLANGCODE1); -+ fixedTtxtSubtitlePages++; -+ } -+ else -+ esyslog("ERROR: invalid Teletext page!"); // no need to set ok to 'false' -+ } -+ else -+ esyslog("ERROR: too many Teletext pages!"); // no need to set ok to 'false' -+ p = NULL; -+ } -+ totalTtxtSubtitlePages = fixedTtxtSubtitlePages; -+ } -+ if (sscanf(tpidbuf, "%d", &tpid) != 1) -+ return false; -+ } - if (caidbuf) { - char *p = caidbuf; - char *q; -@@ -916,6 +978,7 @@ bool cChannel::Parse(const char *s) - free(sourcebuf); - free(vpidbuf); - free(apidbuf); -+ free(tpidbuf); - free(caidbuf); - free(namebuf); - if (!GetChannelID().Valid()) { -diff --git a/channels.h b/channels.h -index b465f6a..897c8cd 100644 ---- a/channels.h -+++ b/channels.h -@@ -35,6 +35,7 @@ - #define MAXDPIDS 16 // dolby (AC3 + DTS) - #define MAXSPIDS 32 // subtitles - #define MAXCAIDS 8 // conditional access -+#define MAXTXTPAGES 8 // teletext pages - - #define MAXLANGCODE1 4 // a 3 letter language code, zero terminated - #define MAXLANGCODE2 8 // up to two 3 letter language codes, separated by '+' and zero terminated -@@ -92,6 +93,16 @@ public: - static const tChannelID InvalidID; - }; - -+struct tTeletextSubtitlePage { -+ tTeletextSubtitlePage(void) { ttxtPage = ttxtMagazine = 0; ttxtType = 0x02; strcpy(ttxtLanguage, "und"); } -+ tTeletextSubtitlePage(int page) { ttxtMagazine = (page / 100) & 0x7; ttxtPage = (((page % 100) / 10) << 4) + (page % 10); ttxtType = 0x02; strcpy(ttxtLanguage, "und"); } -+ char ttxtLanguage[MAXLANGCODE1]; -+ uchar ttxtPage; -+ uchar ttxtMagazine; -+ uchar ttxtType; -+ int PageNumber(void) const { return BCDCHARTOINT(ttxtMagazine) * 100 + BCDCHARTOINT(ttxtPage); } -+ }; -+ - class cChannel; - - class cLinkChannel : public cListObject { -@@ -133,6 +144,9 @@ private: - uint16_t compositionPageIds[MAXSPIDS]; - uint16_t ancillaryPageIds[MAXSPIDS]; - int tpid; -+ int fixedTtxtSubtitlePages; -+ int totalTtxtSubtitlePages; -+ tTeletextSubtitlePage teletextSubtitlePages[MAXTXTPAGES]; - int caids[MAXCAIDS + 1]; // list is zero-terminated - int nid; - int tid; -@@ -192,6 +206,8 @@ public: - uint16_t CompositionPageId(int i) const { return (0 <= i && i < MAXSPIDS) ? compositionPageIds[i] : uint16_t(0); } - uint16_t AncillaryPageId(int i) const { return (0 <= i && i < MAXSPIDS) ? ancillaryPageIds[i] : uint16_t(0); } - int Tpid(void) const { return tpid; } -+ const tTeletextSubtitlePage *TeletextSubtitlePages() const { return teletextSubtitlePages; } -+ int TotalTeletextSubtitlePages() const { return totalTtxtSubtitlePages; } - const int *Caids(void) const { return caids; } - int Ca(int Index = 0) const { return Index < MAXCAIDS ? caids[Index] : 0; } - int Nid(void) const { return nid; } -@@ -228,6 +244,7 @@ public: - void SetName(const char *Name, const char *ShortName, const char *Provider); - void SetPortalName(const char *PortalName); - void SetPids(int Vpid, int Ppid, int Vtype, int *Apids, char ALangs[][MAXLANGCODE2], int *Dpids, char DLangs[][MAXLANGCODE2], int *Spids, char SLangs[][MAXLANGCODE2], int Tpid); -+ void SetTeletextSubtitlePages(tTeletextSubtitlePage pages[], int numberOfPages); - void SetCaIds(const int *CaIds); // list must be zero-terminated - void SetCaDescriptors(int Level); - void SetLinkChannels(cLinkChannels *LinkChannels); -diff --git a/ci.c b/ci.c -index 6c7b031..22fda9f 100644 ---- a/ci.c -+++ b/ci.c -@@ -1911,6 +1911,8 @@ void cCamSlot::AddChannel(const cChannel *Channel) - AddPid(Channel->Sid(), *Apid, STREAM_TYPE_AUDIO); - for (const int *Dpid = Channel->Dpids(); *Dpid; Dpid++) - AddPid(Channel->Sid(), *Dpid, STREAM_TYPE_DOLBY); -+ if (Channel->Tpid() && Setup.SupportTeletext) -+ AddPid(Channel->Sid(), Channel->Tpid(), STREAM_TYPE_DOLBY); - } - } - -@@ -1932,6 +1934,9 @@ bool cCamSlot::CanDecrypt(const cChannel *Channel) - CaPmt.AddPid(*Apid, STREAM_TYPE_AUDIO); - for (const int *Dpid = Channel->Dpids(); *Dpid; Dpid++) - CaPmt.AddPid(*Dpid, STREAM_TYPE_DOLBY); -+ if (Channel->Tpid() && Setup.SupportTeletext) { -+ CaPmt.AddPid(Channel->Tpid(), STREAM_TYPE_DOLBY); // FIXME: STREAM_TYPE_DOLBY should probably be renamed STREAM_TYPE_PRIVATE -+ } - cas->SendPMT(&CaPmt); - cTimeMs Timeout(QUERY_REPLY_TIMEOUT); - do { -diff --git a/config.c b/config.c -index acdf4c4..29377d9 100644 ---- a/config.c -+++ b/config.c -@@ -333,6 +333,7 @@ cSetup::cSetup(void) - MarginStop = 10; - AudioLanguages[0] = -1; - DisplaySubtitles = 0; -+ SupportTeletext = 0; - SubtitleLanguages[0] = -1; - SubtitleOffset = 0; - SubtitleFgTransparency = 0; -@@ -521,6 +522,7 @@ bool cSetup::Parse(const char *Name, const char *Value) - else if (!strcasecmp(Name, "MarginStop")) MarginStop = atoi(Value); - else if (!strcasecmp(Name, "AudioLanguages")) return ParseLanguages(Value, AudioLanguages); - else if (!strcasecmp(Name, "DisplaySubtitles")) DisplaySubtitles = atoi(Value); -+ else if (!strcasecmp(Name, "SupportTeletext")) SupportTeletext = atoi(Value); - else if (!strcasecmp(Name, "SubtitleLanguages")) return ParseLanguages(Value, SubtitleLanguages); - else if (!strcasecmp(Name, "SubtitleOffset")) SubtitleOffset = atoi(Value); - else if (!strcasecmp(Name, "SubtitleFgTransparency")) SubtitleFgTransparency = atoi(Value); -@@ -614,6 +616,7 @@ bool cSetup::Save(void) - Store("MarginStop", MarginStop); - StoreLanguages("AudioLanguages", AudioLanguages); - Store("DisplaySubtitles", DisplaySubtitles); -+ Store("SupportTeletext", SupportTeletext); - StoreLanguages("SubtitleLanguages", SubtitleLanguages); - Store("SubtitleOffset", SubtitleOffset); - Store("SubtitleFgTransparency", SubtitleFgTransparency); -diff --git a/config.h b/config.h -index be1d7bd..e7b094d 100644 ---- a/config.h -+++ b/config.h -@@ -235,6 +235,7 @@ public: - int MarginStart, MarginStop; - int AudioLanguages[I18N_MAX_LANGUAGES + 1]; - int DisplaySubtitles; -+ int SupportTeletext; - int SubtitleLanguages[I18N_MAX_LANGUAGES + 1]; - int SubtitleOffset; - int SubtitleFgTransparency, SubtitleBgTransparency; -diff --git a/device.c b/device.c -index cb31b83..fb4c655 100644 ---- a/device.c -+++ b/device.c -@@ -18,6 +18,7 @@ - #include "receiver.h" - #include "status.h" - #include "transfer.h" -+#include "vdrttxtsubshooks.h" - - // --- cLiveSubtitle --------------------------------------------------------- - -@@ -1190,6 +1191,13 @@ int cDevice::PlayPesPacket(const uchar *Data, int Length, bool VideoOnly) - } - break; - case 0xBD: { // private stream 1 -+ // EBU Teletext data, ETSI EN 300 472 -+ // if PES data header length = 24 and data_identifier = 0x10..0x1F (EBU Data) -+ if (Data[8] == 0x24 && Data[45] >= 0x10 && Data[45] < 0x20) { -+ cVDRTtxtsubsHookListener::Hook()->PlayerTeletextData((uint8_t*)Data, Length); -+ break; -+ } -+ - int PayloadOffset = Data[8] + 9; - - // Compatibility mode for old subtitles plugin: -@@ -1349,6 +1357,7 @@ int cDevice::PlayTs(const uchar *Data, int Length, bool VideoOnly) - tsToPesVideo.Reset(); - tsToPesAudio.Reset(); - tsToPesSubtitle.Reset(); -+ tsToPesTeletext.Reset(); - } - else if (Length < TS_SIZE) { - esyslog("ERROR: skipped %d bytes of TS fragment", Length); -@@ -1394,6 +1403,17 @@ int cDevice::PlayTs(const uchar *Data, int Length, bool VideoOnly) - if (!VideoOnly || HasIBPTrickSpeed()) - PlayTsSubtitle(Data, TS_SIZE); - } -+ else if (Pid == patPmtParser.Tpid()) { -+ if (!VideoOnly || HasIBPTrickSpeed()) { -+ int l; -+ tsToPesTeletext.PutTs(Data, Length); -+ if (const uchar *p = tsToPesTeletext.GetPes(l)) { -+ if ((l > 45) && (p[0] == 0x00) && (p[1] == 0x00) && (p[2] == 0x01) && (p[3] == 0xbd) && (p[8] == 0x24) && (p[45] >= 0x10) && (p[45] < 0x20)) -+ cVDRTtxtsubsHookListener::Hook()->PlayerTeletextData((uchar *)p, l, false, patPmtParser.TeletextSubtitlePages(), patPmtParser.TotalTeletextSubtitlePages()); -+ tsToPesTeletext.Reset(); -+ } -+ } -+ } - } - } - else if (Pid == patPmtParser.Ppid()) { -diff --git a/device.h b/device.h -index 897de2a..2e36351 100644 ---- a/device.h -+++ b/device.h -@@ -499,6 +499,7 @@ private: - cTsToPes tsToPesVideo; - cTsToPes tsToPesAudio; - cTsToPes tsToPesSubtitle; -+ cTsToPes tsToPesTeletext; - bool isPlayingVideo; - protected: - const cPatPmtParser *PatPmtParser(void) const { return &patPmtParser; } -diff --git a/menu.c b/menu.c -index 7ddf0cf..35fa9c3 100644 ---- a/menu.c -+++ b/menu.c -@@ -2790,6 +2790,7 @@ void cMenuSetupDVB::Setup(void) - Add(new cMenuEditIntItem( tr("Setup.DVB$Subtitle foreground transparency"), &data.SubtitleFgTransparency, 0, 9)); - Add(new cMenuEditIntItem( tr("Setup.DVB$Subtitle background transparency"), &data.SubtitleBgTransparency, 0, 10)); - } -+ Add(new cMenuEditBoolItem(tr("Setup.DVB$Enable teletext support"), &data.SupportTeletext)); - - SetCurrent(Get(current)); - Display(); -diff --git a/pat.c b/pat.c -index 9b3ded6..c6e7834 100644 ---- a/pat.c -+++ b/pat.c -@@ -13,6 +13,7 @@ - #include "libsi/section.h" - #include "libsi/descriptor.h" - #include "thread.h" -+#include "vdrttxtsubshooks.h" - - #define PMT_SCAN_TIMEOUT 10 // seconds - -@@ -341,6 +342,8 @@ void cPatFilter::Process(u_short Pid, u_char Tid, const u_char *Data, int Length - char DLangs[MAXDPIDS][MAXLANGCODE2] = { "" }; - char SLangs[MAXSPIDS][MAXLANGCODE2] = { "" }; - int Tpid = 0; -+ tTeletextSubtitlePage TeletextSubtitlePages[MAXTXTPAGES]; -+ int NumTPages = 0; - int NumApids = 0; - int NumDpids = 0; - int NumSpids = 0; -@@ -426,8 +429,21 @@ void cPatFilter::Process(u_short Pid, u_char Tid, const u_char *Data, int Length - NumSpids++; - } - break; -- case SI::TeletextDescriptorTag: -+ case SI::TeletextDescriptorTag: { - Tpid = esPid; -+ SI::TeletextDescriptor *sd = (SI::TeletextDescriptor *)d; -+ SI::TeletextDescriptor::Teletext ttxt; -+ for (SI::Loop::Iterator it; sd->teletextLoop.getNext(ttxt, it); ) { -+ bool isSubtitlePage = (ttxt.getTeletextType() == 0x02) || (ttxt.getTeletextType() == 0x05); -+ if ((NumTPages < MAXTXTPAGES) && ttxt.languageCode[0] && isSubtitlePage) { -+ strn0cpy(TeletextSubtitlePages[NumTPages].ttxtLanguage, I18nNormalizeLanguageCode(ttxt.languageCode), MAXLANGCODE1); -+ TeletextSubtitlePages[NumTPages].ttxtPage = ttxt.getTeletextPageNumber(); -+ TeletextSubtitlePages[NumTPages].ttxtMagazine = ttxt.getTeletextMagazineNumber(); -+ TeletextSubtitlePages[NumTPages].ttxtType = ttxt.getTeletextType(); -+ NumTPages++; -+ } -+ } -+ } - break; - case SI::ISO639LanguageDescriptorTag: { - SI::ISO639LanguageDescriptor *ld = (SI::ISO639LanguageDescriptor *)d; -@@ -458,6 +474,12 @@ void cPatFilter::Process(u_short Pid, u_char Tid, const u_char *Data, int Length - } - if (Setup.UpdateChannels >= 2) { - Channel->SetPids(Vpid, Ppid, Vtype, Apids, ALangs, Dpids, DLangs, Spids, SLangs, Tpid); -+ if (NumTPages < MAXTXTPAGES) { -+ int manualPageNumber = cVDRTtxtsubsHookListener::Hook()->ManualPageNumber(Channel); -+ if (manualPageNumber) -+ TeletextSubtitlePages[NumTPages++] = tTeletextSubtitlePage(manualPageNumber); -+ } -+ Channel->SetTeletextSubtitlePages(TeletextSubtitlePages, NumTPages); - Channel->SetCaIds(CaDescriptors->CaIds()); - Channel->SetSubtitlingDescriptors(SubtitlingTypes, CompositionPageIds, AncillaryPageIds); - } -diff --git a/po/ca_ES.po b/po/ca_ES.po -index fcdf672..cc137c0 100644 ---- a/po/ca_ES.po -+++ b/po/ca_ES.po -@@ -10,7 +10,7 @@ msgid "" - msgstr "" - "Project-Id-Version: VDR 1.6.0\n" - "Report-Msgid-Bugs-To: \n" --"POT-Creation-Date: 2010-01-17 16:18+0100\n" -+"POT-Creation-Date: 2010-02-14 17:47+0100\n" - "PO-Revision-Date: 2008-03-02 19:02+0100\n" - "Last-Translator: Luca Olivetti \n" - "Language-Team: Catalanian\n" -@@ -934,6 +934,9 @@ msgstr "Transpar - msgid "Setup.DVB$Subtitle background transparency" - msgstr "Transparncia fons subttols" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "" -+ - msgid "LNB" - msgstr "Configuraci de l'LNB" - -diff --git a/po/cs_CZ.po b/po/cs_CZ.po -index 3bbd6eb..9802516 100644 ---- a/po/cs_CZ.po -+++ b/po/cs_CZ.po -@@ -8,7 +8,7 @@ msgid "" - msgstr "" - "Project-Id-Version: VDR 1.6.0\n" - "Report-Msgid-Bugs-To: \n" --"POT-Creation-Date: 2010-01-17 16:18+0100\n" -+"POT-Creation-Date: 2010-02-14 17:47+0100\n" - "PO-Revision-Date: 2008-02-28 15:00+0200\n" - "Last-Translator: Vladimr Brta , Ji Dobr \n" - "Language-Team: Czech\n" -@@ -932,6 +932,9 @@ msgstr "Pr - msgid "Setup.DVB$Subtitle background transparency" - msgstr "Prhlednost pozad titulk" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "" -+ - msgid "LNB" - msgstr "LNB" - -diff --git a/po/da_DK.po b/po/da_DK.po -index fbad909..740486d 100644 ---- a/po/da_DK.po -+++ b/po/da_DK.po -@@ -7,7 +7,7 @@ msgid "" - msgstr "" - "Project-Id-Version: VDR 1.6.0\n" - "Report-Msgid-Bugs-To: \n" --"POT-Creation-Date: 2010-01-17 16:18+0100\n" -+"POT-Creation-Date: 2010-02-14 17:47+0100\n" - "PO-Revision-Date: 2007-08-12 14:17+0200\n" - "Last-Translator: Mogens Elneff \n" - "Language-Team: Danish\n" -@@ -931,6 +931,9 @@ msgstr "Undertekst forgrundsgennemsigtighed" - msgid "Setup.DVB$Subtitle background transparency" - msgstr "Undertekst baggrundsgennemsigtighed" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "" -+ - msgid "LNB" - msgstr "LNB" - -diff --git a/po/de_DE.po b/po/de_DE.po -index ad6401b..8e93111 100644 ---- a/po/de_DE.po -+++ b/po/de_DE.po -@@ -7,8 +7,8 @@ msgid "" - msgstr "" - "Project-Id-Version: VDR 1.6.0\n" - "Report-Msgid-Bugs-To: \n" --"POT-Creation-Date: 2010-01-17 16:18+0100\n" --"PO-Revision-Date: 2010-01-16 16:46+0100\n" -+"POT-Creation-Date: 2010-02-14 17:47+0100\n" -+"PO-Revision-Date: 2010-02-14 17:50+0100\n" - "Last-Translator: Klaus Schmidinger \n" - "Language-Team: German\n" - "MIME-Version: 1.0\n" -@@ -931,6 +931,9 @@ msgstr "Untertitel-Transparenz Vordergrund" - msgid "Setup.DVB$Subtitle background transparency" - msgstr "Untertitel-Transparenz Hintergrund" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "Videotext-Untersttzung aktivieren" -+ - msgid "LNB" - msgstr "LNB" - -diff --git a/po/el_GR.po b/po/el_GR.po -index e8382b8..72d966a 100644 ---- a/po/el_GR.po -+++ b/po/el_GR.po -@@ -7,7 +7,7 @@ msgid "" - msgstr "" - "Project-Id-Version: VDR 1.6.0\n" - "Report-Msgid-Bugs-To: \n" --"POT-Creation-Date: 2010-01-17 16:18+0100\n" -+"POT-Creation-Date: 2010-02-14 17:47+0100\n" - "PO-Revision-Date: 2007-08-12 14:17+0200\n" - "Last-Translator: Dimitrios Dimitrakos \n" - "Language-Team: Greek\n" -@@ -931,6 +931,9 @@ msgstr "" - msgid "Setup.DVB$Subtitle background transparency" - msgstr "" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "" -+ - msgid "LNB" - msgstr "LNB" - -diff --git a/po/es_ES.po b/po/es_ES.po -index d2bf5b0..0eb591e 100644 ---- a/po/es_ES.po -+++ b/po/es_ES.po -@@ -8,7 +8,7 @@ msgid "" - msgstr "" - "Project-Id-Version: VDR 1.6.0\n" - "Report-Msgid-Bugs-To: \n" --"POT-Creation-Date: 2010-01-17 16:18+0100\n" -+"POT-Creation-Date: 2010-02-14 17:47+0100\n" - "PO-Revision-Date: 2008-03-02 19:02+0100\n" - "Last-Translator: Luca Olivetti \n" - "Language-Team: Spanish\n" -@@ -932,6 +932,9 @@ msgstr "Transparencia primer plano subt - msgid "Setup.DVB$Subtitle background transparency" - msgstr "Transparencia fondo subttulos" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "" -+ - msgid "LNB" - msgstr "LNB" - -diff --git a/po/et_EE.po b/po/et_EE.po -index 97e2aee..4190c63 100644 ---- a/po/et_EE.po -+++ b/po/et_EE.po -@@ -7,7 +7,7 @@ msgid "" - msgstr "" - "Project-Id-Version: VDR 1.6.0\n" - "Report-Msgid-Bugs-To: \n" --"POT-Creation-Date: 2010-01-17 16:18+0100\n" -+"POT-Creation-Date: 2010-02-14 17:47+0100\n" - "PO-Revision-Date: 2007-08-12 14:17+0200\n" - "Last-Translator: Arthur Konovalov \n" - "Language-Team: Estonian\n" -@@ -931,6 +931,9 @@ msgstr "Subtiitri l - msgid "Setup.DVB$Subtitle background transparency" - msgstr "Subtiitri tausta lbipaistvus" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "Teleteksti tugi" -+ - msgid "LNB" - msgstr "LNB" - -diff --git a/po/fi_FI.po b/po/fi_FI.po -index 916b51e..034de64 100644 ---- a/po/fi_FI.po -+++ b/po/fi_FI.po -@@ -10,7 +10,7 @@ msgid "" - msgstr "" - "Project-Id-Version: VDR 1.6.0\n" - "Report-Msgid-Bugs-To: \n" --"POT-Creation-Date: 2010-01-17 16:18+0100\n" -+"POT-Creation-Date: 2010-02-14 17:47+0100\n" - "PO-Revision-Date: 2007-08-15 15:52+0200\n" - "Last-Translator: Rolf Ahrenberg \n" - "Language-Team: Finnish\n" -@@ -934,6 +934,9 @@ msgstr "Tekstityksen l - msgid "Setup.DVB$Subtitle background transparency" - msgstr "Tekstityksen taustan lpinkyvyys" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "Salli teksti-TV-tuki" -+ - msgid "LNB" - msgstr "LNB" - -diff --git a/po/fr_FR.po b/po/fr_FR.po -index 4c4dcce..dc35127 100644 ---- a/po/fr_FR.po -+++ b/po/fr_FR.po -@@ -13,7 +13,7 @@ msgid "" - msgstr "" - "Project-Id-Version: VDR 1.6.0\n" - "Report-Msgid-Bugs-To: \n" --"POT-Creation-Date: 2010-01-17 16:18+0100\n" -+"POT-Creation-Date: 2010-02-14 17:47+0100\n" - "PO-Revision-Date: 2008-02-27 18:14+0100\n" - "Last-Translator: Jean-Claude Repetto \n" - "Language-Team: French\n" -@@ -937,6 +937,9 @@ msgstr "Transparence de l'avant-plan" - msgid "Setup.DVB$Subtitle background transparency" - msgstr "Transparence du fond" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "" -+ - msgid "LNB" - msgstr "LNB" - -diff --git a/po/hr_HR.po b/po/hr_HR.po -index b7cf5a0..b04cbb5 100644 ---- a/po/hr_HR.po -+++ b/po/hr_HR.po -@@ -9,7 +9,7 @@ msgid "" - msgstr "" - "Project-Id-Version: VDR 1.6.0\n" - "Report-Msgid-Bugs-To: \n" --"POT-Creation-Date: 2010-01-17 16:18+0100\n" -+"POT-Creation-Date: 2010-02-14 17:47+0100\n" - "PO-Revision-Date: 2008-03-17 19:00+0100\n" - "Last-Translator: Adrian Caval \n" - "Language-Team: Croatian\n" -@@ -933,6 +933,9 @@ msgstr "Transparentnost titla" - msgid "Setup.DVB$Subtitle background transparency" - msgstr "Transparentnost pozadine titla" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "" -+ - msgid "LNB" - msgstr "LNB" - -diff --git a/po/hu_HU.po b/po/hu_HU.po -index d09c8dd..570efbb 100644 ---- a/po/hu_HU.po -+++ b/po/hu_HU.po -@@ -10,7 +10,7 @@ msgid "" - msgstr "" - "Project-Id-Version: VDR 1.6.0\n" - "Report-Msgid-Bugs-To: \n" --"POT-Creation-Date: 2010-01-17 16:18+0100\n" -+"POT-Creation-Date: 2010-02-14 17:47+0100\n" - "PO-Revision-Date: 2007-12-01 21:42+0200\n" - "Last-Translator: Istvn Fley \n" - "Language-Team: Hungarian\n" -@@ -934,6 +934,9 @@ msgstr "Felirat transzparenci - msgid "Setup.DVB$Subtitle background transparency" - msgstr "Felirat htternek transzparencija" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "" -+ - msgid "LNB" - msgstr "LNB" - -diff --git a/po/it_IT.po b/po/it_IT.po -index 3a8f2e2..48d9f14 100644 ---- a/po/it_IT.po -+++ b/po/it_IT.po -@@ -11,7 +11,7 @@ msgid "" - msgstr "" - "Project-Id-Version: VDR 1.6.0\n" - "Report-Msgid-Bugs-To: \n" --"POT-Creation-Date: 2010-01-17 16:18+0100\n" -+"POT-Creation-Date: 2010-02-14 17:47+0100\n" - "PO-Revision-Date: 2010-01-12 23:53+0100\n" - "Last-Translator: Diego Pierotto \n" - "Language-Team: Italian\n" -@@ -938,6 +938,9 @@ msgstr "Trasparenza sottotitoli" - msgid "Setup.DVB$Subtitle background transparency" - msgstr "Trasparenza sfondo sottotitoli" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "" -+ - msgid "LNB" - msgstr "LNB" - -diff --git a/po/lt_LT.po b/po/lt_LT.po -index 93583c5..a9370f5 100644 ---- a/po/lt_LT.po -+++ b/po/lt_LT.po -@@ -7,7 +7,7 @@ msgid "" - msgstr "" - "Project-Id-Version: VDR 1.7.9\n" - "Report-Msgid-Bugs-To: \n" --"POT-Creation-Date: 2010-01-17 16:18+0100\n" -+"POT-Creation-Date: 2010-02-14 17:47+0100\n" - "PO-Revision-Date: 2009-10-17 14:19+0200\n" - "Last-Translator: Valdemaras Pipiras \n" - "Language-Team: Lithuanian\n" -@@ -931,6 +931,9 @@ msgstr "Subtitrų priekinio vaizdo permatomumas" - msgid "Setup.DVB$Subtitle background transparency" - msgstr "Subtitrų fono permatomumas" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "" -+ - msgid "LNB" - msgstr "Konverteris (LNB)" - -diff --git a/po/nl_NL.po b/po/nl_NL.po -index fdfaf8d..68de220 100644 ---- a/po/nl_NL.po -+++ b/po/nl_NL.po -@@ -11,7 +11,7 @@ msgid "" - msgstr "" - "Project-Id-Version: VDR 1.6.0\n" - "Report-Msgid-Bugs-To: \n" --"POT-Creation-Date: 2010-01-17 16:18+0100\n" -+"POT-Creation-Date: 2010-02-14 17:47+0100\n" - "PO-Revision-Date: 2008-02-26 17:20+0100\n" - "Last-Translator: Johan Schuring \n" - "Language-Team: Dutch\n" -@@ -935,6 +935,9 @@ msgstr "Transparantie voorgrond ondertiteling" - msgid "Setup.DVB$Subtitle background transparency" - msgstr "Transparantie achtergrond ondertiteling" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "" -+ - msgid "LNB" - msgstr "LNB" - -diff --git a/po/nn_NO.po b/po/nn_NO.po -index 1f50117..2e08b7e 100644 ---- a/po/nn_NO.po -+++ b/po/nn_NO.po -@@ -8,7 +8,7 @@ msgid "" - msgstr "" - "Project-Id-Version: VDR 1.6.0\n" - "Report-Msgid-Bugs-To: \n" --"POT-Creation-Date: 2010-01-17 16:18+0100\n" -+"POT-Creation-Date: 2010-02-14 17:47+0100\n" - "PO-Revision-Date: 2007-08-12 14:17+0200\n" - "Last-Translator: Truls Slevigen \n" - "Language-Team: Norwegian\n" -@@ -932,6 +932,9 @@ msgstr "" - msgid "Setup.DVB$Subtitle background transparency" - msgstr "" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "" -+ - msgid "LNB" - msgstr "LNB" - -diff --git a/po/pl_PL.po b/po/pl_PL.po -index 038d058..70335d2 100644 ---- a/po/pl_PL.po -+++ b/po/pl_PL.po -@@ -8,7 +8,7 @@ msgid "" - msgstr "" - "Project-Id-Version: VDR 1.6.0\n" - "Report-Msgid-Bugs-To: \n" --"POT-Creation-Date: 2010-01-17 16:18+0100\n" -+"POT-Creation-Date: 2010-02-14 17:47+0100\n" - "PO-Revision-Date: 2008-03-09 12:59+0100\n" - "Last-Translator: Michael Rakowski \n" - "Language-Team: Polish\n" -@@ -932,6 +932,9 @@ msgstr "Prze - msgid "Setup.DVB$Subtitle background transparency" - msgstr "Przerocze podtytuw: To" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "" -+ - msgid "LNB" - msgstr "LNB" - -diff --git a/po/pt_PT.po b/po/pt_PT.po -index e409581..c9ea089 100644 ---- a/po/pt_PT.po -+++ b/po/pt_PT.po -@@ -7,7 +7,7 @@ msgid "" - msgstr "" - "Project-Id-Version: VDR 1.6.0\n" - "Report-Msgid-Bugs-To: \n" --"POT-Creation-Date: 2010-01-17 16:18+0100\n" -+"POT-Creation-Date: 2010-02-14 17:47+0100\n" - "PO-Revision-Date: 2008-03-18 17:04+0100\n" - "Last-Translator: anonymous\n" - "Language-Team: Portuguese\n" -@@ -931,6 +931,9 @@ msgstr "Transpar - msgid "Setup.DVB$Subtitle background transparency" - msgstr "Transparncia de background das legendas" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "" -+ - msgid "LNB" - msgstr "LNB" - -diff --git a/po/ro_RO.po b/po/ro_RO.po -index f52a7d8..a4714f6 100644 ---- a/po/ro_RO.po -+++ b/po/ro_RO.po -@@ -8,7 +8,7 @@ msgid "" - msgstr "" - "Project-Id-Version: VDR 1.6.0\n" - "Report-Msgid-Bugs-To: \n" --"POT-Creation-Date: 2010-01-17 16:18+0100\n" -+"POT-Creation-Date: 2010-02-14 17:47+0100\n" - "PO-Revision-Date: 2008-02-25 00:39+0100\n" - "Last-Translator: Lucian Muresan \n" - "Language-Team: Romanian\n" -@@ -934,6 +934,9 @@ msgstr "Transparen - msgid "Setup.DVB$Subtitle background transparency" - msgstr "Transparena fundalului subtitrrii" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "" -+ - msgid "LNB" - msgstr "LNB" - -diff --git a/po/ru_RU.po b/po/ru_RU.po -index c6d6aca..8c7907e 100644 ---- a/po/ru_RU.po -+++ b/po/ru_RU.po -@@ -8,7 +8,7 @@ msgid "" - msgstr "" - "Project-Id-Version: VDR 1.6.0\n" - "Report-Msgid-Bugs-To: \n" --"POT-Creation-Date: 2010-01-17 16:18+0100\n" -+"POT-Creation-Date: 2010-02-14 17:47+0100\n" - "PO-Revision-Date: 2008-12-15 14:37+0100\n" - "Last-Translator: Oleg Roitburd \n" - "Language-Team: Russian\n" -@@ -932,6 +932,9 @@ msgstr " - msgid "Setup.DVB$Subtitle background transparency" - msgstr " " - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "" -+ - msgid "LNB" - msgstr "" - -diff --git a/po/sk_SK.po b/po/sk_SK.po -index c66132a..8414523 100644 ---- a/po/sk_SK.po -+++ b/po/sk_SK.po -@@ -8,7 +8,7 @@ msgid "" - msgstr "" - "Project-Id-Version: VDR 1.6.0\n" - "Report-Msgid-Bugs-To: \n" --"POT-Creation-Date: 2010-01-17 16:18+0100\n" -+"POT-Creation-Date: 2010-02-14 17:47+0100\n" - "PO-Revision-Date: 2009-09-30 12:50+0100\n" - "Last-Translator: Milan Hrala \n" - "Language-Team: Slovak\n" -@@ -932,6 +932,9 @@ msgstr "Prieh - msgid "Setup.DVB$Subtitle background transparency" - msgstr "Priehadnos pozadia titulkov" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "" -+ - msgid "LNB" - msgstr "LNB" - -diff --git a/po/sl_SI.po b/po/sl_SI.po -index 2c20440..1682a16 100644 ---- a/po/sl_SI.po -+++ b/po/sl_SI.po -@@ -8,7 +8,7 @@ msgid "" - msgstr "" - "Project-Id-Version: VDR 1.6.0\n" - "Report-Msgid-Bugs-To: \n" --"POT-Creation-Date: 2010-01-17 16:18+0100\n" -+"POT-Creation-Date: 2010-02-14 17:47+0100\n" - "PO-Revision-Date: 2008-02-28 19:44+0100\n" - "Last-Translator: Matjaz Thaler \n" - "Language-Team: Slovenian\n" -@@ -932,6 +932,9 @@ msgstr "Transparentnost podnapisov" - msgid "Setup.DVB$Subtitle background transparency" - msgstr "Transparentnost ozadja podnapisov" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "" -+ - msgid "LNB" - msgstr "LNB" - -diff --git a/po/sv_SE.po b/po/sv_SE.po -index 4ac9a0f..1f55853 100644 ---- a/po/sv_SE.po -+++ b/po/sv_SE.po -@@ -10,7 +10,7 @@ msgid "" - msgstr "" - "Project-Id-Version: VDR 1.6.0\n" - "Report-Msgid-Bugs-To: \n" --"POT-Creation-Date: 2010-01-17 16:18+0100\n" -+"POT-Creation-Date: 2010-02-14 17:47+0100\n" - "PO-Revision-Date: 2008-03-12 18:25+0100\n" - "Last-Translator: Magnus Andersson \n" - "Language-Team: Swedish\n" -@@ -934,6 +934,9 @@ msgstr "Transparent f - msgid "Setup.DVB$Subtitle background transparency" - msgstr "Transparent bakgrund textremsa" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "" -+ - msgid "LNB" - msgstr "LNB" - -diff --git a/po/tr_TR.po b/po/tr_TR.po -index 02a9642..abce6da 100644 ---- a/po/tr_TR.po -+++ b/po/tr_TR.po -@@ -7,7 +7,7 @@ msgid "" - msgstr "" - "Project-Id-Version: VDR 1.6.0\n" - "Report-Msgid-Bugs-To: \n" --"POT-Creation-Date: 2010-01-17 16:18+0100\n" -+"POT-Creation-Date: 2010-02-14 17:47+0100\n" - "PO-Revision-Date: 2008-02-28 00:33+0100\n" - "Last-Translator: Oktay Yolgeen \n" - "Language-Team: Turkish\n" -@@ -931,6 +931,9 @@ msgstr "Altyaz - msgid "Setup.DVB$Subtitle background transparency" - msgstr "Altyaz arka effaflk" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "" -+ - msgid "LNB" - msgstr "LNB" - -diff --git a/po/uk_UA.po b/po/uk_UA.po -index 7e3010c..d52f3ea 100644 ---- a/po/uk_UA.po -+++ b/po/uk_UA.po -@@ -7,7 +7,7 @@ msgid "" - msgstr "" - "Project-Id-Version: VDR 1.7.7\n" - "Report-Msgid-Bugs-To: \n" --"POT-Creation-Date: 2010-01-17 16:18+0100\n" -+"POT-Creation-Date: 2010-02-14 17:47+0100\n" - "PO-Revision-Date: 2009-05-31 13:17+0200\n" - "Last-Translator: Yarema aka Knedlyk \n" - "Language-Team: Ukrainian\n" -@@ -931,6 +931,9 @@ msgstr "Прозорість переднього плану субтитрів" - msgid "Setup.DVB$Subtitle background transparency" - msgstr "Прозорість заднього плану субтитрів" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "" -+ - msgid "LNB" - msgstr "Конвертер" - -diff --git a/po/zh_CN.po b/po/zh_CN.po -index 1d12f71..482b487 100644 ---- a/po/zh_CN.po -+++ b/po/zh_CN.po -@@ -7,7 +7,7 @@ msgid "" - msgstr "" - "Project-Id-Version: VDR 1.6.0\n" - "Report-Msgid-Bugs-To: \n" --"POT-Creation-Date: 2010-01-17 16:18+0100\n" -+"POT-Creation-Date: 2010-02-14 17:47+0100\n" - "PO-Revision-Date: 2009-09-23 23:50+0800\n" - "Last-Translator: Nan Feng \n" - "Language-Team: Chinese\n" -@@ -934,6 +934,9 @@ msgstr "字幕前景透明度" - msgid "Setup.DVB$Subtitle background transparency" - msgstr "字幕背景透明度" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "" -+ - msgid "LNB" - msgstr "切换器设置" - -diff --git a/receiver.c b/receiver.c -index f922e98..8bfb36e 100644 ---- a/receiver.c -+++ b/receiver.c -@@ -82,7 +82,8 @@ bool cReceiver::SetPids(const cChannel *Channel) - (Channel->Ppid() == Channel->Vpid() || AddPid(Channel->Ppid())) && - AddPids(Channel->Apids()) && - (!Setup.UseDolbyDigital || AddPids(Channel->Dpids())) && -- AddPids(Channel->Spids()); -+ AddPids(Channel->Spids()) && -+ (!Setup.SupportTeletext || AddPid(Channel->Tpid())); - } - return true; - } -diff --git a/remux.c b/remux.c -index 070a06a..ead63ea 100644 ---- a/remux.c -+++ b/remux.c -@@ -215,6 +215,29 @@ int cPatPmtGenerator::MakeSubtitlingDescriptor(uchar *Target, const char *Langua - return i; - } - -+int cPatPmtGenerator::MakeTeletextDescriptor(uchar *Target, const tTeletextSubtitlePage *pages, int pageCount) -+{ -+ int i = 0, j = 0; -+ Target[i++] = SI::TeletextDescriptorTag; -+ int l = i; -+ Target[i++] = 0x00; // length -+ for (int n = 0; n < pageCount; n++) { -+ const char* Language = pages[n].ttxtLanguage; -+ Target[i++] = *Language++; -+ Target[i++] = *Language++; -+ Target[i++] = *Language++; -+ Target[i++] = (pages[n].ttxtType << 3) + pages[n].ttxtMagazine; -+ Target[i++] = pages[n].ttxtPage; -+ j++; -+ } -+ if (j > 0) { -+ Target[l] = j * 5; // update length -+ IncEsInfoLength(i); -+ return i; -+ } -+ return 0; -+} -+ - int cPatPmtGenerator::MakeLanguageDescriptor(uchar *Target, const char *Language) - { - int i = 0; -@@ -296,6 +319,7 @@ void cPatPmtGenerator::GeneratePmt(const cChannel *Channel) - if (Channel) { - int Vpid = Channel->Vpid(); - int Ppid = Channel->Ppid(); -+ int Tpid = Channel->Tpid(); - uchar *p = buf; - int i = 0; - p[i++] = 0x02; // table id -@@ -330,6 +354,10 @@ void cPatPmtGenerator::GeneratePmt(const cChannel *Channel) - i += MakeStream(buf + i, 0x06, Channel->Spid(n)); - i += MakeSubtitlingDescriptor(buf + i, Channel->Slang(n), Channel->SubtitlingType(n), Channel->CompositionPageId(n), Channel->AncillaryPageId(n)); - } -+ if (Tpid) { -+ i += MakeStream(buf + i, 0x06, Tpid); -+ i += MakeTeletextDescriptor(buf + i, Channel->TeletextSubtitlePages(), Channel->TotalTeletextSubtitlePages()); -+ } - - int sl = i - SectionLength - 2 + 4; // -2 = SectionLength storage, +4 = length of CRC - buf[SectionLength] |= (sl >> 8) & 0x0F; -@@ -403,6 +431,7 @@ void cPatPmtParser::Reset(void) - pmtPid = -1; - vpid = vtype = 0; - ppid = 0; -+ tpid = 0; - } - - void cPatPmtParser::ParsePat(const uchar *Data, int Length) -@@ -488,11 +517,13 @@ void cPatPmtParser::ParsePmt(const uchar *Data, int Length) - int NumSpids = 0; - vpid = vtype = 0; - ppid = 0; -+ tpid = 0; - apids[0] = 0; - dpids[0] = 0; - spids[0] = 0; - atypes[0] = 0; - dtypes[0] = 0; -+ totalTtxtSubtitlePages = 0; - SI::PMT::Stream stream; - for (SI::Loop::Iterator it; Pmt.streamLoop.getNext(stream, it); ) { - dbgpatpmt(" stream type = %02X, pid = %d", stream.getStreamType(), stream.getPid()); -@@ -586,6 +617,28 @@ void cPatPmtParser::ParsePmt(const uchar *Data, int Length) - spids[NumSpids]= 0; - } - break; -+ case SI::TeletextDescriptorTag: { -+ dbgpatpmt(" teletext"); -+ tpid = stream.getPid(); -+ SI::TeletextDescriptor *sd = (SI::TeletextDescriptor *)d; -+ SI::TeletextDescriptor::Teletext ttxt; -+ if (totalTtxtSubtitlePages < MAXTXTPAGES) { -+ for (SI::Loop::Iterator it; sd->teletextLoop.getNext(ttxt, it); ) { -+ bool isSubtitlePage = (ttxt.getTeletextType() == 0x02) || (ttxt.getTeletextType() == 0x05); -+ if (isSubtitlePage && ttxt.languageCode[0]) { -+ dbgpatpmt(" '%s:%x.%x'", ttxt.languageCode, ttxt.getTeletextMagazineNumber(), ttxt.getTeletextPageNumber()); -+ strn0cpy(teletextSubtitlePages[totalTtxtSubtitlePages].ttxtLanguage, I18nNormalizeLanguageCode(ttxt.languageCode), MAXLANGCODE1); -+ teletextSubtitlePages[totalTtxtSubtitlePages].ttxtPage = ttxt.getTeletextPageNumber(); -+ teletextSubtitlePages[totalTtxtSubtitlePages].ttxtMagazine = ttxt.getTeletextMagazineNumber(); -+ teletextSubtitlePages[totalTtxtSubtitlePages].ttxtType = ttxt.getTeletextType(); -+ totalTtxtSubtitlePages++; -+ if (totalTtxtSubtitlePages >= MAXTXTPAGES) -+ break; -+ } -+ } -+ } -+ } -+ break; - case SI::ISO639LanguageDescriptorTag: { - SI::ISO639LanguageDescriptor *ld = (SI::ISO639LanguageDescriptor *)d; - dbgpatpmt(" '%s'", ld->languageCode); -diff --git a/remux.h b/remux.h -index 1115c4a..7bf712e 100644 ---- a/remux.h -+++ b/remux.h -@@ -170,6 +170,7 @@ protected: - int MakeStream(uchar *Target, uchar Type, int Pid); - int MakeAC3Descriptor(uchar *Target); - int MakeSubtitlingDescriptor(uchar *Target, const char *Language, uchar SubtitlingType, uint16_t CompositionPageId, uint16_t AncillaryPageId); -+ int MakeTeletextDescriptor(uchar *Target, const tTeletextSubtitlePage *pages, int pageCount); - int MakeLanguageDescriptor(uchar *Target, const char *Language); - int MakeCRC(uchar *Target, const uchar *Data, int Length); - void GeneratePmtPid(const cChannel *Channel); -@@ -215,6 +216,7 @@ private: - int vpid; - int ppid; - int vtype; -+ int tpid; - int apids[MAXAPIDS + 1]; // list is zero-terminated - int atypes[MAXAPIDS + 1]; // list is zero-terminated - char alangs[MAXAPIDS][MAXLANGCODE2]; -@@ -227,6 +229,8 @@ private: - uint16_t compositionPageIds[MAXSPIDS]; - uint16_t ancillaryPageIds[MAXSPIDS]; - bool updatePrimaryDevice; -+ int totalTtxtSubtitlePages; -+ tTeletextSubtitlePage teletextSubtitlePages[MAXTXTPAGES]; - protected: - int SectionLength(const uchar *Data, int Length) { return (Length >= 3) ? ((int(Data[1]) & 0x0F) << 8)| Data[2] : 0; } - public: -@@ -259,6 +263,9 @@ public: - int Vtype(void) const { return vtype; } - ///< Returns the video stream type as defined by the current PMT, or 0 if no video - ///< stream type has been detected, yet. -+ int Tpid(void) { return tpid; } -+ ///< Returns the teletext pid as defined by the current PMT, or 0 if no teletext -+ ///< pid has been detected, yet. - const int *Apids(void) const { return apids; } - const int *Dpids(void) const { return dpids; } - const int *Spids(void) const { return spids; } -@@ -273,6 +280,8 @@ public: - uchar SubtitlingType(int i) const { return (0 <= i && i < MAXSPIDS) ? subtitlingTypes[i] : uchar(0); } - uint16_t CompositionPageId(int i) const { return (0 <= i && i < MAXSPIDS) ? compositionPageIds[i] : uint16_t(0); } - uint16_t AncillaryPageId(int i) const { return (0 <= i && i < MAXSPIDS) ? ancillaryPageIds[i] : uint16_t(0); } -+ const tTeletextSubtitlePage *TeletextSubtitlePages() const { return teletextSubtitlePages; } -+ int TotalTeletextSubtitlePages() const { return totalTtxtSubtitlePages; } - }; - - // TS to PES converter: -diff --git a/vdr.5 b/vdr.5 -index 4b2cb90..c7da844 100644 ---- a/vdr.5 -+++ b/vdr.5 -@@ -207,6 +207,13 @@ can be indicated by adding a second language code, delimited by a '+' sign, as i - .TP - .B TPID - The teletext PID. -+ -+Fixed teletext subtitling pages can be defined separated by a semicolon. -+The pages (separated by commas) can contain ISO 639 language codes, delimited -+by a '=' sign, as in -+ -+.B ...:2001;150=deu,151=fin:... -+ - .TP - .B Conditional access - A hexadecimal integer defining how this channel can be accessed: -diff --git a/vdrttxtsubshooks.c b/vdrttxtsubshooks.c -new file mode 100644 -index 0000000..2471788 ---- /dev/null -+++ b/vdrttxtsubshooks.c -@@ -0,0 +1,63 @@ -+/* -+ * vdr-ttxtsubs - A plugin for the Linux Video Disk Recorder -+ * Copyright (c) 2003 - 2008 Ragnar Sundblad -+ * -+ * 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., -+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -+ * -+ */ -+ -+#include -+#include -+#include -+ -+#include "vdrttxtsubshooks.h" -+ -+// XXX Really should be a list... -+static cVDRTtxtsubsHookListener *gListener; -+ -+// ------ class cVDRTtxtsubsHookProxy ------ -+ -+class cVDRTtxtsubsHookProxy : public cVDRTtxtsubsHookListener -+{ -+ public: -+ virtual void HideOSD(void) { if(gListener) gListener->HideOSD(); }; -+ virtual void ShowOSD(void) { if(gListener) gListener->ShowOSD(); }; -+ virtual void PlayerTeletextData(uint8_t *p, int length, bool IsPesRecording, const struct tTeletextSubtitlePage teletextSubtitlePages[] = NULL, int pageCount = 0) -+ { if(gListener) gListener->PlayerTeletextData(p, length, IsPesRecording, teletextSubtitlePages, pageCount); }; -+ virtual int ManualPageNumber(const cChannel *channel) -+ { if(gListener) return gListener->ManualPageNumber(channel); else return 0; }; -+}; -+ -+ -+// ------ class cVDRTtxtsubsHookListener ------ -+ -+cVDRTtxtsubsHookListener::~cVDRTtxtsubsHookListener() -+{ -+ gListener = 0; -+} -+ -+void cVDRTtxtsubsHookListener::HookAttach(void) -+{ -+ gListener = this; -+ //printf("cVDRTtxtsubsHookListener::HookAttach\n"); -+} -+ -+static cVDRTtxtsubsHookProxy gProxy; -+ -+cVDRTtxtsubsHookListener *cVDRTtxtsubsHookListener::Hook(void) -+{ -+ return &gProxy; -+} -+ -diff --git a/vdrttxtsubshooks.h b/vdrttxtsubshooks.h -new file mode 100644 -index 0000000..2f97969 ---- /dev/null -+++ b/vdrttxtsubshooks.h -@@ -0,0 +1,46 @@ -+/* -+ * vdr-ttxtsubs - A plugin for the Linux Video Disk Recorder -+ * Copyright (c) 2003 - 2008 Ragnar Sundblad -+ * -+ * 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., -+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -+ * -+ */ -+ -+#ifndef __VDRTTXTSUBSHOOKS_H -+#define __VDRTTXTSUBSHOOKS_H -+ -+#define TTXTSUBSVERSNUM 2 -+ -+class cDevice; -+class cChannel; -+struct tTeletextSubtitlePage; -+ -+class cVDRTtxtsubsHookListener { -+ public: -+ cVDRTtxtsubsHookListener(void) {}; -+ virtual ~cVDRTtxtsubsHookListener(); -+ -+ void HookAttach(void); -+ -+ virtual void HideOSD(void) {}; -+ virtual void ShowOSD(void) {}; -+ virtual void PlayerTeletextData(uint8_t *p, int length, bool IsPesRecording = true, const struct tTeletextSubtitlePage teletextSubtitlePages[] = NULL, int pageCount = 0) {}; -+ virtual int ManualPageNumber(const cChannel *channel) { return 0; }; -+ -+ // used by VDR to call hook listeners -+ static cVDRTtxtsubsHookListener *Hook(void); -+}; -+ -+#endif diff --git a/patches/vdr-1.7.13-ttxtsubs.patch b/patches/vdr-1.7.13-ttxtsubs.patch deleted file mode 100644 index 8fad746..0000000 --- a/patches/vdr-1.7.13-ttxtsubs.patch +++ /dev/null @@ -1,1047 +0,0 @@ -diff --git a/MANUAL b/MANUAL -index ff80f55..533a110 100644 ---- a/MANUAL -+++ b/MANUAL -@@ -721,6 +721,9 @@ Version 1.6 - background transparency. By default the values as broadcast - are used. - -+ Record Teletext Subtitles = no -+ If set to 'yes', teletext subtitles will be recorded. -+ - LNB: - - SLOF = 11700 The switching frequency (in MHz) between low and -diff --git a/Makefile b/Makefile -index 31f05b0..a45b189 100644 ---- a/Makefile -+++ b/Makefile -@@ -44,6 +44,8 @@ OBJS = audio.o channels.o ci.o config.o cutter.o device.o diseqc.o dvbdevice.o d - skinclassic.o skins.o skinsttng.o sourceparams.o sources.o spu.o status.o svdrp.o themes.o thread.o\ - timers.o tools.o transfer.o vdr.o videodir.o - -+OBJS += vdrttxtsubshooks.o -+ - ifndef NO_KBD - DEFINES += -DREMOTE_KBD - endif -diff --git a/channels.c b/channels.c -index a694d54..4ba88a5 100644 ---- a/channels.c -+++ b/channels.c -@@ -365,6 +365,26 @@ void cChannel::SetSubtitlingDescriptors(uchar *SubtitlingTypes, uint16_t *Compos - } - } - -+void cChannel::SetTeletextSubtitlePages(tTeletextSubtitlePage pages[], int numberOfPages) -+{ -+ int mod = CHANNELMOD_NONE; -+ if (totalTtxtSubtitlePages != numberOfPages) -+ mod |= CHANNELMOD_PIDS; -+ totalTtxtSubtitlePages = fixedTtxtSubtitlePages; -+ for (int i = 0; (i < numberOfPages) && (totalTtxtSubtitlePages < MAXTXTPAGES); i++) { -+ if (teletextSubtitlePages[totalTtxtSubtitlePages].ttxtMagazine != pages[i].ttxtMagazine || -+ teletextSubtitlePages[totalTtxtSubtitlePages].ttxtPage != pages[i].ttxtPage || -+ teletextSubtitlePages[totalTtxtSubtitlePages].ttxtType != pages[i].ttxtType || -+ strcmp(teletextSubtitlePages[totalTtxtSubtitlePages].ttxtLanguage, pages[i].ttxtLanguage)) { -+ mod |= CHANNELMOD_PIDS; -+ teletextSubtitlePages[totalTtxtSubtitlePages] = pages[i]; -+ } -+ totalTtxtSubtitlePages++; -+ } -+ modification |= mod; -+ Channels.SetModified(); -+} -+ - void cChannel::SetCaIds(const int *CaIds) - { - if (caids[0] && caids[0] <= CA_USER_MAX) -@@ -493,11 +513,22 @@ cString cChannel::ToText(const cChannel *Channel) - q += IntArrayToString(q, Channel->dpids, 10, Channel->dlangs); - } - *q = 0; -+ const int TBufferSize = 5 + 1 + (MAXTXTPAGES * (3 + 1 + MAXLANGCODE1 + 1)) + 10; // '12345;150=deu,151=fin,...', +10: paranoia -+ char tpidbuf[TBufferSize]; -+ q = tpidbuf; -+ q += snprintf(q, sizeof(tpidbuf), "%d", Channel->tpid); -+ if (Channel->fixedTtxtSubtitlePages > 0) { -+ q += snprintf(q, sizeof(tpidbuf) - (q - tpidbuf), ";"); -+ for (int i = 0; i < Channel->fixedTtxtSubtitlePages; ++i) { -+ tTeletextSubtitlePage page = Channel->teletextSubtitlePages[i]; -+ q += snprintf(q, sizeof(tpidbuf) - (q - tpidbuf), "%d=%s", page.PageNumber(), page.ttxtLanguage); -+ } -+ } - char caidbuf[MAXCAIDS * 5 + 10]; // 5: 4 digits plus delimiting ',', 10: paranoia - q = caidbuf; - q += IntArrayToString(q, Channel->caids, 16); - *q = 0; -- buffer = cString::sprintf("%s:%d:%s:%s:%d:%s:%s:%d:%s:%d:%d:%d:%d\n", FullName, Channel->frequency, *Channel->parameters, *cSource::ToString(Channel->source), Channel->srate, vpidbuf, apidbuf, Channel->tpid, caidbuf, Channel->sid, Channel->nid, Channel->tid, Channel->rid); -+ buffer = cString::sprintf("%s:%d:%s:%s:%d:%s:%s:%s:%s:%d:%d:%d:%d\n", FullName, Channel->frequency, *Channel->parameters, *cSource::ToString(Channel->source), Channel->srate, vpidbuf, apidbuf, tpidbuf, caidbuf, Channel->sid, Channel->nid, Channel->tid, Channel->rid); - } - return buffer; - } -@@ -531,8 +562,9 @@ bool cChannel::Parse(const char *s) - char *parambuf = NULL; - char *vpidbuf = NULL; - char *apidbuf = NULL; -+ char *tpidbuf = NULL; - char *caidbuf = NULL; -- int fields = sscanf(s, "%a[^:]:%d :%a[^:]:%a[^:] :%d :%a[^:]:%a[^:]:%d :%a[^:]:%d :%d :%d :%d ", &namebuf, &frequency, ¶mbuf, &sourcebuf, &srate, &vpidbuf, &apidbuf, &tpid, &caidbuf, &sid, &nid, &tid, &rid); -+ int fields = sscanf(s, "%a[^:]:%d :%a[^:]:%a[^:] :%d :%a[^:]:%a[^:]:%a[^:]:%a[^:]:%d :%d :%d :%d ", &namebuf, &frequency, ¶mbuf, &sourcebuf, &srate, &vpidbuf, &apidbuf, &tpidbuf, &caidbuf, &sid, &nid, &tid, &rid); - if (fields >= 9) { - if (fields == 9) { - // allow reading of old format -@@ -615,7 +647,37 @@ bool cChannel::Parse(const char *s) - } - dpids[NumDpids] = 0; - } -- -+ if (tpidbuf) { -+ char *p; -+ fixedTtxtSubtitlePages = 0; -+ // 2001;150=deu,151=fin -+ if ((p = strchr(tpidbuf, ';')) != NULL) { -+ char *q, *strtok_next; -+ *p++ = 0; -+ while ((q = strtok_r(p, ",", &strtok_next)) != NULL) { -+ if (fixedTtxtSubtitlePages < MAXTXTPAGES) { -+ int page; -+ char *l = strchr(q, '='); -+ if (l) -+ *l++ = 0; -+ if (sscanf(q, "%d", &page) == 1) { -+ teletextSubtitlePages[fixedTtxtSubtitlePages] = tTeletextSubtitlePage(page); -+ if (l) -+ strn0cpy(teletextSubtitlePages[fixedTtxtSubtitlePages].ttxtLanguage, l, MAXLANGCODE1); -+ fixedTtxtSubtitlePages++; -+ } -+ else -+ esyslog("ERROR: invalid Teletext page!"); // no need to set ok to 'false' -+ } -+ else -+ esyslog("ERROR: too many Teletext pages!"); // no need to set ok to 'false' -+ p = NULL; -+ } -+ totalTtxtSubtitlePages = fixedTtxtSubtitlePages; -+ } -+ if (sscanf(tpidbuf, "%d", &tpid) != 1) -+ return false; -+ } - if (caidbuf) { - char *p = caidbuf; - char *q; -@@ -652,6 +714,7 @@ bool cChannel::Parse(const char *s) - free(sourcebuf); - free(vpidbuf); - free(apidbuf); -+ free(tpidbuf); - free(caidbuf); - free(namebuf); - if (!GetChannelID().Valid()) { -diff --git a/channels.h b/channels.h -index 4ed1358..bce62cd 100644 ---- a/channels.h -+++ b/channels.h -@@ -35,6 +35,7 @@ - #define MAXDPIDS 16 // dolby (AC3 + DTS) - #define MAXSPIDS 32 // subtitles - #define MAXCAIDS 8 // conditional access -+#define MAXTXTPAGES 8 // teletext pages - - #define MAXLANGCODE1 4 // a 3 letter language code, zero terminated - #define MAXLANGCODE2 8 // up to two 3 letter language codes, separated by '+' and zero terminated -@@ -71,6 +72,16 @@ public: - static const tChannelID InvalidID; - }; - -+struct tTeletextSubtitlePage { -+ tTeletextSubtitlePage(void) { ttxtPage = ttxtMagazine = 0; ttxtType = 0x02; strcpy(ttxtLanguage, "und"); } -+ tTeletextSubtitlePage(int page) { ttxtMagazine = (page / 100) & 0x7; ttxtPage = (((page % 100) / 10) << 4) + (page % 10); ttxtType = 0x02; strcpy(ttxtLanguage, "und"); } -+ char ttxtLanguage[MAXLANGCODE1]; -+ uchar ttxtPage; -+ uchar ttxtMagazine; -+ uchar ttxtType; -+ int PageNumber(void) const { return BCDCHARTOINT(ttxtMagazine) * 100 + BCDCHARTOINT(ttxtPage); } -+ }; -+ - class cChannel; - - class cLinkChannel : public cListObject { -@@ -113,6 +124,9 @@ private: - uint16_t compositionPageIds[MAXSPIDS]; - uint16_t ancillaryPageIds[MAXSPIDS]; - int tpid; -+ int fixedTtxtSubtitlePages; -+ int totalTtxtSubtitlePages; -+ tTeletextSubtitlePage teletextSubtitlePages[MAXTXTPAGES]; - int caids[MAXCAIDS + 1]; // list is zero-terminated - int nid; - int tid; -@@ -160,6 +174,8 @@ public: - uint16_t CompositionPageId(int i) const { return (0 <= i && i < MAXSPIDS) ? compositionPageIds[i] : uint16_t(0); } - uint16_t AncillaryPageId(int i) const { return (0 <= i && i < MAXSPIDS) ? ancillaryPageIds[i] : uint16_t(0); } - int Tpid(void) const { return tpid; } -+ const tTeletextSubtitlePage *TeletextSubtitlePages() const { return teletextSubtitlePages; } -+ int TotalTeletextSubtitlePages() const { return totalTtxtSubtitlePages; } - const int *Caids(void) const { return caids; } - int Ca(int Index = 0) const { return Index < MAXCAIDS ? caids[Index] : 0; } - int Nid(void) const { return nid; } -@@ -184,6 +200,7 @@ public: - void SetName(const char *Name, const char *ShortName, const char *Provider); - void SetPortalName(const char *PortalName); - void SetPids(int Vpid, int Ppid, int Vtype, int *Apids, char ALangs[][MAXLANGCODE2], int *Dpids, char DLangs[][MAXLANGCODE2], int *Spids, char SLangs[][MAXLANGCODE2], int Tpid); -+ void SetTeletextSubtitlePages(tTeletextSubtitlePage pages[], int numberOfPages); - void SetCaIds(const int *CaIds); // list must be zero-terminated - void SetCaDescriptors(int Level); - void SetLinkChannels(cLinkChannels *LinkChannels); -diff --git a/ci.c b/ci.c -index 6c7b031..22fda9f 100644 ---- a/ci.c -+++ b/ci.c -@@ -1911,6 +1911,8 @@ void cCamSlot::AddChannel(const cChannel *Channel) - AddPid(Channel->Sid(), *Apid, STREAM_TYPE_AUDIO); - for (const int *Dpid = Channel->Dpids(); *Dpid; Dpid++) - AddPid(Channel->Sid(), *Dpid, STREAM_TYPE_DOLBY); -+ if (Channel->Tpid() && Setup.SupportTeletext) -+ AddPid(Channel->Sid(), Channel->Tpid(), STREAM_TYPE_DOLBY); - } - } - -@@ -1932,6 +1934,9 @@ bool cCamSlot::CanDecrypt(const cChannel *Channel) - CaPmt.AddPid(*Apid, STREAM_TYPE_AUDIO); - for (const int *Dpid = Channel->Dpids(); *Dpid; Dpid++) - CaPmt.AddPid(*Dpid, STREAM_TYPE_DOLBY); -+ if (Channel->Tpid() && Setup.SupportTeletext) { -+ CaPmt.AddPid(Channel->Tpid(), STREAM_TYPE_DOLBY); // FIXME: STREAM_TYPE_DOLBY should probably be renamed STREAM_TYPE_PRIVATE -+ } - cas->SendPMT(&CaPmt); - cTimeMs Timeout(QUERY_REPLY_TIMEOUT); - do { -diff --git a/config.c b/config.c -index acdf4c4..29377d9 100644 ---- a/config.c -+++ b/config.c -@@ -333,6 +333,7 @@ cSetup::cSetup(void) - MarginStop = 10; - AudioLanguages[0] = -1; - DisplaySubtitles = 0; -+ SupportTeletext = 0; - SubtitleLanguages[0] = -1; - SubtitleOffset = 0; - SubtitleFgTransparency = 0; -@@ -521,6 +522,7 @@ bool cSetup::Parse(const char *Name, const char *Value) - else if (!strcasecmp(Name, "MarginStop")) MarginStop = atoi(Value); - else if (!strcasecmp(Name, "AudioLanguages")) return ParseLanguages(Value, AudioLanguages); - else if (!strcasecmp(Name, "DisplaySubtitles")) DisplaySubtitles = atoi(Value); -+ else if (!strcasecmp(Name, "SupportTeletext")) SupportTeletext = atoi(Value); - else if (!strcasecmp(Name, "SubtitleLanguages")) return ParseLanguages(Value, SubtitleLanguages); - else if (!strcasecmp(Name, "SubtitleOffset")) SubtitleOffset = atoi(Value); - else if (!strcasecmp(Name, "SubtitleFgTransparency")) SubtitleFgTransparency = atoi(Value); -@@ -614,6 +616,7 @@ bool cSetup::Save(void) - Store("MarginStop", MarginStop); - StoreLanguages("AudioLanguages", AudioLanguages); - Store("DisplaySubtitles", DisplaySubtitles); -+ Store("SupportTeletext", SupportTeletext); - StoreLanguages("SubtitleLanguages", SubtitleLanguages); - Store("SubtitleOffset", SubtitleOffset); - Store("SubtitleFgTransparency", SubtitleFgTransparency); -diff --git a/config.h b/config.h -index e4237f7..5a66814 100644 ---- a/config.h -+++ b/config.h -@@ -235,6 +235,7 @@ public: - int MarginStart, MarginStop; - int AudioLanguages[I18N_MAX_LANGUAGES + 1]; - int DisplaySubtitles; -+ int SupportTeletext; - int SubtitleLanguages[I18N_MAX_LANGUAGES + 1]; - int SubtitleOffset; - int SubtitleFgTransparency, SubtitleBgTransparency; -diff --git a/device.c b/device.c -index ac4d6d4..773cf21 100644 ---- a/device.c -+++ b/device.c -@@ -18,6 +18,7 @@ - #include "receiver.h" - #include "status.h" - #include "transfer.h" -+#include "vdrttxtsubshooks.h" - - // --- cLiveSubtitle --------------------------------------------------------- - -@@ -1223,6 +1224,13 @@ int cDevice::PlayPesPacket(const uchar *Data, int Length, bool VideoOnly) - } - break; - case 0xBD: { // private stream 1 -+ // EBU Teletext data, ETSI EN 300 472 -+ // if PES data header length = 24 and data_identifier = 0x10..0x1F (EBU Data) -+ if (Data[8] == 0x24 && Data[45] >= 0x10 && Data[45] < 0x20) { -+ cVDRTtxtsubsHookListener::Hook()->PlayerTeletextData((uint8_t*)Data, Length); -+ break; -+ } -+ - int PayloadOffset = Data[8] + 9; - - // Compatibility mode for old subtitles plugin: -@@ -1382,6 +1390,7 @@ int cDevice::PlayTs(const uchar *Data, int Length, bool VideoOnly) - tsToPesVideo.Reset(); - tsToPesAudio.Reset(); - tsToPesSubtitle.Reset(); -+ tsToPesTeletext.Reset(); - } - else if (Length < TS_SIZE) { - esyslog("ERROR: skipped %d bytes of TS fragment", Length); -@@ -1427,6 +1436,17 @@ int cDevice::PlayTs(const uchar *Data, int Length, bool VideoOnly) - if (!VideoOnly || HasIBPTrickSpeed()) - PlayTsSubtitle(Data, TS_SIZE); - } -+ else if (Pid == patPmtParser.Tpid()) { -+ if (!VideoOnly || HasIBPTrickSpeed()) { -+ int l; -+ tsToPesTeletext.PutTs(Data, Length); -+ if (const uchar *p = tsToPesTeletext.GetPes(l)) { -+ if ((l > 45) && (p[0] == 0x00) && (p[1] == 0x00) && (p[2] == 0x01) && (p[3] == 0xbd) && (p[8] == 0x24) && (p[45] >= 0x10) && (p[45] < 0x20)) -+ cVDRTtxtsubsHookListener::Hook()->PlayerTeletextData((uchar *)p, l, false, patPmtParser.TeletextSubtitlePages(), patPmtParser.TotalTeletextSubtitlePages()); -+ tsToPesTeletext.Reset(); -+ } -+ } -+ } - } - } - else if (Pid == patPmtParser.Ppid()) { -diff --git a/device.h b/device.h -index 9ce814a..426dc8f 100644 ---- a/device.h -+++ b/device.h -@@ -519,6 +519,7 @@ private: - cTsToPes tsToPesVideo; - cTsToPes tsToPesAudio; - cTsToPes tsToPesSubtitle; -+ cTsToPes tsToPesTeletext; - bool isPlayingVideo; - protected: - const cPatPmtParser *PatPmtParser(void) const { return &patPmtParser; } -diff --git a/menu.c b/menu.c -index 655eb4c..194b3de 100644 ---- a/menu.c -+++ b/menu.c -@@ -2780,6 +2780,7 @@ void cMenuSetupDVB::Setup(void) - Add(new cMenuEditIntItem( tr("Setup.DVB$Subtitle foreground transparency"), &data.SubtitleFgTransparency, 0, 9)); - Add(new cMenuEditIntItem( tr("Setup.DVB$Subtitle background transparency"), &data.SubtitleBgTransparency, 0, 10)); - } -+ Add(new cMenuEditBoolItem(tr("Setup.DVB$Enable teletext support"), &data.SupportTeletext)); - - SetCurrent(Get(current)); - Display(); -diff --git a/pat.c b/pat.c -index 9b3ded6..c6e7834 100644 ---- a/pat.c -+++ b/pat.c -@@ -13,6 +13,7 @@ - #include "libsi/section.h" - #include "libsi/descriptor.h" - #include "thread.h" -+#include "vdrttxtsubshooks.h" - - #define PMT_SCAN_TIMEOUT 10 // seconds - -@@ -341,6 +342,8 @@ void cPatFilter::Process(u_short Pid, u_char Tid, const u_char *Data, int Length - char DLangs[MAXDPIDS][MAXLANGCODE2] = { "" }; - char SLangs[MAXSPIDS][MAXLANGCODE2] = { "" }; - int Tpid = 0; -+ tTeletextSubtitlePage TeletextSubtitlePages[MAXTXTPAGES]; -+ int NumTPages = 0; - int NumApids = 0; - int NumDpids = 0; - int NumSpids = 0; -@@ -426,8 +429,21 @@ void cPatFilter::Process(u_short Pid, u_char Tid, const u_char *Data, int Length - NumSpids++; - } - break; -- case SI::TeletextDescriptorTag: -+ case SI::TeletextDescriptorTag: { - Tpid = esPid; -+ SI::TeletextDescriptor *sd = (SI::TeletextDescriptor *)d; -+ SI::TeletextDescriptor::Teletext ttxt; -+ for (SI::Loop::Iterator it; sd->teletextLoop.getNext(ttxt, it); ) { -+ bool isSubtitlePage = (ttxt.getTeletextType() == 0x02) || (ttxt.getTeletextType() == 0x05); -+ if ((NumTPages < MAXTXTPAGES) && ttxt.languageCode[0] && isSubtitlePage) { -+ strn0cpy(TeletextSubtitlePages[NumTPages].ttxtLanguage, I18nNormalizeLanguageCode(ttxt.languageCode), MAXLANGCODE1); -+ TeletextSubtitlePages[NumTPages].ttxtPage = ttxt.getTeletextPageNumber(); -+ TeletextSubtitlePages[NumTPages].ttxtMagazine = ttxt.getTeletextMagazineNumber(); -+ TeletextSubtitlePages[NumTPages].ttxtType = ttxt.getTeletextType(); -+ NumTPages++; -+ } -+ } -+ } - break; - case SI::ISO639LanguageDescriptorTag: { - SI::ISO639LanguageDescriptor *ld = (SI::ISO639LanguageDescriptor *)d; -@@ -458,6 +474,12 @@ void cPatFilter::Process(u_short Pid, u_char Tid, const u_char *Data, int Length - } - if (Setup.UpdateChannels >= 2) { - Channel->SetPids(Vpid, Ppid, Vtype, Apids, ALangs, Dpids, DLangs, Spids, SLangs, Tpid); -+ if (NumTPages < MAXTXTPAGES) { -+ int manualPageNumber = cVDRTtxtsubsHookListener::Hook()->ManualPageNumber(Channel); -+ if (manualPageNumber) -+ TeletextSubtitlePages[NumTPages++] = tTeletextSubtitlePage(manualPageNumber); -+ } -+ Channel->SetTeletextSubtitlePages(TeletextSubtitlePages, NumTPages); - Channel->SetCaIds(CaDescriptors->CaIds()); - Channel->SetSubtitlingDescriptors(SubtitlingTypes, CompositionPageIds, AncillaryPageIds); - } -diff --git a/po/ca_ES.po b/po/ca_ES.po -index 40198f8..9ba7e30 100644 ---- a/po/ca_ES.po -+++ b/po/ca_ES.po -@@ -934,6 +934,9 @@ msgstr "Transpar - msgid "Setup.DVB$Subtitle background transparency" - msgstr "Transparncia fons subttols" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "" -+ - msgid "LNB" - msgstr "Configuraci de l'LNB" - -diff --git a/po/cs_CZ.po b/po/cs_CZ.po -index 63b5d1c..0c68400 100644 ---- a/po/cs_CZ.po -+++ b/po/cs_CZ.po -@@ -932,6 +932,9 @@ msgstr "Pr - msgid "Setup.DVB$Subtitle background transparency" - msgstr "Prhlednost pozad titulk" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "" -+ - msgid "LNB" - msgstr "LNB" - -diff --git a/po/da_DK.po b/po/da_DK.po -index 99af59b..fca4669 100644 ---- a/po/da_DK.po -+++ b/po/da_DK.po -@@ -931,6 +931,9 @@ msgstr "Undertekst forgrundsgennemsigtighed" - msgid "Setup.DVB$Subtitle background transparency" - msgstr "Undertekst baggrundsgennemsigtighed" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "" -+ - msgid "LNB" - msgstr "LNB" - -diff --git a/po/de_DE.po b/po/de_DE.po -index 6181eb3..b385571 100644 ---- a/po/de_DE.po -+++ b/po/de_DE.po -@@ -931,6 +931,9 @@ msgstr "Untertitel-Transparenz Vordergrund" - msgid "Setup.DVB$Subtitle background transparency" - msgstr "Untertitel-Transparenz Hintergrund" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "Videotext-Untersttzung aktivieren" -+ - msgid "LNB" - msgstr "LNB" - -diff --git a/po/el_GR.po b/po/el_GR.po -index 70f6e54..ffb73a0 100644 ---- a/po/el_GR.po -+++ b/po/el_GR.po -@@ -931,6 +931,9 @@ msgstr "" - msgid "Setup.DVB$Subtitle background transparency" - msgstr "" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "" -+ - msgid "LNB" - msgstr "LNB" - -diff --git a/po/es_ES.po b/po/es_ES.po -index f78c8cb..5ce2238 100644 ---- a/po/es_ES.po -+++ b/po/es_ES.po -@@ -932,6 +932,9 @@ msgstr "Transparencia primer plano subt - msgid "Setup.DVB$Subtitle background transparency" - msgstr "Transparencia fondo subttulos" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "" -+ - msgid "LNB" - msgstr "LNB" - -diff --git a/po/et_EE.po b/po/et_EE.po -index 047a2f7..09e4b17 100644 ---- a/po/et_EE.po -+++ b/po/et_EE.po -@@ -931,6 +931,9 @@ msgstr "Subtiitri l - msgid "Setup.DVB$Subtitle background transparency" - msgstr "Subtiitri tausta lbipaistvus" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "Teleteksti tugi" -+ - msgid "LNB" - msgstr "LNB" - -diff --git a/po/fi_FI.po b/po/fi_FI.po -index 49af156..17c7003 100644 ---- a/po/fi_FI.po -+++ b/po/fi_FI.po -@@ -934,6 +934,9 @@ msgstr "Tekstityksen l - msgid "Setup.DVB$Subtitle background transparency" - msgstr "Tekstityksen taustan lpinkyvyys" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "Salli teksti-TV-tuki" -+ - msgid "LNB" - msgstr "LNB" - -diff --git a/po/fr_FR.po b/po/fr_FR.po -index 7b23a5e..572902e 100644 ---- a/po/fr_FR.po -+++ b/po/fr_FR.po -@@ -937,6 +937,9 @@ msgstr "Transparence de l'avant-plan" - msgid "Setup.DVB$Subtitle background transparency" - msgstr "Transparence du fond" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "" -+ - msgid "LNB" - msgstr "LNB" - -diff --git a/po/hr_HR.po b/po/hr_HR.po -index 56b1bd8..edb6fee 100644 ---- a/po/hr_HR.po -+++ b/po/hr_HR.po -@@ -933,6 +933,9 @@ msgstr "Transparentnost titla" - msgid "Setup.DVB$Subtitle background transparency" - msgstr "Transparentnost pozadine titla" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "" -+ - msgid "LNB" - msgstr "LNB" - -diff --git a/po/hu_HU.po b/po/hu_HU.po -index 212d2fe..eefc7d7 100644 ---- a/po/hu_HU.po -+++ b/po/hu_HU.po -@@ -934,6 +934,9 @@ msgstr "Felirat transzparenci - msgid "Setup.DVB$Subtitle background transparency" - msgstr "Felirat htternek transzparencija" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "" -+ - msgid "LNB" - msgstr "LNB" - -diff --git a/po/it_IT.po b/po/it_IT.po -index ba7c57c..b2d5c3b 100644 ---- a/po/it_IT.po -+++ b/po/it_IT.po -@@ -938,6 +938,9 @@ msgstr "Trasparenza sottotitoli" - msgid "Setup.DVB$Subtitle background transparency" - msgstr "Trasparenza sfondo sottotitoli" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "" -+ - msgid "LNB" - msgstr "LNB" - -diff --git a/po/lt_LT.po b/po/lt_LT.po -index acf2309..4beb77c 100644 ---- a/po/lt_LT.po -+++ b/po/lt_LT.po -@@ -931,6 +931,9 @@ msgstr "Subtitrų priekinio vaizdo permatomumas" - msgid "Setup.DVB$Subtitle background transparency" - msgstr "Subtitrų fono permatomumas" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "" -+ - msgid "LNB" - msgstr "Konverteris (LNB)" - -diff --git a/po/nl_NL.po b/po/nl_NL.po -index 1e1d382..a25263e 100644 ---- a/po/nl_NL.po -+++ b/po/nl_NL.po -@@ -935,6 +935,9 @@ msgstr "Transparantie voorgrond ondertiteling" - msgid "Setup.DVB$Subtitle background transparency" - msgstr "Transparantie achtergrond ondertiteling" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "" -+ - msgid "LNB" - msgstr "LNB" - -diff --git a/po/nn_NO.po b/po/nn_NO.po -index 11668c7..92fb487 100644 ---- a/po/nn_NO.po -+++ b/po/nn_NO.po -@@ -932,6 +932,9 @@ msgstr "" - msgid "Setup.DVB$Subtitle background transparency" - msgstr "" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "" -+ - msgid "LNB" - msgstr "LNB" - -diff --git a/po/pl_PL.po b/po/pl_PL.po -index d1944cb..0e72f00 100644 ---- a/po/pl_PL.po -+++ b/po/pl_PL.po -@@ -932,6 +932,9 @@ msgstr "Prze - msgid "Setup.DVB$Subtitle background transparency" - msgstr "Przerocze podtytuw: To" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "" -+ - msgid "LNB" - msgstr "LNB" - -diff --git a/po/pt_PT.po b/po/pt_PT.po -index 99d8168..f2aa111 100644 ---- a/po/pt_PT.po -+++ b/po/pt_PT.po -@@ -931,6 +931,9 @@ msgstr "Transpar - msgid "Setup.DVB$Subtitle background transparency" - msgstr "Transparncia de background das legendas" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "" -+ - msgid "LNB" - msgstr "LNB" - -diff --git a/po/ro_RO.po b/po/ro_RO.po -index 31e6b17..380d4db 100644 ---- a/po/ro_RO.po -+++ b/po/ro_RO.po -@@ -934,6 +934,9 @@ msgstr "Transparen - msgid "Setup.DVB$Subtitle background transparency" - msgstr "Transparena fundalului subtitrrii" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "" -+ - msgid "LNB" - msgstr "LNB" - -diff --git a/po/ru_RU.po b/po/ru_RU.po -index 0796c19..418ccdb 100644 ---- a/po/ru_RU.po -+++ b/po/ru_RU.po -@@ -932,6 +932,9 @@ msgstr " - msgid "Setup.DVB$Subtitle background transparency" - msgstr " " - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "" -+ - msgid "LNB" - msgstr "" - -diff --git a/po/sk_SK.po b/po/sk_SK.po -index f53c251..55fdf40 100644 ---- a/po/sk_SK.po -+++ b/po/sk_SK.po -@@ -932,6 +932,9 @@ msgstr "Prieh - msgid "Setup.DVB$Subtitle background transparency" - msgstr "Priehadnos pozadia titulkov" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "" -+ - msgid "LNB" - msgstr "LNB" - -diff --git a/po/sl_SI.po b/po/sl_SI.po -index 88858e5..6135157 100644 ---- a/po/sl_SI.po -+++ b/po/sl_SI.po -@@ -932,6 +932,9 @@ msgstr "Transparentnost podnapisov" - msgid "Setup.DVB$Subtitle background transparency" - msgstr "Transparentnost ozadja podnapisov" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "" -+ - msgid "LNB" - msgstr "LNB" - -diff --git a/po/sv_SE.po b/po/sv_SE.po -index 1c5821b..870bc05 100644 ---- a/po/sv_SE.po -+++ b/po/sv_SE.po -@@ -934,6 +934,9 @@ msgstr "Transparent f - msgid "Setup.DVB$Subtitle background transparency" - msgstr "Transparent bakgrund textremsa" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "" -+ - msgid "LNB" - msgstr "LNB" - -diff --git a/po/tr_TR.po b/po/tr_TR.po -index 763a6b6..6bf7f41 100644 ---- a/po/tr_TR.po -+++ b/po/tr_TR.po -@@ -931,6 +931,9 @@ msgstr "Altyaz - msgid "Setup.DVB$Subtitle background transparency" - msgstr "Altyaz arka effaflk" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "" -+ - msgid "LNB" - msgstr "LNB" - -diff --git a/po/uk_UA.po b/po/uk_UA.po -index 2c080fe..da179a0 100644 ---- a/po/uk_UA.po -+++ b/po/uk_UA.po -@@ -931,6 +931,9 @@ msgstr "Прозорість переднього плану субтитрів" - msgid "Setup.DVB$Subtitle background transparency" - msgstr "Прозорість заднього плану субтитрів" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "" -+ - msgid "LNB" - msgstr "Конвертер" - -diff --git a/po/zh_CN.po b/po/zh_CN.po -index 30d1094..f886ae1 100644 ---- a/po/zh_CN.po -+++ b/po/zh_CN.po -@@ -934,6 +934,9 @@ msgstr "字幕前景透明度" - msgid "Setup.DVB$Subtitle background transparency" - msgstr "字幕背景透明度" - -+msgid "Setup.DVB$Enable teletext support" -+msgstr "" -+ - msgid "LNB" - msgstr "切换器设置" - -diff --git a/receiver.c b/receiver.c -index 58dda78..ed28f1b 100644 ---- a/receiver.c -+++ b/receiver.c -@@ -82,7 +82,8 @@ bool cReceiver::SetPids(const cChannel *Channel) - (Channel->Ppid() == Channel->Vpid() || AddPid(Channel->Ppid())) && - AddPids(Channel->Apids()) && - AddPids(Channel->Dpids()) && -- AddPids(Channel->Spids()); -+ AddPids(Channel->Spids()) && -+ (!Setup.SupportTeletext || AddPid(Channel->Tpid())); - } - return true; - } -diff --git a/remux.c b/remux.c -index 2532c63..31367a1 100644 ---- a/remux.c -+++ b/remux.c -@@ -215,6 +215,29 @@ int cPatPmtGenerator::MakeSubtitlingDescriptor(uchar *Target, const char *Langua - return i; - } - -+int cPatPmtGenerator::MakeTeletextDescriptor(uchar *Target, const tTeletextSubtitlePage *pages, int pageCount) -+{ -+ int i = 0, j = 0; -+ Target[i++] = SI::TeletextDescriptorTag; -+ int l = i; -+ Target[i++] = 0x00; // length -+ for (int n = 0; n < pageCount; n++) { -+ const char* Language = pages[n].ttxtLanguage; -+ Target[i++] = *Language++; -+ Target[i++] = *Language++; -+ Target[i++] = *Language++; -+ Target[i++] = (pages[n].ttxtType << 3) + pages[n].ttxtMagazine; -+ Target[i++] = pages[n].ttxtPage; -+ j++; -+ } -+ if (j > 0) { -+ Target[l] = j * 5; // update length -+ IncEsInfoLength(i); -+ return i; -+ } -+ return 0; -+} -+ - int cPatPmtGenerator::MakeLanguageDescriptor(uchar *Target, const char *Language) - { - int i = 0; -@@ -296,6 +319,7 @@ void cPatPmtGenerator::GeneratePmt(const cChannel *Channel) - if (Channel) { - int Vpid = Channel->Vpid(); - int Ppid = Channel->Ppid(); -+ int Tpid = Channel->Tpid(); - uchar *p = buf; - int i = 0; - p[i++] = 0x02; // table id -@@ -330,6 +354,10 @@ void cPatPmtGenerator::GeneratePmt(const cChannel *Channel) - i += MakeStream(buf + i, 0x06, Channel->Spid(n)); - i += MakeSubtitlingDescriptor(buf + i, Channel->Slang(n), Channel->SubtitlingType(n), Channel->CompositionPageId(n), Channel->AncillaryPageId(n)); - } -+ if (Tpid) { -+ i += MakeStream(buf + i, 0x06, Tpid); -+ i += MakeTeletextDescriptor(buf + i, Channel->TeletextSubtitlePages(), Channel->TotalTeletextSubtitlePages()); -+ } - - int sl = i - SectionLength - 2 + 4; // -2 = SectionLength storage, +4 = length of CRC - buf[SectionLength] |= (sl >> 8) & 0x0F; -@@ -403,6 +431,7 @@ void cPatPmtParser::Reset(void) - pmtPid = -1; - vpid = vtype = 0; - ppid = 0; -+ tpid = 0; - } - - void cPatPmtParser::ParsePat(const uchar *Data, int Length) -@@ -488,11 +517,13 @@ void cPatPmtParser::ParsePmt(const uchar *Data, int Length) - int NumSpids = 0; - vpid = vtype = 0; - ppid = 0; -+ tpid = 0; - apids[0] = 0; - dpids[0] = 0; - spids[0] = 0; - atypes[0] = 0; - dtypes[0] = 0; -+ totalTtxtSubtitlePages = 0; - SI::PMT::Stream stream; - for (SI::Loop::Iterator it; Pmt.streamLoop.getNext(stream, it); ) { - dbgpatpmt(" stream type = %02X, pid = %d", stream.getStreamType(), stream.getPid()); -@@ -586,6 +617,28 @@ void cPatPmtParser::ParsePmt(const uchar *Data, int Length) - spids[NumSpids]= 0; - } - break; -+ case SI::TeletextDescriptorTag: { -+ dbgpatpmt(" teletext"); -+ tpid = stream.getPid(); -+ SI::TeletextDescriptor *sd = (SI::TeletextDescriptor *)d; -+ SI::TeletextDescriptor::Teletext ttxt; -+ if (totalTtxtSubtitlePages < MAXTXTPAGES) { -+ for (SI::Loop::Iterator it; sd->teletextLoop.getNext(ttxt, it); ) { -+ bool isSubtitlePage = (ttxt.getTeletextType() == 0x02) || (ttxt.getTeletextType() == 0x05); -+ if (isSubtitlePage && ttxt.languageCode[0]) { -+ dbgpatpmt(" '%s:%x.%x'", ttxt.languageCode, ttxt.getTeletextMagazineNumber(), ttxt.getTeletextPageNumber()); -+ strn0cpy(teletextSubtitlePages[totalTtxtSubtitlePages].ttxtLanguage, I18nNormalizeLanguageCode(ttxt.languageCode), MAXLANGCODE1); -+ teletextSubtitlePages[totalTtxtSubtitlePages].ttxtPage = ttxt.getTeletextPageNumber(); -+ teletextSubtitlePages[totalTtxtSubtitlePages].ttxtMagazine = ttxt.getTeletextMagazineNumber(); -+ teletextSubtitlePages[totalTtxtSubtitlePages].ttxtType = ttxt.getTeletextType(); -+ totalTtxtSubtitlePages++; -+ if (totalTtxtSubtitlePages >= MAXTXTPAGES) -+ break; -+ } -+ } -+ } -+ } -+ break; - case SI::ISO639LanguageDescriptorTag: { - SI::ISO639LanguageDescriptor *ld = (SI::ISO639LanguageDescriptor *)d; - dbgpatpmt(" '%s'", ld->languageCode); -diff --git a/remux.h b/remux.h -index 1115c4a..7bf712e 100644 ---- a/remux.h -+++ b/remux.h -@@ -170,6 +170,7 @@ protected: - int MakeStream(uchar *Target, uchar Type, int Pid); - int MakeAC3Descriptor(uchar *Target); - int MakeSubtitlingDescriptor(uchar *Target, const char *Language, uchar SubtitlingType, uint16_t CompositionPageId, uint16_t AncillaryPageId); -+ int MakeTeletextDescriptor(uchar *Target, const tTeletextSubtitlePage *pages, int pageCount); - int MakeLanguageDescriptor(uchar *Target, const char *Language); - int MakeCRC(uchar *Target, const uchar *Data, int Length); - void GeneratePmtPid(const cChannel *Channel); -@@ -215,6 +216,7 @@ private: - int vpid; - int ppid; - int vtype; -+ int tpid; - int apids[MAXAPIDS + 1]; // list is zero-terminated - int atypes[MAXAPIDS + 1]; // list is zero-terminated - char alangs[MAXAPIDS][MAXLANGCODE2]; -@@ -227,6 +229,8 @@ private: - uint16_t compositionPageIds[MAXSPIDS]; - uint16_t ancillaryPageIds[MAXSPIDS]; - bool updatePrimaryDevice; -+ int totalTtxtSubtitlePages; -+ tTeletextSubtitlePage teletextSubtitlePages[MAXTXTPAGES]; - protected: - int SectionLength(const uchar *Data, int Length) { return (Length >= 3) ? ((int(Data[1]) & 0x0F) << 8)| Data[2] : 0; } - public: -@@ -259,6 +263,9 @@ public: - int Vtype(void) const { return vtype; } - ///< Returns the video stream type as defined by the current PMT, or 0 if no video - ///< stream type has been detected, yet. -+ int Tpid(void) { return tpid; } -+ ///< Returns the teletext pid as defined by the current PMT, or 0 if no teletext -+ ///< pid has been detected, yet. - const int *Apids(void) const { return apids; } - const int *Dpids(void) const { return dpids; } - const int *Spids(void) const { return spids; } -@@ -273,6 +280,8 @@ public: - uchar SubtitlingType(int i) const { return (0 <= i && i < MAXSPIDS) ? subtitlingTypes[i] : uchar(0); } - uint16_t CompositionPageId(int i) const { return (0 <= i && i < MAXSPIDS) ? compositionPageIds[i] : uint16_t(0); } - uint16_t AncillaryPageId(int i) const { return (0 <= i && i < MAXSPIDS) ? ancillaryPageIds[i] : uint16_t(0); } -+ const tTeletextSubtitlePage *TeletextSubtitlePages() const { return teletextSubtitlePages; } -+ int TotalTeletextSubtitlePages() const { return totalTtxtSubtitlePages; } - }; - - // TS to PES converter: -diff --git a/vdr.5 b/vdr.5 -index 7f5cce2..7532806 100644 ---- a/vdr.5 -+++ b/vdr.5 -@@ -207,6 +207,13 @@ can be indicated by adding a second language code, delimited by a '+' sign, as i - .TP - .B TPID - The teletext PID. -+ -+Fixed teletext subtitling pages can be defined separated by a semicolon. -+The pages (separated by commas) can contain ISO 639 language codes, delimited -+by a '=' sign, as in -+ -+.B ...:2001;150=deu,151=fin:... -+ - .TP - .B Conditional access - A hexadecimal integer defining how this channel can be accessed: -diff --git a/vdrttxtsubshooks.c b/vdrttxtsubshooks.c -new file mode 100644 -index 0000000..2471788 ---- /dev/null -+++ b/vdrttxtsubshooks.c -@@ -0,0 +1,63 @@ -+/* -+ * vdr-ttxtsubs - A plugin for the Linux Video Disk Recorder -+ * Copyright (c) 2003 - 2008 Ragnar Sundblad -+ * -+ * 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., -+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -+ * -+ */ -+ -+#include -+#include -+#include -+ -+#include "vdrttxtsubshooks.h" -+ -+// XXX Really should be a list... -+static cVDRTtxtsubsHookListener *gListener; -+ -+// ------ class cVDRTtxtsubsHookProxy ------ -+ -+class cVDRTtxtsubsHookProxy : public cVDRTtxtsubsHookListener -+{ -+ public: -+ virtual void HideOSD(void) { if(gListener) gListener->HideOSD(); }; -+ virtual void ShowOSD(void) { if(gListener) gListener->ShowOSD(); }; -+ virtual void PlayerTeletextData(uint8_t *p, int length, bool IsPesRecording, const struct tTeletextSubtitlePage teletextSubtitlePages[] = NULL, int pageCount = 0) -+ { if(gListener) gListener->PlayerTeletextData(p, length, IsPesRecording, teletextSubtitlePages, pageCount); }; -+ virtual int ManualPageNumber(const cChannel *channel) -+ { if(gListener) return gListener->ManualPageNumber(channel); else return 0; }; -+}; -+ -+ -+// ------ class cVDRTtxtsubsHookListener ------ -+ -+cVDRTtxtsubsHookListener::~cVDRTtxtsubsHookListener() -+{ -+ gListener = 0; -+} -+ -+void cVDRTtxtsubsHookListener::HookAttach(void) -+{ -+ gListener = this; -+ //printf("cVDRTtxtsubsHookListener::HookAttach\n"); -+} -+ -+static cVDRTtxtsubsHookProxy gProxy; -+ -+cVDRTtxtsubsHookListener *cVDRTtxtsubsHookListener::Hook(void) -+{ -+ return &gProxy; -+} -+ -diff --git a/vdrttxtsubshooks.h b/vdrttxtsubshooks.h -new file mode 100644 -index 0000000..2f97969 ---- /dev/null -+++ b/vdrttxtsubshooks.h -@@ -0,0 +1,46 @@ -+/* -+ * vdr-ttxtsubs - A plugin for the Linux Video Disk Recorder -+ * Copyright (c) 2003 - 2008 Ragnar Sundblad -+ * -+ * 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., -+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -+ * -+ */ -+ -+#ifndef __VDRTTXTSUBSHOOKS_H -+#define __VDRTTXTSUBSHOOKS_H -+ -+#define TTXTSUBSVERSNUM 2 -+ -+class cDevice; -+class cChannel; -+struct tTeletextSubtitlePage; -+ -+class cVDRTtxtsubsHookListener { -+ public: -+ cVDRTtxtsubsHookListener(void) {}; -+ virtual ~cVDRTtxtsubsHookListener(); -+ -+ void HookAttach(void); -+ -+ virtual void HideOSD(void) {}; -+ virtual void ShowOSD(void) {}; -+ virtual void PlayerTeletextData(uint8_t *p, int length, bool IsPesRecording = true, const struct tTeletextSubtitlePage teletextSubtitlePages[] = NULL, int pageCount = 0) {}; -+ virtual int ManualPageNumber(const cChannel *channel) { return 0; }; -+ -+ // used by VDR to call hook listeners -+ static cVDRTtxtsubsHookListener *Hook(void); -+}; -+ -+#endif diff --git a/patches/vdr-1.7.14-ttxtsubs.patch b/patches/vdr-1.7.14-ttxtsubs.patch new file mode 100644 index 0000000..1c5171e --- /dev/null +++ b/patches/vdr-1.7.14-ttxtsubs.patch @@ -0,0 +1,1047 @@ +diff --git a/MANUAL b/MANUAL +index 3fd528f..01c98b9 100644 +--- a/MANUAL ++++ b/MANUAL +@@ -725,6 +725,9 @@ Version 1.6 + background transparency. By default the values as broadcast + are used. + ++ Record Teletext Subtitles = no ++ If set to 'yes', teletext subtitles will be recorded. ++ + LNB: + + SLOF = 11700 The switching frequency (in MHz) between low and +diff --git a/Makefile b/Makefile +index 31f05b0..a45b189 100644 +--- a/Makefile ++++ b/Makefile +@@ -44,6 +44,8 @@ OBJS = audio.o channels.o ci.o config.o cutter.o device.o diseqc.o dvbdevice.o d + skinclassic.o skins.o skinsttng.o sourceparams.o sources.o spu.o status.o svdrp.o themes.o thread.o\ + timers.o tools.o transfer.o vdr.o videodir.o + ++OBJS += vdrttxtsubshooks.o ++ + ifndef NO_KBD + DEFINES += -DREMOTE_KBD + endif +diff --git a/channels.c b/channels.c +index a694d54..878c5ef 100644 +--- a/channels.c ++++ b/channels.c +@@ -365,6 +365,26 @@ void cChannel::SetSubtitlingDescriptors(uchar *SubtitlingTypes, uint16_t *Compos + } + } + ++void cChannel::SetTeletextSubtitlePages(tTeletextSubtitlePage pages[], int numberOfPages) ++{ ++ int mod = CHANNELMOD_NONE; ++ if (totalTtxtSubtitlePages != (fixedTtxtSubtitlePages + numberOfPages)) ++ mod |= CHANNELMOD_PIDS; ++ totalTtxtSubtitlePages = fixedTtxtSubtitlePages; ++ for (int i = 0; (i < numberOfPages) && (totalTtxtSubtitlePages < MAXTXTPAGES); i++) { ++ if (teletextSubtitlePages[totalTtxtSubtitlePages].ttxtMagazine != pages[i].ttxtMagazine || ++ teletextSubtitlePages[totalTtxtSubtitlePages].ttxtPage != pages[i].ttxtPage || ++ teletextSubtitlePages[totalTtxtSubtitlePages].ttxtType != pages[i].ttxtType || ++ strcmp(teletextSubtitlePages[totalTtxtSubtitlePages].ttxtLanguage, pages[i].ttxtLanguage)) { ++ mod |= CHANNELMOD_PIDS; ++ teletextSubtitlePages[totalTtxtSubtitlePages] = pages[i]; ++ } ++ totalTtxtSubtitlePages++; ++ } ++ modification |= mod; ++ Channels.SetModified(); ++} ++ + void cChannel::SetCaIds(const int *CaIds) + { + if (caids[0] && caids[0] <= CA_USER_MAX) +@@ -493,11 +513,22 @@ cString cChannel::ToText(const cChannel *Channel) + q += IntArrayToString(q, Channel->dpids, 10, Channel->dlangs); + } + *q = 0; ++ const int TBufferSize = 5 + 1 + (MAXTXTPAGES * (3 + 1 + MAXLANGCODE1 + 1)) + 10; // '12345;150=deu,151=fin,...', +10: paranoia ++ char tpidbuf[TBufferSize]; ++ q = tpidbuf; ++ q += snprintf(q, sizeof(tpidbuf), "%d", Channel->tpid); ++ if (Channel->fixedTtxtSubtitlePages > 0) { ++ q += snprintf(q, sizeof(tpidbuf) - (q - tpidbuf), ";"); ++ for (int i = 0; i < Channel->fixedTtxtSubtitlePages; ++i) { ++ tTeletextSubtitlePage page = Channel->teletextSubtitlePages[i]; ++ q += snprintf(q, sizeof(tpidbuf) - (q - tpidbuf), "%d=%s", page.PageNumber(), page.ttxtLanguage); ++ } ++ } + char caidbuf[MAXCAIDS * 5 + 10]; // 5: 4 digits plus delimiting ',', 10: paranoia + q = caidbuf; + q += IntArrayToString(q, Channel->caids, 16); + *q = 0; +- buffer = cString::sprintf("%s:%d:%s:%s:%d:%s:%s:%d:%s:%d:%d:%d:%d\n", FullName, Channel->frequency, *Channel->parameters, *cSource::ToString(Channel->source), Channel->srate, vpidbuf, apidbuf, Channel->tpid, caidbuf, Channel->sid, Channel->nid, Channel->tid, Channel->rid); ++ buffer = cString::sprintf("%s:%d:%s:%s:%d:%s:%s:%s:%s:%d:%d:%d:%d\n", FullName, Channel->frequency, *Channel->parameters, *cSource::ToString(Channel->source), Channel->srate, vpidbuf, apidbuf, tpidbuf, caidbuf, Channel->sid, Channel->nid, Channel->tid, Channel->rid); + } + return buffer; + } +@@ -531,8 +562,9 @@ bool cChannel::Parse(const char *s) + char *parambuf = NULL; + char *vpidbuf = NULL; + char *apidbuf = NULL; ++ char *tpidbuf = NULL; + char *caidbuf = NULL; +- int fields = sscanf(s, "%a[^:]:%d :%a[^:]:%a[^:] :%d :%a[^:]:%a[^:]:%d :%a[^:]:%d :%d :%d :%d ", &namebuf, &frequency, ¶mbuf, &sourcebuf, &srate, &vpidbuf, &apidbuf, &tpid, &caidbuf, &sid, &nid, &tid, &rid); ++ int fields = sscanf(s, "%a[^:]:%d :%a[^:]:%a[^:] :%d :%a[^:]:%a[^:]:%a[^:]:%a[^:]:%d :%d :%d :%d ", &namebuf, &frequency, ¶mbuf, &sourcebuf, &srate, &vpidbuf, &apidbuf, &tpidbuf, &caidbuf, &sid, &nid, &tid, &rid); + if (fields >= 9) { + if (fields == 9) { + // allow reading of old format +@@ -615,7 +647,37 @@ bool cChannel::Parse(const char *s) + } + dpids[NumDpids] = 0; + } +- ++ if (tpidbuf) { ++ char *p; ++ fixedTtxtSubtitlePages = 0; ++ // 2001;150=deu,151=fin ++ if ((p = strchr(tpidbuf, ';')) != NULL) { ++ char *q, *strtok_next; ++ *p++ = 0; ++ while ((q = strtok_r(p, ",", &strtok_next)) != NULL) { ++ if (fixedTtxtSubtitlePages < MAXTXTPAGES) { ++ int page; ++ char *l = strchr(q, '='); ++ if (l) ++ *l++ = 0; ++ if (sscanf(q, "%d", &page) == 1) { ++ teletextSubtitlePages[fixedTtxtSubtitlePages] = tTeletextSubtitlePage(page); ++ if (l) ++ strn0cpy(teletextSubtitlePages[fixedTtxtSubtitlePages].ttxtLanguage, l, MAXLANGCODE1); ++ fixedTtxtSubtitlePages++; ++ } ++ else ++ esyslog("ERROR: invalid Teletext page!"); // no need to set ok to 'false' ++ } ++ else ++ esyslog("ERROR: too many Teletext pages!"); // no need to set ok to 'false' ++ p = NULL; ++ } ++ totalTtxtSubtitlePages = fixedTtxtSubtitlePages; ++ } ++ if (sscanf(tpidbuf, "%d", &tpid) != 1) ++ return false; ++ } + if (caidbuf) { + char *p = caidbuf; + char *q; +@@ -652,6 +714,7 @@ bool cChannel::Parse(const char *s) + free(sourcebuf); + free(vpidbuf); + free(apidbuf); ++ free(tpidbuf); + free(caidbuf); + free(namebuf); + if (!GetChannelID().Valid()) { +diff --git a/channels.h b/channels.h +index 5c9727f..be94422 100644 +--- a/channels.h ++++ b/channels.h +@@ -35,6 +35,7 @@ + #define MAXDPIDS 16 // dolby (AC3 + DTS) + #define MAXSPIDS 32 // subtitles + #define MAXCAIDS 8 // conditional access ++#define MAXTXTPAGES 8 // teletext pages + + #define MAXLANGCODE1 4 // a 3 letter language code, zero terminated + #define MAXLANGCODE2 8 // up to two 3 letter language codes, separated by '+' and zero terminated +@@ -71,6 +72,16 @@ public: + static const tChannelID InvalidID; + }; + ++struct tTeletextSubtitlePage { ++ tTeletextSubtitlePage(void) { ttxtPage = ttxtMagazine = 0; ttxtType = 0x02; strcpy(ttxtLanguage, "und"); } ++ tTeletextSubtitlePage(int page) { ttxtMagazine = (page / 100) & 0x7; ttxtPage = (((page % 100) / 10) << 4) + (page % 10); ttxtType = 0x02; strcpy(ttxtLanguage, "und"); } ++ char ttxtLanguage[MAXLANGCODE1]; ++ uchar ttxtPage; ++ uchar ttxtMagazine; ++ uchar ttxtType; ++ int PageNumber(void) const { return BCDCHARTOINT(ttxtMagazine) * 100 + BCDCHARTOINT(ttxtPage); } ++ }; ++ + class cChannel; + + class cLinkChannel : public cListObject { +@@ -113,6 +124,9 @@ private: + uint16_t compositionPageIds[MAXSPIDS]; + uint16_t ancillaryPageIds[MAXSPIDS]; + int tpid; ++ int fixedTtxtSubtitlePages; ++ int totalTtxtSubtitlePages; ++ tTeletextSubtitlePage teletextSubtitlePages[MAXTXTPAGES]; + int caids[MAXCAIDS + 1]; // list is zero-terminated + int nid; + int tid; +@@ -160,6 +174,8 @@ public: + uint16_t CompositionPageId(int i) const { return (0 <= i && i < MAXSPIDS) ? compositionPageIds[i] : uint16_t(0); } + uint16_t AncillaryPageId(int i) const { return (0 <= i && i < MAXSPIDS) ? ancillaryPageIds[i] : uint16_t(0); } + int Tpid(void) const { return tpid; } ++ const tTeletextSubtitlePage *TeletextSubtitlePages() const { return teletextSubtitlePages; } ++ int TotalTeletextSubtitlePages() const { return totalTtxtSubtitlePages; } + const int *Caids(void) const { return caids; } + int Ca(int Index = 0) const { return Index < MAXCAIDS ? caids[Index] : 0; } + int Nid(void) const { return nid; } +@@ -186,6 +202,7 @@ public: + void SetName(const char *Name, const char *ShortName, const char *Provider); + void SetPortalName(const char *PortalName); + void SetPids(int Vpid, int Ppid, int Vtype, int *Apids, char ALangs[][MAXLANGCODE2], int *Dpids, char DLangs[][MAXLANGCODE2], int *Spids, char SLangs[][MAXLANGCODE2], int Tpid); ++ void SetTeletextSubtitlePages(tTeletextSubtitlePage pages[], int numberOfPages); + void SetCaIds(const int *CaIds); // list must be zero-terminated + void SetCaDescriptors(int Level); + void SetLinkChannels(cLinkChannels *LinkChannels); +diff --git a/ci.c b/ci.c +index 6c7b031..22fda9f 100644 +--- a/ci.c ++++ b/ci.c +@@ -1911,6 +1911,8 @@ void cCamSlot::AddChannel(const cChannel *Channel) + AddPid(Channel->Sid(), *Apid, STREAM_TYPE_AUDIO); + for (const int *Dpid = Channel->Dpids(); *Dpid; Dpid++) + AddPid(Channel->Sid(), *Dpid, STREAM_TYPE_DOLBY); ++ if (Channel->Tpid() && Setup.SupportTeletext) ++ AddPid(Channel->Sid(), Channel->Tpid(), STREAM_TYPE_DOLBY); + } + } + +@@ -1932,6 +1934,9 @@ bool cCamSlot::CanDecrypt(const cChannel *Channel) + CaPmt.AddPid(*Apid, STREAM_TYPE_AUDIO); + for (const int *Dpid = Channel->Dpids(); *Dpid; Dpid++) + CaPmt.AddPid(*Dpid, STREAM_TYPE_DOLBY); ++ if (Channel->Tpid() && Setup.SupportTeletext) { ++ CaPmt.AddPid(Channel->Tpid(), STREAM_TYPE_DOLBY); // FIXME: STREAM_TYPE_DOLBY should probably be renamed STREAM_TYPE_PRIVATE ++ } + cas->SendPMT(&CaPmt); + cTimeMs Timeout(QUERY_REPLY_TIMEOUT); + do { +diff --git a/config.c b/config.c +index aa18ebc..351f56d 100644 +--- a/config.c ++++ b/config.c +@@ -333,6 +333,7 @@ cSetup::cSetup(void) + MarginStop = 10; + AudioLanguages[0] = -1; + DisplaySubtitles = 0; ++ SupportTeletext = 0; + SubtitleLanguages[0] = -1; + SubtitleOffset = 0; + SubtitleFgTransparency = 0; +@@ -523,6 +524,7 @@ bool cSetup::Parse(const char *Name, const char *Value) + else if (!strcasecmp(Name, "MarginStop")) MarginStop = atoi(Value); + else if (!strcasecmp(Name, "AudioLanguages")) return ParseLanguages(Value, AudioLanguages); + else if (!strcasecmp(Name, "DisplaySubtitles")) DisplaySubtitles = atoi(Value); ++ else if (!strcasecmp(Name, "SupportTeletext")) SupportTeletext = atoi(Value); + else if (!strcasecmp(Name, "SubtitleLanguages")) return ParseLanguages(Value, SubtitleLanguages); + else if (!strcasecmp(Name, "SubtitleOffset")) SubtitleOffset = atoi(Value); + else if (!strcasecmp(Name, "SubtitleFgTransparency")) SubtitleFgTransparency = atoi(Value); +@@ -618,6 +620,7 @@ bool cSetup::Save(void) + Store("MarginStop", MarginStop); + StoreLanguages("AudioLanguages", AudioLanguages); + Store("DisplaySubtitles", DisplaySubtitles); ++ Store("SupportTeletext", SupportTeletext); + StoreLanguages("SubtitleLanguages", SubtitleLanguages); + Store("SubtitleOffset", SubtitleOffset); + Store("SubtitleFgTransparency", SubtitleFgTransparency); +diff --git a/config.h b/config.h +index f4996bb..ed355dd 100644 +--- a/config.h ++++ b/config.h +@@ -235,6 +235,7 @@ public: + int MarginStart, MarginStop; + int AudioLanguages[I18N_MAX_LANGUAGES + 1]; + int DisplaySubtitles; ++ int SupportTeletext; + int SubtitleLanguages[I18N_MAX_LANGUAGES + 1]; + int SubtitleOffset; + int SubtitleFgTransparency, SubtitleBgTransparency; +diff --git a/device.c b/device.c +index ac4d6d4..773cf21 100644 +--- a/device.c ++++ b/device.c +@@ -18,6 +18,7 @@ + #include "receiver.h" + #include "status.h" + #include "transfer.h" ++#include "vdrttxtsubshooks.h" + + // --- cLiveSubtitle --------------------------------------------------------- + +@@ -1223,6 +1224,13 @@ int cDevice::PlayPesPacket(const uchar *Data, int Length, bool VideoOnly) + } + break; + case 0xBD: { // private stream 1 ++ // EBU Teletext data, ETSI EN 300 472 ++ // if PES data header length = 24 and data_identifier = 0x10..0x1F (EBU Data) ++ if (Data[8] == 0x24 && Data[45] >= 0x10 && Data[45] < 0x20) { ++ cVDRTtxtsubsHookListener::Hook()->PlayerTeletextData((uint8_t*)Data, Length); ++ break; ++ } ++ + int PayloadOffset = Data[8] + 9; + + // Compatibility mode for old subtitles plugin: +@@ -1382,6 +1390,7 @@ int cDevice::PlayTs(const uchar *Data, int Length, bool VideoOnly) + tsToPesVideo.Reset(); + tsToPesAudio.Reset(); + tsToPesSubtitle.Reset(); ++ tsToPesTeletext.Reset(); + } + else if (Length < TS_SIZE) { + esyslog("ERROR: skipped %d bytes of TS fragment", Length); +@@ -1427,6 +1436,17 @@ int cDevice::PlayTs(const uchar *Data, int Length, bool VideoOnly) + if (!VideoOnly || HasIBPTrickSpeed()) + PlayTsSubtitle(Data, TS_SIZE); + } ++ else if (Pid == patPmtParser.Tpid()) { ++ if (!VideoOnly || HasIBPTrickSpeed()) { ++ int l; ++ tsToPesTeletext.PutTs(Data, Length); ++ if (const uchar *p = tsToPesTeletext.GetPes(l)) { ++ if ((l > 45) && (p[0] == 0x00) && (p[1] == 0x00) && (p[2] == 0x01) && (p[3] == 0xbd) && (p[8] == 0x24) && (p[45] >= 0x10) && (p[45] < 0x20)) ++ cVDRTtxtsubsHookListener::Hook()->PlayerTeletextData((uchar *)p, l, false, patPmtParser.TeletextSubtitlePages(), patPmtParser.TotalTeletextSubtitlePages()); ++ tsToPesTeletext.Reset(); ++ } ++ } ++ } + } + } + else if (Pid == patPmtParser.Ppid()) { +diff --git a/device.h b/device.h +index 9ce814a..426dc8f 100644 +--- a/device.h ++++ b/device.h +@@ -519,6 +519,7 @@ private: + cTsToPes tsToPesVideo; + cTsToPes tsToPesAudio; + cTsToPes tsToPesSubtitle; ++ cTsToPes tsToPesTeletext; + bool isPlayingVideo; + protected: + const cPatPmtParser *PatPmtParser(void) const { return &patPmtParser; } +diff --git a/menu.c b/menu.c +index e3b49ce..493d6ed 100644 +--- a/menu.c ++++ b/menu.c +@@ -2788,6 +2788,7 @@ void cMenuSetupDVB::Setup(void) + Add(new cMenuEditIntItem( tr("Setup.DVB$Subtitle foreground transparency"), &data.SubtitleFgTransparency, 0, 9)); + Add(new cMenuEditIntItem( tr("Setup.DVB$Subtitle background transparency"), &data.SubtitleBgTransparency, 0, 10)); + } ++ Add(new cMenuEditBoolItem(tr("Setup.DVB$Enable teletext support"), &data.SupportTeletext)); + + SetCurrent(Get(current)); + Display(); +diff --git a/pat.c b/pat.c +index 0d084e5..4541682 100644 +--- a/pat.c ++++ b/pat.c +@@ -13,6 +13,7 @@ + #include "libsi/section.h" + #include "libsi/descriptor.h" + #include "thread.h" ++#include "vdrttxtsubshooks.h" + + #define PMT_SCAN_TIMEOUT 10 // seconds + +@@ -341,6 +342,8 @@ void cPatFilter::Process(u_short Pid, u_char Tid, const u_char *Data, int Length + char DLangs[MAXDPIDS][MAXLANGCODE2] = { "" }; + char SLangs[MAXSPIDS][MAXLANGCODE2] = { "" }; + int Tpid = 0; ++ tTeletextSubtitlePage TeletextSubtitlePages[MAXTXTPAGES]; ++ int NumTPages = 0; + int NumApids = 0; + int NumDpids = 0; + int NumSpids = 0; +@@ -426,8 +429,21 @@ void cPatFilter::Process(u_short Pid, u_char Tid, const u_char *Data, int Length + NumSpids++; + } + break; +- case SI::TeletextDescriptorTag: ++ case SI::TeletextDescriptorTag: { + Tpid = esPid; ++ SI::TeletextDescriptor *sd = (SI::TeletextDescriptor *)d; ++ SI::TeletextDescriptor::Teletext ttxt; ++ for (SI::Loop::Iterator it; sd->teletextLoop.getNext(ttxt, it); ) { ++ bool isSubtitlePage = (ttxt.getTeletextType() == 0x02) || (ttxt.getTeletextType() == 0x05); ++ if ((NumTPages < MAXTXTPAGES) && ttxt.languageCode[0] && isSubtitlePage) { ++ strn0cpy(TeletextSubtitlePages[NumTPages].ttxtLanguage, I18nNormalizeLanguageCode(ttxt.languageCode), MAXLANGCODE1); ++ TeletextSubtitlePages[NumTPages].ttxtPage = ttxt.getTeletextPageNumber(); ++ TeletextSubtitlePages[NumTPages].ttxtMagazine = ttxt.getTeletextMagazineNumber(); ++ TeletextSubtitlePages[NumTPages].ttxtType = ttxt.getTeletextType(); ++ NumTPages++; ++ } ++ } ++ } + break; + case SI::ISO639LanguageDescriptorTag: { + SI::ISO639LanguageDescriptor *ld = (SI::ISO639LanguageDescriptor *)d; +@@ -481,6 +497,12 @@ void cPatFilter::Process(u_short Pid, u_char Tid, const u_char *Data, int Length + } + if (Setup.UpdateChannels >= 2) { + Channel->SetPids(Vpid, Ppid, Vtype, Apids, ALangs, Dpids, DLangs, Spids, SLangs, Tpid); ++ if (NumTPages < MAXTXTPAGES) { ++ int manualPageNumber = cVDRTtxtsubsHookListener::Hook()->ManualPageNumber(Channel); ++ if (manualPageNumber) ++ TeletextSubtitlePages[NumTPages++] = tTeletextSubtitlePage(manualPageNumber); ++ } ++ Channel->SetTeletextSubtitlePages(TeletextSubtitlePages, NumTPages); + Channel->SetCaIds(CaDescriptors->CaIds()); + Channel->SetSubtitlingDescriptors(SubtitlingTypes, CompositionPageIds, AncillaryPageIds); + } +diff --git a/po/ca_ES.po b/po/ca_ES.po +index 1dd35e3..af5627d 100644 +--- a/po/ca_ES.po ++++ b/po/ca_ES.po +@@ -937,6 +937,9 @@ msgstr "Transpar + msgid "Setup.DVB$Subtitle background transparency" + msgstr "Transparncia fons subttols" + ++msgid "Setup.DVB$Enable teletext support" ++msgstr "" ++ + msgid "LNB" + msgstr "Configuraci de l'LNB" + +diff --git a/po/cs_CZ.po b/po/cs_CZ.po +index e8c6687..68c5202 100644 +--- a/po/cs_CZ.po ++++ b/po/cs_CZ.po +@@ -935,6 +935,9 @@ msgstr "Pr + msgid "Setup.DVB$Subtitle background transparency" + msgstr "Prhlednost pozad titulk" + ++msgid "Setup.DVB$Enable teletext support" ++msgstr "" ++ + msgid "LNB" + msgstr "LNB" + +diff --git a/po/da_DK.po b/po/da_DK.po +index 580d82a..44bb590 100644 +--- a/po/da_DK.po ++++ b/po/da_DK.po +@@ -934,6 +934,9 @@ msgstr "Undertekst forgrundsgennemsigtighed" + msgid "Setup.DVB$Subtitle background transparency" + msgstr "Undertekst baggrundsgennemsigtighed" + ++msgid "Setup.DVB$Enable teletext support" ++msgstr "" ++ + msgid "LNB" + msgstr "LNB" + +diff --git a/po/de_DE.po b/po/de_DE.po +index 42caadc..07e96f6 100644 +--- a/po/de_DE.po ++++ b/po/de_DE.po +@@ -934,6 +934,9 @@ msgstr "Untertitel-Transparenz Vordergrund" + msgid "Setup.DVB$Subtitle background transparency" + msgstr "Untertitel-Transparenz Hintergrund" + ++msgid "Setup.DVB$Enable teletext support" ++msgstr "Videotext-Untersttzung aktivieren" ++ + msgid "LNB" + msgstr "LNB" + +diff --git a/po/el_GR.po b/po/el_GR.po +index 344b641..4206815 100644 +--- a/po/el_GR.po ++++ b/po/el_GR.po +@@ -934,6 +934,9 @@ msgstr "" + msgid "Setup.DVB$Subtitle background transparency" + msgstr "" + ++msgid "Setup.DVB$Enable teletext support" ++msgstr "" ++ + msgid "LNB" + msgstr "LNB" + +diff --git a/po/es_ES.po b/po/es_ES.po +index 4630a3b..a15e452 100644 +--- a/po/es_ES.po ++++ b/po/es_ES.po +@@ -935,6 +935,9 @@ msgstr "Transparencia primer plano subt + msgid "Setup.DVB$Subtitle background transparency" + msgstr "Transparencia fondo subttulos" + ++msgid "Setup.DVB$Enable teletext support" ++msgstr "" ++ + msgid "LNB" + msgstr "LNB" + +diff --git a/po/et_EE.po b/po/et_EE.po +index 803a539..f834e16 100644 +--- a/po/et_EE.po ++++ b/po/et_EE.po +@@ -934,6 +934,9 @@ msgstr "Subtiitri l + msgid "Setup.DVB$Subtitle background transparency" + msgstr "Subtiitri tausta lbipaistvus" + ++msgid "Setup.DVB$Enable teletext support" ++msgstr "Teleteksti tugi" ++ + msgid "LNB" + msgstr "LNB" + +diff --git a/po/fi_FI.po b/po/fi_FI.po +index 70e4d58..f07e5f7 100644 +--- a/po/fi_FI.po ++++ b/po/fi_FI.po +@@ -937,6 +937,9 @@ msgstr "Tekstityksen l + msgid "Setup.DVB$Subtitle background transparency" + msgstr "Tekstityksen taustan lpinkyvyys" + ++msgid "Setup.DVB$Enable teletext support" ++msgstr "Salli teksti-TV-tuki" ++ + msgid "LNB" + msgstr "LNB" + +diff --git a/po/fr_FR.po b/po/fr_FR.po +index 74d8ceb..9437bb4 100644 +--- a/po/fr_FR.po ++++ b/po/fr_FR.po +@@ -940,6 +940,9 @@ msgstr "Transparence de l'avant-plan" + msgid "Setup.DVB$Subtitle background transparency" + msgstr "Transparence du fond" + ++msgid "Setup.DVB$Enable teletext support" ++msgstr "" ++ + msgid "LNB" + msgstr "LNB" + +diff --git a/po/hr_HR.po b/po/hr_HR.po +index 55912e5..60f6483 100644 +--- a/po/hr_HR.po ++++ b/po/hr_HR.po +@@ -936,6 +936,9 @@ msgstr "Transparentnost titla" + msgid "Setup.DVB$Subtitle background transparency" + msgstr "Transparentnost pozadine titla" + ++msgid "Setup.DVB$Enable teletext support" ++msgstr "" ++ + msgid "LNB" + msgstr "LNB" + +diff --git a/po/hu_HU.po b/po/hu_HU.po +index ccc10cc..51e7c0f 100644 +--- a/po/hu_HU.po ++++ b/po/hu_HU.po +@@ -937,6 +937,9 @@ msgstr "Felirat transzparenci + msgid "Setup.DVB$Subtitle background transparency" + msgstr "Felirat htternek transzparencija" + ++msgid "Setup.DVB$Enable teletext support" ++msgstr "" ++ + msgid "LNB" + msgstr "LNB" + +diff --git a/po/it_IT.po b/po/it_IT.po +index c478284..25684ef 100644 +--- a/po/it_IT.po ++++ b/po/it_IT.po +@@ -941,6 +941,9 @@ msgstr "Trasparenza sottotitoli" + msgid "Setup.DVB$Subtitle background transparency" + msgstr "Trasparenza sfondo sottotitoli" + ++msgid "Setup.DVB$Enable teletext support" ++msgstr "" ++ + msgid "LNB" + msgstr "LNB" + +diff --git a/po/lt_LT.po b/po/lt_LT.po +index d79f03f..31b2457 100644 +--- a/po/lt_LT.po ++++ b/po/lt_LT.po +@@ -934,6 +934,9 @@ msgstr "Subtitrų priekinio vaizdo permatomumas" + msgid "Setup.DVB$Subtitle background transparency" + msgstr "Subtitrų fono permatomumas" + ++msgid "Setup.DVB$Enable teletext support" ++msgstr "" ++ + msgid "LNB" + msgstr "Konverteris (LNB)" + +diff --git a/po/nl_NL.po b/po/nl_NL.po +index f4d9120..e9a3679 100644 +--- a/po/nl_NL.po ++++ b/po/nl_NL.po +@@ -938,6 +938,9 @@ msgstr "Transparantie voorgrond ondertiteling" + msgid "Setup.DVB$Subtitle background transparency" + msgstr "Transparantie achtergrond ondertiteling" + ++msgid "Setup.DVB$Enable teletext support" ++msgstr "" ++ + msgid "LNB" + msgstr "LNB" + +diff --git a/po/nn_NO.po b/po/nn_NO.po +index e739b35..82b64be 100644 +--- a/po/nn_NO.po ++++ b/po/nn_NO.po +@@ -935,6 +935,9 @@ msgstr "" + msgid "Setup.DVB$Subtitle background transparency" + msgstr "" + ++msgid "Setup.DVB$Enable teletext support" ++msgstr "" ++ + msgid "LNB" + msgstr "LNB" + +diff --git a/po/pl_PL.po b/po/pl_PL.po +index 9af0227..83a4748 100644 +--- a/po/pl_PL.po ++++ b/po/pl_PL.po +@@ -935,6 +935,9 @@ msgstr "Prze + msgid "Setup.DVB$Subtitle background transparency" + msgstr "Przerocze podtytuw: To" + ++msgid "Setup.DVB$Enable teletext support" ++msgstr "" ++ + msgid "LNB" + msgstr "LNB" + +diff --git a/po/pt_PT.po b/po/pt_PT.po +index edea421..b1158e3 100644 +--- a/po/pt_PT.po ++++ b/po/pt_PT.po +@@ -934,6 +934,9 @@ msgstr "Transpar + msgid "Setup.DVB$Subtitle background transparency" + msgstr "Transparncia de background das legendas" + ++msgid "Setup.DVB$Enable teletext support" ++msgstr "" ++ + msgid "LNB" + msgstr "LNB" + +diff --git a/po/ro_RO.po b/po/ro_RO.po +index ffac7e9..32061de 100644 +--- a/po/ro_RO.po ++++ b/po/ro_RO.po +@@ -937,6 +937,9 @@ msgstr "Transparen + msgid "Setup.DVB$Subtitle background transparency" + msgstr "Transparena fundalului subtitrrii" + ++msgid "Setup.DVB$Enable teletext support" ++msgstr "" ++ + msgid "LNB" + msgstr "LNB" + +diff --git a/po/ru_RU.po b/po/ru_RU.po +index 4409394..0182ee7 100644 +--- a/po/ru_RU.po ++++ b/po/ru_RU.po +@@ -935,6 +935,9 @@ msgstr " + msgid "Setup.DVB$Subtitle background transparency" + msgstr " " + ++msgid "Setup.DVB$Enable teletext support" ++msgstr "" ++ + msgid "LNB" + msgstr "" + +diff --git a/po/sk_SK.po b/po/sk_SK.po +index bedb133..b240231 100644 +--- a/po/sk_SK.po ++++ b/po/sk_SK.po +@@ -935,6 +935,9 @@ msgstr "Prieh + msgid "Setup.DVB$Subtitle background transparency" + msgstr "Priehadnos pozadia titulkov" + ++msgid "Setup.DVB$Enable teletext support" ++msgstr "" ++ + msgid "LNB" + msgstr "LNB" + +diff --git a/po/sl_SI.po b/po/sl_SI.po +index 7f45b02..869d99b 100644 +--- a/po/sl_SI.po ++++ b/po/sl_SI.po +@@ -935,6 +935,9 @@ msgstr "Transparentnost podnapisov" + msgid "Setup.DVB$Subtitle background transparency" + msgstr "Transparentnost ozadja podnapisov" + ++msgid "Setup.DVB$Enable teletext support" ++msgstr "" ++ + msgid "LNB" + msgstr "LNB" + +diff --git a/po/sv_SE.po b/po/sv_SE.po +index 732e179..263c7ff 100644 +--- a/po/sv_SE.po ++++ b/po/sv_SE.po +@@ -937,6 +937,9 @@ msgstr "Transparent f + msgid "Setup.DVB$Subtitle background transparency" + msgstr "Transparent bakgrund textremsa" + ++msgid "Setup.DVB$Enable teletext support" ++msgstr "" ++ + msgid "LNB" + msgstr "LNB" + +diff --git a/po/tr_TR.po b/po/tr_TR.po +index 1a3382c..4e2c68f 100644 +--- a/po/tr_TR.po ++++ b/po/tr_TR.po +@@ -934,6 +934,9 @@ msgstr "Altyaz + msgid "Setup.DVB$Subtitle background transparency" + msgstr "Altyaz arka effaflk" + ++msgid "Setup.DVB$Enable teletext support" ++msgstr "" ++ + msgid "LNB" + msgstr "LNB" + +diff --git a/po/uk_UA.po b/po/uk_UA.po +index a373fb5..5cec5c1 100644 +--- a/po/uk_UA.po ++++ b/po/uk_UA.po +@@ -934,6 +934,9 @@ msgstr "Прозорість переднього плану субтитрів" + msgid "Setup.DVB$Subtitle background transparency" + msgstr "Прозорість заднього плану субтитрів" + ++msgid "Setup.DVB$Enable teletext support" ++msgstr "" ++ + msgid "LNB" + msgstr "Конвертер" + +diff --git a/po/zh_CN.po b/po/zh_CN.po +index 48c4a38..580c190 100644 +--- a/po/zh_CN.po ++++ b/po/zh_CN.po +@@ -937,6 +937,9 @@ msgstr "字幕前景透明度" + msgid "Setup.DVB$Subtitle background transparency" + msgstr "字幕背景透明度" + ++msgid "Setup.DVB$Enable teletext support" ++msgstr "" ++ + msgid "LNB" + msgstr "切换器设置" + +diff --git a/receiver.c b/receiver.c +index 58dda78..ed28f1b 100644 +--- a/receiver.c ++++ b/receiver.c +@@ -82,7 +82,8 @@ bool cReceiver::SetPids(const cChannel *Channel) + (Channel->Ppid() == Channel->Vpid() || AddPid(Channel->Ppid())) && + AddPids(Channel->Apids()) && + AddPids(Channel->Dpids()) && +- AddPids(Channel->Spids()); ++ AddPids(Channel->Spids()) && ++ (!Setup.SupportTeletext || AddPid(Channel->Tpid())); + } + return true; + } +diff --git a/remux.c b/remux.c +index 2532c63..31367a1 100644 +--- a/remux.c ++++ b/remux.c +@@ -215,6 +215,29 @@ int cPatPmtGenerator::MakeSubtitlingDescriptor(uchar *Target, const char *Langua + return i; + } + ++int cPatPmtGenerator::MakeTeletextDescriptor(uchar *Target, const tTeletextSubtitlePage *pages, int pageCount) ++{ ++ int i = 0, j = 0; ++ Target[i++] = SI::TeletextDescriptorTag; ++ int l = i; ++ Target[i++] = 0x00; // length ++ for (int n = 0; n < pageCount; n++) { ++ const char* Language = pages[n].ttxtLanguage; ++ Target[i++] = *Language++; ++ Target[i++] = *Language++; ++ Target[i++] = *Language++; ++ Target[i++] = (pages[n].ttxtType << 3) + pages[n].ttxtMagazine; ++ Target[i++] = pages[n].ttxtPage; ++ j++; ++ } ++ if (j > 0) { ++ Target[l] = j * 5; // update length ++ IncEsInfoLength(i); ++ return i; ++ } ++ return 0; ++} ++ + int cPatPmtGenerator::MakeLanguageDescriptor(uchar *Target, const char *Language) + { + int i = 0; +@@ -296,6 +319,7 @@ void cPatPmtGenerator::GeneratePmt(const cChannel *Channel) + if (Channel) { + int Vpid = Channel->Vpid(); + int Ppid = Channel->Ppid(); ++ int Tpid = Channel->Tpid(); + uchar *p = buf; + int i = 0; + p[i++] = 0x02; // table id +@@ -330,6 +354,10 @@ void cPatPmtGenerator::GeneratePmt(const cChannel *Channel) + i += MakeStream(buf + i, 0x06, Channel->Spid(n)); + i += MakeSubtitlingDescriptor(buf + i, Channel->Slang(n), Channel->SubtitlingType(n), Channel->CompositionPageId(n), Channel->AncillaryPageId(n)); + } ++ if (Tpid) { ++ i += MakeStream(buf + i, 0x06, Tpid); ++ i += MakeTeletextDescriptor(buf + i, Channel->TeletextSubtitlePages(), Channel->TotalTeletextSubtitlePages()); ++ } + + int sl = i - SectionLength - 2 + 4; // -2 = SectionLength storage, +4 = length of CRC + buf[SectionLength] |= (sl >> 8) & 0x0F; +@@ -403,6 +431,7 @@ void cPatPmtParser::Reset(void) + pmtPid = -1; + vpid = vtype = 0; + ppid = 0; ++ tpid = 0; + } + + void cPatPmtParser::ParsePat(const uchar *Data, int Length) +@@ -488,11 +517,13 @@ void cPatPmtParser::ParsePmt(const uchar *Data, int Length) + int NumSpids = 0; + vpid = vtype = 0; + ppid = 0; ++ tpid = 0; + apids[0] = 0; + dpids[0] = 0; + spids[0] = 0; + atypes[0] = 0; + dtypes[0] = 0; ++ totalTtxtSubtitlePages = 0; + SI::PMT::Stream stream; + for (SI::Loop::Iterator it; Pmt.streamLoop.getNext(stream, it); ) { + dbgpatpmt(" stream type = %02X, pid = %d", stream.getStreamType(), stream.getPid()); +@@ -586,6 +617,28 @@ void cPatPmtParser::ParsePmt(const uchar *Data, int Length) + spids[NumSpids]= 0; + } + break; ++ case SI::TeletextDescriptorTag: { ++ dbgpatpmt(" teletext"); ++ tpid = stream.getPid(); ++ SI::TeletextDescriptor *sd = (SI::TeletextDescriptor *)d; ++ SI::TeletextDescriptor::Teletext ttxt; ++ if (totalTtxtSubtitlePages < MAXTXTPAGES) { ++ for (SI::Loop::Iterator it; sd->teletextLoop.getNext(ttxt, it); ) { ++ bool isSubtitlePage = (ttxt.getTeletextType() == 0x02) || (ttxt.getTeletextType() == 0x05); ++ if (isSubtitlePage && ttxt.languageCode[0]) { ++ dbgpatpmt(" '%s:%x.%x'", ttxt.languageCode, ttxt.getTeletextMagazineNumber(), ttxt.getTeletextPageNumber()); ++ strn0cpy(teletextSubtitlePages[totalTtxtSubtitlePages].ttxtLanguage, I18nNormalizeLanguageCode(ttxt.languageCode), MAXLANGCODE1); ++ teletextSubtitlePages[totalTtxtSubtitlePages].ttxtPage = ttxt.getTeletextPageNumber(); ++ teletextSubtitlePages[totalTtxtSubtitlePages].ttxtMagazine = ttxt.getTeletextMagazineNumber(); ++ teletextSubtitlePages[totalTtxtSubtitlePages].ttxtType = ttxt.getTeletextType(); ++ totalTtxtSubtitlePages++; ++ if (totalTtxtSubtitlePages >= MAXTXTPAGES) ++ break; ++ } ++ } ++ } ++ } ++ break; + case SI::ISO639LanguageDescriptorTag: { + SI::ISO639LanguageDescriptor *ld = (SI::ISO639LanguageDescriptor *)d; + dbgpatpmt(" '%s'", ld->languageCode); +diff --git a/remux.h b/remux.h +index 1115c4a..7bf712e 100644 +--- a/remux.h ++++ b/remux.h +@@ -170,6 +170,7 @@ protected: + int MakeStream(uchar *Target, uchar Type, int Pid); + int MakeAC3Descriptor(uchar *Target); + int MakeSubtitlingDescriptor(uchar *Target, const char *Language, uchar SubtitlingType, uint16_t CompositionPageId, uint16_t AncillaryPageId); ++ int MakeTeletextDescriptor(uchar *Target, const tTeletextSubtitlePage *pages, int pageCount); + int MakeLanguageDescriptor(uchar *Target, const char *Language); + int MakeCRC(uchar *Target, const uchar *Data, int Length); + void GeneratePmtPid(const cChannel *Channel); +@@ -215,6 +216,7 @@ private: + int vpid; + int ppid; + int vtype; ++ int tpid; + int apids[MAXAPIDS + 1]; // list is zero-terminated + int atypes[MAXAPIDS + 1]; // list is zero-terminated + char alangs[MAXAPIDS][MAXLANGCODE2]; +@@ -227,6 +229,8 @@ private: + uint16_t compositionPageIds[MAXSPIDS]; + uint16_t ancillaryPageIds[MAXSPIDS]; + bool updatePrimaryDevice; ++ int totalTtxtSubtitlePages; ++ tTeletextSubtitlePage teletextSubtitlePages[MAXTXTPAGES]; + protected: + int SectionLength(const uchar *Data, int Length) { return (Length >= 3) ? ((int(Data[1]) & 0x0F) << 8)| Data[2] : 0; } + public: +@@ -259,6 +263,9 @@ public: + int Vtype(void) const { return vtype; } + ///< Returns the video stream type as defined by the current PMT, or 0 if no video + ///< stream type has been detected, yet. ++ int Tpid(void) { return tpid; } ++ ///< Returns the teletext pid as defined by the current PMT, or 0 if no teletext ++ ///< pid has been detected, yet. + const int *Apids(void) const { return apids; } + const int *Dpids(void) const { return dpids; } + const int *Spids(void) const { return spids; } +@@ -273,6 +280,8 @@ public: + uchar SubtitlingType(int i) const { return (0 <= i && i < MAXSPIDS) ? subtitlingTypes[i] : uchar(0); } + uint16_t CompositionPageId(int i) const { return (0 <= i && i < MAXSPIDS) ? compositionPageIds[i] : uint16_t(0); } + uint16_t AncillaryPageId(int i) const { return (0 <= i && i < MAXSPIDS) ? ancillaryPageIds[i] : uint16_t(0); } ++ const tTeletextSubtitlePage *TeletextSubtitlePages() const { return teletextSubtitlePages; } ++ int TotalTeletextSubtitlePages() const { return totalTtxtSubtitlePages; } + }; + + // TS to PES converter: +diff --git a/vdr.5 b/vdr.5 +index dbef7dc..001dfc3 100644 +--- a/vdr.5 ++++ b/vdr.5 +@@ -207,6 +207,13 @@ can be indicated by adding a second language code, delimited by a '+' sign, as i + .TP + .B TPID + The teletext PID. ++ ++Fixed teletext subtitling pages can be defined separated by a semicolon. ++The pages (separated by commas) can contain ISO 639 language codes, delimited ++by a '=' sign, as in ++ ++.B ...:2001;150=deu,151=fin:... ++ + .TP + .B Conditional access + A hexadecimal integer defining how this channel can be accessed: +diff --git a/vdrttxtsubshooks.c b/vdrttxtsubshooks.c +new file mode 100644 +index 0000000..2471788 +--- /dev/null ++++ b/vdrttxtsubshooks.c +@@ -0,0 +1,63 @@ ++/* ++ * vdr-ttxtsubs - A plugin for the Linux Video Disk Recorder ++ * Copyright (c) 2003 - 2008 Ragnar Sundblad ++ * ++ * 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., ++ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ * ++ */ ++ ++#include ++#include ++#include ++ ++#include "vdrttxtsubshooks.h" ++ ++// XXX Really should be a list... ++static cVDRTtxtsubsHookListener *gListener; ++ ++// ------ class cVDRTtxtsubsHookProxy ------ ++ ++class cVDRTtxtsubsHookProxy : public cVDRTtxtsubsHookListener ++{ ++ public: ++ virtual void HideOSD(void) { if(gListener) gListener->HideOSD(); }; ++ virtual void ShowOSD(void) { if(gListener) gListener->ShowOSD(); }; ++ virtual void PlayerTeletextData(uint8_t *p, int length, bool IsPesRecording, const struct tTeletextSubtitlePage teletextSubtitlePages[] = NULL, int pageCount = 0) ++ { if(gListener) gListener->PlayerTeletextData(p, length, IsPesRecording, teletextSubtitlePages, pageCount); }; ++ virtual int ManualPageNumber(const cChannel *channel) ++ { if(gListener) return gListener->ManualPageNumber(channel); else return 0; }; ++}; ++ ++ ++// ------ class cVDRTtxtsubsHookListener ------ ++ ++cVDRTtxtsubsHookListener::~cVDRTtxtsubsHookListener() ++{ ++ gListener = 0; ++} ++ ++void cVDRTtxtsubsHookListener::HookAttach(void) ++{ ++ gListener = this; ++ //printf("cVDRTtxtsubsHookListener::HookAttach\n"); ++} ++ ++static cVDRTtxtsubsHookProxy gProxy; ++ ++cVDRTtxtsubsHookListener *cVDRTtxtsubsHookListener::Hook(void) ++{ ++ return &gProxy; ++} ++ +diff --git a/vdrttxtsubshooks.h b/vdrttxtsubshooks.h +new file mode 100644 +index 0000000..2f97969 +--- /dev/null ++++ b/vdrttxtsubshooks.h +@@ -0,0 +1,46 @@ ++/* ++ * vdr-ttxtsubs - A plugin for the Linux Video Disk Recorder ++ * Copyright (c) 2003 - 2008 Ragnar Sundblad ++ * ++ * 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., ++ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ * ++ */ ++ ++#ifndef __VDRTTXTSUBSHOOKS_H ++#define __VDRTTXTSUBSHOOKS_H ++ ++#define TTXTSUBSVERSNUM 2 ++ ++class cDevice; ++class cChannel; ++struct tTeletextSubtitlePage; ++ ++class cVDRTtxtsubsHookListener { ++ public: ++ cVDRTtxtsubsHookListener(void) {}; ++ virtual ~cVDRTtxtsubsHookListener(); ++ ++ void HookAttach(void); ++ ++ virtual void HideOSD(void) {}; ++ virtual void ShowOSD(void) {}; ++ virtual void PlayerTeletextData(uint8_t *p, int length, bool IsPesRecording = true, const struct tTeletextSubtitlePage teletextSubtitlePages[] = NULL, int pageCount = 0) {}; ++ virtual int ManualPageNumber(const cChannel *channel) { return 0; }; ++ ++ // used by VDR to call hook listeners ++ static cVDRTtxtsubsHookListener *Hook(void); ++}; ++ ++#endif -- cgit v1.2.3