summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSebastian Rasmussen <sebrn@hotmail.com>2015-11-02 00:41:28 +0100
committerTim-Philipp Müller <tim@centricular.com>2017-12-23 12:45:11 +0100
commit0d57709d388f548910dcab8b193ef85bb0de7341 (patch)
treeb1bd9cc8eba4baf2dc835b1b7e3d0aee0088404a /tests
parent4632f33334e7fe32460ef9dcf0bc4f6a3d11762e (diff)
tests: udpsink: add check that sets QoS on IPv4/6 sockets
https://bugzilla.gnome.org/show_bug.cgi?id=757449
Diffstat (limited to 'tests')
-rw-r--r--tests/check/Makefile.am3
-rw-r--r--tests/check/elements/udpsink.c38
2 files changed, 40 insertions, 1 deletions
diff --git a/tests/check/Makefile.am b/tests/check/Makefile.am
index c17c90797..3c8ca2fc1 100644
--- a/tests/check/Makefile.am
+++ b/tests/check/Makefile.am
@@ -581,6 +581,9 @@ elements_rtpmux_LDADD = $(GST_PLUGINS_BASE_LIBS) -lgstrtp-$(GST_API_VERSION) $(G
elements_souphttpsrc_CFLAGS = $(SOUP_CFLAGS) $(AM_CFLAGS)
elements_souphttpsrc_LDADD = $(SOUP_LIBS) $(LDADD)
+elements_udpsink_CFLAGS = $(AM_CFLAGS) $(GIO_CFLAGS)
+elements_udpsink_LDADD = $(LDADD) $(GIO_LIBS)
+
elements_udpsrc_CFLAGS = $(AM_CFLAGS) $(GIO_CFLAGS)
elements_udpsrc_LDADD = $(LDADD) $(GIO_LIBS)
diff --git a/tests/check/elements/udpsink.c b/tests/check/elements/udpsink.c
index 0e938eef1..ca8b722bb 100644
--- a/tests/check/elements/udpsink.c
+++ b/tests/check/elements/udpsink.c
@@ -1,4 +1,4 @@
-/* GStreamer RTP payloader unit tests
+/* GStreamer udpsink unit tests
* Copyright (C) 2009 Axis Communications <dev-gstreamer@axis.com>
* @author Ognyan Tonchev <ognyan@axis.com>
*
@@ -19,6 +19,7 @@
*/
#include <gst/check/gstcheck.h>
#include <gst/base/gstbasesink.h>
+#include <gio/gio.h>
#include <stdlib.h>
static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src",
@@ -204,6 +205,40 @@ GST_START_TEST (test_udpsink_client_add_remove)
GST_END_TEST;
+GST_START_TEST (test_udpsink_dscp)
+{
+ GstElement *udpsink;
+ GError *error = NULL;
+ GSocket *sock4, *sock6;
+
+ sock4 =
+ g_socket_new (G_SOCKET_FAMILY_IPV4, G_SOCKET_TYPE_DATAGRAM,
+ G_SOCKET_PROTOCOL_UDP, &error);
+ fail_unless (sock4 != NULL && error == NULL);
+ sock6 =
+ g_socket_new (G_SOCKET_FAMILY_IPV6, G_SOCKET_TYPE_DATAGRAM,
+ G_SOCKET_PROTOCOL_UDP, &error);
+ fail_unless (sock6 != NULL && error == NULL);
+
+ udpsink = gst_check_setup_element ("udpsink");
+ g_signal_emit_by_name (udpsink, "add", "127.0.0.1", 5554, NULL);
+ g_object_set (udpsink, "socket", sock4, NULL);
+ g_object_set (udpsink, "socket-v6", sock6, NULL);
+
+ ASSERT_SET_STATE (udpsink, GST_STATE_READY, GST_STATE_CHANGE_SUCCESS);
+
+ g_object_set (udpsink, "qos-dscp", 0, NULL);
+ g_object_set (udpsink, "qos-dscp", 63, NULL);
+
+ ASSERT_SET_STATE (udpsink, GST_STATE_NULL, GST_STATE_CHANGE_SUCCESS);
+
+ gst_object_unref (udpsink);
+ g_object_unref (sock4);
+ g_object_unref (sock6);
+}
+
+GST_END_TEST;
+
static Suite *
udpsink_suite (void)
{
@@ -215,6 +250,7 @@ udpsink_suite (void)
tcase_add_test (tc_chain, test_udpsink);
tcase_add_test (tc_chain, test_udpsink_bufferlist);
tcase_add_test (tc_chain, test_udpsink_client_add_remove);
+ tcase_add_test (tc_chain, test_udpsink_dscp);
return s;
}