Commit Graph

99 Commits

Author SHA1 Message Date
Uoti Urpala 173beb5608 Merge svn changes up to r30514 2010-03-09 19:58:02 +02:00
Uoti Urpala 852570d342 Merge svn changes up to r30216 2010-01-08 02:39:39 +02:00
diego 620ab70745 Add missing header #includes to fix 'make checkheaders'.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30208 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-01-04 19:04:33 +00:00
Uoti Urpala d46b86bc7c Merge svn changes up to r30136
Ignore another broken correct-pts change in 30134.
2009-12-30 00:56:10 +02:00
reimar a5ee26b559 vo_x11_classhint name argument should be const, since we pass string constants there.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30125 b3059339-0415-0410-9bf9-f77b7e298cf2
2009-12-27 14:19:48 +00:00
Uoti Urpala 201bef7ee1 Implement vsync-aware frame timing for VDPAU
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.
2009-11-15 12:45:58 +02:00
Uoti Urpala f2864e9a07 x11_common.h: Remove declarations of some nonexistent variables 2009-05-04 03:53:50 +03:00
Uoti Urpala 186e5a998c Merge svn changes up to r28641
Convert vo_x11_border (used in vo_gl/gl2 though the vo_gl_border
macro) to use a wrapper macro in old-style VOs which do not provide a
VO object argument. Before this function had an explicit global_vo
argument in vo_gl/gl2. New vo_vdpau uses it too so use the same
mechanism as most other functions.
2009-02-18 01:45:36 +02:00
Uoti Urpala 738f66b1bc Merge svn changes up to r28549 2009-02-13 03:52:51 +02:00
reimar dbc106f4da Remove now unused vo_calc_drwXY function.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28547 b3059339-0415-0410-9bf9-f77b7e298cf2
2009-02-12 18:03:38 +00:00
Uoti Urpala 1e86963828 Merge svn changes up to r28537 2009-02-12 04:17:55 +02:00
diego befc528297 Add standard license headers, unify header formatting.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28481 b3059339-0415-0410-9bf9-f77b7e298cf2
2009-02-08 03:27:30 +00:00
Uoti Urpala 9bcd12fdf5 Merge svn changes up to r28310
The libdvdread4 and libdvdnav directories, which are externals in the
svn repository, are at least for now not included in any form. I added
configure checks to automatically disable internal libdvdread and
libdvdnav if the corresponding directories are not present; if they're
added manually then things work the same as in svn.
2009-01-15 05:57:31 +02:00
cehoyos 0fa2d1abd7 Factor calc_drwXY out of vo_xv and vo_xvmc.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28285 b3059339-0415-0410-9bf9-f77b7e298cf2
2009-01-09 15:25:24 +00:00
Uoti Urpala 6c712271ce Remove old VO vo_mouse_autohide compatibility #define
The VOs no longer access vo_mouse_autohide directly so the #define is
not needed.
2008-11-22 19:18:48 +02:00
Uoti Urpala 1715c2a336 Merge svn changes up to r27949
Conflicts:
	common.mak
	libvo/vo_xv.c
	libvo/x11_common.c
	libvo/x11_common.h
	stream/cache2.c
2008-11-17 20:50:23 +02:00
reimar 4b9ee2e206 Simplify vo_vm_switch and vo_vm_close, everyone was using the (almost) same
boiler-plate code with them, just with different bugs.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27924 b3059339-0415-0410-9bf9-f77b7e298cf2
2008-11-15 18:56:25 +00:00
reimar 8b0b5bee77 Cosmetics: remove useless "extern"
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27920 b3059339-0415-0410-9bf9-f77b7e298cf2
2008-11-15 17:48:27 +00:00
reimar 87bee02b19 Replace some of the different inconsistent XGetGeometry uses by a
vo_x11_update_geometry function.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27919 b3059339-0415-0410-9bf9-f77b7e298cf2
2008-11-15 17:45:55 +00:00
Uoti Urpala 0301309425 Merge svn changes up to 27824
Conflicts:
	cfg-common-opts.h
	libmpcodecs/dec_video.c
	libmpcodecs/vd.c
	libvo/x11_common.h
	mplayer.c
	stream/cache2.c
2008-10-25 05:12:34 +03:00
diego a290af1657 Move X11_FULLSCREEN definition to x11_common.h where it belongs.
config.h should only contain option definitions, no logic.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27784 b3059339-0415-0410-9bf9-f77b7e298cf2
2008-10-16 18:19:36 +00:00
Uoti Urpala 849dc0ba31 Merge svn changes up to r27649
Conflicts:
	Makefile
	configure
	libvo/x11_common.c
2008-09-20 16:13:33 +03:00
Uoti Urpala cfe2839386 Move some declarations from mplayer.c to proper headers
Declare mp_input_register_options in input.h and
xscreensaver_heartbeat in x11_common.h.
2008-08-12 14:57:18 +03:00
Uoti Urpala 17d3e4b36d Merge svn changes up to r27441
Conflicts:

	cfg-common-opts.h
	command.c
	configure
	input/input.c
	libmpcodecs/dec_video.c
	libmpcodecs/vd.c
	libmpdemux/stheader.h
	libvo/sub.c
	libvo/video_out.c
	libvo/vo_xv.c
	libvo/vosub_vidix.c
	libvo/x11_common.c
	libvo/x11_common.h
	mp_core.h
	mplayer.c
	stream/stream.h
