diff options
author | Tobias Grimm <git@e-tobi.net> | 2013-03-10 16:58:24 +0100 |
---|---|---|
committer | Tobias Grimm <git@e-tobi.net> | 2013-03-10 16:58:24 +0100 |
commit | a47f8e7da7c66c453d134654d9795f9e8345f90e (patch) | |
tree | 7031449769f730f43c5ce0b395a3e30fb478a8d3 /patches/patch-set.1.7.38/0006-Ttxtsubs-plugin-hook.patch | |
parent | 9745777fc2145796ca208033c116c7589725c394 (diff) | |
download | vdr-plugin-ttxtsubs-a47f8e7da7c66c453d134654d9795f9e8345f90e.tar.gz vdr-plugin-ttxtsubs-a47f8e7da7c66c453d134654d9795f9e8345f90e.tar.bz2 |
Updated patch for VDR 1.7.40
Diffstat (limited to 'patches/patch-set.1.7.38/0006-Ttxtsubs-plugin-hook.patch')
-rw-r--r-- | patches/patch-set.1.7.38/0006-Ttxtsubs-plugin-hook.patch | 256 |
1 files changed, 0 insertions, 256 deletions
diff --git a/patches/patch-set.1.7.38/0006-Ttxtsubs-plugin-hook.patch b/patches/patch-set.1.7.38/0006-Ttxtsubs-plugin-hook.patch deleted file mode 100644 index 9f0fec2..0000000 --- a/patches/patch-set.1.7.38/0006-Ttxtsubs-plugin-hook.patch +++ /dev/null @@ -1,256 +0,0 @@ -From 321f443bfd3273602e62ecc5f008a7f2a78bb17d 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 - ---- - 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 deletion(-) - create mode 100644 vdrttxtsubshooks.c - create mode 100644 vdrttxtsubshooks.h - -diff --git a/Makefile b/Makefile -index db59754..d6afb7e 100644 ---- a/Makefile -+++ b/Makefile -@@ -73,6 +73,8 @@ OBJS = audio.o channels.o ci.o config.o cutter.o device.o diseqc.o dvbdevice.o d - skinclassic.o skinlcars.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 -+ - DEFINES += $(CDEFINES) - INCLUDES += $(CINCLUDES) - -diff --git a/device.c b/device.c -index ca897b0..f22c6eb 100644 ---- a/device.c -+++ b/device.c -@@ -18,6 +18,7 @@ - #include "receiver.h" - #include "status.h" - #include "transfer.h" -+#include "vdrttxtsubshooks.h" - - // --- cLiveSubtitle --------------------------------------------------------- - -@@ -1313,6 +1314,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: -@@ -1472,6 +1480,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); -@@ -1517,6 +1526,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 fd010d4..41d410c 100644 ---- a/device.h -+++ b/device.h -@@ -584,6 +584,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 3f89258..d9731f8 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 - -@@ -562,6 +563,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, Atypes, ALangs, Dpids, Dtypes, 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 203ed34..396f41d 100644 ---- a/remux.h -+++ b/remux.h -@@ -410,7 +410,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 <ragge@nada.kth.se> -+ * -+ * 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 <stdlib.h> -+#include <stdio.h> -+#include <stdint.h> -+ -+#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 <ragge@nada.kth.se> -+ * -+ * 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.10.4 - |