• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
GST_START_TEST(test_uri_to_properties)22 GST_START_TEST (test_uri_to_properties)
23 {
24   GstElement *rtpsrc;
25   guint latency, ttl, ttl_mc;
26 
27   rtpsrc = gst_element_factory_make ("rtpsrc", NULL);
28 
29   /* Sets properties to non-default values (make sure this stays in sync) */
30   g_object_set (rtpsrc, "uri", "rtp://1.230.1.2:1234?"
31       "latency=300" "&ttl=8" "&ttl-mc=9" "&multicast-iface=dummy", NULL);
32 
33   g_object_get (rtpsrc,
34       "latency", &latency, "ttl-mc", &ttl_mc, "ttl", &ttl, NULL);
35 
36   /* Make sure these values are in sync with the one from the URI. */
37   g_assert_cmpuint (latency, ==, 300);
38   g_assert_cmpint (ttl, ==, 8);
39   g_assert_cmpint (ttl_mc, ==, 9);
40 
41   gst_object_unref (rtpsrc);
42 }
43 
44 GST_END_TEST;
45 
46 static Suite *
rtpsrc_suite(void)47 rtpsrc_suite (void)
48 {
49   Suite *s = suite_create ("rtpsrc");
50   TCase *tc_chain = tcase_create ("general");
51 
52   suite_add_tcase (s, tc_chain);
53   tcase_add_test (tc_chain, test_uri_to_properties);
54 
55   return s;
56 }
57 
58 GST_CHECK_MAIN (rtpsrc);
59