ptp: Initial implementation of a PTP clock
authorSebastian Dröge <sebastian@centricular.com>
Thu, 14 May 2015 10:18:25 +0000 (12:18 +0200)
committerSebastian Dröge <sebastian@centricular.com>
Wed, 3 Jun 2015 11:55:28 +0000 (13:55 +0200)
commit8d7775983460e605c46628644fecb1839bde1ffe
treedd3d2861169bbfe5d0d956124d28ce1f7368f818
parentfe3249b0e1092c442e0889640295569eb012177d
ptp: Initial implementation of a PTP clock

GstPtpClock implements a PTP (IEEE1588:2008) ordinary clock in
slave-only mode, that allows a GStreamer pipeline to synchronize
to a PTP network clock in some specific domain.

The PTP subsystem can be initialized with gst_ptp_init(), which then
starts a helper process to do the actual communication via the PTP
ports. This is required as PTP listens on ports < 1024 and thus
requires special privileges. Once this helper process is started, the
main process will synchronize to all PTP domains that are detected on
the selected interfaces.

gst_ptp_clock_new() then allows to create a GstClock that provides the
PTP time from a master clock inside a specific PTP domain. This clock
will only return valid timestamps once the timestamps in the PTP domain
are known. To check this, the GstPtpClock::internal-clock property and
the related notify::clock signal can be used. Once the internal clock
is not NULL, the PTP domain's time is known. Alternatively you can wait
for this with gst_ptp_clock_wait_ready().

To gather statistics about the PTP clock synchronization,
gst_ptp_statistics_callback_add() can be used. This gives the
application the possibility to collect all kinds of statistics
from the clock synchronization.

https://bugzilla.gnome.org/show_bug.cgi?id=749391
15 files changed:
configure.ac
docs/libs/gstreamer-libs-docs.sgml
docs/libs/gstreamer-libs-sections.txt
libs/gst/helpers/Makefile.am
libs/gst/helpers/gst-ptp-helper.c [new file with mode: 0644]
libs/gst/net/Makefile.am
libs/gst/net/gstptp_private.h [new file with mode: 0644]
libs/gst/net/gstptpclock.c [new file with mode: 0644]
libs/gst/net/gstptpclock.h [new file with mode: 0644]
libs/gst/net/net.h
tests/examples/Makefile.am
tests/examples/ptp/.gitignore [new file with mode: 0644]
tests/examples/ptp/Makefile.am [new file with mode: 0644]
tests/examples/ptp/ptp-print-times.c [new file with mode: 0644]
win32/common/libgstnet.def