diff options
Diffstat (limited to 'include/gst/net')
-rw-r--r-- | include/gst/net/gstnet.h | 31 | ||||
-rw-r--r-- | include/gst/net/gstnetaddressmeta.h | 63 | ||||
-rw-r--r-- | include/gst/net/gstnetclientclock.h | 106 | ||||
-rw-r--r-- | include/gst/net/gstnetcontrolmessagemeta.h | 69 | ||||
-rw-r--r-- | include/gst/net/gstnettimepacket.h | 81 | ||||
-rw-r--r-- | include/gst/net/gstnettimeprovider.h | 79 | ||||
-rw-r--r-- | include/gst/net/gstnetutils.h | 37 | ||||
-rw-r--r-- | include/gst/net/gstptpclock.h | 161 | ||||
-rw-r--r-- | include/gst/net/net-prelude.h | 35 | ||||
-rw-r--r-- | include/gst/net/net.h | 36 |
10 files changed, 698 insertions, 0 deletions
diff --git a/include/gst/net/gstnet.h b/include/gst/net/gstnet.h new file mode 100644 index 0000000000..28173809c2 --- /dev/null +++ b/include/gst/net/gstnet.h @@ -0,0 +1,31 @@ +/* GStreamer + * Copyright (C) 2005 Andy Wingo <wingo@pobox.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + + +#ifndef __GST_NET_H__ +#define __GST_NET_H__ + +#include <gst/net/net-prelude.h> + +#include <gst/net/gstnetaddressmeta.h> +#include <gst/net/gstnetclientclock.h> +#include <gst/net/gstnettimepacket.h> +#include <gst/net/gstnettimeprovider.h> + +#endif /* __GST_NET_H__ */ diff --git a/include/gst/net/gstnetaddressmeta.h b/include/gst/net/gstnetaddressmeta.h new file mode 100644 index 0000000000..e949b3117e --- /dev/null +++ b/include/gst/net/gstnetaddressmeta.h @@ -0,0 +1,63 @@ +/* GStreamer + * Copyright (C) <2011> Wim Taymans <wim.taymans@gmail.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#ifndef __GST_NET_ADDRESS_META_H__ +#define __GST_NET_ADDRESS_META_H__ + +#include <gst/gst.h> +#include <gio/gio.h> +#include <gst/net/net-prelude.h> + +G_BEGIN_DECLS + +typedef struct _GstNetAddressMeta GstNetAddressMeta; + +/** + * GstNetAddressMeta: + * @meta: the parent type + * @addr: a #GSocketAddress stored as metadata + * + * Buffer metadata for network addresses. + */ +struct _GstNetAddressMeta { + GstMeta meta; + + GSocketAddress *addr; +}; + +GST_NET_API +GType gst_net_address_meta_api_get_type (void); +#define GST_NET_ADDRESS_META_API_TYPE (gst_net_address_meta_api_get_type()) + +/* implementation */ + +GST_NET_API +const GstMetaInfo *gst_net_address_meta_get_info (void); +#define GST_NET_ADDRESS_META_INFO (gst_net_address_meta_get_info()) + +GST_NET_API +GstNetAddressMeta * gst_buffer_add_net_address_meta (GstBuffer *buffer, + GSocketAddress *addr); +GST_NET_API +GstNetAddressMeta * gst_buffer_get_net_address_meta (GstBuffer *buffer); + +G_END_DECLS + +#endif /* __GST_NET_ADDRESS_META_H__ */ + diff --git a/include/gst/net/gstnetclientclock.h b/include/gst/net/gstnetclientclock.h new file mode 100644 index 0000000000..506270c7d5 --- /dev/null +++ b/include/gst/net/gstnetclientclock.h @@ -0,0 +1,106 @@ +/* GStreamer + * Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu> + * 2005 Wim Taymans <wim@fluendo.com> + * 2005 Andy Wingo <wingo@pobox.com> + * Copyright (C) 2012 Collabora Ltd. <tim.muller@collabora.co.uk> + * + * gstnetclientclock.h: clock that synchronizes itself to a time provider over + * the network + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + + +#ifndef __GST_NET_CLIENT_CLOCK_H__ +#define __GST_NET_CLIENT_CLOCK_H__ + +#include <gst/gst.h> +#include <gst/gstsystemclock.h> +#include <gst/net/net-prelude.h> + +G_BEGIN_DECLS + +#define GST_TYPE_NET_CLIENT_CLOCK \ + (gst_net_client_clock_get_type()) +#define GST_NET_CLIENT_CLOCK(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_NET_CLIENT_CLOCK,GstNetClientClock)) +#define GST_NET_CLIENT_CLOCK_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_NET_CLIENT_CLOCK,GstNetClientClockClass)) +#define GST_IS_NET_CLIENT_CLOCK(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_NET_CLIENT_CLOCK)) +#define GST_IS_NET_CLIENT_CLOCK_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_NET_CLIENT_CLOCK)) + +typedef struct _GstNetClientClock GstNetClientClock; +typedef struct _GstNetClientClockClass GstNetClientClockClass; +typedef struct _GstNetClientClockPrivate GstNetClientClockPrivate; + +/** + * GstNetClientClock: + * + * Opaque #GstNetClientClock structure. + */ +struct _GstNetClientClock { + GstSystemClock clock; + + /*< private >*/ + GstNetClientClockPrivate *priv; + + gpointer _gst_reserved[GST_PADDING]; +}; + +struct _GstNetClientClockClass { + GstSystemClockClass parent_class; + + /*< private >*/ + gpointer _gst_reserved[GST_PADDING]; +}; + +GST_NET_API +GType gst_net_client_clock_get_type (void); + +GST_NET_API +GstClock* gst_net_client_clock_new (const gchar *name, const gchar *remote_address, + gint remote_port, GstClockTime base_time); + +#define GST_TYPE_NTP_CLOCK \ + (gst_ntp_clock_get_type()) +#define GST_NTP_CLOCK(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_NTP_CLOCK,GstNtpClock)) +#define GST_NTP_CLOCK_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_NTP_CLOCK,GstNtpClockClass)) +#define GST_IS_NTP_CLOCK(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_NTP_CLOCK)) +#define GST_IS_NTP_CLOCK_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_NTP_CLOCK)) + +typedef struct _GstNetClientClock GstNtpClock; +typedef struct _GstNetClientClockClass GstNtpClockClass; + +GST_NET_API +GType gst_ntp_clock_get_type (void); + +GST_NET_API +GstClock* gst_ntp_clock_new (const gchar *name, const gchar *remote_address, + gint remote_port, GstClockTime base_time); + +G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstNetClientClock, gst_object_unref) + +G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstNtpClock, gst_object_unref) + +G_END_DECLS + +#endif /* __GST_NET_CLIENT_CLOCK_H__ */ diff --git a/include/gst/net/gstnetcontrolmessagemeta.h b/include/gst/net/gstnetcontrolmessagemeta.h new file mode 100644 index 0000000000..b51b87683c --- /dev/null +++ b/include/gst/net/gstnetcontrolmessagemeta.h @@ -0,0 +1,69 @@ +/* GStreamer + * Copyright (C) <2014> William Manley <will@williammanley.net> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#ifndef __GST_NET_CONTROL_MESSAGE_META_H__ +#define __GST_NET_CONTROL_MESSAGE_META_H__ + +#include <gst/gst.h> +#include <gio/gio.h> +#include <gst/net/net-prelude.h> + +G_BEGIN_DECLS + +typedef struct _GstNetControlMessageMeta GstNetControlMessageMeta; + +/** + * GstNetControlMessageMeta: + * @meta: the parent type + * @message: a #GSocketControlMessage stored as metadata + * + * Buffer metadata for GSocket control messages, AKA ancillary data attached to + * data sent across a socket. + */ +struct _GstNetControlMessageMeta { + GstMeta meta; + + GSocketControlMessage *message; +}; + +GST_NET_API +GType gst_net_control_message_meta_api_get_type (void); + +#define GST_NET_CONTROL_MESSAGE_META_API_TYPE \ + (gst_net_control_message_meta_api_get_type()) + +#define gst_buffer_get_net_control_message_meta(b) ((GstNetControlMessageMeta*)\ + gst_buffer_get_meta((b),GST_NET_CONTROL_MESSAGE_META_API_TYPE)) + +/* implementation */ + +GST_NET_API +const GstMetaInfo *gst_net_control_message_meta_get_info (void); + +#define GST_NET_CONTROL_MESSAGE_META_INFO \ + (gst_net_control_message_meta_get_info()) + +GST_NET_API +GstNetControlMessageMeta * gst_buffer_add_net_control_message_meta (GstBuffer * buffer, + GSocketControlMessage * message); + +G_END_DECLS + +#endif /* __GST_NET_CONTROL_MESSAGE_META_H__ */ + diff --git a/include/gst/net/gstnettimepacket.h b/include/gst/net/gstnettimepacket.h new file mode 100644 index 0000000000..a8f2f661bd --- /dev/null +++ b/include/gst/net/gstnettimepacket.h @@ -0,0 +1,81 @@ +/* GStreamer + * Copyright (C) 2005 Andy Wingo <wingo@pobox.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + + +#ifndef __GST_NET_TIME_PACKET_H__ +#define __GST_NET_TIME_PACKET_H__ + +#include <gst/gst.h> +#include <gio/gio.h> +#include <gst/net/net-prelude.h> + +G_BEGIN_DECLS + +/** + * GST_NET_TIME_PACKET_SIZE: + * + * The size of the packets sent between network clocks. + */ +#define GST_NET_TIME_PACKET_SIZE 16 + +typedef struct _GstNetTimePacket GstNetTimePacket; + +/** + * GstNetTimePacket: + * @local_time: the local time when this packet was sent + * @remote_time: the remote time observation + * + * Content of a #GstNetTimePacket. + */ +struct _GstNetTimePacket { + GstClockTime local_time; + GstClockTime remote_time; +}; + +GST_NET_API +GType gst_net_time_packet_get_type (void); + +GST_NET_API +GstNetTimePacket* gst_net_time_packet_new (const guint8 *buffer); + +GST_NET_API +GstNetTimePacket* gst_net_time_packet_copy (const GstNetTimePacket *packet); + +GST_NET_API +void gst_net_time_packet_free (GstNetTimePacket *packet); + +GST_NET_API +guint8* gst_net_time_packet_serialize (const GstNetTimePacket *packet); + +GST_NET_API +GstNetTimePacket* gst_net_time_packet_receive (GSocket * socket, + GSocketAddress ** src_address, + GError ** error); +GST_NET_API +gboolean gst_net_time_packet_send (const GstNetTimePacket * packet, + GSocket * socket, + GSocketAddress * dest_address, + GError ** error); + +G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstNetTimePacket, gst_net_time_packet_free) + +G_END_DECLS + + +#endif /* __GST_NET_TIME_PACKET_H__ */ diff --git a/include/gst/net/gstnettimeprovider.h b/include/gst/net/gstnettimeprovider.h new file mode 100644 index 0000000000..40eeef318d --- /dev/null +++ b/include/gst/net/gstnettimeprovider.h @@ -0,0 +1,79 @@ +/* GStreamer + * Copyright (C) 2005 Andy Wingo <wingo@pobox.com> + * 2006 Joni Valtanen <joni.valtanen@movial.fi> + * Copyright (C) 2012 Collabora Ltd. <tim.muller@collabora.co.uk> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + + +#ifndef __GST_NET_TIME_PROVIDER_H__ +#define __GST_NET_TIME_PROVIDER_H__ + +#include <gst/gst.h> +#include <gst/net/net-prelude.h> + +G_BEGIN_DECLS + +#define GST_TYPE_NET_TIME_PROVIDER \ + (gst_net_time_provider_get_type()) +#define GST_NET_TIME_PROVIDER(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_NET_TIME_PROVIDER,GstNetTimeProvider)) +#define GST_NET_TIME_PROVIDER_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_NET_TIME_PROVIDER,GstNetTimeProviderClass)) +#define GST_IS_NET_TIME_PROVIDER(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_NET_TIME_PROVIDER)) +#define GST_IS_NET_TIME_PROVIDER_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_NET_TIME_PROVIDER)) + +typedef struct _GstNetTimeProvider GstNetTimeProvider; +typedef struct _GstNetTimeProviderClass GstNetTimeProviderClass; +typedef struct _GstNetTimeProviderPrivate GstNetTimeProviderPrivate; + +/** + * GstNetTimeProvider: + * + * Opaque #GstNetTimeProvider structure. + */ +struct _GstNetTimeProvider { + GstObject parent; + + /*< private >*/ + GstNetTimeProviderPrivate *priv; + + gpointer _gst_reserved[GST_PADDING]; +}; + +struct _GstNetTimeProviderClass { + GstObjectClass parent_class; + + gpointer _gst_reserved[GST_PADDING]; +}; + +GST_NET_API +GType gst_net_time_provider_get_type (void); + +GST_NET_API +GstNetTimeProvider* gst_net_time_provider_new (GstClock *clock, + const gchar *address, + gint port); + +G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstNetTimeProvider, gst_object_unref) + +G_END_DECLS + + +#endif /* __GST_NET_TIME_PROVIDER_H__ */ diff --git a/include/gst/net/gstnetutils.h b/include/gst/net/gstnetutils.h new file mode 100644 index 0000000000..d2b4043be8 --- /dev/null +++ b/include/gst/net/gstnetutils.h @@ -0,0 +1,37 @@ +/* GStreamer + * Copyright (C) 2017 Sebastian Dröge <sebastian@centricular.com> + * Copyright (C) 2017 Robert Rosengren <robertr@axis.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + + +#ifndef __GST_NET_UTILS_H__ +#define __GST_NET_UTILS_H__ + +#include <glib.h> +#include <gio/gio.h> +#include <gst/net/net-prelude.h> + +G_BEGIN_DECLS + +GST_NET_API +gboolean gst_net_utils_set_socket_tos (GSocket * socket, + gint qos_dscp); + +G_END_DECLS + +#endif /* __GST_NET_UTILS_H__ */ diff --git a/include/gst/net/gstptpclock.h b/include/gst/net/gstptpclock.h new file mode 100644 index 0000000000..3182431b9f --- /dev/null +++ b/include/gst/net/gstptpclock.h @@ -0,0 +1,161 @@ +/* GStreamer + * Copyright (C) 2015 Sebastian Dröge <sebastian@centricular.com> + * + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#ifndef __GST_PTP_CLOCK_H__ +#define __GST_PTP_CLOCK_H__ + +#include <gst/gst.h> +#include <gst/gstsystemclock.h> +#include <gst/net/net-prelude.h> + +G_BEGIN_DECLS + +#define GST_TYPE_PTP_CLOCK \ + (gst_ptp_clock_get_type()) +#define GST_PTP_CLOCK(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_PTP_CLOCK,GstPtpClock)) +#define GST_PTP_CLOCK_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_PTP_CLOCK,GstPtpClockClass)) +#define GST_IS_PTP_CLOCK(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_PTP_CLOCK)) +#define GST_IS_PTP_CLOCK_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_PTP_CLOCK)) + +typedef struct _GstPtpClock GstPtpClock; +typedef struct _GstPtpClockClass GstPtpClockClass; +typedef struct _GstPtpClockPrivate GstPtpClockPrivate; + +/** + * GstPtpClock: + * + * Opaque #GstPtpClock structure. + */ +struct _GstPtpClock { + GstSystemClock clock; + + /*< private >*/ + GstPtpClockPrivate *priv; + + gpointer _gst_reserved[GST_PADDING]; +}; + +/** + * GstPtpClockClass: + * @parent_class: parented to #GstSystemClockClass + * + * Opaque #GstPtpClockClass structure. + */ +struct _GstPtpClockClass { + GstSystemClockClass parent_class; + + /*< private >*/ + gpointer _gst_reserved[GST_PADDING]; +}; + +/** + * GST_PTP_CLOCK_ID_NONE: + * PTP clock identification that can be passed to gst_ptp_init() to + * automatically select one based on the MAC address of interfaces + */ +#define GST_PTP_CLOCK_ID_NONE ((guint64) -1) + +GST_NET_API +GType gst_ptp_clock_get_type (void); + +GST_NET_API +gboolean gst_ptp_is_supported (void); + +GST_NET_API +gboolean gst_ptp_is_initialized (void); + +GST_NET_API +gboolean gst_ptp_init (guint64 clock_id, + gchar ** interfaces); +GST_NET_API +void gst_ptp_deinit (void); + +#define GST_PTP_STATISTICS_NEW_DOMAIN_FOUND "GstPtpStatisticsNewDomainFound" +#define GST_PTP_STATISTICS_BEST_MASTER_CLOCK_SELECTED "GstPtpStatisticsBestMasterClockSelected" +#define GST_PTP_STATISTICS_PATH_DELAY_MEASURED "GstPtpStatisticsPathDelayMeasured" +#define GST_PTP_STATISTICS_TIME_UPDATED "GstPtpStatisticsTimeUpdated" + +/** + * GstPtpStatisticsCallback: + * @domain: PTP domain identifier + * @stats: New statistics + * @user_data: Data passed to gst_ptp_statistics_callback_add() + * + * The statistics can be the following structures: + * + * GST_PTP_STATISTICS_NEW_DOMAIN_FOUND: + * "domain" G_TYPE_UINT The domain identifier of the domain + * "clock" GST_TYPE_CLOCK The internal clock that is slaved to the + * PTP domain + * + * GST_PTP_STATISTICS_BEST_MASTER_CLOCK_SELECTED: + * "domain" G_TYPE_UINT The domain identifier of the domain + * "master-clock-id" G_TYPE_UINT64 PTP clock identifier of the selected master + * clock + * "master-clock-port" G_TYPE_UINT PTP port number of the selected master clock + * "grandmaster-clock-id" G_TYPE_UINT64 PTP clock identifier of the grandmaster clock + * + * GST_PTP_STATISTICS_PATH_DELAY_MEASURED: + * "domain" G_TYPE_UINT The domain identifier of the domain + * "mean-path-delay-avg" GST_TYPE_CLOCK_TIME Average mean path delay + * "mean-path-delay" GST_TYPE_CLOCK_TIME Latest mean path delay + * "delay-request-delay" GST_TYPE_CLOCK_TIME Delay of DELAY_REQ / DELAY_RESP messages + * + * GST_PTP_STATISTICS_TIME_UPDATED: + * "domain" G_TYPE_UINT The domain identifier of the domain + * "mean-path-delay-avg" GST_TYPE_CLOCK_TIME Average mean path delay + * "local-time" GST_TYPE_CLOCK_TIME Local time that corresponds to ptp-time + * "ptp-time" GST_TYPE_CLOCK_TIME Newly measured PTP time at local-time + * "estimated-ptp-time" GST_TYPE_CLOCK_TIME Estimated PTP time based on previous measurements + * "discontinuity" G_TYPE_INT64 Difference between estimated and measured PTP time + * "synced" G_TYPE_BOOLEAN Currently synced to the remote clock + * "r-squared" G_TYPE_DOUBLE R² of clock estimation regression + * "internal-time" GST_TYPE_CLOCK_TIME Internal time clock parameter + * "external-time" GST_TYPE_CLOCK_TIME External time clock parameter + * "rate-num" G_TYPE_UINT64 Internal/external rate numerator + * "rate-den" G_TYPE_UINT64 Internal/external rate denominator + * "rate" G_TYPE_DOUBLE Internal/external rate + * + * If %FALSE is returned, the callback is removed and never called again. + * + */ +typedef gboolean (*GstPtpStatisticsCallback) (guint8 domain, + const GstStructure * stats, + gpointer user_data); +GST_NET_API +gulong gst_ptp_statistics_callback_add (GstPtpStatisticsCallback callback, + gpointer user_data, GDestroyNotify destroy_data); +GST_NET_API +void gst_ptp_statistics_callback_remove (gulong id); + +GST_NET_API +GstClock* gst_ptp_clock_new (const gchar *name, + guint domain); + +G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstPtpClock, gst_object_unref) + +G_END_DECLS + +#endif /* __GST_PTP_CLOCK_H__ */ + diff --git a/include/gst/net/net-prelude.h b/include/gst/net/net-prelude.h new file mode 100644 index 0000000000..47224fe048 --- /dev/null +++ b/include/gst/net/net-prelude.h @@ -0,0 +1,35 @@ +/* GStreamer Net Library + * Copyright (C) 2018 GStreamer developers + * + * net-prelude.h: prelude include header for gst-net library + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#ifndef __GST_NET_PRELUDE_H__ +#define __GST_NET_PRELUDE_H__ + +#include <gst/gst.h> + +#ifndef GST_NET_API +#ifdef BUILDING_GST_NET +#define GST_NET_API GST_API_EXPORT /* from config.h */ +#else +#define GST_NET_API GST_API_IMPORT +#endif +#endif + +#endif /* __GST_NET_PRELUDE_H__ */ diff --git a/include/gst/net/net.h b/include/gst/net/net.h new file mode 100644 index 0000000000..4a11a94f23 --- /dev/null +++ b/include/gst/net/net.h @@ -0,0 +1,36 @@ +/* GStreamer + * Copyright (C) 2012 GStreamer developers + * + * net.h: single include header for gst-net library + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#ifndef __GST_NET__H__ +#define __GST_NET__H__ + +#include <gst/net/net-prelude.h> + +#include <gst/net/gstnet.h> +#include <gst/net/gstnetaddressmeta.h> +#include <gst/net/gstnetcontrolmessagemeta.h> +#include <gst/net/gstnetclientclock.h> +#include <gst/net/gstnettimepacket.h> +#include <gst/net/gstnettimeprovider.h> +#include <gst/net/gstnetutils.h> +#include <gst/net/gstptpclock.h> + +#endif /* __GST_NET__H__ */ |