summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorscop <scop>2005-08-01 17:45:33 +0000
committerscop <scop>2005-08-01 17:45:33 +0000
commite1a64074adfcf0b075f0267aa8b06810d96de7b8 (patch)
treebc28c8c12f955d67fc2400f9debcabbb0712e8dc
parent87405c497570c356759c51674eb856902338eb80 (diff)
downloadvdr-plugin-dxr3-e1a64074adfcf0b075f0267aa8b06810d96de7b8.tar.gz
vdr-plugin-dxr3-e1a64074adfcf0b075f0267aa8b06810d96de7b8.tar.bz2
Move OSD flush rate setting to UI.
-rw-r--r--HISTORY2
-rw-r--r--Makefile9
-rw-r--r--dxr3.c12
-rw-r--r--dxr3.h1
-rw-r--r--dxr3configdata.c1
-rw-r--r--dxr3configdata.h10
-rw-r--r--dxr3i18n.c26
-rw-r--r--dxr3osd_subpicture.c10
8 files changed, 57 insertions, 14 deletions
diff --git a/HISTORY b/HISTORY
index 8c6027e..5ae164b 100644
--- a/HISTORY
+++ b/HISTORY
@@ -260,7 +260,7 @@ NOTE: I havent found time to include all of the languages, will be done in pre2
- avoid high CPU usage in pause mode (Luca Olivetti, Klaus Schmidinger)
- improved GetSTC(): fixes DVB subtitles sync problems (Mikko Tuumanen)
- limit OSD flush rate: prevents OSD from going berserk due to being
- refreshed too often, see FLUSHRATE in Makefile (Luca Olivetti, Ville Skyttä)
+ refreshed too often, see plugin settings (Luca Olivetti, Ville Skyttä)
- borrow better OSD scaling routines from the Xine plugin (Luca Olivetti)
- improve original OSD scaler for small resolutions (#1014339, Luca Olivetti)
- improve error checking, eliminate some compiler warnings (Ville Skyttä)
diff --git a/Makefile b/Makefile
index 4057c74..b8fed74 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
#
# Makefile for a Video Disk Recorder plugin
#
-# $Id: Makefile,v 1.1.2.17 2005/06/22 16:57:58 scop Exp $
+# $Id: Makefile,v 1.1.2.18 2005/08/01 17:45:33 scop Exp $
# The official name of this plugin.
# This name will be used in the '-P...' option of VDR to load the plugin.
@@ -54,13 +54,6 @@ DEFINES += -DMICROCODE=\"/usr/share/misc/em8300.uc\"
# comment this out to use the traditional vdr-dxr3 scaler
DEFINES += -DUSE_XINE_SCALER
-# The OSD goes berserk (flickering rectangles in colors from the current
-# palette around the screen) in some setups if it's refreshed too often.
-# If it doesn't happen for you or you don't like the small delay this
-# causes, change this to 0. Experiment with larger values if the default
-# of 40ms does not calm down your OSD.
-DEFINES += -DFLUSHRATE=40
-
### The object files (add further files here):
OBJS = $(PLUGIN).o dxr3multichannelaudio.o dxr3sysclock.o dxr3colormanager.o dxr3syncbuffer.o dxr3audiodecoder.o \
diff --git a/dxr3.c b/dxr3.c
index b39a5b8..3b349a4 100644
--- a/dxr3.c
+++ b/dxr3.c
@@ -3,7 +3,7 @@
*
* See the README file for copyright information and how to reach the author.
*
- * $Id: dxr3.c,v 1.1.2.14 2005/07/06 18:04:46 scop Exp $
+ * $Id: dxr3.c,v 1.1.2.15 2005/08/01 17:45:33 scop Exp $
*
*/
@@ -82,6 +82,9 @@ cMenuSetupDxr3::cMenuSetupDxr3(void)
&newVideoMode, 3, menuVideoModes));
newHideMenu = cDxr3ConfigData::Instance().GetHideMenu();
Add(new cMenuEditBoolItem(tr("Hide main menu entry"), &newHideMenu));
+ newOsdFlushRate = cDxr3ConfigData::Instance().GetOsdFlushRate();
+ Add(new cMenuEditIntItem(tr("OSD flush rate (ms)"),
+ &newOsdFlushRate, 0, 255));
}
// ==================================
@@ -96,6 +99,8 @@ void cMenuSetupDxr3::Store(void)
cDxr3ConfigData::Instance().SetVideoMode((eVideoMode) newVideoMode));
SetupStore("HideMenu",
cDxr3ConfigData::Instance().SetHideMenu(newHideMenu));
+ SetupStore("OsdFlushRate",
+ cDxr3ConfigData::Instance().SetOsdFlushRate(newOsdFlushRate));
}
// ==================================
@@ -201,6 +206,11 @@ bool cPluginDxr3::SetupParse(const char *Name, const char *Value)
cDxr3ConfigData::Instance().SetHideMenu(atoi(Value));
return true;
}
+ if (!strcasecmp(Name, "OsdFlushRate"))
+ {
+ cDxr3ConfigData::Instance().SetOsdFlushRate(atoi(Value));
+ return true;
+ }
return false;
}
diff --git a/dxr3.h b/dxr3.h
index cae4988..c3a1a04 100644
--- a/dxr3.h
+++ b/dxr3.h
@@ -19,6 +19,7 @@ private:
int newVideoMode;
const char *menuVideoModes[3];
int newHideMenu;
+ int newOsdFlushRate;
};
diff --git a/dxr3configdata.c b/dxr3configdata.c
index 86afb37..2a60ab2 100644
--- a/dxr3configdata.c
+++ b/dxr3configdata.c
@@ -36,6 +36,7 @@ cDxr3ConfigData::cDxr3ConfigData()
m_contrast = 500;
m_saturation = 500;
m_hidemenu = 0;
+ m_osdflushrate = 40;
}
// Local variables:
diff --git a/dxr3configdata.h b/dxr3configdata.h
index e13eb53..13d4a31 100644
--- a/dxr3configdata.h
+++ b/dxr3configdata.h
@@ -138,6 +138,15 @@ public:
return m_hidemenu = value;
}
+ unsigned int GetOsdFlushRate() const
+ {
+ return (unsigned) m_osdflushrate;
+ }
+ int SetOsdFlushRate(int value)
+ {
+ return m_osdflushrate = value;
+ }
+
protected:
eVideoMode m_videomode;
eMenuMode m_menumode;
@@ -150,6 +159,7 @@ protected:
int m_contrast;
int m_saturation;
int m_hidemenu;
+ int m_osdflushrate;
};
#endif /*_DXR3_CONFIGDATA_H_*/
diff --git a/dxr3i18n.c b/dxr3i18n.c
index 50fc83d..8195dcf 100644
--- a/dxr3i18n.c
+++ b/dxr3i18n.c
@@ -570,6 +570,32 @@ const tI18nPhrase Phrases[] = {
#endif
#endif
},
+ {
+ "OSD flush rate (ms)",
+ "", // Deutsch
+ "", // Slovenski
+ "", // Italiano
+ "", // Nederlands
+ "", // Português
+ "", // Français
+ "", // Norsk
+ "Kuvaruutunäytön päivitysväli (ms)",
+ "", // Polski
+ "", // Español
+ "", // ÅëëçíéêÜ (Greek)
+ "", // Svenska
+ "", // Românã
+ "", // Magyar
+ "", // Català
+ "", // ÀãááÚØÙ (Russian)
+ "", // Hrvatski
+#if VDRVERSNUM > 10312
+ "", // Eesti
+#if VDRVERSNUM > 10315
+ "", // Dansk
+#endif
+#endif
+ },
{ NULL }
};
diff --git a/dxr3osd_subpicture.c b/dxr3osd_subpicture.c
index 0bb57a9..9f5fa2c 100644
--- a/dxr3osd_subpicture.c
+++ b/dxr3osd_subpicture.c
@@ -39,9 +39,9 @@ cDxr3SubpictureOsd::cDxr3SubpictureOsd(int Left, int Top) : cOsd(Left, Top)
Palette = new cPalette(4);
#if VDRVERSNUM >= 10318
last = new cTimeMs();
- last->Set(-FLUSHRATE);
+ last->Set(-cDxr3ConfigData::Instance().GetOsdFlushRate());
#else
- last = time_ms() - FLUSHRATE;
+ last = time_ms() - cDxr3ConfigData::Instance().GetOsdFlushRate();
#endif
Spu = &cSPUEncoder::Instance();
@@ -107,10 +107,12 @@ void cDxr3SubpictureOsd::RestoreRegion()
void cDxr3SubpictureOsd::Flush()
{
#if VDRVERSNUM >= 10318
- if (last->Elapsed()<FLUSHRATE) return;
+ if (last->Elapsed() < cDxr3ConfigData::Instance().GetOsdFlushRate())
+ return;
last->Set();
#else
- if (time_ms()-last<FLUSHRATE) return;
+ if (time_ms() - last < cDxr3ConfigData::Instance().GetOsdFlushRate())
+ return;
last = time_ms();
#endif