diff options
-rw-r--r-- | config.c | 24 | ||||
-rw-r--r-- | config.h | 5 | ||||
-rw-r--r-- | frontend_local.c | 9 | ||||
-rw-r--r-- | xineliboutput.c | 5 |
4 files changed, 35 insertions, 8 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.100 2011-01-17 12:54:22 phintuka Exp $ + * $Id: config.c,v 1.101 2011-02-28 13:37:10 phintuka Exp $ * */ @@ -654,6 +654,7 @@ config_t::config_t() { remote_local_ip[0] = 0; // bind locally to this IP - undefined -> any/all use_x_keyboard = 1; + window_id = WINDOW_ID_NONE; // video settings ibp_trickspeed = 1; @@ -714,6 +715,7 @@ bool config_t::ProcessArgs(int argc, char *argv[]) { "opengl", no_argument, NULL, 'O' }, { "width", required_argument, NULL, 'w' }, { "height", required_argument, NULL, 'h' }, + { "geometry", required_argument, NULL, 'g' }, //{ "xkeyboard", no_argument, NULL, 'k' }, //{ "noxkeyboard", no_argument, NULL, 'K' }, { "local", required_argument, NULL, 'l' }, @@ -722,6 +724,7 @@ bool config_t::ProcessArgs(int argc, char *argv[]) { "audio", required_argument, NULL, 'A' }, { "video", required_argument, NULL, 'V' }, { "display", required_argument, NULL, 'd' }, + { "window", required_argument, NULL, 'W' }, { "post", required_argument, NULL, 'P' }, { "config", required_argument, NULL, 'C' }, { "primary", no_argument, NULL, 'p' }, @@ -734,6 +737,8 @@ bool config_t::ProcessArgs(int argc, char *argv[]) switch (c) { case 'd': ProcessArg("Video.Port", optarg); break; + case 'W': ProcessArg("X11.WindowId", optarg); + break; case 'f': ProcessArg("Fullscreen", "1"); break; case 'D': ProcessArg("X11.HUDOSD", "1"); @@ -758,12 +763,21 @@ bool config_t::ProcessArgs(int argc, char *argv[]) LOGMSG("OpenGL HUD OSD not supported\n"); #endif break; - case 'w': ProcessArg("Fullscreen", "0"); + case 'w': //ProcessArg("Fullscreen", "0"); ProcessArg("X11.WindowWidth", optarg); break; - case 'h': ProcessArg("Fullscreen", "0"); + case 'h': //ProcessArg("Fullscreen", "0"); ProcessArg("X11.WindowHeight", optarg); break; + case 'g': { + int _width = width, _height = height, _xpos = 0, _ypos = 0; + sscanf (optarg, "%dx%d+%d+%d", &_width, &_height, &_xpos, &_ypos); + ProcessArg("X11.WindowWidth", *cString::sprintf("%d", _width)); + ProcessArg("X11.WindowHeight", *cString::sprintf("%d", _height)); + ProcessArg("X11.XPos", *cString::sprintf("%d", _xpos)); + ProcessArg("X11.YPos", *cString::sprintf("%d", _ypos)); + } + break; //case 'k': ProcessArg("X11.UseKeyboard", "1"); // break; //case 'K': ProcessArg("X11.UseKeyboard", "0"); @@ -834,8 +848,11 @@ bool config_t::SetupParse(const char *Name, const char *Value) else if (!strcasecmp(Name, "DisplayAspect")) display_aspect = strstra(Value, s_aspects, 0); else if (!strcasecmp(Name, "ForcePrimaryDevice")) force_primary_device = atoi(Value); + else if (!strcasecmp(Name, "X11.WindowId")) window_id = (!strcmp(Value, "root")) ? WINDOW_ID_ROOT : atoi(Value); else if (!strcasecmp(Name, "X11.WindowWidth")) width = atoi(Value); else if (!strcasecmp(Name, "X11.WindowHeight")) height = atoi(Value); + else if (!strcasecmp(Name, "X11.XPos")) xpos = atoi(Value); + else if (!strcasecmp(Name, "X11.YPos")) ypos = atoi(Value); else if (!strcasecmp(Name, "X11.UseKeyboard")) use_x_keyboard = atoi(Value); else if (!strcasecmp(Name, "X11.HUDOSD")) hud_osd |= (atoi(Value) ? HUD_COMPOSITE : 0); else if (!strcasecmp(Name, "X11.OpenglAlways")) opengl = atoi(Value); @@ -905,6 +922,7 @@ bool config_t::SetupParse(const char *Name, const char *Value) else if (!strcasecmp(Name, "Video.Driver")) STRN0CPY(video_driver, Value); else if (!strcasecmp(Name, "Video.Port")) STRN0CPY(video_port, Value); + else if (!strcasecmp(Name, "Video.Scale")) scale_video = atoi(Value); else if (!strcasecmp(Name, "Video.DeinterlaceOptions")) STRN0CPY(deinterlace_opts, Value); else if (!strcasecmp(Name, "Video.Deinterlace")) STRN0CPY(deinterlace_method, 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.75 2011-01-17 12:29:13 phintuka Exp $ + * $Id: config.h,v 1.76 2011-02-28 13:39:58 phintuka Exp $ * */ @@ -273,11 +273,14 @@ class config_t { int modeswitch; int width; int height; + int xpos; + int ypos; int display_aspect; int scale_video; int field_order; int exit_on_close; // Terminate VDR when local frontend is closed int use_x_keyboard; // Use X11 keyboard to control VDR (console kbd is handled by VDR) + int window_id; // use existing X11 window // Audio settings int speaker_type; diff --git a/frontend_local.c b/frontend_local.c index 54f53e80..49004a1e 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.53 2011-02-28 13:29:31 phintuka Exp $ + * $Id: frontend_local.c,v 1.54 2011-02-28 13:37:10 phintuka Exp $ * */ @@ -337,14 +337,17 @@ void cXinelibLocal::Action(void) Cancel(-1); } 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, + if(!curr_fe->fe_display_open(curr_fe, + xc.xpos, xc.ypos, xc.width, xc.height, xc.fullscreen, + xc.hud_osd, xc.opengl, xc.modeswitch, xc.modeline, xc.display_aspect, keypress_handler, 0/*no_x_kbd*/, 0/*gui_hotkeys*/, xc.video_port, xc.scale_video, xc.field_order, - NULL, -1)) { + NULL, + xc.window_id)) { LOGMSG("cXinelibLocal: Error initializing display"); Cancel(-1); } else { diff --git a/xineliboutput.c b/xineliboutput.c index 8c8200d5..b48d5089 100644 --- a/xineliboutput.c +++ b/xineliboutput.c @@ -21,7 +21,7 @@ * * xineliboutput.c: VDR Plugin interface * - * $Id: xineliboutput.c,v 1.44 2011-01-17 12:54:22 phintuka Exp $ + * $Id: xineliboutput.c,v 1.45 2011-02-28 13:37:10 phintuka Exp $ * */ @@ -140,8 +140,11 @@ const char cmdLineHelp[] = #endif " -w --width=x Window width\n" " -h --height=x Window width\n" +" -g, --geometry=WxH[+X+Y] Set output window geometry (X style)\n" " -d DISP --display=DISP Use X11 display DISP\n" " (or framebuffer device name)\n" +" -W ID --wid=ID Use existing X11 window\n" +" Special ID for root window: --wid=root\n" " -P NAME --post=NAME Use xine post plugin NAME\n" " format: pluginname[:arg=val[,arg=val]][,...]\n" " example: \n" |