2008-08-08 02:13:09 +03:00
diego 82f319af62 Change a bunch of X11-specific preprocessor directives.
Switch from a HAVE_ prefix to a CONFIG_ prefix.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27409 b3059339-0415-0410-9bf9-f77b7e298cf2
2008-08-04 06:16:23 +00:00
Uoti Urpala 3a69d65f8d Merge svn changes up to r27347
Conflicts:

	libvo/x11_common.c
	libvo/x11_common.h

Rename the vo_gl macro "vo_border()" to "vo_gl_border" as it conflicts
with the global variable "vo_border"; done in the merge commit because
uses of the macro needed changes anyway to resolve conflicts.
2008-07-25 02:50:58 +03:00
reimar 983800b76f Enable runtime border/window decorations-toggling for Linux gl and gl2 vos.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27338 b3059339-0415-0410-9bf9-f77b7e298cf2
2008-07-22 18:46:07 +00:00
Uoti Urpala 4237cb821b Move allocation/free of x11 struct to x11_common.c
Allocate the struct in the init function and free in uninit.
2008-04-29 16:22:33 +03:00
Uoti Urpala 77ec83e351 Add a context for mp_fifo
Store data in an allocated context and take it as an argument instead
of using static variables.
2008-04-29 15:36:51 +03:00
Uoti Urpala db8924ea3c Move mRootWin,mScreen,mLocalDisplay to x11 struct 2008-04-23 13:47:43 +03:00
Uoti Urpala 0ef3e9ae87 Move vo_mouse_autohide,vo_wm_type,vo_fs_type,vo_fs_flip to x11 struct 2008-04-23 13:47:43 +03:00
Uoti Urpala cc8334710e x11_common: Move vo_old_[x|y|width|height| to x11 struct 2008-04-23 13:47:43 +03:00
Uoti Urpala 52b3c6097b x11_common.c: Move orig_layer and old_gravity to x11 struct 2008-04-23 13:47:43 +03:00
Uoti Urpala 49ac1f06ca Move static mouse hide timers to x11 struct 2008-04-23 13:47:43 +03:00
Uoti Urpala 49461e04d0 Move vo_gc,f_gc,vo_hints to x11 struct 2008-04-23 13:47:43 +03:00
Uoti Urpala 5f39342e01 x11_common.c: Move function-static variables to struct 2008-04-23 13:47:42 +03:00
Uoti Urpala e66e17adc1 Move xv_port,xv_colorkey,xv_ck_info to x11 struct 2008-04-23 13:47:35 +03:00
Uoti Urpala 40f02f64fd Move vo_window to x11 struct 2008-04-23 13:46:40 +03:00
Uoti Urpala 7159af499c Move static X11 atoms to struct 2008-04-23 13:46:40 +03:00
Uoti Urpala 78172918ff Move vo_screenwidth,vo_screenheight to options struct 2008-04-23 13:46:40 +03:00
Uoti Urpala 432e8ff4a5 Move vo_depthonscreen to x11 struct 2008-04-23 13:46:40 +03:00
Uoti Urpala eaab1ce896 Move vo_dx,vo_dy,vo_dwidth,vo_dheight to vo struct 2008-04-23 13:46:40 +03:00
Uoti Urpala 26039a38e3 Move global mDisplay to x11 state struct 2008-04-23 13:46:34 +03:00
Uoti Urpala acf319b3ed Create a struct for X11 state
Will be used for common data between X11 VOs. The main reasons for
making it a separate struct rather than extra fields in the main VO
struct are that some field definitions need X headers and that the code
keeps basic X state such as the display connection over opening and
closing of individual VOs.
2008-04-23 13:41:07 +03:00
Uoti Urpala d283d5236a x11_common.c: Make some functions static 2008-04-23 13:41:06 +03:00
Uoti Urpala bfe569b76e Move vo_ontop to options struct
Add a 'struct vo *vo' argument to the x11_common.c functions that
access the variable so it's available as vo->opts->vo_ontop. To keep
VOs using the old API working create a global vo variable that is set
to the currently used old vo. "vo_ontop" will be #defined to
"global_vo->opts->vo_ontop", and x11_common.h will add defines like
the following when it is included by old VOs:
 #define vo_x11_ontop() vo_x11_ontop(global_vo)
so that they will call the function according to the new declaration.
2008-04-23 13:41:06 +03:00
diego 8efb2fa21c Add MPLAYER_ prefix to multiple inclusion guards.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26061 b3059339-0415-0410-9bf9-f77b7e298cf2
2008-02-22 09:09:46 +00:00
diego 77eb726c3d Remove pointless #ifdefs around extern declarations.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26039 b3059339-0415-0410-9bf9-f77b7e298cf2
2008-02-20 08:51:53 +00:00
diego fba0b66ff9 Add explanatory comments to the #endif part of multiple inclusion guards.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25563 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-12-31 16:15:50 +00:00
reimar f131aafff1 Make X11 window creation and (with -fixed-vo) management simpler and more
consistent by introducing a new function that handles most of the
ugly things. Changes of behaviour with some vos is unavoidable, bug reports
welcome.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23675 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-06-27 10:26:13 +00:00