Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/GStreamer/gst-plugins-good.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJohn Bassett <john.bassett@pexip.com>2017-01-18 17:32:03 +0300
committerHavard Graff <havard@pexip.com>2020-02-11 17:12:07 +0300
commit16d750bc01fc6633349a888d4490f8a382b8717f (patch)
treeb6eb8d2bab2e660e7af7244ac81e627560db3db6 /tests
parent5800950a2d049e33589f0f4e2e7b80fb3e442fba (diff)
rtpssrcdemux: Handle RTCP APP packets
Fix crash when processing RTCP APP packets.
Diffstat (limited to 'tests')
-rw-r--r--tests/check/elements/rtpssrcdemux.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/tests/check/elements/rtpssrcdemux.c b/tests/check/elements/rtpssrcdemux.c
index bb9bbc0b4..691fa4140 100644
--- a/tests/check/elements/rtpssrcdemux.c
+++ b/tests/check/elements/rtpssrcdemux.c
@@ -277,6 +277,45 @@ GST_START_TEST (test_rtpssrcdemux_max_streams)
GST_END_TEST;
+static void
+new_rtcp_ssrc_pad_found (GstElement * element, G_GNUC_UNUSED guint ssrc,
+ G_GNUC_UNUSED GstPad * rtp_pad, GSList ** src_h)
+{
+ GstHarness *h;
+ gchar *name;
+
+ name = g_strdup_printf ("rtcp_src_%u", ssrc);
+ h = gst_harness_new_with_element (element, NULL, name);
+ g_free (name);
+ *src_h = g_slist_prepend (*src_h, h);
+}
+
+GST_START_TEST (test_rtpssrcdemux_rtcp_app)
+{
+ GstHarness *h =
+ gst_harness_new_with_padnames ("rtpssrcdemux", "rtcp_sink", NULL);
+ GSList *src_h = NULL;
+ guint8 rtcp_app_pkt[] = { 0x81, 0xcc, 0x00, 0x05, 0x00, 0x00, 0x5d, 0xaf,
+ 0x20, 0x20, 0x20, 0x20, 0x21, 0x02, 0x00, 0x0a,
+ 0x00, 0x00, 0x5d, 0xaf, 0x00, 0x00, 0x16, 0x03
+ };
+
+ gst_harness_set_src_caps_str (h, "application/x-rtcp");
+ g_signal_connect (h->element,
+ "new-ssrc-pad", (GCallback) new_rtcp_ssrc_pad_found, &src_h);
+ gst_harness_play (h);
+
+ fail_unless_equals_int (GST_FLOW_OK,
+ gst_harness_push (h, gst_buffer_new_wrapped_full (0, rtcp_app_pkt,
+ sizeof rtcp_app_pkt, 0, sizeof rtcp_app_pkt, NULL, NULL)));
+
+ fail_unless_equals_int (g_slist_length (src_h), 1);
+ g_slist_free_full (src_h, (GDestroyNotify) gst_harness_teardown);
+ gst_harness_teardown (h);
+}
+
+GST_END_TEST;
+
GST_START_TEST (test_rtpssrcdemux_invalid_rtp)
{
GstHarness *h = gst_harness_new_with_padnames ("rtpssrcdemux", "sink", NULL);
@@ -316,6 +355,8 @@ GST_START_TEST (test_rtpssrcdemux_invalid_rtcp)
GST_END_TEST;
+
+
static Suite *
rtpssrcdemux_suite (void)
{
@@ -326,6 +367,7 @@ rtpssrcdemux_suite (void)
tcase_add_test (tc_chain, test_event_forwarding);
tcase_add_test (tc_chain, test_oob_event_locking);
tcase_add_test (tc_chain, test_rtpssrcdemux_max_streams);
+ tcase_add_test (tc_chain, test_rtpssrcdemux_rtcp_app);
tcase_add_test (tc_chain, test_rtpssrcdemux_invalid_rtp);
tcase_add_test (tc_chain, test_rtpssrcdemux_invalid_rtcp);