From 3b5933eadd281b59633a48059f77ebbf6f964b0f Mon Sep 17 00:00:00 2001 From: Robert Rosengren Date: Tue, 13 Nov 2018 13:41:53 +0100 Subject: [PATCH] netutils: make gst_net_utils_set_socket_dscp external Internal gst_net_utils_set_socket_dscp renamed and turned into external function. Similar functionality exists in e.g. multidupsink, which could instead use this one. --- docs/libs/gstreamer-libs-docs.sgml | 1 + docs/libs/gstreamer-libs-sections.txt | 8 ++++++++ libs/gst/net/Makefile.am | 3 ++- libs/gst/net/gstnetclientclock.c | 2 +- libs/gst/net/gstnettimeprovider.c | 2 +- libs/gst/net/gstnetutils.c | 17 +++++++++++++++-- libs/gst/net/gstnetutils.h | 7 ++++--- libs/gst/net/meson.build | 1 + libs/gst/net/net.h | 1 + 9 files changed, 34 insertions(+), 8 deletions(-) diff --git a/docs/libs/gstreamer-libs-docs.sgml b/docs/libs/gstreamer-libs-docs.sgml index 872e92abf7..07c3634571 100644 --- a/docs/libs/gstreamer-libs-docs.sgml +++ b/docs/libs/gstreamer-libs-docs.sgml @@ -83,6 +83,7 @@ + diff --git a/docs/libs/gstreamer-libs-sections.txt b/docs/libs/gstreamer-libs-sections.txt index fccc689b4e..3b46a76444 100644 --- a/docs/libs/gstreamer-libs-sections.txt +++ b/docs/libs/gstreamer-libs-sections.txt @@ -1116,6 +1116,14 @@ gst_net_time_provider_get_type +
+gstnetutils +GstNetUtils +gst/net/net.h +gst_net_utils_set_socket_tos +
+ +
gstptpclock GstPtpClock diff --git a/libs/gst/net/Makefile.am b/libs/gst/net/Makefile.am index c0eab7aeb8..b1eba4b37b 100644 --- a/libs/gst/net/Makefile.am +++ b/libs/gst/net/Makefile.am @@ -10,6 +10,7 @@ libgstnet_@GST_API_VERSION@_include_HEADERS = \ gstnetcontrolmessagemeta.h \ gstnettimepacket.h \ gstnettimeprovider.h \ + gstnetutils.h \ gstptpclock.h libgstnet_@GST_API_VERSION@_la_SOURCES = \ @@ -22,7 +23,7 @@ libgstnet_@GST_API_VERSION@_la_SOURCES = \ gstntppacket.c \ gstnetutils.c -noinst_HEADERS = gstptp_private.h gstntppacket.h gstnetutils.h +noinst_HEADERS = gstptp_private.h gstntppacket.h libgstnet_@GST_API_VERSION@_la_CFLAGS = $(GST_OBJ_CFLAGS) $(GIO_CFLAGS) -DBUILDING_GST_NET libgstnet_@GST_API_VERSION@_la_LIBADD = $(GST_OBJ_LIBS) $(GIO_LIBS) \ diff --git a/libs/gst/net/gstnetclientclock.c b/libs/gst/net/gstnetclientclock.c index e0a04d2953..09d011b5b6 100644 --- a/libs/gst/net/gstnetclientclock.c +++ b/libs/gst/net/gstnetclientclock.c @@ -677,7 +677,7 @@ gst_net_client_internal_clock_thread (gpointer data) /* before next sending check if need to change QoS */ new_qos_dscp = self->qos_dscp; if (cur_qos_dscp != new_qos_dscp && - gst_net_utils_set_socket_dscp (socket, new_qos_dscp)) { + gst_net_utils_set_socket_tos (socket, new_qos_dscp)) { GST_DEBUG_OBJECT (self, "changed QoS DSCP to: %d", new_qos_dscp); cur_qos_dscp = new_qos_dscp; } diff --git a/libs/gst/net/gstnettimeprovider.c b/libs/gst/net/gstnettimeprovider.c index d323bf489a..1757424330 100644 --- a/libs/gst/net/gstnettimeprovider.c +++ b/libs/gst/net/gstnettimeprovider.c @@ -214,7 +214,7 @@ gst_net_time_provider_thread (gpointer data) /* before next sending check if need to change QoS */ new_qos_dscp = self->priv->qos_dscp; if (cur_qos_dscp != new_qos_dscp && - gst_net_utils_set_socket_dscp (socket, new_qos_dscp)) { + gst_net_utils_set_socket_tos (socket, new_qos_dscp)) { GST_DEBUG_OBJECT (self, "changed QoS DSCP to: %d", new_qos_dscp); cur_qos_dscp = new_qos_dscp; } diff --git a/libs/gst/net/gstnetutils.c b/libs/gst/net/gstnetutils.c index 7ed3f7f6bc..3390e7d65d 100644 --- a/libs/gst/net/gstnetutils.c +++ b/libs/gst/net/gstnetutils.c @@ -17,6 +17,17 @@ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301, USA. */ +/** + * SECTION:gstnetutils + * @title: GstNetUtils + * @short_description: Network utility functions. + * + * GstNetUtils gathers network utility functions, enabling use for all + * gstreamer plugins. + * + * Since: 1.18 + * + */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -35,16 +46,18 @@ #endif /** - * gst_net_time_packet_util_set_dscp: + * gst_net_utils_set_socket_tos: * @socket: Socket to configure * @qos_dscp: QoS DSCP value * * Configures IP_TOS value of socket, i.e. sets QoS DSCP. * * Returns: TRUE if successful, FALSE in case an error occurred. + * + * Since: 1.18 */ gboolean -gst_net_utils_set_socket_dscp (GSocket * socket, gint qos_dscp) +gst_net_utils_set_socket_tos (GSocket * socket, gint qos_dscp) { gboolean ret = FALSE; diff --git a/libs/gst/net/gstnetutils.h b/libs/gst/net/gstnetutils.h index 053f187e65..d2b4043be8 100644 --- a/libs/gst/net/gstnetutils.h +++ b/libs/gst/net/gstnetutils.h @@ -24,12 +24,13 @@ #include #include +#include G_BEGIN_DECLS -G_GNUC_INTERNAL -gboolean gst_net_utils_set_socket_dscp (GSocket * socket, - gint qos_dscp); +GST_NET_API +gboolean gst_net_utils_set_socket_tos (GSocket * socket, + gint qos_dscp); G_END_DECLS diff --git a/libs/gst/net/meson.build b/libs/gst/net/meson.build index 1e631645ed..d0605a7273 100644 --- a/libs/gst/net/meson.build +++ b/libs/gst/net/meson.build @@ -16,6 +16,7 @@ gst_net_headers = [ 'gstnetcontrolmessagemeta.h', 'gstnettimepacket.h', 'gstnettimeprovider.h', + 'gstnetutils.h', 'gstptpclock.h', 'net-prelude.h', 'net.h', diff --git a/libs/gst/net/net.h b/libs/gst/net/net.h index 2575af59be..4a11a94f23 100644 --- a/libs/gst/net/net.h +++ b/libs/gst/net/net.h @@ -30,6 +30,7 @@ #include #include #include +#include #include #endif /* __GST_NET__H__ */