2000-02-13 05:31:35 +01:00
|
|
|
/*****************************************************************************
|
2006-12-03 14:48:21 +01:00
|
|
|
* vlc_mtime.h: high resolution time management functions
|
|
|
|
*****************************************************************************
|
1999-08-08 14:42:54 +02:00
|
|
|
* This header provides portable high precision time management functions,
|
|
|
|
* which should be the only ones used in other segments of the program, since
|
|
|
|
* functions like gettimeofday() and ftime() are not always supported.
|
|
|
|
* Most functions are declared as inline or as macros since they are only
|
|
|
|
* interfaces to system calls and have to be called frequently.
|
|
|
|
* 'm' stands for 'micro', since maximum resolution is the microsecond.
|
|
|
|
* Functions prototyped are implemented in interface/mtime.c.
|
2000-02-13 05:31:35 +01:00
|
|
|
*****************************************************************************
|
2005-07-09 08:17:09 +02:00
|
|
|
* Copyright (C) 1996, 1997, 1998, 1999, 2000 the VideoLAN team
|
2004-07-10 20:08:09 +02:00
|
|
|
* $Id$
|
2000-03-03 08:03:34 +01:00
|
|
|
*
|
2000-08-24 00:15:28 +02:00
|
|
|
* Authors: Vincent Seguin <seguin@via.ecp.fr>
|
2000-03-03 08:03:34 +01:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
2005-12-15 12:37:45 +01:00
|
|
|
*
|
2000-03-03 08:03:34 +01:00
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2000-05-25 00:39:44 +02:00
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
2000-03-03 08:03:34 +01:00
|
|
|
*
|
2000-05-25 00:39:44 +02:00
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
2006-01-13 00:10:04 +01:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
|
2000-03-03 08:03:34 +01:00
|
|
|
*****************************************************************************/
|
|
|
|
|
2000-02-13 05:31:35 +01:00
|
|
|
/*****************************************************************************
|
1999-08-08 14:42:54 +02:00
|
|
|
* LAST_MDATE: date which will never happen
|
2000-02-13 05:31:35 +01:00
|
|
|
*****************************************************************************
|
1999-08-08 14:42:54 +02:00
|
|
|
* This date can be used as a 'never' date, to mark missing events in a function
|
|
|
|
* supposed to return a date, such as nothing to display in a function
|
|
|
|
* returning the date of the first image to be displayed. It can be used in
|
|
|
|
* comparaison with other values: all existing dates will be earlier.
|
2000-02-13 05:31:35 +01:00
|
|
|
*****************************************************************************/
|
2002-11-11 15:39:12 +01:00
|
|
|
#define LAST_MDATE ((mtime_t)((uint64_t)(-1)/2))
|
1999-08-08 14:42:54 +02:00
|
|
|
|
2000-02-13 05:31:35 +01:00
|
|
|
/*****************************************************************************
|
1999-08-08 14:42:54 +02:00
|
|
|
* MSTRTIME_MAX_SIZE: maximum possible size of mstrtime
|
2000-02-13 05:31:35 +01:00
|
|
|
*****************************************************************************
|
1999-08-08 14:42:54 +02:00
|
|
|
* This values is the maximal possible size of the string returned by the
|
1999-09-29 11:56:04 +02:00
|
|
|
* mstrtime() function, including '-' and the final '\0'. It should be used to
|
|
|
|
* allocate the buffer.
|
2000-02-13 05:31:35 +01:00
|
|
|
*****************************************************************************/
|
1999-09-29 11:56:04 +02:00
|
|
|
#define MSTRTIME_MAX_SIZE 22
|
1999-08-08 14:42:54 +02:00
|
|
|
|
2004-09-06 06:38:46 +02:00
|
|
|
/* Well, Duh? But it does clue us in that we are converting from
|
|
|
|
millisecond quantity to a second quantity or vice versa.
|
|
|
|
*/
|
|
|
|
#define MILLISECONDS_PER_SEC 1000
|
|
|
|
|
2003-12-02 02:54:30 +01:00
|
|
|
#define msecstotimestr(psz_buffer, msecs) \
|
2004-09-06 06:38:46 +02:00
|
|
|
secstotimestr( psz_buffer, (msecs / (int) MILLISECONDS_PER_SEC) )
|
2003-12-02 02:54:30 +01:00
|
|
|
|
2000-02-13 05:31:35 +01:00
|
|
|
/*****************************************************************************
|
1999-08-08 14:42:54 +02:00
|
|
|
* Prototypes
|
2000-02-13 05:31:35 +01:00
|
|
|
*****************************************************************************/
|
* ALL: the first libvlc commit.
As for video output 4, this breaks almost everything, but I'll slowly
do what remains to be fixed during the weekend.
Changes in vlc:
===============
* vlc is now a very small program (20 lines) which uses the libvlc API;
it is quite simple for the moment but can be extended in the future.
* interfaces, decoders, video outputs, etc. are now almost the same
objects (yes, I know, this is C++ redone in C) and are structured in
a tree. More about this later, but basically it allows the following
nice features:
- several interfaces
- several playlists with several outputs
- input plugins spawning helper interfaces (will be used for DVD menus)
- anything spawning anything; I swear there are useful uses for this!
* libvlc can be used in other programs; I'm currently writing a Mozilla
plugin for my employer.
Things currently broken:
========================
* most interfaces, most ports
* the playlist handling (almost finished rewriting this though). This means
no file can be played from the GUI, you need to use the commandline. This
also means it segfaults at EOF, when exiting the program, and it sometimes
refuses to open a file when asked to.
2002-06-01 14:32:02 +02:00
|
|
|
VLC_EXPORT( char *, mstrtime, ( char *psz_buffer, mtime_t date ) );
|
|
|
|
VLC_EXPORT( mtime_t, mdate, ( void ) );
|
|
|
|
VLC_EXPORT( void, mwait, ( mtime_t date ) );
|
|
|
|
VLC_EXPORT( void, msleep, ( mtime_t delay ) );
|
2003-12-02 02:54:30 +01:00
|
|
|
VLC_EXPORT( char *, secstotimestr, ( char *psz_buffer, int secs ) );
|
Some heavy changes today:
* Removed duplicate function checks from configure.in.
* Added extra magic to Makefile.modules so that the module Makefiles
are now ridiculously simple. And I mean *simple*. Check it! This will
make a possible switch to full autoconf/automake a lot easier.
* Added the vlc version name to the plugin symbols, to be sure we only load
plugins with the same version number. A nasty consequence is that you
need to rebuild your tree after midnight if you are using a CVS tree :-)
* Got rid of modules_export.h by #defining exported functions in the same
header as their prototype.
* Added modules_inner.h and other commonly used .h files to common.h so
there are less and less files to include, and renamed common.h to
<videolan/vlc.h>.
* First modifications to the module handling system towards my ultimate
goal to get rid of the *_Probe functions. Got rid of TestMethod and
TestCPU, as well as src/misc/tests.c.
* Wrote the chroma plugin handling functions. No YUV functions have been
ported yet because it'ls a lot of work, but the core system works, I
tried it with a naive yv12->rgb16 plugin (which will disappear when the
real functions are ready).
* Made a lot of functions in dvd_summary.c one-liners to avoid wasting
too many output lines.
* Fixed a segfault in input_dvd.c:DVDInit.
* Added a fixfiles.sh script in plugins/gtk to be run after Glade has
generated its C files.
* Did some work on the KDE interface to make it suck a bit less. It still
segfaults, but at least it runs and it looks less ugly.
* RGB SDL rendering works again, though in 16bpp only.
* Made plugins/vcd/linux_cdrom_tools.c independent of any vlc structure
so that it'll be easily put in a library. Maybe libdvdcss?
* Fixed VCD date display.
* Merged vout_xvideo.c, vout_x11.c and vout_common.c into xcommon.c.
* Wrote non-Shm XVideo output.
* Made X11 output work again. Still pretty unstable, only works for 16bpp.
* Additional french translation in po/fr.po. Any taker for the rest?
* Fixed a segfault in video_output.c when the allocated pictures were
not direct buffers.
* If $DISPLAY isn't set, don't try to run the Gtk+ interface.
* Replaced 48x48 .xpm images with 32x32 ones to conform to Debian policy
(Closes Debian bug #126939).
* Removed the automatic ./configure launch when running `make all' for
the first time.
Stuff currently more broken than it ought to be:
* The wall filter. Being fixed.
* x11 and sdl plugins for depth != 16bpp.
* Software YUV.
* gvlc, gnome-vlc, kvlc shortcuts. Use --intf instead for the moment.
2001-12-30 08:09:56 +01:00
|
|
|
|
2004-07-10 20:08:09 +02:00
|
|
|
/*****************************************************************************
|
|
|
|
* date_t: date incrementation without long-term rounding errors
|
|
|
|
*****************************************************************************/
|
|
|
|
struct date_t
|
|
|
|
{
|
|
|
|
mtime_t date;
|
|
|
|
uint32_t i_divider_num;
|
|
|
|
uint32_t i_divider_den;
|
|
|
|
uint32_t i_remainder;
|
|
|
|
};
|
|
|
|
|
|
|
|
VLC_EXPORT( void, date_Init, ( date_t *, uint32_t, uint32_t ) );
|
|
|
|
VLC_EXPORT( void, date_Change, ( date_t *, uint32_t, uint32_t ) );
|
|
|
|
VLC_EXPORT( void, date_Set, ( date_t *, mtime_t ) );
|
|
|
|
VLC_EXPORT( mtime_t, date_Get, ( const date_t * ) );
|
|
|
|
VLC_EXPORT( void, date_Move, ( date_t *, mtime_t ) );
|
|
|
|
VLC_EXPORT( mtime_t, date_Increment, ( date_t *, uint32_t ) );
|
2007-02-09 19:24:06 +01:00
|
|
|
VLC_EXPORT( uint64_t, NTPtime64, ( void ) );
|