summaryrefslogtreecommitdiff
path: root/dvbsubtitle.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2010-05-13 14:51:48 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2010-05-13 14:51:48 +0200
commit08e6d87a866c0ed737e9ce82cb5c562d4617e163 (patch)
tree536c40ebb4f9a96fc15b4148e92fc21a51f5b0d4 /dvbsubtitle.c
parent539c0da85348b52534429bed7ff0a5ea24bbf00f (diff)
downloadvdr-08e6d87a866c0ed737e9ce82cb5c562d4617e163.tar.gz
vdr-08e6d87a866c0ed737e9ce82cb5c562d4617e163.tar.bz2
Implemented handling of HD resolution subtitles according to v1.3.1 of ETSI EN 300 743, chapter 7.2.1
Diffstat (limited to 'dvbsubtitle.c')
-rw-r--r--dvbsubtitle.c29
1 files changed, 27 insertions, 2 deletions
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);