summaryrefslogtreecommitdiff
path: root/PLUGINS/src/dvbhddevice/hdffosd.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <Klaus (dot) Schmidinger (at) tvdr (dot) de>2011-12-04 16:53:00 +0100
committerDieter Hametner <dh (plus) vdr (at) gekrumbel (dot) de>2011-12-05 20:36:02 +0100
commit5a28d999363f8ace192489d4f6b13dfeb6cfc20b (patch)
tree4aa9a419b3e1d45656c66ead7b8a4997665951e2 /PLUGINS/src/dvbhddevice/hdffosd.c
parent0c96d6b62650790dc83ce6621eb664e51f39719b (diff)
downloadvdr-patches-5a28d999363f8ace192489d4f6b13dfeb6cfc20b.tar.gz
vdr-patches-5a28d999363f8ace192489d4f6b13dfeb6cfc20b.tar.bz2
Version 1.7.22
Original announce message: VDR developer version 1.7.22 is now available at ftp://ftp.tvdr.de/vdr/Developer/vdr-1.7.22.tar.bz2 A 'diff' against the previous version is available at ftp://ftp.tvdr.de/vdr/Developer/vdr-1.7.21-1.7.22.diff MD5 checksums: b9c0fe1aac8e653c0d0234bc72c2bb2c vdr-1.7.22.tar.bz2 868bb332342c9a78beda17cc85e0bb93 vdr-1.7.21-1.7.22.diff WARNING: ======== This is a developer version. Even though I use it in my productive environment. I strongly recommend that you only use it under controlled conditions and for testing and debugging. From the HISTORY file: - Fixed scaling subtitles in case the primary device's GetVideoSize() function doesn't return actual values (thanks to Luca Olivetti). - The DiSEqC codes are now copied in the call to cDiseqc::Execute(). - VDR now supports "Satellite Channel Routing" (SCR) according to EN50494 (based on the "unicable" patch from Lars Hanisch). Since "Unicable" is a registered trademark and stands for only one of many implementations of SCR, the following changes have been made compared to the patch, which need to be taken into account by people who have set up their system using the patch: - The 'U' parameter in the diseqc.conf file has been changed to 'S' ("Scr"). - The configuration file name has been changed from "unicable.conf" to "scr.conf". - Updated sources.conf (thanks to Arthur Konovalov). - The SVDRP command LSTC now also accepts channel IDs (thanks to Dominic Evans). - Fixed handling DVB subtitles and implemented decoding textual DVB subtitles (thanks to Rolf Ahrenberg). - Added cap_net_raw to the capabilities that are not dropped (thanks to Dominic Evans). - Fixed setting the start time of an edited recording (thanks to Christoph Haubrich). - Temporarily switching free devices to transponders in order to have their running status updated is now done by marking the devices as "occupied" for a certain amount of time. - The new setup options "LNB/Device n connected to sat cable" can be used to define which DVB-S devices are connected to the same sat cable and are therefore "bonded". This obsoletes the LNBSHARE patch. Users of the LNBSHARE patch will need to newly set up their sat devices with the above options. - Fixed a crash when deleting a recording while cutting it (thanks to Ville Skyttä). - Fixed several spelling errors (thanks to Ville Skyttä). - The new SVDRP command UPDR can be used to trigger an update of the list of recordings (thanks to Lars Hanisch). - Added generating a pkg-config file to the Makefile (thanks to Ville Skyttä). - Removed the '.pl' suffix from all scripts (thanks to Ville Skyttä). - Changed the default location for the LIRC socket to /var/run/lirc/lircd (thanks to Ville Skyttä). - Added file name and line number to LOG_ERROR_STR() (thanks to Rolf Ahrenberg). - Replaced all calls to sleep() with cCondWait::SleepMs() (thanks to Rolf Ahrenberg). - Fixed a crash with malformed SI data (patch from vdr-portal).
Diffstat (limited to 'PLUGINS/src/dvbhddevice/hdffosd.c')
-rw-r--r--PLUGINS/src/dvbhddevice/hdffosd.c138
1 files changed, 78 insertions, 60 deletions
diff --git a/PLUGINS/src/dvbhddevice/hdffosd.c b/PLUGINS/src/dvbhddevice/hdffosd.c
index 90d6897..a492275 100644
--- a/PLUGINS/src/dvbhddevice/hdffosd.c
+++ b/PLUGINS/src/dvbhddevice/hdffosd.c
@@ -3,7 +3,7 @@
*
* See the README file for copyright information and how to reach the author.
*
- * $Id: hdffosd.c 1.10 2011/05/15 14:47:29 kls Exp $
+ * $Id: hdffosd.c 1.12 2011/12/04 15:31:41 kls Exp $
*/
#include "hdffosd.h"
@@ -71,7 +71,7 @@ cHdffOsd::cHdffOsd(int Left, int Top, HDFF::cHdffCmdIf * pHdffCmdIf, uint Level)
: cOsd(Left, Top, Level)
{
double pixelAspect;
- HDFF::tOsdConfig config;
+ HdffOsdConfig_t config;
//printf("cHdffOsd %d, %d, %d\n", Left, Top, Level);
mHdffCmdIf = pHdffCmdIf;
@@ -80,24 +80,24 @@ cHdffOsd::cHdffOsd(int Left, int Top, HDFF::cHdffCmdIf * pHdffCmdIf, uint Level)
shown = false;
mChanged = false;
mBitmapModified = false;
- mBitmapPalette = InvalidHandle;
+ mBitmapPalette = HDFF_INVALID_HANDLE;
config.FontKerning = false;
config.FontAntialiasing = Setup.AntiAlias ? true : false;
mHdffCmdIf->CmdOsdConfigure(&config);
gHdffSetup.GetOsdSize(mDispWidth, mDispHeight, pixelAspect);
- mDisplay = mHdffCmdIf->CmdOsdCreateDisplay(mDispWidth, mDispHeight, HDFF::colorTypeARGB8888);
- mHdffCmdIf->CmdOsdSetDisplayOutputRectangle(mDisplay, 0, 0, SizeFullScreen, SizeFullScreen);
+ mDisplay = mHdffCmdIf->CmdOsdCreateDisplay(mDispWidth, mDispHeight, HDFF_COLOR_TYPE_ARGB8888);
+ mHdffCmdIf->CmdOsdSetDisplayOutputRectangle(mDisplay, 0, 0, HDFF_SIZE_FULL_SCREEN, HDFF_SIZE_FULL_SCREEN);
for (int i = 0; i < MAX_NUM_FONTFACES; i++)
{
mFontFaces[i].Name = "";
- mFontFaces[i].Handle = InvalidHandle;
+ mFontFaces[i].Handle = HDFF_INVALID_HANDLE;
}
for (int i = 0; i < MAX_NUM_FONTS; i++)
{
- mFonts[i].hFontFace = InvalidHandle;
+ mFonts[i].hFontFace = HDFF_INVALID_HANDLE;
mFonts[i].Size = 0;
- mFonts[i].Handle = InvalidHandle;
+ mFonts[i].Handle = HDFF_INVALID_HANDLE;
}
}
@@ -108,18 +108,18 @@ cHdffOsd::~cHdffOsd()
for (int i = 0; i < MAX_NUM_FONTS; i++)
{
- if (mFonts[i].Handle == InvalidHandle)
+ if (mFonts[i].Handle == HDFF_INVALID_HANDLE)
break;
mHdffCmdIf->CmdOsdDeleteFont(mFonts[i].Handle);
}
for (int i = 0; i < MAX_NUM_FONTFACES; i++)
{
- if (mFontFaces[i].Handle == InvalidHandle)
+ if (mFontFaces[i].Handle == HDFF_INVALID_HANDLE)
break;
mHdffCmdIf->CmdOsdDeleteFontFace(mFontFaces[i].Handle);
}
- if (mBitmapPalette != InvalidHandle)
+ if (mBitmapPalette != HDFF_INVALID_HANDLE)
mHdffCmdIf->CmdOsdDeletePalette(mBitmapPalette);
mHdffCmdIf->CmdOsdDrawRectangle(mDisplay, 0, 0, mDispWidth, mDispHeight, 0);
mHdffCmdIf->CmdOsdRenderDisplay(mDisplay);
@@ -220,19 +220,19 @@ void cHdffOsd::DrawBitmap(int x, int y, const cBitmap &Bitmap, tColor ColorFg, t
mBitmapColors[i] = ColorFg;
}
}
- if (mBitmapPalette == InvalidHandle)
+ if (mBitmapPalette == HDFF_INVALID_HANDLE)
{
- mBitmapPalette = mHdffCmdIf->CmdOsdCreatePalette(HDFF::colorTypeClut8,
- HDFF::colorFormatARGB, numColors, mBitmapColors);
+ mBitmapPalette = mHdffCmdIf->CmdOsdCreatePalette(HDFF_COLOR_TYPE_CLUT8,
+ HDFF_COLOR_FORMAT_ARGB, numColors, mBitmapColors);
}
else
{
mHdffCmdIf->CmdOsdSetPaletteColors(mBitmapPalette,
- HDFF::colorFormatARGB, 0, numColors, mBitmapColors);
+ HDFF_COLOR_FORMAT_ARGB, 0, numColors, mBitmapColors);
}
mHdffCmdIf->CmdOsdDrawBitmap(mDisplay, mLeft + x, mTop + y,
(uint8_t *) Bitmap.Data(0, 0), Bitmap.Width(), Bitmap.Height(),
- Bitmap.Width() * Bitmap.Height(), HDFF::colorTypeClut8, mBitmapPalette);
+ Bitmap.Width() * Bitmap.Height(), HDFF_COLOR_TYPE_CLUT8, mBitmapPalette);
#if 0
uint32_t * tmpBitmap = new uint32_t[Bitmap.Width() * Bitmap.Height()];
for (int ix = 0; ix < Bitmap.Width(); ix++)
@@ -284,7 +284,7 @@ void cHdffOsd::DrawText(int x, int y, const char *s, tColor ColorFg, tColor Colo
pFontFace = NULL;
for (i = 0; i < MAX_NUM_FONTFACES; i++)
{
- if (mFontFaces[i].Handle == InvalidHandle)
+ if (mFontFaces[i].Handle == HDFF_INVALID_HANDLE)
break;
if (strcmp(mFontFaces[i].Name, Font->FontName()) == 0)
@@ -312,7 +312,7 @@ void cHdffOsd::DrawText(int x, int y, const char *s, tColor ColorFg, tColor Colo
if (fread(buffer, fileSize, 1, fp) == 1)
{
mFontFaces[i].Handle = mHdffCmdIf->CmdOsdCreateFontFace(buffer, fileSize);
- if (mFontFaces[i].Handle != InvalidHandle)
+ if (mFontFaces[i].Handle != HDFF_INVALID_HANDLE)
{
mFontFaces[i].Name = Font->FontName();
pFontFace = &mFontFaces[i];
@@ -331,7 +331,7 @@ void cHdffOsd::DrawText(int x, int y, const char *s, tColor ColorFg, tColor Colo
pFont = NULL;
for (i = 0; i < MAX_NUM_FONTS; i++)
{
- if (mFonts[i].Handle == InvalidHandle)
+ if (mFonts[i].Handle == HDFF_INVALID_HANDLE)
break;
if (mFonts[i].hFontFace == pFontFace->Handle
@@ -346,7 +346,7 @@ void cHdffOsd::DrawText(int x, int y, const char *s, tColor ColorFg, tColor Colo
if (i < MAX_NUM_FONTS)
{
mFonts[i].Handle = mHdffCmdIf->CmdOsdCreateFont(pFontFace->Handle, size);
- if (mFonts[i].Handle != InvalidHandle)
+ if (mFonts[i].Handle != HDFF_INVALID_HANDLE)
{
mFonts[i].hFontFace = pFontFace->Handle;
mFonts[i].Size = size;
@@ -435,9 +435,9 @@ void cHdffOsd::DrawEllipse(int x1, int y1, int x2, int y2, tColor Color, int Qua
{
case 1:
if (Quadrants > 0)
- flags = HDFF::drawQuarterTopRight;
+ flags = HDFF_DRAW_QUARTER_TOP_RIGHT;
else
- flags = HDFF::drawQuarterTopRightInverted;
+ flags = HDFF_DRAW_QUARTER_TOP_RIGHT_INVERTED;
cx = x1;
cy = y2;
rx = x2 - x1;
@@ -445,9 +445,9 @@ void cHdffOsd::DrawEllipse(int x1, int y1, int x2, int y2, tColor Color, int Qua
break;
case 2:
if (Quadrants > 0)
- flags = HDFF::drawQuarterTopLeft;
+ flags = HDFF_DRAW_QUARTER_TOP_LEFT;
else
- flags = HDFF::drawQuarterTopLeftInverted;
+ flags = HDFF_DRAW_QUARTER_TOP_LEFT_INVERTED;
cx = x2;
cy = y2;
rx = x2 - x1;
@@ -455,9 +455,9 @@ void cHdffOsd::DrawEllipse(int x1, int y1, int x2, int y2, tColor Color, int Qua
break;
case 3:
if (Quadrants > 0)
- flags = HDFF::drawQuarterBottomLeft;
+ flags = HDFF_DRAW_QUARTER_BOTTOM_LEFT;
else
- flags = HDFF::drawQuarterBottomLeftInverted;
+ flags = HDFF_DRAW_QUARTER_BOTTOM_LEFT_INVERTED;
cx = x2;
cy = y1;
rx = x2 - x1;
@@ -465,44 +465,44 @@ void cHdffOsd::DrawEllipse(int x1, int y1, int x2, int y2, tColor Color, int Qua
break;
case 4:
if (Quadrants > 0)
- flags = HDFF::drawQuarterBottomRight;
+ flags = HDFF_DRAW_QUARTER_BOTTOM_RIGHT;
else
- flags = HDFF::drawQuarterBottomRightInverted;
+ flags = HDFF_DRAW_QUARTER_BOTTOM_RIGHT_INVERTED;
cx = x1;
cy = y1;
rx = x2 - x1;
ry = y2 - y1;
break;
case 5:
- flags = HDFF::drawHalfRight;
+ flags = HDFF_DRAW_HALF_RIGHT;
cx = x1;
cy = (y1 + y2) / 2;
rx = x2 - x1;
ry = (y2 - y1) / 2;
break;
case 6:
- flags = HDFF::drawHalfTop;
+ flags = HDFF_DRAW_HALF_TOP;
cx = (x1 + x2) / 2;
cy = y2;
rx = (x2 - x1) / 2;
ry = y2 - y1;
break;
case 7:
- flags = HDFF::drawHalfLeft;
+ flags = HDFF_DRAW_HALF_LEFT;
cx = x2;
cy = (y1 + y2) / 2;
rx = x2 - x1;
ry = (y2 - y1) / 2;
break;
case 8:
- flags = HDFF::drawHalfBottom;
+ flags = HDFF_DRAW_HALF_BOTTOM;
cx = (x1 + x2) / 2;
cy = y1;
rx = (x2 - x1) / 2;
ry = y2 - y1;
break;
default:
- flags = HDFF::drawFull;
+ flags = HDFF_DRAW_FULL;
cx = (x1 + x2) / 2;
cy = (y1 + y2) / 2;
rx = (x2 - x1) / 2;
@@ -552,7 +552,7 @@ private:
HDFF::cHdffCmdIf * mHdffCmdIf;
int mDispWidth;
int mDispHeight;
- bool shown;
+ bool refresh;
uint32_t mDisplay;
uint32_t mBitmapPalette;
uint32_t mBitmapColors[256];
@@ -575,24 +575,27 @@ cHdffOsdRaw::cHdffOsdRaw(int Left, int Top, HDFF::cHdffCmdIf * pHdffCmdIf, uint
//printf("cHdffOsdRaw %d, %d, %d\n", Left, Top, Level);
mHdffCmdIf = pHdffCmdIf;
- shown = false;
- mBitmapPalette = InvalidHandle;
+ refresh = true;
+ mBitmapPalette = HDFF_INVALID_HANDLE;
+ mDisplay = HDFF_INVALID_HANDLE;
gHdffSetup.GetOsdSize(mDispWidth, mDispHeight, pixelAspect);
- mDisplay = mHdffCmdIf->CmdOsdCreateDisplay(mDispWidth, mDispHeight, HDFF::colorTypeARGB8888);
- mHdffCmdIf->CmdOsdSetDisplayOutputRectangle(mDisplay, 0, 0, SizeFullScreen, SizeFullScreen);
}
cHdffOsdRaw::~cHdffOsdRaw()
{
//printf("~cHdffOsdRaw %d %d\n", Left(), Top());
- SetActive(false);
-
- if (mBitmapPalette != InvalidHandle)
+ if (mDisplay != HDFF_INVALID_HANDLE)
+ {
+ mHdffCmdIf->CmdOsdDrawRectangle(mDisplay, 0, 0, mDispWidth, mDispHeight, 0);
+ mHdffCmdIf->CmdOsdRenderDisplay(mDisplay);
+ }
+ if (mBitmapPalette != HDFF_INVALID_HANDLE)
mHdffCmdIf->CmdOsdDeletePalette(mBitmapPalette);
- mHdffCmdIf->CmdOsdDrawRectangle(mDisplay, 0, 0, mDispWidth, mDispHeight, 0);
- mHdffCmdIf->CmdOsdRenderDisplay(mDisplay);
- mHdffCmdIf->CmdOsdDeleteDisplay(mDisplay);
+ mBitmapPalette = HDFF_INVALID_HANDLE;
+ if (mDisplay != HDFF_INVALID_HANDLE)
+ mHdffCmdIf->CmdOsdDeleteDisplay(mDisplay);
+ mDisplay = HDFF_INVALID_HANDLE;
}
void cHdffOsdRaw::SetActive(bool On)
@@ -602,14 +605,29 @@ void cHdffOsdRaw::SetActive(bool On)
cOsd::SetActive(On);
if (On)
{
+ if (mDisplay == HDFF_INVALID_HANDLE)
+ {
+ mDisplay = mHdffCmdIf->CmdOsdCreateDisplay(mDispWidth, mDispHeight, HDFF_COLOR_TYPE_ARGB8888);
+ if (mDisplay != HDFF_INVALID_HANDLE)
+ mHdffCmdIf->CmdOsdSetDisplayOutputRectangle(mDisplay, 0, 0, HDFF_SIZE_FULL_SCREEN, HDFF_SIZE_FULL_SCREEN);
+ }
+ refresh = true;
if (GetBitmap(0)) // only flush here if there are already bitmaps
Flush();
}
- else if (shown)
+ else
{
- mHdffCmdIf->CmdOsdDrawRectangle(mDisplay, 0, 0, mDispWidth, mDispHeight, 0);
- mHdffCmdIf->CmdOsdRenderDisplay(mDisplay);
- shown = false;
+ if (mDisplay != HDFF_INVALID_HANDLE)
+ {
+ mHdffCmdIf->CmdOsdDrawRectangle(mDisplay, 0, 0, mDispWidth, mDispHeight, 0);
+ mHdffCmdIf->CmdOsdRenderDisplay(mDisplay);
+ }
+ if (mBitmapPalette != HDFF_INVALID_HANDLE)
+ mHdffCmdIf->CmdOsdDeletePalette(mBitmapPalette);
+ mBitmapPalette = HDFF_INVALID_HANDLE;
+ if (mDisplay != HDFF_INVALID_HANDLE)
+ mHdffCmdIf->CmdOsdDeleteDisplay(mDisplay);
+ mDisplay = HDFF_INVALID_HANDLE;
}
}
}
@@ -635,18 +653,18 @@ eOsdError cHdffOsdRaw::SetAreas(const tArea *Areas, int NumAreas)
{
//printf("SetAreas %d: %d %d %d %d %d\n", i, Areas[i].x1, Areas[i].y1, Areas[i].x2, Areas[i].y2, Areas[i].bpp);
}
- if (shown)
+ if (mDisplay != HDFF_INVALID_HANDLE)
{
mHdffCmdIf->CmdOsdDrawRectangle(mDisplay, 0, 0, mDispWidth, mDispHeight, 0);
mHdffCmdIf->CmdOsdRenderDisplay(mDisplay);
- shown = false;
+ refresh = true;
}
return cOsd::SetAreas(Areas, NumAreas);
}
void cHdffOsdRaw::Flush(void)
{
- if (!Active())
+ if (!Active() || (mDisplay == HDFF_INVALID_HANDLE))
return;
//struct timeval start;
//struct timeval end;
@@ -673,7 +691,7 @@ void cHdffOsdRaw::Flush(void)
mHdffCmdIf->CmdOsdDrawBitmap(mDisplay,
Left() + pm->ViewPort().X(), Top() + pm->ViewPort().Y() + y,
pm->Data() + y * d, w, hc, hc * d,
- HDFF::colorTypeARGB8888, InvalidHandle);
+ HDFF_COLOR_TYPE_ARGB8888, HDFF_INVALID_HANDLE);
}
delete pm;
render = true;
@@ -688,9 +706,9 @@ void cHdffOsdRaw::Flush(void)
for (int i = 0; (bitmap = GetBitmap(i)) != NULL; i++)
{
int x1 = 0, y1 = 0, x2 = 0, y2 = 0;
- if (!shown || bitmap->Dirty(x1, y1, x2, y2))
+ if (refresh || bitmap->Dirty(x1, y1, x2, y2))
{
- if (!shown)
+ if (refresh)
{
x2 = bitmap->Width() - 1;
y2 = bitmap->Height() - 1;
@@ -702,15 +720,15 @@ void cHdffOsdRaw::Flush(void)
{
for (int c = 0; c < numColors; c++)
mBitmapColors[c] = colors[c];
- if (mBitmapPalette == InvalidHandle)
+ if (mBitmapPalette == HDFF_INVALID_HANDLE)
{
- mBitmapPalette = mHdffCmdIf->CmdOsdCreatePalette(HDFF::colorTypeClut8,
- HDFF::colorFormatARGB, numColors, mBitmapColors);
+ mBitmapPalette = mHdffCmdIf->CmdOsdCreatePalette(HDFF_COLOR_TYPE_CLUT8,
+ HDFF_COLOR_FORMAT_ARGB, numColors, mBitmapColors);
}
else
{
mHdffCmdIf->CmdOsdSetPaletteColors(mBitmapPalette,
- HDFF::colorFormatARGB, 0, numColors, mBitmapColors);
+ HDFF_COLOR_FORMAT_ARGB, 0, numColors, mBitmapColors);
}
}
// commit modified data:
@@ -729,7 +747,7 @@ void cHdffOsdRaw::Flush(void)
mHdffCmdIf->CmdOsdDrawBitmap(mDisplay,
Left() + bitmap->X0() + x1, Top() + bitmap->Y0() + y1 + y,
buffer, width, hc, hc * width,
- HDFF::colorTypeClut8, mBitmapPalette);
+ HDFF_COLOR_TYPE_CLUT8, mBitmapPalette);
}
render = true;
}
@@ -745,7 +763,7 @@ void cHdffOsdRaw::Flush(void)
//timeNeeded += (end.tv_sec - start.tv_sec) * 1000000;
//printf("time = %d\n", timeNeeded);
}
- shown = true;
+ refresh = false;
}