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

Fixed displaying DVB subtitles (cont'd)

This commit is contained in:
Klaus Schmidinger 2013-09-06 12:37:27 +02:00
parent d6c10fec7b
commit e8fb500819
5 changed files with 651 additions and 519 deletions

11
HISTORY
View File

@ -7920,7 +7920,7 @@ Video Disk Recorder Revision History
- Fixed cleaning up old EPG events in case no epg data file is given (reported by
Dave Pickles).
2013-08-31: Version 2.1.2
2013-09-06: Version 2.1.2
- Updated the Finnish OSD texts (thanks to Rolf Ahrenberg).
- Fixed displaying DVB subtitles (thanks to Rolf Ahrenberg for helping to debug and
@ -7928,10 +7928,11 @@ Video Disk Recorder Revision History
+ Fixed handling DVB subtitle fill region codes for 2 and 8 bpp.
+ Fixed handling pages without an explicit END_OF_DISPLAY_SET_SEGMENT.
The FINISHPAGE_HACK is no longer necessary.
+ Fixed handling "page refreshes".
+ Added DebugBitmaps, which, if set to true, generates an HTML page with a sequence
of images, showing the subtitle data as it is processed.
+ The debug output now uses some indentation for better structuring.
+ Fixed handling "page refreshes". The data is now parsed and stored closer to the
DVB standard specs, introducing "object refs" and "region refs".
+ The debug output now goes into an HTML file named dbg-log.htm and shows the actual
bitmaps (dbg-nnn.jpg) used to display the subtitles. That way it is much easier to
see what's actually going on.
+ Fixed handling subtitles encoded as a string of characters (the very first
character was always skipped).
- Fixed wrong initialization of Setup.PositionerSwing (reported by Arthur Konovalov).

File diff suppressed because it is too large Load Diff

View File

@ -6,7 +6,7 @@
*
* Original author: Marco Schluessler <marco@lordzodiac.de>
*
* $Id: dvbsubtitle.h 2.7 2012/03/11 13:34:12 kls Exp $
* $Id: dvbsubtitle.h 3.1 2013/09/06 10:53:30 kls Exp $
*/
#ifndef __DVBSUBTITLE_H
@ -39,7 +39,7 @@ private:
double osdFactorY;
cList<cDvbSubtitlePage> *pages;
cList<cDvbSubtitleBitmaps> *bitmaps;
tColor yuv2rgb(int Y, int Cb, int Cr);
cDvbSubtitlePage *GetPageById(int PageId, bool New = false);
void SetOsdData(void);
bool AssertOsd(void);
int ExtractSegment(const uchar *Data, int Length, int64_t Pts);

15
osd.c
View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: osd.c 3.1 2013/05/18 12:33:16 kls Exp $
* $Id: osd.c 3.2 2013/09/03 11:59:17 kls Exp $
*/
#include "osd.h"
@ -512,6 +512,17 @@ void cBitmap::SetIndex(int x, int y, tIndex Index)
}
}
void cBitmap::Fill(tIndex Index)
{
if (bitmap) {
memset(bitmap, Index, width * height);
dirtyX1 = 0;
dirtyY1 = 0;
dirtyX2 = width - 1;
dirtyY2 = height - 1;
}
}
void cBitmap::DrawPixel(int x, int y, tColor Color)
{
x -= x0;
@ -824,7 +835,7 @@ void cBitmap::ShrinkBpp(int NewBpp)
}
}
cBitmap *cBitmap::Scaled(double FactorX, double FactorY, bool AntiAlias)
cBitmap *cBitmap::Scaled(double FactorX, double FactorY, bool AntiAlias) const
{
// Fixed point scaling code based on www.inversereality.org/files/bitmapscaling.pdf
// by deltener@mindtremors.com

8
osd.h
View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: osd.h 3.1 2013/09/02 07:53:54 kls Exp $
* $Id: osd.h 3.2 2013/09/06 12:13:47 kls Exp $
*/
#ifndef __OSD_H
@ -192,6 +192,8 @@ public:
///< contents of the bitmap will be lost. If Width and Height are the same
///< as the current values, nothing will happen and the bitmap remains
///< unchanged.
void SetOffset(int X0, int Y0) { x0 = X0; y0 = Y0; }
///< Sets the offset of this bitmap to the given values.
bool Contains(int x, int y) const;
///< Returns true if this bitmap contains the point (x, y).
bool Covers(int x1, int y1, int x2, int y2) const;
@ -221,6 +223,8 @@ public:
void SetIndex(int x, int y, tIndex Index);
///< Sets the index at the given coordinates to Index.
///< Coordinates are relative to the bitmap's origin.
void Fill(tIndex Index);
///< Fills the bitmap data with the given Index.
void DrawPixel(int x, int y, tColor Color);
///< Sets the pixel at the given coordinates to the given Color, which is
///< a full 32 bit ARGB value.
@ -283,7 +287,7 @@ public:
///< the 2^NewBpp most frequently used colors as defined in the current palette.
///< If NewBpp is not smaller than the bitmap's current color depth,
///< or if it is not one of 4bpp or 2bpp, nothing happens.
cBitmap *Scaled(double FactorX, double FactorY, bool AntiAlias = false);
cBitmap *Scaled(double FactorX, double FactorY, bool AntiAlias = false) const;
///< Creates a copy of this bitmap, scaled by the given factors.
///< If AntiAlias is true and either of the factors is greater than 1.0,
///< anti-aliasing is applied. This will also set the color depth of the