14#define __STDC_FORMAT_MACROS
19#define PAGE_COMPOSITION_SEGMENT 0x10
20#define REGION_COMPOSITION_SEGMENT 0x11
21#define CLUT_DEFINITION_SEGMENT 0x12
22#define OBJECT_DATA_SEGMENT 0x13
23#define DISPLAY_DEFINITION_SEGMENT 0x14
24#define DISPARITY_SIGNALING_SEGMENT 0x15
25#define END_OF_DISPLAY_SET_SEGMENT 0x80
26#define STUFFING_SEGMENT 0xFF
28#define PGS_PALETTE_SEGMENT 0x14
29#define PGS_OBJECT_SEGMENT 0x15
30#define PGS_PRESENTATION_SEGMENT 0x16
31#define PGS_WINDOW_SEGMENT 0x17
32#define PGS_DISPLAY_SEGMENT 0x80
49#define dbgdisplay(a...) if (DebugDisplay) SD.WriteHtml(a)
50#define dbgpages(a...) if (DebugPages) SD.WriteHtml(a)
51#define dbgregions(a...) if (DebugRegions) SD.WriteHtml(a)
52#define dbgobjects(a...) if (DebugObjects) SD.WriteHtml(a)
53#define dbgconverter(a...) if (DebugConverter) SD.WriteHtml(a)
54#define dbgsegments(a...) if (DebugSegments) SD.WriteHtml(a)
55#define dbgpixel(a...) if (DebugPixel) SD.WriteHtml(a)
56#define dbgcluts(a...) if (DebugCluts) SD.WriteHtml(a)
57#define dbgoutput(a...) if (DebugOutput) SD.WriteHtml(a)
59#define DBGMAXBITMAPS 100
60#define DBGBITMAPWIDTH 400
62#define FIX_SUBTITLE_VERSION_BROADCASTER_STUPIDITY
98 int w = MaxX ? int(round(MaxX *
factor)) : Scaled->
Width();
99 int h = MaxY ? int(round(MaxY *
factor)) : Scaled->
Height();
100 uchar mem[w * h * 3];
101 for (
int x = 0; x < w; x++) {
102 for (
int y = 0; y < h; y++) {
104 int o = (y * w + x) * 3;
105 mem[o++] = (c & 0x00FF0000) >> 16;
106 mem[o++] = (c & 0x0000FF00) >> 8;
107 mem[o] = (c & 0x000000FF);
114 int f = open(ImgName, O_WRONLY | O_CREAT, DEFFILEMODE);
116 if (write(f, Jpeg, Size) < 0)
129 if (FILE *f = fopen(
"dbg-log.htm",
newFile ?
"w" :
"a")) {
131 va_start(ap, Format);
132 vfprintf(f, Format, ap);
166 int a = 0, r = 0, g = 0, b = 0;
176 for (
int i = 1; i < 16; ++i) {
178 r = (i & 1) ? 255 : 0;
179 g = (i & 2) ? 255 : 0;
180 b = (i & 4) ? 255 : 0;
183 r = (i & 1) ? 127 : 0;
184 g = (i & 2) ? 127 : 0;
185 b = (i & 4) ? 127 : 0;
191 for (
int i = 1; i < 256; ++i) {
193 r = (i & 1) ? 255 : 0;
194 g = (i & 2) ? 255 : 0;
195 b = (i & 4) ? 255 : 0;
201 r = ((i & 1) ? 85 : 0) + ((i & 0x10) ? 170 : 0);
202 g = ((i & 2) ? 85 : 0) + ((i & 0x20) ? 170 : 0);
203 b = ((i & 4) ? 85 : 0) + ((i & 0x40) ? 170 : 0);
207 r = ((i & 1) ? 85 : 0) + ((i & 0x10) ? 170 : 0);
208 g = ((i & 2) ? 85 : 0) + ((i & 0x20) ? 170 : 0);
209 b = ((i & 4) ? 85 : 0) + ((i & 0x40) ? 170 : 0);
213 r = 127 + ((i & 1) ? 43 : 0) + ((i & 0x10) ? 85 : 0);
214 g = 127 + ((i & 2) ? 43 : 0) + ((i & 0x20) ? 85 : 0);
215 b = 127 + ((i & 4) ? 43 : 0) + ((i & 0x40) ? 85 : 0);
219 r = ((i & 1) ? 43 : 0) + ((i & 0x10) ? 85 : 0);
220 g = ((i & 2) ? 43 : 0) + ((i & 0x20) ? 85 : 0);
221 b = ((i & 4) ? 43 : 0) + ((i & 0x40) ? 85 : 0);
233#ifndef FIX_SUBTITLE_VERSION_BROADCASTER_STUPIDITY
240 while (!bs.
IsEOF()) {
242 bool entryClut2Flag = bs.
GetBit();
243 bool entryClut4Flag = bs.
GetBit();
244 bool entryClut8Flag = bs.
GetBit();
264 value =
yuv2rgb(yval, cbval, crval);
265 value |= ((10 - (clutEntryId ?
Setup.SubtitleFgTransparency :
Setup.SubtitleBgTransparency)) * (255 - tval) / 10) << 24;
267 dbgcluts(
"%2d %d %d %d %08X<br>\n", clutEntryId, entryClut2Flag ? 2 : 0, entryClut4Flag ? 4 : 0, entryClut8Flag ? 8 : 0, value);
284 for (
int i = 0; i < 256; ++i)
286 while (!bs.
IsEOF()) {
294 value =
yuv2rgb(yval, cbval, crval);
295 value |= ((10 - (clutEntryId ?
Setup.SubtitleFgTransparency :
Setup.SubtitleBgTransparency)) * tval / 10) << 24;
297 dbgcluts(
"%2d %08X<br>\n", clutEntryId, value);
311 Er =
constrain((298 * Ey + 460 * Epr) / 256, 0, 255);
312 Eg =
constrain((298 * Ey - 55 * Epb - 137 * Epr) / 256, 0, 255);
313 Eb =
constrain((298 * Ey + 543 * Epb ) / 256, 0, 255);
315 return (Er << 16) | (Eg << 8) | Eb;
324 default:
esyslog(
"ERROR: wrong Bpp in cSubtitleClut::SetColor(%d, %d, %08X)", Bpp,
Index, Color);
334 default:
esyslog(
"ERROR: wrong Bpp in cSubtitleClut::GetPalette(%d)", Bpp);
398#ifndef FIX_SUBTITLE_VERSION_BROADCASTER_STUPIDITY
423 int numberOfCodes = bs.
GetBits(8);
436 if (b.
Dirty(x1, y1, x2, y2)) {
437 cString ImgName =
SD.WriteJpeg(&b, x2, y2);
438 dbgobjects(
"<img src=\"%s\"><br>\n", *ImgName);
450 int sequenceDescriptor = bs.
GetBits(8);
451 if (!(sequenceDescriptor & 0x80) &&
topData != NULL) {
477 if (NumberOfCodes > 0) {
478 char txt[NumberOfCodes + 1];
479 for (
int i = 0; i < NumberOfCodes; i++)
480 txt[i] = Data[i * 2 + 1];
481 txt[NumberOfCodes] = 0;
483 int len = NumberOfCodes;
485 dbgobjects(
" table %s raw '%s'", CharacterTable, from);
487 const char *s = conv.
Convert((
const char *)from);
497 int y = Even ? 0 : 1;
498 uint8_t map2to4[ 4] = { 0x00, 0x07, 0x08, 0x0F };
499 uint8_t map2to8[ 4] = { 0x00, 0x77, 0x88, 0xFF };
500 uint8_t map4to8[16] = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF };
501 const uint8_t *mapTable = NULL;
503 while (!bs.
IsEOF()) {
506 dbgpixel(
"2-bit / pixel code string<br>\n");
507 switch (Bitmap->
Bpp()) {
508 case 8: mapTable = map2to8;
break;
509 case 4: mapTable = map2to4;
break;
510 default: mapTable = NULL;
break;
517 dbgpixel(
"4-bit / pixel code string<br>\n");
518 switch (Bitmap->
Bpp()) {
519 case 8: mapTable = map4to8;
break;
520 default: mapTable = NULL;
break;
527 dbgpixel(
"8-bit / pixel code string<br>\n");
532 dbgpixel(
"sub block 2 to 4 map<br>\n");
533 for (
int i = 0; i < 4; ++i)
537 dbgpixel(
"sub block 2 to 8 map<br>\n");
538 for (
int i = 0; i < 4; ++i)
542 dbgpixel(
"sub block 4 to 8 map<br>\n");
543 for (
int i = 0; i < 16; ++i)
547 dbgpixel(
"end of object line<br>\n");
552 dbgpixel(
"PGS code string, including EOLs<br>\n");
558 default:
dbgpixel(
"unknown sub block %s %d<br>\n", __FUNCTION__, __LINE__);
567 for (
int pos = x; pos < x + Length; pos++)
605 color = MapTable[color];
606 DrawLine(Bitmap, px + x, py + y, color, rl);
620 else if (bs->
GetBit() == 0) {
627 else if (bs->
GetBit() == 0) {
650 color = MapTable[color];
651 DrawLine(Bitmap, px + x, py + y, color, rl);
676 DrawLine(Bitmap, px + x, py + y, color, rl);
683 while (!bs->
IsEOF()) {
690 rl = (rl << 8) + bs->
GetBits(8);
691 color = flags & 0x80 ? bs->
GetBits(8) : 0;
694 DrawLine(Bitmap, px + x, py + y, color, rl);
737 if (so->ObjectId() == ObjectId)
882#ifndef FIX_SUBTITLE_VERSION_BROADCASTER_STUPIDITY
926 switch (Bitmap->
Bpp()) {
930 default:
dbgregions(
"unknown bpp %d (%s %d)<br>\n", Bitmap->
Bpp(), __FUNCTION__, __LINE__);
935 so->Render(Bitmap, sor->ObjectHorizontalPosition(), sor->ObjectVerticalPosition(), sor->ForegroundPixelCode(), sor->BackgroundPixelCode());
1023#ifndef FIX_SUBTITLE_VERSION_BROADCASTER_STUPIDITY
1090 a->
x1 = srr->RegionHorizontalAddress();
1091 a->
y1 = srr->RegionVerticalAddress();
1092 a->
x2 = srr->RegionHorizontalAddress() + sr->RegionWidth() - 1;
1093 a->
y2 = srr->RegionVerticalAddress() + sr->RegionHeight() - 1;
1094 a->
bpp = sr->RegionDepth();
1114 for (
int i = 0; i < NumAreas; i++) {
1127 a.
x1 = int(round(FactorX * Area.
x1) );
1128 a.
x2 = int(round(FactorX * Area.
x2) - 1);
1129 a.
y1 = int(round(FactorY * Area.
y1) );
1130 a.
y2 = int(round(FactorY * Area.
y2) - 1);
1132 while ((a.
Width() & 3) != 0)
1140 if (sc->ClutId() == ClutId)
1153 if (sr->RegionId() == RegionId)
1165 return objects.GetObjectById(ObjectId, New);
1181 unsigned char *
Get(
int &Length);
1182 void Put(
const uchar *Data,
int Length);
1206 Size =
max(Size, 2048);
1212 esyslog(
"ERROR: can't allocate memory for subtitle assembler");
1228 unsigned char *result =
data +
pos;
1267 void DbgDump(
int WindowWidth,
int WindowHeight);
1286 for (
int i = 0; i <
bitmaps.Size(); i++)
1298 bool AntiAlias =
Setup.AntiAlias;
1311 for (
int i = 0; i <
bitmaps.Size(); i++) {
1325 SD.SetFirstPts(
Pts());
1327 double Start = double(
Pts() -
SD.FirstPts()) / 90000;
1329 double End = Start + Duration;
1330 cBitmap Bitmap(WindowWidth, WindowHeight, 8);
1331#define DBGBACKGROUND 0xA0A0A0
1333 for (
int i = 0; i <
bitmaps.Size(); i++) {
1337 cString ImgName =
SD.WriteJpeg(&Bitmap);
1339 SD.WriteHtml(
"<p>%s<br>",
State() == 0 ?
"page update" :
State() == 1 ?
"page refresh" :
State() == 2 ?
"new page" :
"???");
1340 SD.WriteHtml(
"<table" BORDER "><tr><td>");
1341 SD.WriteHtml(
"%.2f", STC);
1342 SD.WriteHtml(
"</td><td>");
1343 SD.WriteHtml(
"<img src=\"%s\">", *ImgName);
1344 SD.WriteHtml(
"</td><td style=\"height:100%%\"><table" BORDER " style=\"height:100%%\">");
1345 SD.WriteHtml(
"<tr><td valign=top><b>%.2f</b></td></tr>", Start);
1346 SD.WriteHtml(
"<tr><td valign=middle>%.2f</td></tr>", Duration);
1347 SD.WriteHtml(
"<tr><td valign=bottom>%.2f</td></tr>", End);
1348 SD.WriteHtml(
"</table></td>");
1349 SD.WriteHtml(
"</tr></table>\n");
1354#define SUBTITLE_RETENTION 120
1415 dbgconverter(
"converter reset -----------------------<br>\n");
1428 if (Data && Length > 8) {
1430 int SubstreamHeaderLength = 4;
1431 bool ResetSubtitleAssembler = Data[PayloadOffset + 3] == 0x00;
1434 if ((Data[7] & 0x01) && (Data[PayloadOffset - 3] & 0x81) == 0x01 && Data[PayloadOffset - 2] == 0x81) {
1436 SubstreamHeaderLength = 1;
1437 ResetSubtitleAssembler = Data[8] >= 5;
1440 if (Length > PayloadOffset + SubstreamHeaderLength) {
1444 const uchar *data = Data + PayloadOffset + SubstreamHeaderLength;
1445 int length = Length - PayloadOffset - SubstreamHeaderLength;
1446 if (ResetSubtitleAssembler)
1450 if (data[0] == 0x20 && data[1] == 0x00 && data[2] == 0x0F)
1458 if (b && b[0] == 0x0F) {
1474 if (Data && Length > 8) {
1476 if (Length > PayloadOffset) {
1480 const uchar *data = Data + PayloadOffset;
1481 int length = Length - PayloadOffset;
1483 if (length > 2 && data[0] == 0x20 && data[1] == 0x00 && data[2] == 0x0F) {
1487 const uchar *b = data;
1488 while (length > 0) {
1508#define LimitTo32Bit(n) ((n) & 0x00000000FFFFFFFFL)
1515#define TEMPSUBTITLETAIL 1000
1526 if (LastSetupLevel != NewSetupLevel) {
1530 LastSetupLevel = NewSetupLevel;
1541 if (Delta > 0 && sb ==
bitmaps->Last())
1546 else if (Delta == 0)
1548 if (This && This !=
current) {
1560 dbgconverter(
"PTS: %" PRId64
" STC: %" PRId64
" (%" PRId64
") timeout: %d<br>\n",
current->Pts(), STC, Delta,
current->Timeout());
1579 int OsdWidth, OsdHeight;
1606 if (sp->PageId() == PageId)
1619 if (Length > 5 && bs.
GetBits(8) == 0x0F) {
1620 int segmentType = bs.
GetBits(8);
1625 int segmentLength = bs.
GetBits(16);
1628 switch (segmentType) {
1631 dbgsegments(
"END_OF_DISPLAY_SET_SEGMENT (simulated)<br>\n");
1635 page->
Parse(Pts, bs);
1660#ifndef FIX_SUBTITLE_VERSION_BROADCASTER_STUPIDITY
1664 bool displayWindowFlag = bs.
GetBit();
1670 if (displayWindowFlag) {
1684 bool disparity_shift_update_sequence_page_flag = bs.
GetBit();
1687 if (disparity_shift_update_sequence_page_flag) {
1690 int division_period_count = bs.
GetBits(8);
1691 for (
int i = 0; i < division_period_count; ++i) {
1696 while (!bs.
IsEOF()) {
1698 bool disparity_shift_update_sequence_region_flag = bs.
GetBit();
1700 int number_of_subregions_minus_1 = bs.
GetBits(2);
1701 for (
int i = 0; i <= number_of_subregions_minus_1; ++i) {
1702 if (number_of_subregions_minus_1 > 0) {
1709 if (disparity_shift_update_sequence_region_flag) {
1712 int division_period_count = bs.
GetBits(8);
1713 for (
int i = 0; i < division_period_count; ++i) {
1729 dbgsegments(
"*** unknown segment type: %02X<br>\n", segmentType);
1740 int segmentType = bs.
GetBits(8);
1741 int segmentLength = bs.
GetBits(16);
1746 switch (segmentType) {
1749 dbgsegments(
"PGS_DISPLAY_SEGMENT (simulated)<br>\n");
1764 int regionHorizontalAddress = bs.
GetBits(16);
1765 int regionVerticalAddress = bs.
GetBits(16);
1766 int regionWidth = bs.
GetBits(16);
1767 int regionHeight = bs.
GetBits(16);
1793 dbgsegments(
"*** unknown segment type: %02X<br>\n", segmentType);
1820 bool Reduced =
false;
1822 while (
osd->CanHandleAreas(&AreaOsd, 1) !=
oeOk) {
1823 dbgoutput(
"CanHandleAreas: %d<br>\n",
osd->CanHandleAreas(&AreaOsd, 1));
1824 int HalfBpp = Bpp / 2;
1826 if (AreaOsd.
bpp >= Bpp) {
1827 AreaOsd.
bpp = HalfBpp;
1841 for (
int i = 0; i < NumAreas; i++) {
1845 cBitmap *bm =
new cBitmap(sr->RegionWidth(), sr->RegionHeight(), sr->RegionDepth());
1846 bm->
Replace(*clut->GetPalette(sr->RegionDepth()));
1847 sr->Render(bm, Page->
Objects());
1849 if (sr->RegionDepth() != Areas[i].
bpp) {
1850 if (sr->RegionLevelOfCompatibility() <= Areas[i].
bpp) {
1853 dbgregions(
"reduce region %d bpp %d level %d area bpp %d<br>\n", sr->RegionId(), sr->RegionDepth(), sr->RegionLevelOfCompatibility(), Areas[i].
bpp);
1857 dbgregions(
"condense region %d bpp %d level %d area bpp %d<br>\n", sr->RegionId(), sr->RegionDepth(), sr->RegionLevelOfCompatibility(), Areas[i].
bpp);
1862 bm->
SetOffset(srr->RegionHorizontalAddress(), srr->RegionVerticalAddress());
bool SetLength(int Length)
const uint8_t * GetData(void) const
void ShrinkBpp(int NewBpp)
Shrinks the color depth of the bitmap to NewBpp by keeping only the 2^NewBpp most frequently used col...
void SetOffset(int X0, int Y0)
Sets the offset of this bitmap to the given values.
void ReduceBpp(const cPalette &Palette)
Reduces the color depth of the bitmap to that of the given Palette.
bool Dirty(int &x1, int &y1, int &x2, int &y2)
Tells whether there is a dirty area and returns the bounding rectangle of that area (relative to the ...
cBitmap * Scaled(double FactorX, double FactorY, bool AntiAlias=false) const
Creates a copy of this bitmap, scaled by the given factors.
tColor GetColor(int x, int y) const
Returns the color at the given coordinates.
void SetIndex(int x, int y, tIndex Index)
Sets the index at the given coordinates to Index.
void DrawRectangle(int x1, int y1, int x2, int y2, tColor Color)
Draws a filled rectangle defined by the upper left (x1, y1) and lower right (x2, y2) corners with the...
void Clean(void)
Marks the dirty area as clean.
void DrawBitmap(int x, int y, const cBitmap &Bitmap, tColor ColorFg=0, tColor ColorBg=0, bool ReplacePalette=false, bool Overlay=false)
Sets the pixels in this bitmap with the data from the given Bitmap, putting the upper left corner of ...
void Fill(tIndex Index)
Fills the bitmap data with the given Index.
void DrawText(int x, int y, const char *s, tColor ColorFg, tColor ColorBg, const cFont *Font, int Width=0, int Height=0, int Alignment=taDefault)
Draws the given string at coordinates (x, y) with the given foreground and background color and font.
static const char * SystemCharacterTable(void)
const char * Convert(const char *From, char *To=NULL, size_t ToLength=0)
Converts the given Text from FromCode to ToCode (as set in the constructor).
static void SleepMs(int TimeoutMs)
Creates a cCondWait object and uses it to sleep for TimeoutMs milliseconds, immediately giving up the...
static cDevice * PrimaryDevice(void)
Returns the primary device.
virtual int64_t GetSTC(void)
Gets the current System Time Counter, which can be used to synchronize audio, video and subtitles.
virtual void GetOsdSize(int &Width, int &Height, double &PixelAspect)
Returns the Width, Height and PixelAspect ratio the OSD should use to best fit the resolution of the ...
virtual ~cDvbSubtitleAssembler()
void Put(const uchar *Data, int Length)
cDvbSubtitleAssembler(void)
unsigned char * Get(int &Length)
virtual ~cDvbSubtitleBitmaps() override
cDvbSubtitleBitmaps(int State, int64_t Pts, int Timeout, tArea *Areas, int NumAreas, double OsdFactorX, double OsdFactorY, tArea &AreaCombined, tArea &AreaOsd)
void DbgDump(int WindowWidth, int WindowHeight)
void AddBitmap(cBitmap *Bitmap)
cVector< cBitmap * > bitmaps
int Convert(const uchar *Data, int Length)
cDvbSubtitleConverter(void)
virtual void Action(void) override
A derived cThread class must implement the code it wants to execute as a separate thread in this func...
void SetTempVisible(void)
int windowHorizontalOffset
void SetVisible(bool Visible)
cList< cDvbSubtitleBitmaps > * bitmaps
void FinishPage(cDvbSubtitlePage *Page)
int ExtractPgsSegment(const uchar *Data, int Length, int64_t Pts)
virtual ~cDvbSubtitleConverter() override
int ExtractSegment(const uchar *Data, int Length, int64_t Pts)
cDvbSubtitleAssembler * dvbSubtitleAssembler
cList< cDvbSubtitlePage > * pages
cDvbSubtitlePage * GetPageById(int PageId, bool New=false)
static void SetupChanged(void)
int ConvertFragments(const uchar *Data, int Length)
cDvbSubtitleBitmaps * current
cSubtitleRegionRef * GetRegionRefByIndex(int RegionRefIndex)
cList< cSubtitleRegion > regions
cSubtitleClut * GetClutById(int ClutId, bool New=false)
void SetPending(bool Pending)
cDvbSubtitlePage(int PageId)
void Parse(int64_t Pts, cBitStream &bs)
cList< cSubtitleClut > cluts
tArea CombineAreas(int NumAreas, const tArea *Areas)
tArea * GetAreas(int &NumAreas)
int PageVersionNumber(void)
cSubtitleObjects * Objects(void)
cSubtitleObject * GetObjectById(int ObjectId, bool New=false)
void AddRegionRef(cSubtitleRegionRef *rf)
cList< cSubtitleRegionRef > regionRefs
void ParsePgs(int64_t Pts, cBitStream &bs)
cSubtitleRegion * GetRegionById(int RegionId, bool New=false)
tArea ScaleArea(const tArea &Area, double FactorX, double FactorY)
virtual int Width(void) const =0
Returns the original character width as requested when the font was created, or 0 if the default widt...
static cFont * CreateFont(const char *Name, int CharHeight, int CharWidth=0)
Creates a new font object with the given Name and makes its characters CharHeight pixels high.
virtual int Height(void) const =0
Returns the height of this font in pixel (all characters have the same height).
void Add(cListObject *Object, cListObject *After=NULL)
cListObject(const cListObject &ListObject)
const cSubtitleObject * First(void) const
cList(const char *NeedsLocking=NULL)
const cSubtitleObject * Next(const cSubtitleObject *Object) const
static cOsd * NewOsd(int Left, int Top, uint Level=OSD_LEVEL_DEFAULT)
Returns a pointer to a newly created cOsd object, which will be located at the given coordinates.
The cOsd class is the interface to the "On Screen Display".
virtual eOsdError SetAreas(const tArea *Areas, int NumAreas)
Sets the sub-areas to the given areas.
virtual eOsdError CanHandleAreas(const tArea *Areas, int NumAreas)
Checks whether the OSD can display the given set of sub-areas.
virtual void DrawScaledBitmap(int x, int y, const cBitmap &Bitmap, double FactorX, double FactorY, bool AntiAlias=false)
Sets the pixels in the OSD with the data from the given Bitmap, putting the upper left corner of the ...
virtual void Flush(void)
Actually commits all data to the OSD hardware.
tColor Color(int Index) const
Returns the color at the given Index.
void Replace(const cPalette &Palette)
Replaces the colors of this palette with the colors from the given palette.
static cString sprintf(const char *fmt,...) __attribute__((format(printf
void Parse(cBitStream &bs)
tColor yuv2rgb(int Y, int Cb, int Cr)
void SetColor(int Bpp, int Index, tColor Color)
int ClutVersionNumber(void)
const cPalette * GetPalette(int Bpp)
cSubtitleClut(int ClutId)
void ParsePgs(cBitStream &bs)
cString WriteJpeg(const cBitmap *Bitmap, int MaxX=0, int MaxY=0)
void SetFactor(double Factor)
void WriteHtml(const char *Format,...)
void SetFirstPts(int64_t FirstPts)
cSubtitleObjectRefPgs(cBitStream &bs)
int ObjectProviderFlag(void)
int ForegroundPixelCode(void)
int objectHorizontalPosition
int ObjectVerticalPosition(void)
int ObjectHorizontalPosition(void)
int BackgroundPixelCode(void)
int objectVerticalPosition
cSubtitleObject(int ObjectId)
bool Decode4BppCodeString(cBitmap *Bitmap, int px, int py, cBitStream *bs, int &x, int y, const uint8_t *MapTable)
void DecodeCharacterString(const uchar *Data, int NumberOfCodes)
bool Decode2BppCodeString(cBitmap *Bitmap, int px, int py, cBitStream *bs, int &x, int y, const uint8_t *MapTable)
bool Decode8BppCodeString(cBitmap *Bitmap, int px, int py, cBitStream *bs, int &x, int y)
void DrawLine(cBitmap *Bitmap, int x, int y, tIndex Index, int Length)
void ParsePgs(cBitStream &bs)
bool nonModifyingColorFlag
void DecodeSubBlock(cBitmap *Bitmap, int px, int py, const uchar *Data, int Length, bool Even)
void Render(cBitmap *Bitmap, int px, int py, tIndex IndexFg, tIndex IndexBg)
int ObjectVersionNumber(void)
bool DecodePgsCodeString(cBitmap *Bitmap, int px, int py, cBitStream *bs, int &x, int y)
int ObjectCodingMethod(void)
void Parse(cBitStream &bs)
bool NonModifyingColorFlag(void)
cSubtitleObject * GetObjectById(int ObjectId, bool New=false)
cSubtitleRegionRef(int id, int x, int y)
int regionVerticalAddress
int RegionHorizontalAddress(void)
int regionHorizontalAddress
int RegionVerticalAddress(void)
cList< cSubtitleObjectRef > objectRefs
int regionLevelOfCompatibility
void Parse(cBitStream &bs)
bool RegionFillFlag(void)
void SetDimensions(int Width, int Height)
void Render(cBitmap *Bitmap, cSubtitleObjects *Objects)
int RegionVersionNumber(void)
cSubtitleRegion(int RegionId)
void ParsePgs(cBitStream &bs)
int RegionLevelOfCompatibility(void)
void bool Start(void)
Sets the description of this thread, which will be used when logging starting or stopping of the thre...
bool Running(void)
Returns false if a derived cThread object shall leave its Action() function.
cThread(const char *Description=NULL, bool LowPriority=false)
Creates a new thread.
void Cancel(int WaitSeconds=0)
Cancels the thread by first setting 'running' to false, so that the Action() loop can finish in an or...
#define PGS_PALETTE_SEGMENT
#define OBJECT_DATA_SEGMENT
#define PGS_OBJECT_SEGMENT
#define CLUT_DEFINITION_SEGMENT
#define SUBTITLE_RETENTION
#define dbgsegments(a...)
static bool DebugSegments
#define END_OF_DISPLAY_SET_SEGMENT
#define REGION_COMPOSITION_SEGMENT
static int PtsDeltaMs(int64_t a, int64_t b)
#define PAGE_COMPOSITION_SEGMENT
#define PGS_WINDOW_SEGMENT
#define PGS_DISPLAY_SEGMENT
static bool DebugConverter
#define DISPARITY_SIGNALING_SEGMENT
#define dbgconverter(a...)
#define PGS_PRESENTATION_SEGMENT
#define DISPLAY_DEFINITION_SEGMENT
const char * getCharacterTable(const unsigned char *&buffer, int &length, bool *isSingleByte)
#define OSD_LEVEL_SUBTITLES
tColor ArgbToColor(uint8_t A, uint8_t R, uint8_t G, uint8_t B)
int PesPayloadOffset(const uchar *p)
bool PesHasPts(const uchar *p)
int64_t PesGetPts(const uchar *p)