summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CONTRIBUTORS2
-rw-r--r--HISTORY2
-rw-r--r--dvbsubtitle.c29
-rw-r--r--dvbsubtitle.h7
4 files changed, 37 insertions, 3 deletions
diff --git a/CONTRIBUTORS b/CONTRIBUTORS
index b0603937..9a6ab5de 100644
--- a/CONTRIBUTORS
+++ b/CONTRIBUTORS
@@ -1095,6 +1095,8 @@ Rolf Ahrenberg <rahrenbe@cc.hut.fi>
for suggesting to assign the source character 'I' to "IPTV"
for fixing generating PMT language descriptors for multi language PIDs
for reporting a possible out of buffer memory access in case of bad TS data
+ for implementing handling of HD resolution subtitles according to v1.3.1 of
+ ETSI EN 300 743, chapter 7.2.1
Ralf Klueber <ralf.klueber@vodafone.com>
for reporting a bug in cutting a recording if there is only a single editing mark
diff --git a/HISTORY b/HISTORY
index c5927e76..2fe578a3 100644
--- a/HISTORY
+++ b/HISTORY
@@ -6453,3 +6453,5 @@ Video Disk Recorder Revision History
- Updated the Czech OSD texts (thanks to Radek Stastny).
- Fixed a possible out of buffer memory access in case of bad TS data (reported
by Rolf Ahrenberg).
+- Implemented handling of HD resolution subtitles according to v1.3.1 of
+ ETSI EN 300 743, chapter 7.2.1 (thanks to Rolf Ahrenberg).
diff --git a/dvbsubtitle.c b/dvbsubtitle.c
index a02a01f3..c5544316 100644
--- a/dvbsubtitle.c
+++ b/dvbsubtitle.c
@@ -7,7 +7,7 @@
* Original author: Marco Schlüßler <marco@lordzodiac.de>
* With some input from the "subtitle plugin" by Pekka Virtanen <pekka.virtanen@sci.fi>
*
- * $Id: dvbsubtitle.c 2.4 2010/02/07 12:08:13 kls Exp $
+ * $Id: dvbsubtitle.c 2.5 2010/05/13 14:43:44 kls Exp $
*/
#include "dvbsubtitle.h"
@@ -17,6 +17,7 @@
#define REGION_COMPOSITION_SEGMENT 0x11
#define CLUT_DEFINITION_SEGMENT 0x12
#define OBJECT_DATA_SEGMENT 0x13
+#define DISPLAY_DEFINITION_SEGMENT 0x14
#define END_OF_DISPLAY_SET_SEGMENT 0x80
// Set these to 'true' for debug output:
@@ -659,6 +660,11 @@ cDvbSubtitleConverter::cDvbSubtitleConverter(void)
dvbSubtitleAssembler = new cDvbSubtitleAssembler;
osd = NULL;
frozen = false;
+ ddsVersionNumber = 0;
+ displayWidth = 720;
+ displayHeight = 576;
+ displayHorizontalOffset = 0;
+ displayVerticalOffset = 0;
pages = new cList<cDvbSubtitlePage>;
bitmaps = new cList<cDvbSubtitleBitmaps>;
Start();
@@ -687,6 +693,11 @@ void cDvbSubtitleConverter::Reset(void)
bitmaps->Clear();
DELETENULL(osd);
frozen = false;
+ ddsVersionNumber = 0;
+ displayWidth = 720;
+ displayHeight = 576;
+ displayHorizontalOffset = 0;
+ displayVerticalOffset = 0;
Unlock();
}
@@ -842,7 +853,7 @@ tColor cDvbSubtitleConverter::yuv2rgb(int Y, int Cb, int Cr)
bool cDvbSubtitleConverter::AssertOsd(void)
{
- return osd || (osd = cOsdProvider::NewOsd(0, Setup.SubtitleOffset, OSD_LEVEL_SUBTITLES));
+ return osd || (osd = cOsdProvider::NewOsd(displayHorizontalOffset, displayVerticalOffset + Setup.SubtitleOffset, OSD_LEVEL_SUBTITLES));
}
int cDvbSubtitleConverter::ExtractSegment(const uchar *Data, int Length, int64_t Pts)
@@ -1001,6 +1012,20 @@ int cDvbSubtitleConverter::ExtractSegment(const uchar *Data, int Length, int64_t
}
break;
}
+ case DISPLAY_DEFINITION_SEGMENT: {
+ dbgsegments("DISPLAY_DEFINITION_SEGMENT\n");
+ int version = (Data[6] & 0xF0) >> 4;
+ if (version != ddsVersionNumber) {
+ int displayWindowFlag = (Data[6] & 0x08) >> 3;
+ displayWidth = (Data[7] << 8) | Data[8];
+ displayHeight = (Data[9] << 8) | Data[10];
+ displayHorizontalOffset = displayWindowFlag ? Data[11] : 0; // displayWindowHorizontalPositionMinimum
+ displayVerticalOffset = displayWindowFlag ? Data[13] : 0; // displayWindowVerticalPositionMinimum
+ SetupChanged();
+ ddsVersionNumber = version;
+ }
+ break;
+ }
case END_OF_DISPLAY_SET_SEGMENT: {
dbgsegments("END_OF_DISPLAY_SET_SEGMENT\n");
FinishPage(page);
diff --git a/dvbsubtitle.h b/dvbsubtitle.h
index c6775a9e..68886610 100644
--- a/dvbsubtitle.h
+++ b/dvbsubtitle.h
@@ -6,7 +6,7 @@
*
* Original author: Marco Schlüßler <marco@lordzodiac.de>
*
- * $Id: dvbsubtitle.h 2.2 2010/02/07 11:55:14 kls Exp $
+ * $Id: dvbsubtitle.h 2.3 2010/05/13 14:43:44 kls Exp $
*/
#ifndef __DVBSUBTITLE_H
@@ -26,6 +26,11 @@ private:
cDvbSubtitleAssembler *dvbSubtitleAssembler;
cOsd *osd;
bool frozen;
+ int ddsVersionNumber;
+ int displayWidth;
+ int displayHeight;
+ int displayHorizontalOffset;
+ int displayVerticalOffset;
cList<cDvbSubtitlePage> *pages;
cList<cDvbSubtitleBitmaps> *bitmaps;
tColor yuv2rgb(int Y, int Cb, int Cr);