clocks Package¶
base
Module¶
-
class
ebu_tt_live.clocks.base.
Clock
[source]¶ Bases:
object
This class represents our timing source that we use to get time related information when document processing happens. Most of the utility functions are meant to stay here and the subclasses should implement get_time only.
-
clock_mode
¶
-
is_fixed_time_mode
()[source]¶ Returns the current status of the fixed-time mode. :return: True if fixed-time mode is currently active, False otherwise.
-
set_fixed_time
(value)[source]¶ Registers a time in the Clock object. If fixed-time mode is active, e.g. set_fixed_time_mode(true) was called on self, then every call to get_time() will return the registered time. The parameter value must contain the time as a datetime.timedelta. If it is not a datetime.timedelta, a TypeError exception will be raised. :param value: the time to register as the fixed time of the Clock. Must of type datetime.timedelta
-
set_fixed_time_mode
(value)[source]¶ Used to activate or deactivate the fixed-time mode. If value is True the clock will be set in fixed-time mode, while this mode is active any call to get_time() will return the time registered with set_fixed_time as the fixed time of clock. If value is False, the fixed-time mode is deactivated and the real time of the clock is returned when get_time() is called. If value is not of type bool a TypeError exception will be raised. :param value: a bool. True to activate fixed-time mode, False to deactivate fixed-time mode.
-
time_base
¶
-
media
Module¶
-
class
ebu_tt_live.clocks.media.
MediaClock
[source]¶ Bases:
ebu_tt_live.clocks.base.Clock
MediaClock is a reference clock that simulates the mediastream’s time by interpolating the local machine time from the last adjusted reference time.
-
class
ebu_tt_live.clocks.media.
ReferenceTime
(local, remote)¶ Bases:
tuple
-
local
¶ Alias for field number 0
-
remote
¶ Alias for field number 1
-