GstSystemClock always uses monotonic time on macOS/Windows
The documentation indicates that the default clock mode for GstSystemClock is "time since Epoch" in my testing I noticed we're getting some other value. Digging into gst/gstsystemclock.c
I see that the gst_system_clock_get_internal_time
uses mach_absolute_time
to generate the timestamp rather than changing behavior depending on what time source/type is required. mach_absolute_time
is a monotonic clock that pauses while the system is asleep, not a unix timestamp. Looking into this further I see that the clock-type property is checked later in the function but this portion is omitted by the pre-processor.
The function in question after being run through the pre-processor:
# 825 "gst/gstsystemclock.c"
static GstClockTime
gst_system_clock_get_internal_time (GstClock * clock)
{
GstSystemClock *sysclock = ((GstSystemClock *)(clock));
uint64_t mach_t = mach_absolute_time ();
return gst_util_uint64_scale (mach_t, sysclock->priv->mach_timebase.numer,
sysclock->priv->mach_timebase.denom);
# 870 "gst/gstsystemclock.c"
}
Is this behavior expected?