mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-04 14:38:48 +00:00
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:
parent
3faab6f017
commit
3b5933eadd
9 changed files with 34 additions and 8 deletions
|
@ -83,6 +83,7 @@
|
||||||
<xi:include href="xml/gstnettimepacket.xml" />
|
<xi:include href="xml/gstnettimepacket.xml" />
|
||||||
<xi:include href="xml/gstnettimeprovider.xml" />
|
<xi:include href="xml/gstnettimeprovider.xml" />
|
||||||
<xi:include href="xml/gstptpclock.xml" />
|
<xi:include href="xml/gstptpclock.xml" />
|
||||||
|
<xi:include href="xml/gstnetutils.xml" />
|
||||||
</chapter>
|
</chapter>
|
||||||
|
|
||||||
<chapter id="gstreamer-check">
|
<chapter id="gstreamer-check">
|
||||||
|
|
|
@ -1116,6 +1116,14 @@ gst_net_time_provider_get_type
|
||||||
</SECTION>
|
</SECTION>
|
||||||
|
|
||||||
|
|
||||||
|
<SECTION>
|
||||||
|
<FILE>gstnetutils</FILE>
|
||||||
|
<TITLE>GstNetUtils</TITLE>
|
||||||
|
<INCLUDE>gst/net/net.h</INCLUDE>
|
||||||
|
gst_net_utils_set_socket_tos
|
||||||
|
</SECTION>
|
||||||
|
|
||||||
|
|
||||||
<SECTION>
|
<SECTION>
|
||||||
<FILE>gstptpclock</FILE>
|
<FILE>gstptpclock</FILE>
|
||||||
<TITLE>GstPtpClock</TITLE>
|
<TITLE>GstPtpClock</TITLE>
|
||||||
|
|
|
@ -10,6 +10,7 @@ libgstnet_@GST_API_VERSION@_include_HEADERS = \
|
||||||
gstnetcontrolmessagemeta.h \
|
gstnetcontrolmessagemeta.h \
|
||||||
gstnettimepacket.h \
|
gstnettimepacket.h \
|
||||||
gstnettimeprovider.h \
|
gstnettimeprovider.h \
|
||||||
|
gstnetutils.h \
|
||||||
gstptpclock.h
|
gstptpclock.h
|
||||||
|
|
||||||
libgstnet_@GST_API_VERSION@_la_SOURCES = \
|
libgstnet_@GST_API_VERSION@_la_SOURCES = \
|
||||||
|
@ -22,7 +23,7 @@ libgstnet_@GST_API_VERSION@_la_SOURCES = \
|
||||||
gstntppacket.c \
|
gstntppacket.c \
|
||||||
gstnetutils.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_CFLAGS = $(GST_OBJ_CFLAGS) $(GIO_CFLAGS) -DBUILDING_GST_NET
|
||||||
libgstnet_@GST_API_VERSION@_la_LIBADD = $(GST_OBJ_LIBS) $(GIO_LIBS) \
|
libgstnet_@GST_API_VERSION@_la_LIBADD = $(GST_OBJ_LIBS) $(GIO_LIBS) \
|
||||||
|
|
|
@ -677,7 +677,7 @@ gst_net_client_internal_clock_thread (gpointer data)
|
||||||
/* before next sending check if need to change QoS */
|
/* before next sending check if need to change QoS */
|
||||||
new_qos_dscp = self->qos_dscp;
|
new_qos_dscp = self->qos_dscp;
|
||||||
if (cur_qos_dscp != new_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);
|
GST_DEBUG_OBJECT (self, "changed QoS DSCP to: %d", new_qos_dscp);
|
||||||
cur_qos_dscp = new_qos_dscp;
|
cur_qos_dscp = new_qos_dscp;
|
||||||
}
|
}
|
||||||
|
|
|
@ -214,7 +214,7 @@ gst_net_time_provider_thread (gpointer data)
|
||||||
/* before next sending check if need to change QoS */
|
/* before next sending check if need to change QoS */
|
||||||
new_qos_dscp = self->priv->qos_dscp;
|
new_qos_dscp = self->priv->qos_dscp;
|
||||||
if (cur_qos_dscp != new_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);
|
GST_DEBUG_OBJECT (self, "changed QoS DSCP to: %d", new_qos_dscp);
|
||||||
cur_qos_dscp = new_qos_dscp;
|
cur_qos_dscp = new_qos_dscp;
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,6 +17,17 @@
|
||||||
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
||||||
* Boston, MA 02110-1301, USA.
|
* 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
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
@ -35,16 +46,18 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gst_net_time_packet_util_set_dscp:
|
* gst_net_utils_set_socket_tos:
|
||||||
* @socket: Socket to configure
|
* @socket: Socket to configure
|
||||||
* @qos_dscp: QoS DSCP value
|
* @qos_dscp: QoS DSCP value
|
||||||
*
|
*
|
||||||
* Configures IP_TOS value of socket, i.e. sets QoS DSCP.
|
* Configures IP_TOS value of socket, i.e. sets QoS DSCP.
|
||||||
*
|
*
|
||||||
* Returns: TRUE if successful, FALSE in case an error occurred.
|
* Returns: TRUE if successful, FALSE in case an error occurred.
|
||||||
|
*
|
||||||
|
* Since: 1.18
|
||||||
*/
|
*/
|
||||||
gboolean
|
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;
|
gboolean ret = FALSE;
|
||||||
|
|
||||||
|
|
|
@ -24,11 +24,12 @@
|
||||||
|
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
#include <gio/gio.h>
|
#include <gio/gio.h>
|
||||||
|
#include <gst/net/net-prelude.h>
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
GST_NET_API
|
||||||
gboolean gst_net_utils_set_socket_dscp (GSocket * socket,
|
gboolean gst_net_utils_set_socket_tos (GSocket * socket,
|
||||||
gint qos_dscp);
|
gint qos_dscp);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
|
@ -16,6 +16,7 @@ gst_net_headers = [
|
||||||
'gstnetcontrolmessagemeta.h',
|
'gstnetcontrolmessagemeta.h',
|
||||||
'gstnettimepacket.h',
|
'gstnettimepacket.h',
|
||||||
'gstnettimeprovider.h',
|
'gstnettimeprovider.h',
|
||||||
|
'gstnetutils.h',
|
||||||
'gstptpclock.h',
|
'gstptpclock.h',
|
||||||
'net-prelude.h',
|
'net-prelude.h',
|
||||||
'net.h',
|
'net.h',
|
||||||
|
|
|
@ -30,6 +30,7 @@
|
||||||
#include <gst/net/gstnetclientclock.h>
|
#include <gst/net/gstnetclientclock.h>
|
||||||
#include <gst/net/gstnettimepacket.h>
|
#include <gst/net/gstnettimepacket.h>
|
||||||
#include <gst/net/gstnettimeprovider.h>
|
#include <gst/net/gstnettimeprovider.h>
|
||||||
|
#include <gst/net/gstnetutils.h>
|
||||||
#include <gst/net/gstptpclock.h>
|
#include <gst/net/gstptpclock.h>
|
||||||
|
|
||||||
#endif /* __GST_NET__H__ */
|
#endif /* __GST_NET__H__ */
|
||||||
|
|
Loading…
Reference in a new issue