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);
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);
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)) {
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)
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;
1269 void DbgDump(
int WindowWidth,
int WindowHeight);
1332 double End = Start + Duration;
1333 cBitmap Bitmap(WindowWidth, WindowHeight, 8);
1334#define DBGBACKGROUND 0xA0A0A0
1347 SD.
WriteHtml(
"</td><td style=\"height:100%%\"><table" BORDER " style=\"height:100%%\">");
1348 SD.
WriteHtml(
"<tr><td valign=top><b>%.2f</b></td></tr>", Start);
1349 SD.
WriteHtml(
"<tr><td valign=middle>%.2f</td></tr>", Duration);
1350 SD.
WriteHtml(
"<tr><td valign=bottom>%.2f</td></tr>", End);
1357#define SUBTITLE_RETENTION 120
1418 dbgconverter(
"converter reset -----------------------<br>\n");
1431 if (Data && Length > 8) {
1433 int SubstreamHeaderLength = 4;
1434 bool ResetSubtitleAssembler = Data[PayloadOffset + 3] == 0x00;
1437 if ((Data[7] & 0x01) && (Data[PayloadOffset - 3] & 0x81) == 0x01 && Data[PayloadOffset - 2] == 0x81) {
1439 SubstreamHeaderLength = 1;
1440 ResetSubtitleAssembler = Data[8] >= 5;
1443 if (Length > PayloadOffset + SubstreamHeaderLength) {
1447 const uchar *data = Data + PayloadOffset + SubstreamHeaderLength;
1448 int length = Length - PayloadOffset - SubstreamHeaderLength;
1449 if (ResetSubtitleAssembler)
1453 if (data[0] == 0x20 && data[1] == 0x00 && data[2] == 0x0F)
1461 if (b && b[0] == 0x0F) {
1477 if (Data && Length > 8) {
1479 if (Length > PayloadOffset) {
1483 const uchar *data = Data + PayloadOffset;
1484 int length = Length - PayloadOffset;
1486 if (length > 2 && data[0] == 0x20 && data[1] == 0x00 && data[2] == 0x0F) {
1490 const uchar *b = data;
1491 while (length > 0) {
1511#define LimitTo32Bit(n) ((n) & 0x00000000FFFFFFFFL)
1518#define TEMPSUBTITLETAIL 1000
1529 if (LastSetupLevel != NewSetupLevel) {
1533 LastSetupLevel = NewSetupLevel;
1549 else if (Delta == 0)
1551 if (This && This !=
current) {
1582 int OsdWidth, OsdHeight;
1609 if (sp->PageId() == PageId)
1622 if (Length > 5 && bs.
GetBits(8) == 0x0F) {
1623 int segmentType = bs.
GetBits(8);
1628 int segmentLength = bs.
GetBits(16);
1631 switch (segmentType) {
1634 dbgsegments(
"END_OF_DISPLAY_SET_SEGMENT (simulated)<br>\n");
1638 page->
Parse(Pts, bs);
1663#ifndef FIX_SUBTITLE_VERSION_BROADCASTER_STUPIDITY
1667 bool displayWindowFlag = bs.
GetBit();
1673 if (displayWindowFlag) {
1687 bool disparity_shift_update_sequence_page_flag = bs.
GetBit();
1690 if (disparity_shift_update_sequence_page_flag) {
1693 int division_period_count = bs.
GetBits(8);
1694 for (
int i = 0; i < division_period_count; ++i) {
1699 while (!bs.
IsEOF()) {
1701 bool disparity_shift_update_sequence_region_flag = bs.
GetBit();
1703 int number_of_subregions_minus_1 = bs.
GetBits(2);
1704 for (
int i = 0; i <= number_of_subregions_minus_1; ++i) {
1705 if (number_of_subregions_minus_1 > 0) {
1712 if (disparity_shift_update_sequence_region_flag) {
1715 int division_period_count = bs.
GetBits(8);
1716 for (
int i = 0; i < division_period_count; ++i) {
1732 dbgsegments(
"*** unknown segment type: %02X<br>\n", segmentType);
1743 int segmentType = bs.
GetBits(8);
1744 int segmentLength = bs.
GetBits(16);
1749 switch (segmentType) {
1752 dbgsegments(
"PGS_DISPLAY_SEGMENT (simulated)<br>\n");
1767 int regionHorizontalAddress = bs.
GetBits(16);
1768 int regionVerticalAddress = bs.
GetBits(16);
1769 int regionWidth = bs.
GetBits(16);
1770 int regionHeight = bs.
GetBits(16);
1796 dbgsegments(
"*** unknown segment type: %02X<br>\n", segmentType);
1811 if (Delta < 0 || Delta == 0 && Page->PageVersionNumber() != sb->Version()) {
1815 else if (Delta == 0)
1823 bool Reduced =
false;
1827 int HalfBpp = Bpp / 2;
1829 if (AreaOsd.
bpp >= Bpp) {
1830 AreaOsd.
bpp = HalfBpp;
1846 for (
int i = 0; i < NumAreas; i++) {
1850 cBitmap *bm =
new cBitmap(sr->RegionWidth(), sr->RegionHeight(), sr->RegionDepth());
1851 bm->
Replace(*clut->GetPalette(sr->RegionDepth()));
1852 sr->Render(bm, Page->
Objects());
1854 if (sr->RegionDepth() != Areas[i].
bpp) {
1855 if (sr->RegionLevelOfCompatibility() <= Areas[i].
bpp) {
1858 dbgregions(
"reduce region %d bpp %d level %d area bpp %d<br>\n", sr->RegionId(), sr->RegionDepth(), sr->RegionLevelOfCompatibility(), Areas[i].
bpp);
1862 dbgregions(
"condense region %d bpp %d level %d area bpp %d<br>\n", sr->RegionId(), sr->RegionDepth(), sr->RegionLevelOfCompatibility(), Areas[i].
bpp);
1867 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.
cBitmap(int Width, int Height, int Bpp, int X0=0, int Y0=0)
Creates a bitmap with the given Width, Height and color depth (Bpp).
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
void DbgDump(int WindowWidth, int WindowHeight)
void AddBitmap(cBitmap *Bitmap)
cVector< cBitmap * > bitmaps
cDvbSubtitleBitmaps(int State, int64_t Pts, int Timeout, int Version, tArea *Areas, int NumAreas, double OsdFactorX, double OsdFactorY, tArea &AreaCombined, tArea &AreaOsd)
static std::atomic< int > setupLevel
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
std::atomic< bool > frozen
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 Ins(cListObject *Object, cListObject *Before=NULL)
void Del(cListObject *Object, bool DeleteObject=true)
void Add(cListObject *Object, cListObject *After=NULL)
cListObject(const cListObject &ListObject)
const T * Prev(const T *Object) const
const cSubtitleObject * First(void) const
cList(const char *NeedsLocking=NULL)
const cSubtitleObject * Next(const cSubtitleObject *Object) const
const T * Last(void) const
Returns the last element in this list, or NULL if the list is empty.
const T * Get(int Index) const
Returns the list element at the given Index, or NULL if no such element exists.
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.
static void Delete(cOsd *&Osd)
Deletes the given Osd (if any) and sets it to NULL.
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.
void SetColor(int Index, tColor Color)
Sets the palette entry at Index to Color.
int SubtitleFgTransparency
int SubtitleBgTransparency
char FontOsd[MAXFONTNAME]
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...
virtual void Append(T Data)
#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)