Added -name, -title and -use-filename-title options and implementation in X11 vos

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29904 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
ptt 2009-11-12 09:21:53 +00:00
parent 153cac185c
commit ab4bdb64e1
6 changed files with 36 additions and 2 deletions

View File

@ -3204,6 +3204,10 @@ A value of 1 means square pixels
(correct for (almost?) all LCDs).
.
.TP
.B \-name (X11 only)
Set the window class name.
.
.TP
.B \-nodouble
Disables double buffering, mostly for debugging purposes.
Double buffering fixes flicker by storing two frames in memory, and
@ -3283,6 +3287,16 @@ If your screensaver supports neither the XSS nor XResetScreenSaver
API please use \-heartbeat\-cmd instead.
.
.TP
.B \-title (also see \-use\-filename\-title)
Set the window title.
Supported by X11 based video output drivers.
.
.TP
.B \-use\-filename\-title (also see \-title)
Set the window title using the media file name, when not set with \-title.
Supported by X11 based video output drivers.
.
.TP
.B "\-vm \ \ \ "
Try to change to a different video mode.
Supported by the dga, x11, xv, sdl and directx video output drivers.

View File

@ -170,6 +170,9 @@ const m_option_t mplayer_opts[]={
{"screenh", &vo_screenheight, CONF_TYPE_INT, CONF_RANGE|CONF_OLD, 0, 4096, NULL},
// Geometry string
{"geometry", &vo_geometry, CONF_TYPE_STRING, 0, 0, 0, NULL},
// vo name (X classname) and window title strings
{"name", &vo_winname, CONF_TYPE_STRING, 0, 0, 0, NULL},
{"title", &vo_wintitle, CONF_TYPE_STRING, 0, 0, 0, NULL},
// set aspect ratio of monitor - useful for 16:9 TV-out
{"monitoraspect", &force_monitor_aspect, CONF_TYPE_FLOAT, CONF_RANGE, 0.0, 9.0, NULL},
{"monitorpixelaspect", &monitor_pixel_aspect, CONF_TYPE_FLOAT, CONF_RANGE, 0.2, 9.0, NULL},
@ -246,6 +249,8 @@ const m_option_t mplayer_opts[]={
{"use-filedir-conf", &use_filedir_conf, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL},
{"nouse-filedir-conf", &use_filedir_conf, CONF_TYPE_FLAG, CONF_GLOBAL, 1, 0, NULL},
{"use-filename-title", &use_filename_title, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL},
{"nouse-filename-title", &use_filename_title, CONF_TYPE_FLAG, CONF_GLOBAL, 1, 0, NULL},
#ifdef CONFIG_CRASH_DEBUG
{"crash-debug", &crash_debug, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL},
{"nocrash-debug", &crash_debug, CONF_TYPE_FLAG, CONF_GLOBAL, 1, 0, NULL},

View File

@ -79,6 +79,11 @@ int vo_directrendering=0;
int vo_colorkey = 0x0000ff00; // default colorkey is green
// (0xff000000 means that colorkey has been disabled)
// name to be used instead of the vo's default
char *vo_winname;
// title to be applied to movie window
char *vo_wintitle;
//
// Externally visible list of all vo drivers
//

View File

@ -250,6 +250,9 @@ extern char *vo_subdevice;
extern int vo_colorkey;
extern char *vo_winname;
extern char *vo_wintitle;
extern int64_t WinID;
typedef struct {

View File

@ -738,7 +738,7 @@ void vo_x11_classhint(Display * display, Window window, char *name)
XClassHint wmClass;
pid_t pid = getpid();
wmClass.res_name = name;
wmClass.res_name = vo_winname ? vo_winname : name;
wmClass.res_class = "MPlayer";
XSetClassHint(display, window, &wmClass);
XChangeProperty(display, window, XA_NET_WM_PID, XA_CARDINAL, 32,
@ -1335,6 +1335,9 @@ int vo_x11_update_geometry(void) {
if (w <= INT_MAX && h <= INT_MAX) { vo_dwidth = w; vo_dheight = h; }
XTranslateCoordinates(mDisplay, vo_window, mRootWin, 0, 0, &vo_dx, &vo_dy,
&dummy_win);
if (vo_wintitle)
XStoreName(mDisplay, vo_window, vo_wintitle);
return depth <= INT_MAX ? depth : 0;
}

View File

@ -349,6 +349,7 @@ edl_record_ptr next_edl_record = NULL; ///< only for traversing edl_records
short edl_decision = 0; ///< 1 when an EDL operation has been made.
FILE* edl_fd = NULL; ///< fd to write to when in -edlout mode.
int use_filedir_conf;
int use_filename_title;
static unsigned int initialized_flags=0;
#include "mpcommon.h"
@ -3089,9 +3090,12 @@ while (player_idle_mode && !filename) {
}
//---------------------------------------------------------------------------
if(filename)
if(filename) {
mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_Playing,
filename_recode(filename));
if(use_filename_title && vo_wintitle == NULL)
vo_wintitle = strdup ( mp_basename2 (filename));
}
if (edl_filename) {
if (edl_records) free_edl(edl_records);