summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorphintuka <phintuka>2008-03-28 22:17:17 +0000
committerphintuka <phintuka>2008-03-28 22:17:17 +0000
commitbfc68f7b653aa3da6076a129efc3a59b3009747b (patch)
tree351554f0ea02c43ff3bb667b5cfb15bc0b65bbf4
parentb1b63256f26101ba1193ca38a037864f1dc69339 (diff)
downloadxineliboutput-bfc68f7b653aa3da6076a129efc3a59b3009747b.tar.gz
xineliboutput-bfc68f7b653aa3da6076a129efc3a59b3009747b.tar.bz2
HUD OSD configuration
(Patch from Antti Seppälä and Rolf Ahrenberg)
-rw-r--r--config.c18
-rw-r--r--config.h11
-rw-r--r--frontend_local.c4
-rw-r--r--osd.c4
-rw-r--r--setup_menu.c6
-rw-r--r--xine_fbfe_frontend.c4
-rw-r--r--xine_frontend.h4
-rw-r--r--xine_frontend_main.c13
-rw-r--r--xine_osd_command.h3
-rw-r--r--xine_sxfe_frontend.c4
-rw-r--r--xineliboutput.c3
11 files changed, 55 insertions, 19 deletions
diff --git a/config.c b/config.c
index fb211fe4..ba937852 100644
--- a/config.c
+++ b/config.c
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: config.c,v 1.56 2008-03-13 22:14:06 phintuka Exp $
+ * $Id: config.c,v 1.57 2008-03-28 22:17:17 phintuka Exp $
*
*/
@@ -221,6 +221,13 @@ const char * const config_t::s_osdMixers[] = {
NULL
};
+const char * const config_t::s_osdScalings[] = {
+ trNOOP("no"),
+ trNOOP("nearest"), // item [1]
+ trNOOP("bilinear"), // item [2]
+ NULL
+};
+
static char *strcatrealloc(char *dest, const char *src)
{
if (!src || !*src)
@@ -443,6 +450,8 @@ config_t::config_t() {
hide_main_menu = 0;
osd_mixer = OSD_MIXER_FULL;
+ osd_scaling = OSD_SCALING_NEAREST;
+ hud_osd = 0;
prescale_osd = 1;
prescale_osd_downscale = 0;
@@ -551,10 +560,11 @@ bool config_t::ProcessArg(const char *Name, const char *Value)
bool config_t::ProcessArgs(int argc, char *argv[])
{
- static const char short_options[] = "fw:h:l:r:A:V:d:P:pc";
+ static const char short_options[] = "fDw:h:l:r:A:V:d:P:pc";
static const struct option long_options[] = {
{ "fullscreen", no_argument, NULL, 'f' },
+ { "hud", no_argument, NULL, 'D' },
{ "width", required_argument, NULL, 'w' },
{ "height", required_argument, NULL, 'h' },
//{ "xkeyboard", no_argument, NULL, 'k' },
@@ -581,6 +591,8 @@ bool config_t::ProcessArgs(int argc, char *argv[])
break;
case 'f': ProcessArg("Fullscreen", "1");
break;
+ case 'D': ProcessArg("X11.HUDOSD", "1");
+ break;
case 'w': ProcessArg("Fullscreen", "0");
ProcessArg("X11.WindowWidth", optarg);
break;
@@ -664,6 +676,7 @@ bool config_t::SetupParse(const char *Name, const char *Value)
else if (!strcasecmp(Name, "X11.WindowWidth")) width = atoi(Value);
else if (!strcasecmp(Name, "X11.WindowHeight")) height = atoi(Value);
else if (!strcasecmp(Name, "X11.UseKeyboard")) use_x_keyboard = atoi(Value);
+ else if (!strcasecmp(Name, "X11.HUDOSD")) hud_osd = atoi(Value);
else if (!strcasecmp(Name, "Audio.Driver")) STRN0CPY(audio_driver, Value);
else if (!strcasecmp(Name, "Audio.Port")) STRN0CPY(audio_port, Value);
@@ -680,6 +693,7 @@ bool config_t::SetupParse(const char *Name, const char *Value)
else if (!strcasecmp(Name, "OSD.HideMainMenu")) hide_main_menu = atoi(Value);
else if (!strcasecmp(Name, "OSD.LayersVisible")) osd_mixer = atoi(Value);
+ else if (!strcasecmp(Name, "OSD.Scaling")) osd_scaling = atoi(Value);
else if (!strcasecmp(Name, "OSD.Prescale")) prescale_osd = atoi(Value);
else if (!strcasecmp(Name, "OSD.Downscale")) prescale_osd_downscale = atoi(Value);
else if (!strcasecmp(Name, "OSD.UnscaledAlways")) unscaled_osd = atoi(Value);
diff --git a/config.h b/config.h
index 55085d00..bd8a382c 100644
--- a/config.h
+++ b/config.h
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: config.h,v 1.40 2008-03-13 22:14:06 phintuka Exp $
+ * $Id: config.h,v 1.41 2008-03-28 22:17:17 phintuka Exp $
*
*/
@@ -140,6 +140,12 @@
#define OSD_MIXER_FULL 4
#define OSD_MIXER_count 5
+// OSD scaling modes
+#define OSD_SCALING_NONE 0
+#define OSD_SCALING_NEAREST 1
+#define OSD_SCALING_BILINEAR 2
+#define OSD_SCALING_count 3
+
#define SUBTITLESIZE_count 7
#define HIDDEN_OPTION(opt) \
@@ -182,6 +188,7 @@ class config_t {
static const char * const s_subtitleSizes[];
static const char * const s_subExts[];
static const char * const s_osdMixers[];
+ static const char * const s_osdScalings[];
static const char * const s_vo_aspects[];
public:
@@ -233,6 +240,8 @@ class config_t {
eMainMenuMode main_menu_mode; // used internally to open right sub-menu
int hide_main_menu;
int osd_mixer; // show multiple OSD layers
+ int osd_scaling; // OSD scaling mode: off, nearest, bilinear
+ int hud_osd; // head up display OSD
int prescale_osd;
int prescale_osd_downscale;
int unscaled_osd;
diff --git a/frontend_local.c b/frontend_local.c
index 1c7b8c7c..f13ef069 100644
--- a/frontend_local.c
+++ b/frontend_local.c
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: frontend_local.c,v 1.29 2008-02-19 02:59:46 phintuka Exp $
+ * $Id: frontend_local.c,v 1.30 2008-03-28 22:17:17 phintuka Exp $
*
*/
@@ -339,7 +339,7 @@ void cXinelibLocal::Action(void)
SetStopSignal();
} else {
LOGDBG("cXinelibLocal::Action - fe created");
- if(!curr_fe->fe_display_open(curr_fe, xc.width, xc.height, xc.fullscreen,
+ if(!curr_fe->fe_display_open(curr_fe, xc.width, xc.height, xc.fullscreen, xc.hud_osd,
xc.modeswitch, xc.modeline,
xc.display_aspect, keypress_handler,
xc.video_port,
diff --git a/osd.c b/osd.c
index 9f265a02..f11b752c 100644
--- a/osd.c
+++ b/osd.c
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: osd.c,v 1.16 2008-03-11 15:57:57 phintuka Exp $
+ * $Id: osd.c,v 1.17 2008-03-28 22:17:17 phintuka Exp $
*
*/
@@ -228,6 +228,8 @@ void cXinelibOsd::CmdRle(int Wnd, int X0, int Y0,
osdcmd.num_rle = rle_compress(&osdcmd.data, Data, W, H);
osdcmd.datalen = 4 * osdcmd.num_rle;
+
+ osdcmd.scaling = xc.osd_scaling;
m_Device->OsdCmd((void*)&osdcmd);
diff --git a/setup_menu.c b/setup_menu.c
index 3bb69e4b..2c5787bc 100644
--- a/setup_menu.c
+++ b/setup_menu.c
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: setup_menu.c,v 1.48 2008-03-13 22:19:33 phintuka Exp $
+ * $Id: setup_menu.c,v 1.49 2008-03-28 22:17:17 phintuka Exp $
*
*/
@@ -897,6 +897,9 @@ void cMenuSetupOSD::Set(void)
Add(NewTitle(tr("On-Screen Display")));
Add(new cMenuEditBoolItem(tr("Hide main menu"),
&newconfig.hide_main_menu));
+ Add(new cMenuEditStraI18nItem(tr("OSD scaling method"), &newconfig.osd_scaling,
+ OSD_SCALING_count, xc.s_osdScalings));
+
#if VDRVERSNUM >= 10509
Add(new cMenuEditStraI18nItem(tr("Show all layers"), &newconfig.osd_mixer,
OSD_MIXER_count, xc.s_osdMixers));
@@ -1002,6 +1005,7 @@ void cMenuSetupOSD::Store(void)
orig_alpha_correction = xc.alpha_correction;
orig_alpha_correction_abs = xc.alpha_correction_abs;
+ SetupStore("OSD.Scaling", xc.osd_scaling);
SetupStore("OSD.HideMainMenu", xc.hide_main_menu);
SetupStore("OSD.LayersVisible", xc.osd_mixer);
SetupStore("OSD.Prescale", xc.prescale_osd);
diff --git a/xine_fbfe_frontend.c b/xine_fbfe_frontend.c
index f76e3c9f..13d3f542 100644
--- a/xine_fbfe_frontend.c
+++ b/xine_fbfe_frontend.c
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: xine_fbfe_frontend.c,v 1.18 2008-01-03 10:59:12 phintuka Exp $
+ * $Id: xine_fbfe_frontend.c,v 1.19 2008-03-28 22:17:17 phintuka Exp $
*
*/
@@ -135,7 +135,7 @@ static void fbfe_update_display_size(frontend_t *this_gen)
/*
* fbfe_display_open
*/
-static int fbfe_display_open(frontend_t *this_gen, int width, int height, int fullscreen,
+static int fbfe_display_open(frontend_t *this_gen, int width, int height, int fullscreen, int hud,
int modeswitch, const char *modeline, int aspect,
fe_keypress_f keyfunc, const char *video_port,
int scale_video, int field_order)
diff --git a/xine_frontend.h b/xine_frontend.h
index 45a075f2..09660b89 100644
--- a/xine_frontend.h
+++ b/xine_frontend.h
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: xine_frontend.h,v 1.6 2007-05-18 15:09:42 phintuka Exp $
+ * $Id: xine_frontend.h,v 1.7 2008-03-28 22:17:17 phintuka Exp $
*
*/
@@ -51,7 +51,7 @@ struct frontend_config_s {
struct frontend_s {
/* Display */
int (*fe_display_open)(frontend_t*, int winwidth, int winheight,
- int fullscreen, int modeswitch, const char *modeline,
+ int fullscreen, int hud, int modeswitch, const char *modeline,
int aspect, fe_keypress_f keypresshandler,
const char *video_port,
int scale_video, int field_order);
diff --git a/xine_frontend_main.c b/xine_frontend_main.c
index 53197828..d3ea03d8 100644
--- a/xine_frontend_main.c
+++ b/xine_frontend_main.c
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: xine_frontend_main.c,v 1.37 2008-02-19 02:11:31 phintuka Exp $
+ * $Id: xine_frontend_main.c,v 1.38 2008-03-28 22:17:17 phintuka Exp $
*
*/
@@ -322,6 +322,7 @@ static const char help_str[] =
" Use script to control HW aspect ratio:\n"
" --aspect=auto:path_to_script\n"
" --fullscreen Fullscreen mode\n"
+ " --hud Head Up Display OSD mode\n"
" --width=x Video window width\n"
" --height=x Video window height\n"
" --noscaling Disable all video scaling\n"
@@ -346,7 +347,7 @@ static const char help_str[] =
" are tried in following order:\n"
" local pipe, rtp, udp, tcp\n\n";
-static const char short_options[] = "HL:A:V:d:a:fw:h:P:vslkbtur";
+static const char short_options[] = "HL:A:V:d:a:fDw:h:P:vslkbtur";
static const struct option long_options[] = {
{ "help", no_argument, NULL, 'H' },
@@ -356,6 +357,7 @@ static const struct option long_options[] = {
{ "wid", required_argument, NULL, 'W' },
{ "aspect", required_argument, NULL, 'a' },
{ "fullscreen", no_argument, NULL, 'f' },
+ { "hud", no_argument, NULL, 'D' },
{ "width", required_argument, NULL, 'w' },
{ "height", required_argument, NULL, 'h' },
{ "noscaling", no_argument, NULL, 'n' },
@@ -382,7 +384,7 @@ int main(int argc, char *argv[])
{
char *mrl = NULL, *gdrv = NULL, *adrv = NULL, *adev = NULL;
int ftcp = 0, fudp = 0, frtp = 0, reconnect = 0, firsttry = 1;
- int fullscreen = 0, width = 720, height = 576;
+ int fullscreen = 0, hud = 0, width = 720, height = 576;
int scale_video = 1, aspect = 1;
int daemon_mode = 0, nokbd = 0, slave_mode = 0;
char *video_port = NULL;
@@ -461,6 +463,9 @@ int main(int argc, char *argv[])
case 'f': fullscreen=1;
PRINTF("Fullscreen mode\n");
break;
+ case 'D': hud=1;
+ PRINTF("HUD OSD mode\n");
+ break;
case 'w': width = atoi(optarg);
PRINTF("Width: %d\n", width);
break;
@@ -614,7 +619,7 @@ int main(int argc, char *argv[])
((fe_t*)fe)->aspect_controller = aspect_controller;
/* Initialize display */
- if(!fe->fe_display_open(fe, width, height, fullscreen, 0,
+ if(!fe->fe_display_open(fe, width, height, fullscreen, hud, 0,
"", aspect, NULL, video_port, scale_video, 0)) {
fprintf(stderr, "Error opening display\n");
fe->fe_free(fe);
diff --git a/xine_osd_command.h b/xine_osd_command.h
index bb9956fc..6f6bfd17 100644
--- a/xine_osd_command.h
+++ b/xine_osd_command.h
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: xine_osd_command.h,v 1.9 2008-03-16 23:41:37 phintuka Exp $
+ * $Id: xine_osd_command.h,v 1.10 2008-03-28 22:17:17 phintuka Exp $
*
*/
@@ -91,6 +91,7 @@ typedef struct osd_command_s {
osd_rect_t dirty_area;
uint8_t flags;
+ uint8_t scaling;
} PACKED osd_command_t;
diff --git a/xine_sxfe_frontend.c b/xine_sxfe_frontend.c
index a614b06e..e1567817 100644
--- a/xine_sxfe_frontend.c
+++ b/xine_sxfe_frontend.c
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: xine_sxfe_frontend.c,v 1.31 2008-01-03 10:59:12 phintuka Exp $
+ * $Id: xine_sxfe_frontend.c,v 1.32 2008-03-28 22:17:17 phintuka Exp $
*
*/
@@ -376,7 +376,7 @@ static void set_above(sxfe_t *this, int stay_above)
* connect to X server, create windows
*/
-static int sxfe_display_open(frontend_t *this_gen, int width, int height, int fullscreen,
+static int sxfe_display_open(frontend_t *this_gen, int width, int height, int fullscreen, int hud,
int modeswitch, const char *modeline, int aspect,
fe_keypress_f keyfunc, const char *video_port,
int scale_video, int field_order)
diff --git a/xineliboutput.c b/xineliboutput.c
index 3e5d42dc..dc4e3cbc 100644
--- a/xineliboutput.c
+++ b/xineliboutput.c
@@ -21,7 +21,7 @@
*
* xineliboutput.c: VDR Plugin interface
*
- * $Id: xineliboutput.c,v 1.26 2008-03-24 20:29:37 phintuka Exp $
+ * $Id: xineliboutput.c,v 1.27 2008-03-28 22:17:17 phintuka Exp $
*
*/
@@ -122,6 +122,7 @@ const char cmdLineHelp[] =
" -R --noremote No remote clients\n"
#endif
" -f --fullscreen Fullscreen mode (X11)\n"
+" -D --hud Head Up Display OSD (X11)\n"
" -w --width=x Window width\n"
" -h --height=x Window width\n"
" -d DISP --display=DISP Use X11 display DISP\n"