1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00

Implemented handling of HD resolution subtitles according to v1.3.1 of ETSI EN 300 743, chapter 7.2.1

This commit is contained in:
Klaus Schmidinger 2010-05-13 14:51:48 +02:00
parent 539c0da853
commit 08e6d87a86
4 changed files with 37 additions and 3 deletions

View File

@ -1095,6 +1095,8 @@ Rolf Ahrenberg <rahrenbe@cc.hut.fi>
for suggesting to assign the source character 'I' to "IPTV" for suggesting to assign the source character 'I' to "IPTV"
for fixing generating PMT language descriptors for multi language PIDs 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 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> Ralf Klueber <ralf.klueber@vodafone.com>
for reporting a bug in cutting a recording if there is only a single editing mark for reporting a bug in cutting a recording if there is only a single editing mark

View File

@ -6453,3 +6453,5 @@ Video Disk Recorder Revision History
- Updated the Czech OSD texts (thanks to Radek Stastny). - Updated the Czech OSD texts (thanks to Radek Stastny).
- Fixed a possible out of buffer memory access in case of bad TS data (reported - Fixed a possible out of buffer memory access in case of bad TS data (reported
by Rolf Ahrenberg). 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).

View File

@ -7,7 +7,7 @@
* Original author: Marco Schlüßler <marco@lordzodiac.de> * Original author: Marco Schlüßler <marco@lordzodiac.de>
* With some input from the "subtitle plugin" by Pekka Virtanen <pekka.virtanen@sci.fi> * 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" #include "dvbsubtitle.h"
@ -17,6 +17,7 @@
#define REGION_COMPOSITION_SEGMENT 0x11 #define REGION_COMPOSITION_SEGMENT 0x11
#define CLUT_DEFINITION_SEGMENT 0x12 #define CLUT_DEFINITION_SEGMENT 0x12
#define OBJECT_DATA_SEGMENT 0x13 #define OBJECT_DATA_SEGMENT 0x13
#define DISPLAY_DEFINITION_SEGMENT 0x14
#define END_OF_DISPLAY_SET_SEGMENT 0x80 #define END_OF_DISPLAY_SET_SEGMENT 0x80
// Set these to 'true' for debug output: // Set these to 'true' for debug output:
@ -659,6 +660,11 @@ cDvbSubtitleConverter::cDvbSubtitleConverter(void)
dvbSubtitleAssembler = new cDvbSubtitleAssembler; dvbSubtitleAssembler = new cDvbSubtitleAssembler;
osd = NULL; osd = NULL;
frozen = false; frozen = false;
ddsVersionNumber = 0;
displayWidth = 720;
displayHeight = 576;
displayHorizontalOffset = 0;
displayVerticalOffset = 0;
pages = new cList<cDvbSubtitlePage>; pages = new cList<cDvbSubtitlePage>;
bitmaps = new cList<cDvbSubtitleBitmaps>; bitmaps = new cList<cDvbSubtitleBitmaps>;
Start(); Start();
@ -687,6 +693,11 @@ void cDvbSubtitleConverter::Reset(void)
bitmaps->Clear(); bitmaps->Clear();
DELETENULL(osd); DELETENULL(osd);
frozen = false; frozen = false;
ddsVersionNumber = 0;
displayWidth = 720;
displayHeight = 576;
displayHorizontalOffset = 0;
displayVerticalOffset = 0;
Unlock(); Unlock();
} }
@ -842,7 +853,7 @@ tColor cDvbSubtitleConverter::yuv2rgb(int Y, int Cb, int Cr)
bool cDvbSubtitleConverter::AssertOsd(void) 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) 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; 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: { case END_OF_DISPLAY_SET_SEGMENT: {
dbgsegments("END_OF_DISPLAY_SET_SEGMENT\n"); dbgsegments("END_OF_DISPLAY_SET_SEGMENT\n");
FinishPage(page); FinishPage(page);

View File

@ -6,7 +6,7 @@
* *
* Original author: Marco Schlüßler <marco@lordzodiac.de> * 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 #ifndef __DVBSUBTITLE_H
@ -26,6 +26,11 @@ private:
cDvbSubtitleAssembler *dvbSubtitleAssembler; cDvbSubtitleAssembler *dvbSubtitleAssembler;
cOsd *osd; cOsd *osd;
bool frozen; bool frozen;
int ddsVersionNumber;
int displayWidth;
int displayHeight;
int displayHorizontalOffset;
int displayVerticalOffset;
cList<cDvbSubtitlePage> *pages; cList<cDvbSubtitlePage> *pages;
cList<cDvbSubtitleBitmaps> *bitmaps; cList<cDvbSubtitleBitmaps> *bitmaps;
tColor yuv2rgb(int Y, int Cb, int Cr); tColor yuv2rgb(int Y, int Cb, int Cr);