mirror of
https://github.com/VDR4Arch/vdr.git
synced 2023-10-10 13:36:52 +02:00
Removed limitation to PAL resolution from SPU handling
This commit is contained in:
parent
bf543736b6
commit
74646c0487
1
HISTORY
1
HISTORY
@ -6088,3 +6088,4 @@ Video Disk Recorder Revision History
|
|||||||
- Fixed the way the OSD size is determined on full featured DVB cards (thanks
|
- Fixed the way the OSD size is determined on full featured DVB cards (thanks
|
||||||
to Oliver Endriss).
|
to Oliver Endriss).
|
||||||
- Increased MAXOSDHEIGHT to 1200 (suggested by Nicolas Huillard).
|
- Increased MAXOSDHEIGHT to 1200 (suggested by Nicolas Huillard).
|
||||||
|
- Removed limitation to PAL resolution from SPU handling.
|
||||||
|
31
dvbspu.c
31
dvbspu.c
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
* parts of this file are derived from the OMS program.
|
* parts of this file are derived from the OMS program.
|
||||||
*
|
*
|
||||||
* $Id: dvbspu.c 1.22 2007/02/03 10:13:18 kls Exp $
|
* $Id: dvbspu.c 2.1 2009/05/09 16:25:59 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "dvbspu.h"
|
#include "dvbspu.h"
|
||||||
@ -55,18 +55,16 @@ void cDvbSpuPalette::setPalette(const uint32_t * pal)
|
|||||||
#define setMin(a, b) if (a > b) a = b
|
#define setMin(a, b) if (a > b) a = b
|
||||||
#define setMax(a, b) if (a < b) a = b
|
#define setMax(a, b) if (a < b) a = b
|
||||||
|
|
||||||
#define spuXres 720
|
|
||||||
#define spuYres 576
|
|
||||||
|
|
||||||
#define revRect(r1, r2) { r1.x1 = r2.x2; r1.y1 = r2.y2; r1.x2 = r2.x1; r1.y2 = r2.y1; }
|
#define revRect(r1, r2) { r1.x1 = r2.x2; r1.y1 = r2.y2; r1.x2 = r2.x1; r1.y2 = r2.y1; }
|
||||||
|
|
||||||
cDvbSpuBitmap::cDvbSpuBitmap(sDvbSpuRect size,
|
cDvbSpuBitmap::cDvbSpuBitmap(sDvbSpuRect size,
|
||||||
uint8_t * fodd, uint8_t * eodd,
|
uint8_t * fodd, uint8_t * eodd,
|
||||||
uint8_t * feven, uint8_t * eeven)
|
uint8_t * feven, uint8_t * eeven)
|
||||||
{
|
{
|
||||||
if (size.x1 < 0 || size.y1 < 0 || size.x2 >= spuXres
|
size.x1 = max(size.x1, 0);
|
||||||
|| size.y2 >= spuYres)
|
size.y1 = max(size.y1, 0);
|
||||||
throw;
|
size.x2 = min(size.x2, Setup.OSDWidth);
|
||||||
|
size.y2 = min(size.y2, Setup.OSDHeight);
|
||||||
|
|
||||||
bmpsize = size;
|
bmpsize = size;
|
||||||
revRect(minsize[0], size);
|
revRect(minsize[0], size);
|
||||||
@ -74,10 +72,11 @@ cDvbSpuBitmap::cDvbSpuBitmap(sDvbSpuRect size,
|
|||||||
revRect(minsize[2], size);
|
revRect(minsize[2], size);
|
||||||
revRect(minsize[3], size);
|
revRect(minsize[3], size);
|
||||||
|
|
||||||
if (!(bmp = new uint8_t[spuXres * spuYres * sizeof(uint8_t)]))
|
int MemSize = bmpsize.width() * bmpsize.height() * sizeof(uint8_t);
|
||||||
throw;
|
bmp = new uint8_t[MemSize];
|
||||||
|
|
||||||
memset(bmp, 0, spuXres * spuYres * sizeof(uint8_t));
|
if (bmp)
|
||||||
|
memset(bmp, 0, MemSize);
|
||||||
putFieldData(0, fodd, eodd);
|
putFieldData(0, fodd, eodd);
|
||||||
putFieldData(1, feven, eeven);
|
putFieldData(1, feven, eeven);
|
||||||
}
|
}
|
||||||
@ -94,10 +93,10 @@ cBitmap *cDvbSpuBitmap::getBitmap(const aDvbSpuPalDescr paldescr,
|
|||||||
int h = size.height();
|
int h = size.height();
|
||||||
int w = size.width();
|
int w = size.width();
|
||||||
|
|
||||||
if (size.y1 + h >= spuYres)
|
if (size.y1 + h >= bmpsize.height())
|
||||||
h = spuYres - size.y1 - 1;
|
h = bmpsize.height() - size.y1 - 1;
|
||||||
if (size.x1 + w >= spuXres)
|
if (size.x1 + w >= bmpsize.width())
|
||||||
w = spuXres - size.x1 - 1;
|
w = bmpsize.width() - size.x1 - 1;
|
||||||
|
|
||||||
if (w & 0x03)
|
if (w & 0x03)
|
||||||
w += 4 - (w & 0x03);
|
w += 4 - (w & 0x03);
|
||||||
@ -114,7 +113,7 @@ cBitmap *cDvbSpuBitmap::getBitmap(const aDvbSpuPalDescr paldescr,
|
|||||||
// set the content
|
// set the content
|
||||||
for (int yp = 0; yp < h; yp++) {
|
for (int yp = 0; yp < h; yp++) {
|
||||||
for (int xp = 0; xp < w; xp++) {
|
for (int xp = 0; xp < w; xp++) {
|
||||||
uint8_t idx = bmp[(size.y1 + yp) * spuXres + size.x1 + xp];
|
uint8_t idx = bmp[(size.y1 + yp) * bmpsize.width() + size.x1 + xp];
|
||||||
ret->SetIndex(xp, yp, idx);
|
ret->SetIndex(xp, yp, idx);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -150,7 +149,7 @@ bool cDvbSpuBitmap::getMinSize(const aDvbSpuPalDescr paldescr,
|
|||||||
|
|
||||||
void cDvbSpuBitmap::putPixel(int xp, int yp, int len, uint8_t colorid)
|
void cDvbSpuBitmap::putPixel(int xp, int yp, int len, uint8_t colorid)
|
||||||
{
|
{
|
||||||
memset(bmp + spuXres * yp + xp, colorid, len);
|
memset(bmp + bmpsize.width() * yp + xp, colorid, len);
|
||||||
setMin(minsize[colorid].x1, xp);
|
setMin(minsize[colorid].x1, xp);
|
||||||
setMin(minsize[colorid].y1, yp);
|
setMin(minsize[colorid].y1, yp);
|
||||||
setMax(minsize[colorid].x2, xp + len - 1);
|
setMax(minsize[colorid].x2, xp + len - 1);
|
||||||
|
8
dvbspu.h
8
dvbspu.h
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
* parts of this file are derived from the OMS program.
|
* parts of this file are derived from the OMS program.
|
||||||
*
|
*
|
||||||
* $Id: dvbspu.h 1.12 2006/04/17 11:00:00 kls Exp $
|
* $Id: dvbspu.h 2.1 2009/05/09 16:26:45 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __DVBSPU_H
|
#ifndef __DVBSPU_H
|
||||||
@ -32,10 +32,10 @@ typedef struct sDvbSpuRect {
|
|||||||
int x1, y1;
|
int x1, y1;
|
||||||
int x2, y2;
|
int x2, y2;
|
||||||
|
|
||||||
int width() {
|
int width() const {
|
||||||
return x2 - x1 + 1;
|
return x2 - x1 + 1;
|
||||||
};
|
};
|
||||||
int height() {
|
int height() const {
|
||||||
return y2 - y1 + 1;
|
return y2 - y1 + 1;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -63,8 +63,6 @@ class cDvbSpuPalette {
|
|||||||
// --- cDvbSpuBitmap----------------------------------------------------------
|
// --- cDvbSpuBitmap----------------------------------------------------------
|
||||||
|
|
||||||
class cDvbSpuBitmap {
|
class cDvbSpuBitmap {
|
||||||
|
|
||||||
public:
|
|
||||||
private:
|
private:
|
||||||
sDvbSpuRect bmpsize;
|
sDvbSpuRect bmpsize;
|
||||||
sDvbSpuRect minsize[4];
|
sDvbSpuRect minsize[4];
|
||||||
|
Loading…
Reference in New Issue
Block a user