summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Grimm <git@e-tobi.net>2010-02-14 22:50:13 +0100
committerTobias Grimm <git@e-tobi.net>2010-02-14 22:50:13 +0100
commit974b5b78567e350cd8b646be289b7a9c203cf9a4 (patch)
treed48de49b83b23c6054b6c06fea21d66a21f25d1b
parent481745255e5bb50287595e3134f517c6cbdcccea (diff)
downloadvdr-plugin-ttxtsubs-974b5b78567e350cd8b646be289b7a9c203cf9a4.tar.gz
vdr-plugin-ttxtsubs-974b5b78567e350cd8b646be289b7a9c203cf9a4.tar.bz2
Pass page count to plugin
-rw-r--r--patches/patch-set/0001-Record-teletext-subtitles.patch8
-rw-r--r--patches/patch-set/0002-Added-setup-option-to-enable-teletext-subtitle-recor.patch2
-rw-r--r--patches/patch-set/0003-Allow-manual-configuration-of-teletetxt-subtitle-pag.patch4
-rw-r--r--patches/patch-set/0004-Decrypt-teletext-stream.patch2
-rw-r--r--patches/patch-set/0005-Capture-teletext-subtitle-pages-from-PMT.patch2
-rw-r--r--patches/patch-set/0006-Ttxtsubs-plugin-hook.patch33
-rw-r--r--patches/vdr-1.7.12-ttxtsubs.patch27
-rw-r--r--ttxtsubs.c6
-rw-r--r--ttxtsubsdisplayer.c4
-rw-r--r--ttxtsubsdisplayer.h2
10 files changed, 53 insertions, 37 deletions
diff --git a/patches/patch-set/0001-Record-teletext-subtitles.patch b/patches/patch-set/0001-Record-teletext-subtitles.patch
index 207ac62..93f1d9c 100644
--- a/patches/patch-set/0001-Record-teletext-subtitles.patch
+++ b/patches/patch-set/0001-Record-teletext-subtitles.patch
@@ -1,4 +1,4 @@
-From 21d95f17ee8373033602f0cc79d3589ae2978019 Mon Sep 17 00:00:00 2001
+From 16f2ef39cd891a2333d9127c279d06d5e7204577 Mon Sep 17 00:00:00 2001
From: etobi <git@e-tobi.net>
Date: Fri, 12 Feb 2010 21:55:04 +0100
Subject: [PATCH 1/6] Record teletext subtitles
@@ -30,7 +30,7 @@ index c14df19..08ddf3e 100644
{
if (caids[0] && caids[0] <= CA_USER_MAX)
diff --git a/channels.h b/channels.h
-index b465f6a..acb346e 100644
+index b465f6a..60973b7 100644
--- a/channels.h
+++ b/channels.h
@@ -35,6 +35,7 @@
@@ -71,8 +71,8 @@ index b465f6a..acb346e 100644
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 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; }
diff --git a/patches/patch-set/0002-Added-setup-option-to-enable-teletext-subtitle-recor.patch b/patches/patch-set/0002-Added-setup-option-to-enable-teletext-subtitle-recor.patch
index cbd957c..61bad9b 100644
--- a/patches/patch-set/0002-Added-setup-option-to-enable-teletext-subtitle-recor.patch
+++ b/patches/patch-set/0002-Added-setup-option-to-enable-teletext-subtitle-recor.patch
@@ -1,4 +1,4 @@
-From 16a350dcad8b81dda4b0326d327af8a01628a48b Mon Sep 17 00:00:00 2001
+From 1bb47964b00e093abfb8690f26a287b5656cf5b2 Mon Sep 17 00:00:00 2001
From: etobi <git@e-tobi.net>
Date: Sat, 13 Feb 2010 14:42:30 +0100
Subject: [PATCH 2/6] Added setup option to enable teletext subtitle recording
diff --git a/patches/patch-set/0003-Allow-manual-configuration-of-teletetxt-subtitle-pag.patch b/patches/patch-set/0003-Allow-manual-configuration-of-teletetxt-subtitle-pag.patch
index 30094b2..caad40e 100644
--- a/patches/patch-set/0003-Allow-manual-configuration-of-teletetxt-subtitle-pag.patch
+++ b/patches/patch-set/0003-Allow-manual-configuration-of-teletetxt-subtitle-pag.patch
@@ -1,4 +1,4 @@
-From 578e95faa4f0724c664418587a756590a2947f26 Mon Sep 17 00:00:00 2001
+From 856573ae5f4845a0dac545d64edd5c3f7f387de3 Mon Sep 17 00:00:00 2001
From: etobi <git@e-tobi.net>
Date: Fri, 12 Feb 2010 21:56:41 +0100
Subject: [PATCH 3/6] Allow manual configuration of teletetxt subtitle pages in channels.conf
@@ -103,7 +103,7 @@ index 08ddf3e..0e23389 100644
free(namebuf);
if (!GetChannelID().Valid()) {
diff --git a/channels.h b/channels.h
-index acb346e..c61f770 100644
+index 60973b7..897c8cd 100644
--- a/channels.h
+++ b/channels.h
@@ -144,6 +144,7 @@ private:
diff --git a/patches/patch-set/0004-Decrypt-teletext-stream.patch b/patches/patch-set/0004-Decrypt-teletext-stream.patch
index 04ce9c6..1b90d50 100644
--- a/patches/patch-set/0004-Decrypt-teletext-stream.patch
+++ b/patches/patch-set/0004-Decrypt-teletext-stream.patch
@@ -1,4 +1,4 @@
-From 40f30d2e5ab735443071c61b5458b1d4fe9f5f89 Mon Sep 17 00:00:00 2001
+From b941978d0b1bb23ce39f84682854ce3aeeac6c85 Mon Sep 17 00:00:00 2001
From: etobi <git@e-tobi.net>
Date: Sun, 14 Feb 2010 01:30:34 +0100
Subject: [PATCH 4/6] Decrypt teletext stream
diff --git a/patches/patch-set/0005-Capture-teletext-subtitle-pages-from-PMT.patch b/patches/patch-set/0005-Capture-teletext-subtitle-pages-from-PMT.patch
index 3acdd15..1567ed1 100644
--- a/patches/patch-set/0005-Capture-teletext-subtitle-pages-from-PMT.patch
+++ b/patches/patch-set/0005-Capture-teletext-subtitle-pages-from-PMT.patch
@@ -1,4 +1,4 @@
-From c53754118c53807da2b62d3bb985bfd1e2bd0197 Mon Sep 17 00:00:00 2001
+From 0527d5ea66ee4752653b280ae0f75b47c9e36870 Mon Sep 17 00:00:00 2001
From: etobi <git@e-tobi.net>
Date: Fri, 12 Feb 2010 22:06:19 +0100
Subject: [PATCH 5/6] Capture teletext subtitle pages from PMT
diff --git a/patches/patch-set/0006-Ttxtsubs-plugin-hook.patch b/patches/patch-set/0006-Ttxtsubs-plugin-hook.patch
index d325f13..761cd4b 100644
--- a/patches/patch-set/0006-Ttxtsubs-plugin-hook.patch
+++ b/patches/patch-set/0006-Ttxtsubs-plugin-hook.patch
@@ -1,4 +1,4 @@
-From 1eafdc9add03826b63f05c7b9235c2429f5b083c Mon Sep 17 00:00:00 2001
+From 85bd01ba24dbfbb8653eada418cd57929fb4c016 Mon Sep 17 00:00:00 2001
From: etobi <git@e-tobi.net>
Date: Sat, 13 Feb 2010 00:28:21 +0100
Subject: [PATCH 6/6] Ttxtsubs plugin hook
@@ -8,9 +8,10 @@ Subject: [PATCH 6/6] Ttxtsubs plugin hook
device.c | 20 ++++++++++++++++
device.h | 1 +
pat.c | 6 +++++
+ remux.h | 3 +-
vdrttxtsubshooks.c | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++
vdrttxtsubshooks.h | 46 ++++++++++++++++++++++++++++++++++++++
- 6 files changed, 138 insertions(+), 0 deletions(-)
+ 7 files changed, 140 insertions(+), 1 deletions(-)
create mode 100644 vdrttxtsubshooks.c
create mode 100644 vdrttxtsubshooks.h
@@ -28,7 +29,7 @@ index 01408cb..b280030 100644
DEFINES += -DREMOTE_KBD
endif
diff --git a/device.c b/device.c
-index cb31b83..86b6b2c 100644
+index cb31b83..fb4c655 100644
--- a/device.c
+++ b/device.c
@@ -18,6 +18,7 @@
@@ -71,7 +72,7 @@ index cb31b83..86b6b2c 100644
+ 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());
++ cVDRTtxtsubsHookListener::Hook()->PlayerTeletextData((uchar *)p, l, false, patPmtParser.TeletextSubtitlePages(), patPmtParser.TotalTeletextSubtitlePages());
+ tsToPesTeletext.Reset();
+ }
+ }
@@ -115,9 +116,23 @@ index ff25501..c6e7834 100644
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..865596e
+index 0000000..2471788
--- /dev/null
+++ b/vdrttxtsubshooks.c
@@ -0,0 +1,63 @@
@@ -157,8 +172,8 @@ index 0000000..865596e
+ 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)
-+ { if(gListener) gListener->PlayerTeletextData(p, length, IsPesRecording, teletextSubtitlePages); };
++ 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; };
+};
@@ -186,7 +201,7 @@ index 0000000..865596e
+
diff --git a/vdrttxtsubshooks.h b/vdrttxtsubshooks.h
new file mode 100644
-index 0000000..2e8e9ba
+index 0000000..2f97969
--- /dev/null
+++ b/vdrttxtsubshooks.h
@@ -0,0 +1,46 @@
@@ -228,7 +243,7 @@ index 0000000..2e8e9ba
+
+ virtual void HideOSD(void) {};
+ virtual void ShowOSD(void) {};
-+ virtual void PlayerTeletextData(uint8_t *p, int length, bool IsPesRecording = true, const struct tTeletextSubtitlePage teletextSubtitlePages[] = NULL) {};
++ 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
diff --git a/patches/vdr-1.7.12-ttxtsubs.patch b/patches/vdr-1.7.12-ttxtsubs.patch
index 3333382..3a6af9c 100644
--- a/patches/vdr-1.7.12-ttxtsubs.patch
+++ b/patches/vdr-1.7.12-ttxtsubs.patch
@@ -125,7 +125,7 @@ index c14df19..0e23389 100644
free(namebuf);
if (!GetChannelID().Valid()) {
diff --git a/channels.h b/channels.h
-index b465f6a..c61f770 100644
+index b465f6a..897c8cd 100644
--- a/channels.h
+++ b/channels.h
@@ -35,6 +35,7 @@
@@ -167,8 +167,8 @@ index b465f6a..c61f770 100644
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 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; }
@@ -244,7 +244,7 @@ index be1d7bd..e7b094d 100644
int SubtitleOffset;
int SubtitleFgTransparency, SubtitleBgTransparency;
diff --git a/device.c b/device.c
-index cb31b83..86b6b2c 100644
+index cb31b83..fb4c655 100644
--- a/device.c
+++ b/device.c
@@ -18,6 +18,7 @@
@@ -287,7 +287,7 @@ index cb31b83..86b6b2c 100644
+ 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());
++ cVDRTtxtsubsHookListener::Hook()->PlayerTeletextData((uchar *)p, l, false, patPmtParser.TeletextSubtitlePages(), patPmtParser.TotalTeletextSubtitlePages());
+ tsToPesTeletext.Reset();
+ }
+ }
@@ -1072,7 +1072,7 @@ index 070a06a..ead63ea 100644
SI::ISO639LanguageDescriptor *ld = (SI::ISO639LanguageDescriptor *)d;
dbgpatpmt(" '%s'", ld->languageCode);
diff --git a/remux.h b/remux.h
-index 1115c4a..390236a 100644
+index 1115c4a..7bf712e 100644
--- a/remux.h
+++ b/remux.h
@@ -170,6 +170,7 @@ protected:
@@ -1110,11 +1110,12 @@ index 1115c4a..390236a 100644
const int *Apids(void) const { return apids; }
const int *Dpids(void) const { return dpids; }
const int *Spids(void) const { return spids; }
-@@ -273,6 +280,7 @@ public:
+@@ -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; }
++ const tTeletextSubtitlePage *TeletextSubtitlePages() const { return teletextSubtitlePages; }
++ int TotalTeletextSubtitlePages() const { return totalTtxtSubtitlePages; }
};
// TS to PES converter:
@@ -1138,7 +1139,7 @@ index 4b2cb90..c7da844 100644
A hexadecimal integer defining how this channel can be accessed:
diff --git a/vdrttxtsubshooks.c b/vdrttxtsubshooks.c
new file mode 100644
-index 0000000..865596e
+index 0000000..2471788
--- /dev/null
+++ b/vdrttxtsubshooks.c
@@ -0,0 +1,63 @@
@@ -1178,8 +1179,8 @@ index 0000000..865596e
+ 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)
-+ { if(gListener) gListener->PlayerTeletextData(p, length, IsPesRecording, teletextSubtitlePages); };
++ 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; };
+};
@@ -1207,7 +1208,7 @@ index 0000000..865596e
+
diff --git a/vdrttxtsubshooks.h b/vdrttxtsubshooks.h
new file mode 100644
-index 0000000..2e8e9ba
+index 0000000..2f97969
--- /dev/null
+++ b/vdrttxtsubshooks.h
@@ -0,0 +1,46 @@
@@ -1249,7 +1250,7 @@ index 0000000..2e8e9ba
+
+ virtual void HideOSD(void) {};
+ virtual void ShowOSD(void) {};
-+ virtual void PlayerTeletextData(uint8_t *p, int length, bool IsPesRecording = true, const struct tTeletextSubtitlePage teletextSubtitlePages[] = NULL) {};
++ 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
diff --git a/ttxtsubs.c b/ttxtsubs.c
index f4a6949..f566292 100644
--- a/ttxtsubs.c
+++ b/ttxtsubs.c
@@ -150,7 +150,7 @@ public:
// -- cVDRTtxtsubsHookListener
virtual void HideOSD(void) { HideTtxt(); }
virtual void ShowOSD(void) { ShowTtxt(); }
- virtual void PlayerTeletextData(uint8_t *p, int length, bool IsPesRecording, const struct tTeletextSubtitlePage teletextSubtitlePages[]);
+ virtual void PlayerTeletextData(uint8_t *p, int length, bool IsPesRecording, const struct tTeletextSubtitlePage teletextSubtitlePages[], int pageCount);
virtual int ManualPageNumber(const cChannel *channel);
// -- cThread
@@ -415,11 +415,11 @@ void cPluginTtxtsubs::Replaying(const cControl *Control, const char *Name, const
sem_post(&chswitchwait);
}
-void cPluginTtxtsubs::PlayerTeletextData(uint8_t *p, int length, bool IsPesRecording, const struct tTeletextSubtitlePage teletextSubtitlePages[])
+void cPluginTtxtsubs::PlayerTeletextData(uint8_t *p, int length, bool IsPesRecording, const struct tTeletextSubtitlePage teletextSubtitlePages[], int pageCount)
{
mDisplLock.Lock();
if (mDispl)
- mDispl->PES_data(p, length, IsPesRecording, teletextSubtitlePages);
+ mDispl->PES_data(p, length, IsPesRecording, teletextSubtitlePages, pageCount);
mDisplLock.Unlock();
}
diff --git a/ttxtsubsdisplayer.c b/ttxtsubsdisplayer.c
index 179bba2..64fd81d 100644
--- a/ttxtsubsdisplayer.c
+++ b/ttxtsubsdisplayer.c
@@ -100,7 +100,7 @@ cTtxtSubsPlayer::cTtxtSubsPlayer(int backup_textpage)
// Take PES packets and break out the teletext data
// Buffer the data for processing in a separate thread
// XXX We should do some filtering here to avoid unneccessary load!
-void cTtxtSubsPlayer::PES_data(uchar *p, int Length, bool IsPesRecording, const struct tTeletextSubtitlePage teletextSubtitlePages[])
+void cTtxtSubsPlayer::PES_data(uchar *p, int Length, bool IsPesRecording, const struct tTeletextSubtitlePage teletextSubtitlePages[], int pageCount)
{
int i;
@@ -115,7 +115,7 @@ void cTtxtSubsPlayer::PES_data(uchar *p, int Length, bool IsPesRecording, const
{
if (teletextSubtitlePages && teletextSubtitlePages[0].ttxtType)
{
- for (int p=0; teletextSubtitlePages[p].ttxtType; p++) {
+ for (int p=0; p < pageCount; p++) {
isyslog("ttxtsubs: got page info from vdr: %s 0x%02X 0x%2X.0x%02X", teletextSubtitlePages[p].ttxtLanguage, teletextSubtitlePages[p].ttxtType,
teletextSubtitlePages[p].ttxtMagazine, teletextSubtitlePages[p].ttxtPage);
int ch = globals.langChoise(teletextSubtitlePages[p].ttxtLanguage, teletextSubtitlePages[p].ttxtType == 0x05);
diff --git a/ttxtsubsdisplayer.h b/ttxtsubsdisplayer.h
index 20b296e..66fd10c 100644
--- a/ttxtsubsdisplayer.h
+++ b/ttxtsubsdisplayer.h
@@ -43,7 +43,7 @@ class cTtxtSubsDisplayer : public cThread {
class cTtxtSubsPlayer : public cTtxtSubsDisplayer {
public:
cTtxtSubsPlayer(int backup_textpage);
- virtual void PES_data(uchar *Data, int Length, bool IsPesRecording, const struct tTeletextSubtitlePage teletextSubtitlePages[]);
+ virtual void PES_data(uchar *Data, int Length, bool IsPesRecording, const struct tTeletextSubtitlePage teletextSubtitlePages[], int pageCount);
private:
void SearchLanguagePage(uint8_t *p, int len);