Data Structures | Defines | Functions

vlc_mtime.h File Reference

Go to the source code of this file.

Data Structures

struct  date_t

Defines

#define LAST_MDATE   ((mtime_t)((uint64_t)(-1)/2))
#define MSTRTIME_MAX_SIZE   22

Functions

VLC_API char * mstrtime (char *psz_buffer, mtime_t date)
 Return a date in a readable format.
VLC_API char * secstotimestr (char *psz_buffer, int32_t secs)
 Convert seconds to a time in the format h:mm:ss.
VLC_API void date_Init (date_t *, uint32_t, uint32_t)
 Initialize a date_t.
VLC_API void date_Change (date_t *, uint32_t, uint32_t)
 Change a date_t.
VLC_API void date_Set (date_t *, mtime_t)
 Set the date value of a date_t.
VLC_API mtime_t date_Get (const date_t *)
 Get the date of a date_t.
VLC_API void date_Move (date_t *, mtime_t)
 Move forwards or backwards the date of a date_t.
VLC_API mtime_t date_Increment (date_t *, uint32_t)
 Increment the date and return the result, taking into account rounding errors.
VLC_API mtime_t date_Decrement (date_t *, uint32_t)
 Decrement the date and return the result, taking into account rounding errors.
VLC_API uint64_t NTPtime64 (void)

Define Documentation

#define LAST_MDATE   ((mtime_t)((uint64_t)(-1)/2))
#define MSTRTIME_MAX_SIZE   22

Function Documentation

VLC_API void date_Change ( date_t p_date,
uint32_t  i_divider_n,
uint32_t  i_divider_d 
)

Change a date_t.

Parameters:
date to change
divider (sample rate) numerator
divider (sample rate) denominator

References date_t::i_divider_den, date_t::i_divider_num, and date_t::i_remainder.

VLC_API mtime_t date_Decrement ( date_t p_date,
uint32_t  i_nb_samples 
)

Decrement the date and return the result, taking into account rounding errors.

Parameters:
date to decrement
decrementation in number of samples
Returns:
date value

References date_t::date, date_t::i_divider_den, date_t::i_divider_num, and date_t::i_remainder.

VLC_API mtime_t date_Get ( const date_t p_date  ) 

Get the date of a date_t.

Parameters:
date to get
Returns:
date value

References date_t::date.

Referenced by aout_DecIsEmpty(), aout_FifoMoveDates(), aout_FifoPush(), aout_InputPlay(), aout_OutputSlice(), and aout_TimeReport().

VLC_API mtime_t date_Increment ( date_t p_date,
uint32_t  i_nb_samples 
)

Increment the date and return the result, taking into account rounding errors.

Parameters:
date to increment
incrementation in number of samples
Returns:
date value

References CLOCK_FREQ, date_t::date, date_t::i_divider_den, date_t::i_divider_num, date_t::i_remainder, lldiv(), lldiv_t::quot, and lldiv_t::rem.

Referenced by aout_DecPlay(), aout_FifoPush(), and aout_OutputSlice().

VLC_API void date_Init ( date_t p_date,
uint32_t  i_divider_n,
uint32_t  i_divider_d 
)

Initialize a date_t.

Parameters:
date to initialize
divider (sample rate) numerator
divider (sample rate) denominator

References date_t::date, date_t::i_divider_den, date_t::i_divider_num, and date_t::i_remainder.

Referenced by aout_DecNew(), and aout_FifoInit().

VLC_API void date_Move ( date_t p_date,
mtime_t  i_difference 
)

Move forwards or backwards the date of a date_t.

Parameters:
date to move
difference value

References date_t::date.

Referenced by aout_FifoMoveDates(), and aout_TimeReport().

VLC_API void date_Set ( date_t p_date,
mtime_t  i_new_date 
)

Set the date value of a date_t.

Parameters:
date to set
date value

References date_t::date, and date_t::i_remainder.

Referenced by aout_DecChangePause(), aout_DecFlush(), aout_DecNew(), aout_FifoInit(), aout_FifoPush(), aout_FifoReset(), aout_InputPlay(), and aout_OutputSlice().

VLC_API char* mstrtime ( char *  psz_buffer,
mtime_t  date 
)

Return a date in a readable format.

This function converts a mtime date into a string. psz_buffer should be a buffer long enough to store the formatted date.

Parameters:
date to be converted
psz_buffer should be a buffer at least MSTRTIME_MAX_SIZE characters
Returns:
psz_buffer is returned so this can be used as printf parameter.

References MSTRTIME_MAX_SIZE.

VLC_API uint64_t NTPtime64 ( void   ) 
Returns:
NTP 64-bits timestamp in host byte order.

References CLOCK_REALTIME.

Referenced by sdp_Start(), and vlc_rand_bytes().

VLC_API char* secstotimestr ( char *  psz_buffer,
int32_t  i_seconds 
)

Convert seconds to a time in the format h:mm:ss.

This function is provided for any interface function which need to print a time string in the format h:mm:ss date.

Parameters:
secs the date to be converted
psz_buffer should be a buffer at least MSTRTIME_MAX_SIZE characters
Returns:
psz_buffer is returned so this can be used as printf parameter.

References MSTRTIME_MAX_SIZE, secstotimestr(), and unlikely.

Referenced by input_ControlVarNavigation(), and secstotimestr().

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines