rtpmanagerbad: add RTP streaming elements
[platform/upstream/gstreamer.git] / tests / check / elements / rtpsink.c
1 /* GStreamer
2  * Copyright (C) <2018> Marc Leeman <marc.leeman@gmail.com>
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Library General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library General Public
15  * License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
17  * Boston, MA 02110-1301, USA.
18  */
19
20 #include <gst/check/gstcheck.h>
21
22 GST_START_TEST (test_uri_to_properties)
23 {
24   GstElement *rtpsink;
25
26   gint ttl, ttl_mc;
27
28   rtpsink = gst_element_factory_make ("rtpsink", NULL);
29
30   /* Sets properties to non-default values (make sure this stays in sync) */
31   g_object_set (rtpsink, "uri", "rtp://1.230.1.2?" "ttl=8" "&ttl-mc=9", NULL);
32
33   g_object_get (rtpsink, "ttl", &ttl, "ttl_mc", &ttl_mc, NULL);
34
35   /* Make sure these values are in sync with the one from the URI. */
36   g_assert_cmpint (ttl, ==, 8);
37   g_assert_cmpint (ttl_mc, ==, 9);
38
39   gst_object_unref (rtpsink);
40 }
41
42 GST_END_TEST;
43
44 static Suite *
45 rtpsink_suite (void)
46 {
47   Suite *s = suite_create ("rtpsink");
48   TCase *tc_chain = tcase_create ("general");
49
50   suite_add_tcase (s, tc_chain);
51   tcase_add_test (tc_chain, test_uri_to_properties);
52
53   return s;
54 }
55
56 GST_CHECK_MAIN (rtpsink);