summaryrefslogtreecommitdiffstats
path: root/src/pulsecore/core-rtclock.c
Commit message (Collapse)AuthorAgeFilesLines
* pulsecore:: Define _POSIX_C_SOURCE locally for rtclock on OSXDaniel Mack2011-04-231-0/+4
| | | | | | Defining this macro on a global level is disadvantageous for other APIs, and as we need it for clock_gettime() only on Mac OS X, define it locally in pulsecore/core-rtclock.c only.
* Fix pa_rtclock_from_wallclockMaarten Bosmans2011-03-191-10/+4
| | | | | | | | The HAVE_CLOCK_GETTIME macro protects timespec and related functions, nothing of which is used in pa_rtclock_from_wallclock. And silently just not converting was not the proper solution anyway. Also add an assert in pulse/mainloop.c to report the integer overflow that was triggered by the wrong pa_rtclock_from_wallclock. Without the assert, debugging was painful.
* win32: Implement rtclock based on QueryPerformanceCounterMaarten Bosmans2011-02-171-0/+30
| | | | Also remove some unnecessary <time.h> headers.
* Apply #ifdefs around functionality not available on win32Maarten Bosmans2011-02-171-0/+2
| | | | And also the reverse: around some win32 specific functionality
* core-rtclock.c: tweak OS_IS_DARWIN constraintsDaniel Mack2009-12-091-41/+28
| | | | | Move the code for OS_IS_DARWIN to the top as on Darwin, HAVE_CLOCK_GETTIME is also defined.
* Wrap clock_gettime and friendsDaniel Mack2009-10-311-6/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On Wed, Sep 16, 2009 at 11:48:58PM +0200, Lennart Poettering wrote: > On Wed, 16.09.09 15:15, Daniel Mack (daniel@caiaq.de) wrote: > > > From: Kim Lester <kim@dfusion.com.au> > > > > OS X does not define clockid_t or clock_gettime() and friends. > > Add a wrapper to fix this. > > Hmpf. I am not particularly happy with this. This adds a lot of > unnecessary compat code. We don't actually need implementations of > clock_getres(). All we need is some kind of check whether system > timers are accurate or whether they are rounded up to scheduling > slices. On Linux we do that check with clock_getres(), but all the > information it returns is actually not intertesting at all. We just > check if this is below some trheshold, that's all. > > clock_settime() we don't use at all! We shouldn't carry compat code > for that. > > And clock_gettime we don't really need either. We need some kind of > accurate system timers (preferably monotonic), and on Linux we use > clock_gettime() for that. But we already have a fallback there for > gettimeofday(). > > Or in other words, the current APIs pa_rtclock_get(), > pa_rtclock_hrtimer() is supposed to be the abstract API that has > different backends on different systems. I'd very much prefer if any > MacOS specific code would simply be plugged in there instead of > creating various new abstraction interfaces! Ok - what about the version below? I don't particularily like the Daniel >From 9f0a051953ec354ccdb8aa44a9845c408b26ae0b Mon Sep 17 00:00:00 2001 From: Kim Lester <kim@dfusion.com.au> Date: Wed, 16 Sep 2009 14:40:01 +0800 Subject: [PATCH] Implement pa_rtclock_get() and pa_rtclock_hrtimer() for Darwin OS X does not define clockid_t or clock_gettime() and friends. Add wrappers to fix this. Based on a patch from Kim Lester <kim@dfusion.com.au>.
* timeval: make timeval conversion routines handle PA_USEC_INVALID specialLennart Poettering2009-09-181-1/+7
|
* core-rtclock: introduce pa_timespec_store() akin pa_timeval_store()Lennart Poettering2009-09-181-0/+14
|
* rtclock: make use of constants when converting between nsec and usecLennart Poettering2009-06-231-3/+3
|
* rtclock: fix issues found by LennartMarc-André Lureau2009-06-201-0/+3
|
* Base mainloop on pa_rtclock_now()Marc-André Lureau2009-06-201-0/+35
| | | | | | | | | | | | | | | | Move the mainloop to monotonic based time events. Introduces 4 helper functions: pa_{context,core}_rttime_{new,restart}(), that fill correctly a timeval with the rtclock flag set if the mainloop supports it. Both mainloop-test and mainloop-test-glib works with rt and timeval based time events. PulseAudio and clients should be fully functional. This patch has received several iterations, and this one as been largely untested. Signed-off-by: Marc-André Lureau <marca-andre.lureau@nokia.com>
* pulse: move pa_rtclock_now in pulsecommonMarc-André Lureau2009-06-201-0/+152