summaryrefslogtreecommitdiff
path: root/remux.c
diff options
context:
space:
mode:
authoretobi <git@e-tobi.net>2010-02-12 21:55:04 +0100
committeretobi <git@e-tobi.net>2013-03-10 12:04:12 +0100
commita932f6d2b2569e64d7fc56b5f128917709ff5a8c (patch)
tree13f4305423ae014c62d17b05cf1fff1217ab1cb9 /remux.c
parent4c59501a6b52816000d6c483fae619ebccfcdc9b (diff)
downloadvdr-patches-a932f6d2b2569e64d7fc56b5f128917709ff5a8c.tar.gz
vdr-patches-a932f6d2b2569e64d7fc56b5f128917709ff5a8c.tar.bz2
Record teletext subtitles
Diffstat (limited to 'remux.c')
-rw-r--r--remux.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/remux.c b/remux.c
index 9be3078..2e31012 100644
--- a/remux.c
+++ b/remux.c
@@ -385,6 +385,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;
@@ -472,6 +495,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
@@ -504,6 +528,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;
@@ -670,6 +698,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());