summaryrefslogtreecommitdiff
path: root/PLUGINS
diff options
context:
space:
mode:
Diffstat (limited to 'PLUGINS')
-rw-r--r--PLUGINS/src/dvbhddevice/dvbhddevice.c10
-rw-r--r--PLUGINS/src/dvbhddevice/hdffcmd.c8
-rw-r--r--PLUGINS/src/dvbhddevice/hdffcmd.h3
-rw-r--r--PLUGINS/src/dvbhddevice/hdffosd.c23
-rw-r--r--PLUGINS/src/dvbhddevice/libhdffcmd/hdffcmd_defs.h1
-rw-r--r--PLUGINS/src/dvbhddevice/libhdffcmd/hdffcmd_generic.c42
-rw-r--r--PLUGINS/src/dvbhddevice/libhdffcmd/hdffcmd_osd.c39
-rw-r--r--PLUGINS/src/dvbhddevice/libhdffcmd/hdffcmd_osd.h5
8 files changed, 108 insertions, 23 deletions
diff --git a/PLUGINS/src/dvbhddevice/dvbhddevice.c b/PLUGINS/src/dvbhddevice/dvbhddevice.c
index a1e5881..20b6762 100644
--- a/PLUGINS/src/dvbhddevice/dvbhddevice.c
+++ b/PLUGINS/src/dvbhddevice/dvbhddevice.c
@@ -3,7 +3,7 @@
*
* See the README file for copyright information and how to reach the author.
*
- * $Id: dvbhddevice.c 1.16 2012/02/08 15:10:30 kls Exp $
+ * $Id: dvbhddevice.c 1.17 2012/06/07 09:33:18 kls Exp $
*/
#include <vdr/plugin.h>
@@ -52,7 +52,7 @@ void cPluginDvbhddevice::MainThreadHook(void)
if (gHdffSetup.CecEnabled && gHdffSetup.CecTvOn)
{
HDFF::cHdffCmdIf * hdffCmdIf = cDvbHdFfDevice::GetHdffCmdHandler();
- if (!mIsUserInactive)
+ if (hdffCmdIf && !mIsUserInactive)
{
hdffCmdIf->CmdHdmiSendCecCommand(HDFF_CEC_COMMAND_TV_ON);
}
@@ -67,12 +67,14 @@ const char *cPluginDvbhddevice::MainMenuEntry(void)
cOsdObject *cPluginDvbhddevice::MainMenuAction(void)
{
- return new cHdffMenu(cDvbHdFfDevice::GetHdffCmdHandler());
+ HDFF::cHdffCmdIf * hdffCmdIf = cDvbHdFfDevice::GetHdffCmdHandler();
+ return hdffCmdIf ? new cHdffMenu(hdffCmdIf) : NULL;
}
cMenuSetupPage *cPluginDvbhddevice::SetupMenu(void)
{
- return new cHdffSetupPage(cDvbHdFfDevice::GetHdffCmdHandler());
+ HDFF::cHdffCmdIf * hdffCmdIf = cDvbHdFfDevice::GetHdffCmdHandler();
+ return hdffCmdIf ? new cHdffSetupPage(hdffCmdIf) : NULL;
}
bool cPluginDvbhddevice::SetupParse(const char *Name, const char *Value)
diff --git a/PLUGINS/src/dvbhddevice/hdffcmd.c b/PLUGINS/src/dvbhddevice/hdffcmd.c
index 78e8a89..a6a41d9 100644
--- a/PLUGINS/src/dvbhddevice/hdffcmd.c
+++ b/PLUGINS/src/dvbhddevice/hdffcmd.c
@@ -3,7 +3,7 @@
*
* See the README file for copyright information and how to reach the author.
*
- * $Id: hdffcmd.c 1.24 2012/02/28 09:19:09 kls Exp $
+ * $Id: hdffcmd.c 1.25 2012/06/16 11:16:38 kls Exp $
*/
#include <stdint.h>
@@ -310,6 +310,12 @@ void cHdffCmdIf::CmdOsdDrawText(uint32_t hDisplay, uint32_t hFont, int X, int Y,
HdffCmdOsdDrawText(mOsdDev, hDisplay, hFont, X, Y, pText, Color);
}
+void cHdffCmdIf::CmdOsdDrawUtf8Text(uint32_t hDisplay, uint32_t hFont, int X, int Y, const char * pText, uint32_t Color)
+{
+ //printf("Text(UTF8) %08X (%d,%d), %s, %08X\n", hFont, X, Y, pText, Color);
+ HdffCmdOsdDrawUtf8Text(mOsdDev, hDisplay, hFont, X, Y, pText, Color);
+}
+
void cHdffCmdIf::CmdOsdDrawTextW(uint32_t hDisplay, uint32_t hFont, int X, int Y, const uint16_t * pText, uint32_t Color)
{
//printf("TextW %08X (%d,%d), %08X\n", hFont, X, Y, Color);
diff --git a/PLUGINS/src/dvbhddevice/hdffcmd.h b/PLUGINS/src/dvbhddevice/hdffcmd.h
index c4f5104..f33fe08 100644
--- a/PLUGINS/src/dvbhddevice/hdffcmd.h
+++ b/PLUGINS/src/dvbhddevice/hdffcmd.h
@@ -3,7 +3,7 @@
*
* See the README file for copyright information and how to reach the author.
*
- * $Id: hdffcmd.h 1.19 2012/02/06 11:09:27 kls Exp $
+ * $Id: hdffcmd.h 1.20 2012/06/16 11:16:52 kls Exp $
*/
#ifndef _HDFF_CMD_H_
@@ -74,6 +74,7 @@ public:
void CmdOsdDrawEllipse(uint32_t hDisplay, int CX, int CY, int RadiusX, int RadiusY,
uint32_t Color, uint32_t Flags);
void CmdOsdDrawText(uint32_t hDisplay, uint32_t hFont, int X, int Y, const char * pText, uint32_t Color);
+ void CmdOsdDrawUtf8Text(uint32_t hDisplay, uint32_t hFont, int X, int Y, const char * pText, uint32_t Color);
void CmdOsdDrawTextW(uint32_t hDisplay, uint32_t hFont, int X, int Y, const uint16_t * pText, uint32_t Color);
void CmdOsdDrawBitmap(uint32_t hDisplay, int X, int Y, const uint8_t * pBitmap,
int BmpWidth, int BmpHeight, int BmpSize,
diff --git a/PLUGINS/src/dvbhddevice/hdffosd.c b/PLUGINS/src/dvbhddevice/hdffosd.c
index 0b95707..427a3fb 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.15 2012/05/17 13:29:50 kls Exp $
+ * $Id: hdffosd.c 1.17 2012/06/16 11:17:11 kls Exp $
*/
#include "hdffosd.h"
@@ -47,6 +47,8 @@ private:
uint32_t mBitmapColors[256];
uint32_t mBitmapNumColors;
+ bool mSupportsUtf8Text;
+
protected:
virtual void SetActive(bool On);
public:
@@ -78,6 +80,12 @@ cHdffOsd::cHdffOsd(int Left, int Top, HDFF::cHdffCmdIf * pHdffCmdIf, uint Level)
shown = false;
mChanged = false;
mBitmapPalette = HDFF_INVALID_HANDLE;
+
+ mSupportsUtf8Text = false;
+ if (mHdffCmdIf->CmdGetFirmwareVersion(NULL, 0) >= 0x309)
+ mSupportsUtf8Text = true;
+
+ memset(&config, 0, sizeof(config));
config.FontKerning = true;
config.FontAntialiasing = Setup.AntiAlias ? true : false;
mHdffCmdIf->CmdOsdConfigure(&config);
@@ -346,15 +354,19 @@ void cHdffOsd::DrawText(int x, int y, const char *s, tColor ColorFg, tColor Colo
{
if ((Alignment & taLeft) != 0)
{
+#if (APIVERSNUM >= 10728)
if ((Alignment & taBorder) != 0)
x += max(h / TEXT_ALIGN_BORDER, 1);
+#endif
}
else if ((Alignment & taRight) != 0)
{
if (w < Width)
x += Width - w;
+#if (APIVERSNUM >= 10728)
if ((Alignment & taBorder) != 0)
x -= max(h / TEXT_ALIGN_BORDER, 1);
+#endif
}
else
{ // taCentered
@@ -378,8 +390,11 @@ void cHdffOsd::DrawText(int x, int y, const char *s, tColor ColorFg, tColor Colo
}
}
}
- //x -= mLeft;
- //y -= mTop;
+ if (mSupportsUtf8Text)
+ {
+ mHdffCmdIf->CmdOsdDrawUtf8Text(mDisplay, pFont->Handle, x + mLeft, y + mTop + h, s, ColorFg);
+ }
+ else
{
uint16_t tmp[1000];
uint16_t len = 0;
@@ -394,9 +409,7 @@ void cHdffOsd::DrawText(int x, int y, const char *s, tColor ColorFg, tColor Colo
tmp[len] = 0;
mHdffCmdIf->CmdOsdDrawTextW(mDisplay, pFont->Handle, x + mLeft, y + mTop + h, tmp, ColorFg);
}
- //mHdffCmdIf->CmdOsdDrawText(mDisplay, pFont->Handle, x + mLeft, y + mTop + h - 7, s, ColorFg);
mHdffCmdIf->CmdOsdSetDisplayClippingArea(mDisplay, false, 0, 0, 0, 0);
- //Font->DrawText(this, x, y, s, ColorFg, ColorBg, limit);
mChanged = true;
}
diff --git a/PLUGINS/src/dvbhddevice/libhdffcmd/hdffcmd_defs.h b/PLUGINS/src/dvbhddevice/libhdffcmd/hdffcmd_defs.h
index f68da66..322c256 100644
--- a/PLUGINS/src/dvbhddevice/libhdffcmd/hdffcmd_defs.h
+++ b/PLUGINS/src/dvbhddevice/libhdffcmd/hdffcmd_defs.h
@@ -103,6 +103,7 @@ typedef enum HdffMessageId_t
HDFF_MSG_OSD_DRAW_TEXT,
HDFF_MSG_OSD_DRAW_WIDE_TEXT,
HDFF_MSG_OSD_DRAW_BITMAP,
+ HDFF_MSG_OSD_DRAW_UTF8_TEXT,
HDFF_MSG_HDMI_ENABLE_OUTPUT = 0,
HDFF_MSG_HDMI_SET_VIDEO_MODE,
diff --git a/PLUGINS/src/dvbhddevice/libhdffcmd/hdffcmd_generic.c b/PLUGINS/src/dvbhddevice/libhdffcmd/hdffcmd_generic.c
index f72a7d3..797abe8 100644
--- a/PLUGINS/src/dvbhddevice/libhdffcmd/hdffcmd_generic.c
+++ b/PLUGINS/src/dvbhddevice/libhdffcmd/hdffcmd_generic.c
@@ -21,6 +21,7 @@
*
*********************************************************************/
+#include <errno.h>
#include <stdint.h>
#include <string.h>
#include <sys/ioctl.h>
@@ -38,8 +39,12 @@ int HdffCmdGetFirmwareVersion(int OsdDevice, uint32_t * Version, char * String,
osd_raw_cmd_t osd_cmd;
int err;
+ if (Version == NULL)
+ return -EINVAL;
+
*Version = 0;
- String[0] = 0;
+ if (String)
+ String[0] = 0;
BitBuffer_Init(&cmdBuf, cmdData, sizeof(cmdData));
memset(&osd_cmd, 0, sizeof(osd_raw_cmd_t));
@@ -54,11 +59,14 @@ int HdffCmdGetFirmwareVersion(int OsdDevice, uint32_t * Version, char * String,
{
if (osd_cmd.result_len > 0)
{
- uint8_t textLength = resultData[9];
- if (textLength >= MaxLength)
- textLength = MaxLength - 1;
- memcpy(String, &resultData[10], textLength);
- String[textLength] = 0;
+ if (String)
+ {
+ uint8_t textLength = resultData[9];
+ if (textLength >= MaxLength)
+ textLength = MaxLength - 1;
+ memcpy(String, &resultData[10], textLength);
+ String[textLength] = 0;
+ }
*Version = (resultData[6] << 16)
| (resultData[7] << 8)
| resultData[8];
@@ -76,8 +84,12 @@ int HdffCmdGetInterfaceVersion(int OsdDevice, uint32_t * Version, char * String,
osd_raw_cmd_t osd_cmd;
int err;
+ if (Version == NULL)
+ return -EINVAL;
+
*Version = 0;
- String[0] = 0;
+ if (String)
+ String[0] = 0;
BitBuffer_Init(&cmdBuf, cmdData, sizeof(cmdData));
memset(&osd_cmd, 0, sizeof(osd_raw_cmd_t));
@@ -92,11 +104,14 @@ int HdffCmdGetInterfaceVersion(int OsdDevice, uint32_t * Version, char * String,
{
if (osd_cmd.result_len > 0)
{
- uint8_t textLength = resultData[9];
- if (textLength >= MaxLength)
- textLength = MaxLength - 1;
- memcpy(String, &resultData[10], textLength);
- String[textLength] = 0;
+ if (String)
+ {
+ uint8_t textLength = resultData[9];
+ if (textLength >= MaxLength)
+ textLength = MaxLength - 1;
+ memcpy(String, &resultData[10], textLength);
+ String[textLength] = 0;
+ }
*Version = (resultData[6] << 16)
| (resultData[7] << 8)
| resultData[8];
@@ -114,6 +129,9 @@ int HdffCmdGetCopyrights(int OsdDevice, uint8_t Index, char * String,
osd_raw_cmd_t osd_cmd;
int err;
+ if (String == NULL)
+ return -EINVAL;
+
String[0] = 0;
BitBuffer_Init(&cmdBuf, cmdData, sizeof(cmdData));
diff --git a/PLUGINS/src/dvbhddevice/libhdffcmd/hdffcmd_osd.c b/PLUGINS/src/dvbhddevice/libhdffcmd/hdffcmd_osd.c
index dfe2759..9367415 100644
--- a/PLUGINS/src/dvbhddevice/libhdffcmd/hdffcmd_osd.c
+++ b/PLUGINS/src/dvbhddevice/libhdffcmd/hdffcmd_osd.c
@@ -57,6 +57,8 @@ int HdffCmdOsdConfigure(int OsdDevice, const HdffOsdConfig_t * Config)
{
BitBuffer_SetBits(&cmdBuf, 1, 0);
}
+ BitBuffer_SetBits(&cmdBuf, 6, 0); // reserved
+ BitBuffer_SetBits(&cmdBuf, 16, Config->FontDpi);
osd_cmd.cmd_len = HdffCmdSetLength(&cmdBuf);
return ioctl(OsdDevice, OSD_RAW_CMD, &osd_cmd);
}
@@ -581,6 +583,43 @@ int HdffCmdOsdDrawText(int OsdDevice, uint32_t Display, uint32_t Font,
return ioctl(OsdDevice, OSD_RAW_CMD, &osd_cmd);
}
+int HdffCmdOsdDrawUtf8Text(int OsdDevice, uint32_t Display, uint32_t Font,
+ uint16_t X, uint16_t Y, const char * Text,
+ uint32_t Color)
+{
+ uint8_t cmdData[1060];
+ BitBuffer_t cmdBuf;
+ osd_raw_cmd_t osd_cmd;
+ int i;
+ int length;
+
+ length = 0;
+ while (Text[length])
+ {
+ length++;
+ }
+ if (length > 980)
+ length = 980;
+
+ BitBuffer_Init(&cmdBuf, cmdData, sizeof(cmdData));
+ memset(&osd_cmd, 0, sizeof(osd_raw_cmd_t));
+ osd_cmd.cmd_data = cmdData;
+ HdffCmdBuildHeader(&cmdBuf, HDFF_MSG_TYPE_COMMAND, HDFF_MSG_GROUP_OSD,
+ HDFF_MSG_OSD_DRAW_UTF8_TEXT);
+ BitBuffer_SetBits(&cmdBuf, 32, Display);
+ BitBuffer_SetBits(&cmdBuf, 32, Font);
+ BitBuffer_SetBits(&cmdBuf, 16, X);
+ BitBuffer_SetBits(&cmdBuf, 16, Y);
+ BitBuffer_SetBits(&cmdBuf, 32, Color);
+ BitBuffer_SetBits(&cmdBuf, 16, length);
+ for (i = 0; i < length; i++)
+ {
+ BitBuffer_SetBits(&cmdBuf, 8, Text[i]);
+ }
+ osd_cmd.cmd_len = HdffCmdSetLength(&cmdBuf);
+ return ioctl(OsdDevice, OSD_RAW_CMD, &osd_cmd);
+}
+
int HdffCmdOsdDrawWideText(int OsdDevice, uint32_t Display, uint32_t Font,
uint16_t X, uint16_t Y, const uint16_t * Text,
uint32_t Color)
diff --git a/PLUGINS/src/dvbhddevice/libhdffcmd/hdffcmd_osd.h b/PLUGINS/src/dvbhddevice/libhdffcmd/hdffcmd_osd.h
index 5c13559..48851ef 100644
--- a/PLUGINS/src/dvbhddevice/libhdffcmd/hdffcmd_osd.h
+++ b/PLUGINS/src/dvbhddevice/libhdffcmd/hdffcmd_osd.h
@@ -40,6 +40,7 @@ typedef struct HdffOsdConfig_t
{
int FontAntialiasing;
int FontKerning;
+ uint16_t FontDpi;
} HdffOsdConfig_t;
typedef enum HdffColorType_t
@@ -148,6 +149,10 @@ int HdffCmdOsdDrawText(int OsdDevice, uint32_t Display, uint32_t Font,
uint16_t X, uint16_t Y, const char * Text,
uint32_t Color);
+int HdffCmdOsdDrawUtf8Text(int OsdDevice, uint32_t Display, uint32_t Font,
+ uint16_t X, uint16_t Y, const char * Text,
+ uint32_t Color);
+
int HdffCmdOsdDrawWideText(int OsdDevice, uint32_t Display, uint32_t Font,
uint16_t X, uint16_t Y, const uint16_t * Text,
uint32_t Color);