diff options
author | Klaus Schmidinger <kls (at) cadsoft (dot) de> | 2009-06-14 13:49:00 +0200 |
---|---|---|
committer | Klaus Schmidinger <kls (at) cadsoft (dot) de> | 2009-06-14 13:49:00 +0200 |
commit | ab6f2ccf424896a80b6e2fdf9ab9313ea4b7f316 (patch) | |
tree | cd6cf2c6307c8a58f137e12286674cc8f1366dc5 /dvbspu.c | |
parent | 991eda006700f1703bcec528c1ff178a4cab9048 (diff) | |
download | vdr-patch-lnbsharing-ab6f2ccf424896a80b6e2fdf9ab9313ea4b7f316.tar.gz vdr-patch-lnbsharing-ab6f2ccf424896a80b6e2fdf9ab9313ea4b7f316.tar.bz2 |
Version 1.7.8vdr-1.7.8
- The name of the function cDevice::GetVideoSize() wasn't very well chosen
for its purpose of defining the optimum size of the OSD for the current
output device. Therefore a new function named cDevice::GetOsdSize() has
been introduced (suggested by Rolf Ahrenberg). Plugin authors should
implement this function in classes derived from cDevice, if they are able
to replay video. cDevice::GetVideoSize() still exists and should return the
actual size of the video material that is currently replayed. Note that
because of the many possible aspect ratios for video material, the type
of the Aspect parameter of GetVideoSize() has been changed to 'double',
and the Aspect parameter in both functions is named differently, because
it returns different values (suggested by Reinhard Nissl).
Thanks to Oliver Endriss for his input on calculating the Aspect factor in
GetOsdSize().
- Fixed the way the OSD size is determined on full featured DVB cards (thanks
to Oliver Endriss).
- Increased MAXOSDHEIGHT to 1200 (suggested by Nicolas Huillard).
- Removed limitation to PAL resolution from SPU handling.
- Checking fd_video in cDvbDevice::GetVideoSize() to avoid error messages on
systems with no real primary replay device (reported by Martin Neuditschko).
- Added a note to cTsToPes::GetPes() about having to call it repeatedly, once
it has returned a non-NULL value.
- Added MPEG 1 handling to remux.c (thanks to Ales Jurik).
- Fixed use of time_t in cEIT::cEIT() (thanks to Tobias Bratfisch).
- Added missing update of lastOsdSizeUpdate.
- EIT events are now only processed if a plausible system time is available, to
avoid wrong handling of PDC descriptors (thanks to Tobias Bratfisch).
- Removed unused 'synced' member from cTsToPes (reported by Christoph Haubrich).
- Added a note to cTsToPes about all TS packets having to belong to the same PID,
and that for video data GetPes() may only be called if the next TS packet that
will be given to PutTs() has the "payload start" flag set (suggested by Christoph
Haubrich).
- Added a note about the meaning of PERCENTAGEDELTA in cRingBuffer::UpdatePercentage()
(thanks to Rolf Ahrenberg).
- The new setup option "Recording/Pause key handling" can be used to define
what happens if the Pause key on the remote control is pressed during
live tv (thanks to Timo Eskola).
- Added a note about cFont::GetFont() not being thread-safe.
- Fixed generating PAT/PMT version numbers in case the PIDs change during
recording (reported by Reinhard Nissl).
- Updated the Ukrainian OSD texts (thanks to Yarema Aka Knedlyk).
- Fixed a memory leak when reaching the end of a recording during replay (reported
by Reinhard Nissl).
- Fixed calling close(-1) in cUnbufferedFile::Close() (reported by Reinhard Nissl).
- Added a workaround for the broken linux-dvb driver header files (based on a patch
from Tobias Grimm).
- Fixed handling the length of DiSEqC command sequences (reported by Reinhard Nissl).
- Fixed cOsdMenu::Display() in case the menu size has changed (thanks to
Reinhard Nissl).
- Added some missing 'const' keywords to avoid compilation errors with gcc 4.4
(thanks to Ville Skyttä and Ludwig Nussel).
- Modified cSVDRP::CmdGRAB() to avoid writing into const data (reported by
Ludwig Nussel).
- Fixed calculating menu colum widths in case the font has a size other than the
default size (reported by Reinhard Nissl).
- Added a plausibility check for the OSD percentage parameters
to avoid problems in case the values are stored in the setup.conf
file in a wrong way.
- Fixed variable types in cIndexFile (reported by Udo Richter).
Diffstat (limited to 'dvbspu.c')
-rw-r--r-- | dvbspu.c | 31 |
1 files changed, 15 insertions, 16 deletions
@@ -8,7 +8,7 @@ * * parts of this file are derived from the OMS program. * - * $Id: dvbspu.c 2.0 2007/02/03 10:13:18 kls Exp $ + * $Id: dvbspu.c 2.1 2009/05/09 16:25:59 kls Exp $ */ #include "dvbspu.h" @@ -55,18 +55,16 @@ void cDvbSpuPalette::setPalette(const uint32_t * pal) #define setMin(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; } cDvbSpuBitmap::cDvbSpuBitmap(sDvbSpuRect size, uint8_t * fodd, uint8_t * eodd, uint8_t * feven, uint8_t * eeven) { - if (size.x1 < 0 || size.y1 < 0 || size.x2 >= spuXres - || size.y2 >= spuYres) - throw; + size.x1 = max(size.x1, 0); + size.y1 = max(size.y1, 0); + size.x2 = min(size.x2, Setup.OSDWidth); + size.y2 = min(size.y2, Setup.OSDHeight); bmpsize = size; revRect(minsize[0], size); @@ -74,10 +72,11 @@ cDvbSpuBitmap::cDvbSpuBitmap(sDvbSpuRect size, revRect(minsize[2], size); revRect(minsize[3], size); - if (!(bmp = new uint8_t[spuXres * spuYres * sizeof(uint8_t)])) - throw; + int MemSize = bmpsize.width() * bmpsize.height() * sizeof(uint8_t); + bmp = new uint8_t[MemSize]; - memset(bmp, 0, spuXres * spuYres * sizeof(uint8_t)); + if (bmp) + memset(bmp, 0, MemSize); putFieldData(0, fodd, eodd); putFieldData(1, feven, eeven); } @@ -94,10 +93,10 @@ cBitmap *cDvbSpuBitmap::getBitmap(const aDvbSpuPalDescr paldescr, int h = size.height(); int w = size.width(); - if (size.y1 + h >= spuYres) - h = spuYres - size.y1 - 1; - if (size.x1 + w >= spuXres) - w = spuXres - size.x1 - 1; + if (size.y1 + h >= bmpsize.height()) + h = bmpsize.height() - size.y1 - 1; + if (size.x1 + w >= bmpsize.width()) + w = bmpsize.width() - size.x1 - 1; if (w & 0x03) w += 4 - (w & 0x03); @@ -114,7 +113,7 @@ cBitmap *cDvbSpuBitmap::getBitmap(const aDvbSpuPalDescr paldescr, // set the content for (int yp = 0; yp < h; yp++) { 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); } } @@ -150,7 +149,7 @@ bool cDvbSpuBitmap::getMinSize(const aDvbSpuPalDescr paldescr, 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].y1, yp); setMax(minsize[colorid].x2, xp + len - 1); |