Commit Graph

30 Commits

Author SHA1 Message Date
der richter ee6794225d mac/vulkan: add support for frame timing via presentation feedback 2024-04-10 19:14:20 +02:00
Dudemanguy 59dd7d94af timer: change mp_sleep_us to mp_sleep_ns
Linux and macOS already use nanosecond resolution for their sleep
functions. It was just being converted from microseconds before. Since
we have mp_time_ns now, go ahead and bump the precision here. The timer
for windows uses some timeBeginPeriod thing which I'm not sure what it
does really but whatever just convert the units to ms like they were
doing before. There's really no reason to keep the mp_sleep_us helper
around. A multiplication by 1000 is trivial and underlying OS clocks
have nanosecond precision.
2023-10-10 19:10:55 +00:00
Kacper Michajłow 9606c3fca9 timer: teach it about nanoseconds
Those changes will alow to change vsync base to more precise time base.
In general there is no reason to truncate values returned by system.
2023-09-29 20:48:58 +00:00
Thomas Weißschuh 9efce6d4ae various: drop unused #include "config.h"
Most sources don't need config.h.
The inclusion only leads to lots of unneeded recompilation if the
configuration is changed.
2023-02-20 14:21:18 +00:00
wm4 0112143fda Split mpvcore/ into common/, misc/, bstr/ 2013-12-17 02:39:45 +01:00
Stefano Pigozzi 406241005e core: move contents to mpvcore (2/2)
Followup commit. Fixes all the files references.
2013-08-06 22:52:31 +02:00
wm4 81439c5f35 timer: refactor, add 64 bit timer function
Make OS specific timer code export a mp_raw_time_us() function, and
add generic implementations of GetTimer()/GetTimerMS() using this
function. New mpv code is supposed to call mp_time_us() in situations
where precision is absolutely needed, or mp_time_s() otherwise.

Make it so that mp_time_us() will return a value near program start.
We don't set it to 0 though to avoid confusion with relative vs.
absolute time. Instead, pick an arbitrary offset.

Move the test program in timer-darwin.c to timer.c, and modify it to
work with the generic timer functions.
2013-05-26 16:44:20 +02:00
wm4 4873b32c59 Rename directories, move files (step 2 of 2)
Finish renaming directories and moving files. Adjust all include
statements to make the previous commit compile.

The two commits are separate, because git is bad at tracking renames
and content changes at the same time.

Also take this as an opportunity to remove the separation between
"common" and "mplayer" sources in the Makefile. ("common" used to be
shared between mplayer and mencoder.)
2012-11-12 20:08:18 +01:00
wm4 c5e2120e15 timer: remove timer_name
This was unreferenced and useless.
2012-09-07 16:06:36 +02:00
diego 359e85c234 osdep: tweak some #includes
Add/remove a few standard header #includes in osdep files.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32762 b3059339-0415-0410-9bf9-f77b7e298cf2
2011-01-31 16:03:10 +02:00
Uoti Urpala acdce0176a Merge svn changes up to r30732 2010-03-10 01:25:15 +02:00
diego 38648cae06 Mark sleep_accurate() as static, it is only used within the file.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30715 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-02-22 21:53:06 +00:00
Uoti Urpala 0eb321bf2c Remove trailing whitespace from most files 2009-07-07 02:34:35 +03:00
diego 6e9cbdc104 whitespace cosmetics: Remove all trailing whitespace.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29305 b3059339-0415-0410-9bf9-f77b7e298cf2
2009-05-13 02:58:57 +00:00
Uoti Urpala 1db1773ec2 Merge svn changes up to r29277 2009-05-08 23:50:26 +03:00
diego d9ded9284c Add missing 'void' to parameterless function declarations.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29254 b3059339-0415-0410-9bf9-f77b7e298cf2
2009-05-04 17:35:26 +00:00
ulion 5011271192 Remove useless variable startup_time, since we do not need it any more.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26672 b3059339-0415-0410-9bf9-f77b7e298cf2
2008-05-05 00:35:30 +00:00
Uoti Urpala 06a35804f3 Merge svn changes up to r26587
Conflicts:

	Makefile
	configure
	osdep/timer-darwin.c
2008-04-29 05:03:57 +03:00
ulion d90a7e0283 Force to uint64_t first to avoid direct conversion from double to unsigned int.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26582 b3059339-0415-0410-9bf9-f77b7e298cf2
2008-04-28 15:57:31 +00:00
Uoti Urpala eaf7857b7f timers: Remove GetRelativeTime()
Move the code calculating time delta since last query out of the
platform-specific drivers and into mplayer.c. The platform-specific
drivers now return absolute values only.

The way the code in timer-darwin.c uses doubles in wrapping arithmetic
looks questionable and this change might make problems in it more
visible.
2008-04-28 12:18:45 +03:00
Uoti Urpala c693b77e93 osdep: Change timer_name to a saner type
timer_name was a (non-const) pointer to a const char array. Make the
symbol the array itself.
2008-04-28 12:16:13 +03:00
diego 4bb3d604d5 main() --> main(void)
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25128 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-11-21 09:22:33 +00:00
ulion bddc41ec40 Fix GetTimerMS() discontinuous return value bug caused by GetTimer() overflow
on darwin. This bug will cause osd stuck on darwin.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24843 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-10-23 00:06:08 +00:00
diego fb20d201d7 Unify include paths, -I.. is in CFLAGS.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@16986 b3059339-0415-0410-9bf9-f77b7e298cf2
2005-11-14 00:30:37 +00:00
nplourde d59bfa633d use sleep_accurate darwin timer
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@15276 b3059339-0415-0410-9bf9-f77b7e298cf2
2005-04-27 14:55:30 +00:00
nplourde b48947fc65 repace call to sleep_accurate to usleep which fix hang while using -cache option on osx
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@13777 b3059339-0415-0410-9bf9-f77b7e298cf2
2004-10-27 18:03:11 +00:00
wight e68d7f6858 Native darwin timer update.
Patch by Dan Christiansen <danchr@daimi.au.dk>


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@12955 b3059339-0415-0410-9bf9-f77b7e298cf2
2004-08-04 15:48:43 +00:00
alex 780880f6e4 disable buggy code, patch by Romain Dolbeau
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@11868 b3059339-0415-0410-9bf9-f77b7e298cf2
2004-01-28 10:40:29 +00:00
alex c22e181e2c 10l
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@10516 b3059339-0415-0410-9bf9-f77b7e298cf2
2003-08-03 18:28:28 +00:00
alex 2ce15e7969 Precise timer for Darwin (it's more accurate than timer-macosx.c)
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@10149 b3059339-0415-0410-9bf9-f77b7e298cf2
2003-05-21 21:18:29 +00:00