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.
This commit is contained in:
Robert Rosengren 2018-11-13 13:41:53 +01:00 committed by Sebastian Dröge
parent 3faab6f017
commit 3b5933eadd
9 changed files with 34 additions and 8 deletions

View file

@ -83,6 +83,7 @@
<xi:include href="xml/gstnettimepacket.xml" />
<xi:include href="xml/gstnettimeprovider.xml" />
<xi:include href="xml/gstptpclock.xml" />
<xi:include href="xml/gstnetutils.xml" />
</chapter>
<chapter id="gstreamer-check">

View file

@ -1116,6 +1116,14 @@ gst_net_time_provider_get_type
</SECTION>
<SECTION>
<FILE>gstnetutils</FILE>
<TITLE>GstNetUtils</TITLE>
<INCLUDE>gst/net/net.h</INCLUDE>
gst_net_utils_set_socket_tos
</SECTION>
<SECTION>
<FILE>gstptpclock</FILE>
<TITLE>GstPtpClock</TITLE>

View file

@ -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) \

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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;

View file

@ -24,11 +24,12 @@
#include <glib.h>
#include <gio/gio.h>
#include <gst/net/net-prelude.h>
G_BEGIN_DECLS
G_GNUC_INTERNAL
gboolean gst_net_utils_set_socket_dscp (GSocket * socket,
GST_NET_API
gboolean gst_net_utils_set_socket_tos (GSocket * socket,
gint qos_dscp);
G_END_DECLS

View file

@ -16,6 +16,7 @@ gst_net_headers = [
'gstnetcontrolmessagemeta.h',
'gstnettimepacket.h',
'gstnettimeprovider.h',
'gstnetutils.h',
'gstptpclock.h',
'net-prelude.h',
'net.h',

View file

@ -30,6 +30,7 @@
#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__ */