summaryrefslogtreecommitdiffstats
path: root/libvo/x11_common.c
Commit message (Collapse)AuthorAgeFilesLines
* input: move all key code lists to input/keycodes.hUoti Urpala2011-05-021-2/+1
| | | | | | | | | | | | | Move the definitions of all special key codes (those not passed by ASCII value) to input/keycodes.h. Before they were spread between osdep/keycodes.h, input/joystick.h, input/mouse.h and input/ar.h, plus some special values in input.h. This was especially inconvenient as the codes had to be coordinated to not conflict between the files. The change requires a bit of ugliness as appleir.c includes <linux/input.h> which contains various conflicting KEY_* definitions. Work around this by adding a special preprocessor variable which can be used to avoid defining these in keycodes.h.
* cleanup: avoid various GCC warningsClément Bœsch2011-04-201-6/+5
|
* VO: don't wait for map event in X VO initializationUoti Urpala2011-04-081-4/+0
| | | | | | | | | | | After creating a video window the common X code waited for a MapNotify event before proceeding. This meant that if the window was opened on another workspace the player would be stuck until the user switched to that workspace and the window could become actually visible. Remove this waiting code. I don't know why it was there or if it was actually beneficial/needed for some setup (at least common uses seem to work fine without it); it comes from the earliest MPlayer versions visible in VCS history.
* x11_common: fix for reconfig with pos/xineramascreen setUoti Urpala2011-02-031-7/+7
| | | | | | | | | | | | | vo_x11_create_vo_window() only called vo_x11_update_geometry() if no window position had been specified by -geometry or -xineramascreen, to avoid overwriting the specified position with values from the existing window. However window size should be initialized to the existing window here, and setting new window title for -use-filename-title is also done in vo_x11_update_geometry() (for whatever reason, it doesn't match what else that function does). Change the code in vo_x11_create_vo_window() to always call vo_x11_update_geometry() for size variable and window title updates, but add a flag that tells it not to update position variables.
* input: support bindings with modifier keys for X inputUoti Urpala2010-12-201-6/+15
| | | | | | | | | | | | | | | | | | | | | Add support for binding commands to modifier+key combinations like "Shift+Left" or "Ctrl+Alt+x", and support reading such combinations from the output window of X VOs. The recognized modifier names are Shift, Ctrl, Alt and Meta. Any combination of those and then a non-modifier key name, separated by '+', is accepted as a key name in input.conf. For non-special keys that produce characters shift is ignored as a modifier. For example "A" is handled as a key without modifiers even if you use shift to write the capital letter; 'a' vs 'A' already distinguishes the combinations with a normal keymap, and having separate 'a', 'Shift+A' and 'A' (written with caps lock for example) would bring more confusion than benefit. Currently reading the modifier+key combinations is only supported in the output window of those VOs that use x11_common.c event handling. It's not possible to input the key combinations in other VOs or in a terminal window.
* libvo: register X11 connection fd in input event systemUoti Urpala2010-12-141-0/+1
| | | | | | | | | | | | | | Register the X11 connection fd in the input system so that mp_input_get_cmd() can immediately wake up and handle keyboard or other X events. The callback calls vo_check_events() and tells the input system to handle any input possibly recorded during that. Before this was done for vo_xv only; this commit generalizes it to all VOs that call vo_x11_create_vo_window() - those are hopefully ones that will handle all X events in check_events(). The callback is only kept registered while the vo is properly configured. At other times calling check_events() would not clear pending input and so could lead to a busy loop.
* options: move -name and -title to option structClément Bœsch2010-11-041-3/+5
|
* x11_common: add VO_EVENT_MOVEreimar2010-11-021-2/+6
| | | | | | | | | Add VO_EVENT_MOVE which is required for VOs that interact directly with hardware like MGA and VIDIX. Patch by Dirk Porezag [porezag yahoo com] git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32454 b3059339-0415-0410-9bf9-f77b7e298cf2
* spelling fixessiretart2010-11-021-1/+1
| | | | | | | | | | Found by the Debian QA tool 'lintian' git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31913 b3059339-0415-0410-9bf9-f77b7e298cf2 reintroduce typo in genres.h that was fixed fixed r31913 to match the id3v2 spec git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31920 b3059339-0415-0410-9bf9-f77b7e298cf2
* x11_common: Get window dimensions also for -wid 0reimar2010-11-021-1/+2
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31623 b3059339-0415-0410-9bf9-f77b7e298cf2
* x11_common.c: minor cleanupreimar2010-11-021-3/+1
| | | | | | | | | | Remove some commented-out code that has no purpose and is only confusing. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31620 b3059339-0415-0410-9bf9-f77b7e298cf2 Remove useless () git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31621 b3059339-0415-0410-9bf9-f77b7e298cf2
* x11_common.c: Some indentation fixesreimar2010-11-021-10/+10
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31602 b3059339-0415-0410-9bf9-f77b7e298cf2
* x11_common: Do not try to grab input from -wid windowsreimar2010-11-021-8/+21
| | | | | | | | | | | | | | | | | It will most likely break their input processing. If someone needs the previous behaviour, an option could be added (and also used in the w32_common.c code). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31601 b3059339-0415-0410-9bf9-f77b7e298cf2 Fix resizing with -wid after previous commit. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31604 b3059339-0415-0410-9bf9-f77b7e298cf2 Always request expose events, we have to handle them, the application that created the -wid window can't. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31605 b3059339-0415-0410-9bf9-f77b7e298cf2
* x11_common: Consistently use "None" instead of "NULL" for X resourcesreimar2010-11-021-7/+7
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31422 b3059339-0415-0410-9bf9-f77b7e298cf2
* vo: improve fixed-vo behavior when video size changes in x11 VOsUoti Urpala2010-07-231-0/+14
| | | | | | | | | Now the window is only resized when video size (or size specified by -geometry) changes; reconfiguring the window with the same size no longer changes back to default size from possibly user-modified one. Also fix a bug in fullscreen handling that could cause incorrect window size when turning fullscreen off.
* Merge svn changes up to r31291Uoti Urpala2010-06-021-1/+5
|\
| * Change code to let Window Manager chose window location by default.reimar2010-05-301-1/+5
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31289 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r31189Uoti Urpala2010-05-301-0/+4
|\|
| * Quit MPlayer if we receive a DestroyNotify event.reimar2010-05-141-0/+4
| | | | | | | | | | | | | | | | This in particular avoids MPlayer continuing to play when a frontend using -wid crashed. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31179 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r31104Uoti Urpala2010-05-071-2/+2
|\|
| * Move variable declaration into the block where it is actually used.reimar2010-04-271-2/+2
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31103 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r31100Uoti Urpala2010-05-071-1/+1
|\|
| * Move "screen" variable declaration below the relevant #ifdef, fixes the warning:diego2010-04-271-1/+1
| | | | | | | | | | | | | | libvo/x11_common.c:369: warning: unused variable 'screen' git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31100 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r31097Uoti Urpala2010-04-261-10/+3
|\|
| * Avoid duplicating mouse-movement command-generation code.reimar2010-04-251-6/+1
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31091 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Deduplicate enable_mouse_movements declaration.reimar2010-04-251-1/+0
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31089 b3059339-0415-0410-9bf9-f77b7e298cf2
| * rename 'struct keymap' -> 'struct mp_keymap'siretart2010-04-231-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | This avoids the compilation failure on kFreeBSD (at least amd64): In file included from libvo/vo_directfb2.c:44: libvo/video_out.h:267: error: redefinition of 'struct keymap' This is because libvo/vo_directfb2.c #includes sys/kd.h, which in turn includes sys/kbio.h, which defines another 'struct keymap'. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31059 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Delete things related to old translation systemUoti Urpala2010-03-101-1/+0
| | | | | | | | | | Remove the help/ subdirectory, configure code to create toplevel help_mp.h, and all the '#include "help_mp.h"' lines from .c files.
* | Merge svn changes up to r30798Uoti Urpala2010-03-101-0/+1
|\|
| * Enable StructureNotifyMask before waiting for a DestroyNotify event.reimar2010-02-271-0/+1
| | | | | | | | | | | | | | | | Fixes hangs if OpenGL initialization fails in vo gl preinit and we call uninit while the window is still hidden. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30760 b3059339-0415-0410-9bf9-f77b7e298cf2
| * libvo: Mark functions not used outside of their files as static.diego2010-02-161-1/+1
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30598 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Fix exit_player() usage throughout the codebase.diego2010-02-141-1/+0
| | | | | | | | | | | | | | | | | | | | exit_player() was declared with differing parameter types in mplayer.c and mplayer.h. Make the declaration in the .h file match the one in the .c file and adjust all usages of exit_player() throughout the codebase. Also move the exit_player() declaration into mp_core.h next to exit_player_with_rc(). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30558 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r30514Uoti Urpala2010-03-091-2/+8
|\|
| * Fix hang with -fixed-vo due to VOFLAG_HIDDEN never being removed from ↵reimar2010-02-051-0/+1
| | | | | | | | | | | | window_state. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30514 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Create the OpenGL probe window as a hidden Window on X11.reimar2010-02-041-2/+8
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30507 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r30502Uoti Urpala2010-03-091-1/+1
|\| | | | | | | | | | | | | | | Conflicts: libswscale/rgb2rgb.c libswscale/rgb2rgb.h libswscale/swscale.c libvo/x11_common.c
| * Use vo_x11_clearwindow instead of XClearWindow, both for consistency and alsoreimar2010-02-031-1/+1
| | | | | | | | | | | | | | | | because vo_x11_clearwindow works as intended also when the background is set to None. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30497 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r30494Uoti Urpala2010-03-091-1/+0
|\| | | | | | | | | | | Conflicts: libvo/vo_gl.c libvo/x11_common.c
| * Remove a duplicated vo_x11_sizehint, vo_x11_nofs_sizepos already calls thisreimar2010-02-021-1/+0
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30493 b3059339-0415-0410-9bf9-f77b7e298cf2
* | x11_common: always free x11 context struct on exitUoti Urpala2010-01-281-7/+6
| | | | | | | | | | Previously it was not freed if no X11 display had been opened (for example -vo null).
* | Merge svn changes up to r30136Uoti Urpala2009-12-301-1/+1
|\| | | | | | | Ignore another broken correct-pts change in 30134.
| * vo_x11_classhint name argument should be const, since we pass string ↵reimar2009-12-271-1/+1
| | | | | | | | | | | | constants there. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30125 b3059339-0415-0410-9bf9-f77b7e298cf2
* | cosmetics: remove some unused variablesUoti Urpala2009-11-171-3/+0
| |
* | vo_xv: Support yuv colorspace changes on ATI cardsUoti Urpala2009-11-171-2/+4
| | | | | | | | | | Use the "XV_COLORSPACE" xv attribute if it exists, in addition to previously supported "XV_ITURBT_709" (which works on NVIDIA cards).
* | Merge svn changes up to r29912Uoti Urpala2009-11-161-12/+9
|\|
| * Added -name, -title and -use-filename-title options and implementation in ↵ptt2009-11-121-1/+4
| | | | | | | | | | | | X11 vos git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29904 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Remove unneeded initializationreynaldo2009-11-031-1/+0
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29818 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Slightly change behavior of "none" if fstype specification.corey2009-10-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | In a list of enabled fstypes, "none" now clears the list rather than disabling all fstypes and interrupting the parser. To enable only one (or more) fstypes, list the types to enable after "none". For example: "-fstype none" is the same as before: all disabled "-fstype none,fullscreen" enables only the fullscreen type git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29805 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Move some variable initializations to the beginning of vo_x11_fullscreen().diego2009-10-241-9/+4
| | | | | | | | | | | | | | | | | | | | | | Fixes the warnings: libvo/x11_common.c:1344: warning: 'h' may be used uninitialized in this function libvo/x11_common.c:1344: warning: 'w' may be used uninitialized in this function libvo/x11_common.c:1344: warning: 'y' may be used uninitialized in this function libvo/x11_common.c:1344: warning: 'x' may be used uninitialized in this function git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29795 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Add yuv_colorspace property, implemented in vo_vdpau and vo_xvUoti Urpala2009-11-151-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a property to select YUV colorspace. Currently implemented only in vo_vdpau and vo_xv. Allows switching between BT.601, BT.709 and SMPTE-240M (vdpau only). The xv support uses the "XV_ITURBT_709" attribute. At least my NVIDIA card supports that; I don't know whether other xv implementations do. Bind the colorspace switch to the 'c' key by default. 'c' is currently used by vo_sdl for some fullscreen mode change thing, but at the moment that does not conflict and if it will in the future then vo_sdl can change. VDPAU part based on a patch from Lauri Mylläri <lauri.myllari@gmail.com>
* | Implement vsync-aware frame timing for VDPAUUoti Urpala2009-11-151-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Main things added are custom frame dropping for VDPAU to work around the display FPS limit, frame timing adjustment to avoid jitter when video frame times keep falling near vsyncs, and use of VDPAU's timing feature to keep one future frame queued in advance. NVIDIA's VDPAU implementation refuses to change the displayed frame more than once per vsync. This set a limit on how much video could be sped up, and caused problems for nearly all videos on low-FPS video projectors (playing 24 FPS video on a 24 FPS projector would not work reliably as MPlayer may need to slightly speed up the video for AV sync). This commit adds a framedrop mechanism that drops some frames so that no more than one is sent for display per vsync. The code tries to select the dropped frames smartly, selecting the best one to show for each vsync. Because of the timing features needed the drop functionality currently does not work if the correct-pts option is disabled. The code also adjusts frame timing slightly to avoid jitter. If you for example play 24 FPS video content on a 72 FPS display then normally a frame would be shown for 3 vsyncs, but if the frame times happen to fall near vsyncs and change between just before and just after then there could be frames alternating between 2 and 4 vsyncs. The code changes frame timing by up to one quarter vsync interval to avoid this. The above functionality depends on having reliable vsync timing information available. The display refresh rate is not directly provided by the VDPAU API. The current code uses information from the XF86VidMode extension if available; I'm not sure how common cases where that is inaccurate are. The refresh rate can be specified manually if necessary. After the changes in this commit MPlayer now always tries to keep one frame queued for future display using VDPAU's internal timing mechanism (however no more than 50 ms to the future). This should make video playback somewhat more robust against timing inaccuracies caused by system load.
* | Merge svn changes up to r29644Uoti Urpala2009-09-041-3/+7
|\|
| * Do not do a unmap/map cycle on Windows given with -wid, with some windowreimar2009-09-011-2/+1
| | | | | | | | | | | | | | | | managers this has the ugly side-effect of moving the window. Instead call XInstallColormap to ensure the Colormap is installed. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29614 b3059339-0415-0410-9bf9-f77b7e298cf2
| * First attempts at supporting -fs with -wid, -vo gl on X11 only so farreimar2009-08-271-1/+6
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29556 b3059339-0415-0410-9bf9-f77b7e298cf2
| * <