summaryrefslogtreecommitdiffstats
path: root/libavutil/time.h
Commit message (Collapse)AuthorAgeFilesLines
* Merge commit '1bd0bdcdc236099d5c0d179696951f35f5310fa5'Michael Niedermayer2014-10-241-2/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | * commit '1bd0bdcdc236099d5c0d179696951f35f5310fa5': lavu: Add av_gettime_relative Conflicts: libavutil/time.c libavutil/time.h libavutil/version.h See: 0eec06ed8747923faa6a98e474f224d922dc487d Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * lavu: Add av_gettime_relativeMartin Storsjö2014-10-241-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since av_gettime() is used in a number of places where actual real time clock is required, the monotonic clock introduced in ebef9f5a5 would have consequences that are hard to handle. Instead split it into a separate function that can be used in the cases where only relative time is desired. On platform where no monotonic clock is available, the difference between the two av_gettime functions is not clear, and one could mistakenly use the relative clock where an absolute one is required. Therefore add an offset, to make it evident that the time returned from av_gettime_relative never is actual current real time, even though it is based on av_gettime. Based on a patch by Olivier Langlois. Signed-off-by: Martin Storsjö <martin@martin.st>
* | lavu: add av_gettime_relative()Olivier Langlois2014-05-171-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These functions are using the POSIX clock_gettime() function with the CLOCK_MONOTONIC clock id. If these are not present on the targeted platform, the new functions will fallback on using the original realtime functions av_gettime() and av_usleep(). Monotonic support can be added on other platforms with their equivalent native system API eventually if possible. Whenever time is requested to measure relative time, the monotonic clock, when available, is superior to the system realtime clock because it is not affected by discontinuous jumps in the system time In a future step, offering the flexibility to let the user choose between rt and monotonic clock for avdevices packets will be investigated. It is very easy to experience the issues that this patch attempt to address by rewinding back in the past the system time while ffmpeg is running. this is breaking the ffmpeg report printing (ffmepg.c:print_report()) and the the rate emulator functionality (-re) without the patch. Signed-off-by: Olivier Langlois <olivier@trillion01.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-06-221-0/+10
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: libspeexenc: add supported sample rates and channel layouts. Replace usleep() calls with av_usleep() lavu: add av_usleep() function utvideo: mark interlaced frames as such utvideo: Fix interlaced prediction for RGB utvideo. cosmetics: do not use full path for local headers lavu/file: include unistd.h only when available configure: check for unistd.h log: include unistd.h only when needed lavf: include libavutil/time.h instead of redeclaring av_gettime() Conflicts: configure doc/APIchanges ffmpeg.c ffplay.c libavcodec/utvideo.c libavutil/avutil.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * lavu: add av_usleep() functionMans Rullgard2012-06-221-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This function implements a delay using the first available of the following functions: - nanosleep() - usleep() - Sleep() (Windows) The conditional #includes in time.c are simplified by including unistd.h and windows.h whenever they are available rather than having these lines triggered by specific functions. Signed-off-by: Mans Rullgard <mans@mansr.com>
* | libavutil: fix author attributionMichael Niedermayer2012-06-201-4/+6
|/ | | | | | | | | | | | | | | | | | | | | | | | Libav.org has removed this while moving the code around For reference, the code was originally added in: commit 9aeeeb63f7e1ab7b0b7bb839a5f258667a2d2d78 Author: Fabrice Bellard <fabrice@bellard.org> Date: Wed Dec 20 00:02:47 2000 +0000 Initial revision Originally committed as revision 2 to svn://svn.ffmpeg.org/ffmpeg/trunk -- The function name originates from: commit 949885313226f01ae7ba9a69eff5c45b47b78d57 Author: Fabrice Bellard <fabrice@bellard.org> Date: Thu Jul 25 16:01:46 2002 +0000 more consistent naming Originally committed as revision 802 to svn://svn.ffmpeg.org/ffmpeg/trunk Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* Move av_gettime() to libavutilMans Rullgard2012-06-201-0/+29
Signed-off-by: Mans Rullgard <mans@mansr.com>
OpenPOWER on IntegriCloud