diff options
| author | phintuka <phintuka> | 2011-01-17 12:29:13 +0000 |
|---|---|---|
| committer | phintuka <phintuka> | 2011-01-17 12:29:13 +0000 |
| commit | fb9049ee1dff11c2ff42789db6a067ae9bf7577b (patch) | |
| tree | 7a27ff441b1432ccd9936790551458b78d2ea815 | |
| parent | acadaa22bbedbfe3edd6cfb50a48d887cd107853 (diff) | |
| download | xineliboutput-fb9049ee1dff11c2ff42789db6a067ae9bf7577b.tar.gz xineliboutput-fb9049ee1dff11c2ff42789db6a067ae9bf7577b.tar.bz2 | |
fe_display_open(): combined hud modes to single bitmask
| -rw-r--r-- | config.c | 12 | ||||
| -rw-r--r-- | config.h | 5 | ||||
| -rw-r--r-- | frontend_local.c | 4 | ||||
| -rw-r--r-- | xine_fbfe_frontend.c | 4 | ||||
| -rw-r--r-- | xine_frontend.h | 9 | ||||
| -rw-r--r-- | xine_frontend_main.c | 13 | ||||
| -rw-r--r-- | xine_sxfe_frontend.c | 14 |
7 files changed, 33 insertions, 28 deletions
@@ -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.98 2011-01-10 11:01:14 phintuka Exp $ + * $Id: config.c,v 1.99 2011-01-17 12:29:13 phintuka Exp $ * */ @@ -22,6 +22,7 @@ #include "logdefs.h" #include "config.h" +#include "xine_frontend.h" // HUD_* #define STRN0CPY(dst, src) \ do { \ @@ -583,8 +584,7 @@ config_t::config_t() { osd_scaling = OSD_SCALING_NEAREST; osd_spu_scaling = OSD_SCALING_NEAREST; hud_osd = 0; - opengl_always = 0; - opengl_hud = 0; + opengl = 0; osd_blending = OSD_BLENDING_SOFTWARE; osd_blending_lowresvideo = OSD_BLENDING_HARDWARE; @@ -831,9 +831,9 @@ 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, "X11.OpenglAlways")) opengl_always = atoi(Value); - else if (!strcasecmp(Name, "X11.OpenglHUDOSD")) opengl_hud = atoi(Value); + else if (!strcasecmp(Name, "X11.HUDOSD")) hud_osd |= (atoi(Value) ? HUD_COMPOSITE : 0); + else if (!strcasecmp(Name, "X11.OpenglAlways")) opengl = atoi(Value); + else if (!strcasecmp(Name, "X11.OpenglHUDOSD")) hud_osd |= (atoi(Value) ? HUD_OPENGL : 0); else if (!strcasecmp(Name, "Audio.Driver")) STRN0CPY(audio_driver, Value); else if (!strcasecmp(Name, "Audio.Port")) STRN0CPY(audio_port, Value); @@ -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.74 2011-01-10 11:01:14 phintuka Exp $ + * $Id: config.h,v 1.75 2011-01-17 12:29:13 phintuka Exp $ * */ @@ -313,8 +313,7 @@ class config_t { int osd_scaling; // OSD scaling mode: off, nearest, bilinear int osd_spu_scaling; // SPU OSD scaling mode: off, nearest, bilinear int hud_osd; // head up display OSD - int opengl_always; // use opengl acceleration for video and HUD OSD - int opengl_hud; // use opengl acceleration for HUD OSD only + int opengl; // use opengl acceleration for video and HUD OSD int osd_blending; // OSD blending method int osd_blending_lowresvideo; // Use hardware blending for low-resolution video int alpha_correction; diff --git a/frontend_local.c b/frontend_local.c index 5cf672ad..8f1b32ef 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.51 2010-11-22 23:36:53 phintuka Exp $ + * $Id: frontend_local.c,v 1.52 2011-01-17 12:29:13 phintuka Exp $ * */ @@ -338,7 +338,7 @@ void cXinelibLocal::Action(void) } else { LOGDBG("cXinelibLocal::Action - fe created"); if(!curr_fe->fe_display_open(curr_fe, 0, 0, xc.width, xc.height, xc.fullscreen, xc.hud_osd, - xc.opengl_always, xc.opengl_hud, + xc.opengl, xc.modeswitch, xc.modeline, xc.display_aspect, keypress_handler, 0/*no_x_kbd*/, 0/*gui_hotkeys*/, xc.video_port, diff --git a/xine_fbfe_frontend.c b/xine_fbfe_frontend.c index 719928cf..f50ccfd8 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.47 2010-05-26 11:54:26 phintuka Exp $ + * $Id: xine_fbfe_frontend.c,v 1.48 2011-01-17 12:29:13 phintuka Exp $ * */ @@ -118,7 +118,7 @@ static void update_DFBARGS(const char *fb_dev) */ static int fbfe_display_open(frontend_t *this_gen, int xpos, int ypos, - int width, int height, int fullscreen, int hud, int opengl_always, int opengl_hud, + int width, int height, int fullscreen, int hud, int opengl, int modeswitch, const char *modeline, int aspect, fe_keypress_f keyfunc, int no_x_kbd, int gui_hotkeys, const char *video_port, int scale_video, int field_order, diff --git a/xine_frontend.h b/xine_frontend.h index 6b051026..93e67c63 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.22 2010-05-26 11:54:26 phintuka Exp $ + * $Id: xine_frontend.h,v 1.23 2011-01-17 12:29:13 phintuka Exp $ * */ @@ -59,12 +59,17 @@ struct frontend_config_s { #define FE_OK 1 #define FE_ERROR 0 +/* HUD OSD */ +#define HUD_COMPOSITE 1 +#define HUD_XSHAPE 2 +#define HUD_OPENGL 3 + struct frontend_s { /* Display */ int (*fe_display_open)(frontend_t*, int xpos, int ypos, int winwidth, int winheight, - int fullscreen, int hud, int opengl_always, int opengl_hud, + int fullscreen, int hud, int opengl, int modeswitch, const char *modeline, int aspect, fe_keypress_f keypresshandler, int no_x_kbd, int gui_hotkeys, diff --git a/xine_frontend_main.c b/xine_frontend_main.c index 1401cac2..761ea8c1 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.91 2011-01-08 15:11:05 phintuka Exp $ + * $Id: xine_frontend_main.c,v 1.92 2011-01-17 12:29:13 phintuka Exp $ * */ @@ -483,7 +483,7 @@ static const struct option long_options[] = { int main(int argc, char *argv[]) { int ftcp = 0, fudp = 0, frtp = 0, reconnect = 0, firsttry = 1; - int fullscreen = 0, hud = 0, opengl_always = 0, opengl_hud = 0, xpos = 0, ypos = 0, width = 720, height = 576; + int fullscreen = 0, hud = 0, opengl = 0, xpos = 0, ypos = 0, width = 720, height = 576; int pes_buffers = 250; int scale_video = 1, aspect = 1; int daemon_mode = 0, nokbd = 0, noxkbd = 0, slave_mode = 0; @@ -576,21 +576,22 @@ int main(int argc, char *argv[]) case 'f': fullscreen=1; PRINTF("Fullscreen mode\n"); break; - case 'D': hud=1; + case 'D': hud |= HUD_COMPOSITE; #ifdef HAVE_XRENDER PRINTF("HUD OSD mode\n"); #else PRINTF("HUD OSD not supported\n"); #endif break; - case 'O': opengl_always=1; + case 'O': opengl = 1; + hud |= HUD_OPENGL; #ifdef HAVE_OPENGL PRINTF("Using OpenGL to draw video and HUD OSD\n"); #else PRINTF("OpenGL not supported\n"); #endif break; - case 'Q': opengl_hud=1; + case 'Q': hud |= HUD_OPENGL; #ifdef HAVE_OPENGL PRINTF("Using OpenGL to draw HUD OSD\n"); #else @@ -780,7 +781,7 @@ int main(int argc, char *argv[]) } /* Initialize display */ - if (!fe->fe_display_open(fe, xpos, ypos, width, height, fullscreen, hud, opengl_always, opengl_hud, 0, + if (!fe->fe_display_open(fe, xpos, ypos, width, height, fullscreen, hud, opengl, 0, "", aspect, NULL, noxkbd, gui_hotkeys, video_port, scale_video, 0, aspect_controller, window_id)) { diff --git a/xine_sxfe_frontend.c b/xine_sxfe_frontend.c index 96b50fc4..ab4a41c7 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.143 2011-01-08 15:11:05 phintuka Exp $ + * $Id: xine_sxfe_frontend.c,v 1.144 2011-01-17 12:29:13 phintuka Exp $ * */ @@ -1226,7 +1226,7 @@ static void create_windows(sxfe_t *this) */ static int sxfe_display_open(frontend_t *this_gen, int xpos, int ypos, - int width, int height, int fullscreen, int hud, int opengl_always, int opengl_hud, + int width, int height, int fullscreen, int hud, int opengl, int modeswitch, const char *modeline, int aspect, fe_keypress_f keyfunc, int no_x_kbd, int gui_hotkeys, const char *video_port, int scale_video, int field_order, @@ -1249,21 +1249,21 @@ static int sxfe_display_open(frontend_t *this_gen, #ifdef HAVE_XRENDER LOGDBG("sxfe_display_open: Enabling HUD OSD"); this->hud = hud; - this->opengl_always = opengl_always; - this->opengl_hud = opengl_hud; + this->opengl_always = opengl; + this->opengl_hud = !!(hud & HUD_OPENGL); this->osd_width = OSD_DEF_WIDTH; this->osd_height = OSD_DEF_HEIGHT; - if (opengl_always) { + if (this->opengl_always) { LOGDBG("sxfe_display_open: Using opengl to draw video and HUD OSD"); } - if (opengl_hud) { + if (this->opengl_hud) { LOGDBG("sxfe_display_open: Using opengl to draw HUD OSD only"); } #else LOGMSG("sxfe_display_open: Application was compiled without XRender support. HUD OSD disabled."); #endif } else { - if (opengl_always || opengl_hud) { + if (this->opengl_always || this->opengl_hud) { LOGERR("sxfe_display_open: the --opengl options must be used with --hud !"); } } |
