static SessionHarness * session_harness_new (void) { SessionHarness *h = g_new0 (SessionHarness, 1); h->caps = generate_caps (); h->testclock = GST_TEST_CLOCK_CAST (gst_test_clock_new ()); gst_system_clock_set_default (GST_CLOCK_CAST (h->testclock)); h->session = gst_element_factory_make ("rtpsession", NULL); gst_element_set_clock (h->session, GST_CLOCK_CAST (h->testclock)); h->send_rtp_h = gst_harness_new_with_element (h->session, "send_rtp_sink", "send_rtp_src"); gst_harness_set_src_caps (h->send_rtp_h, gst_caps_copy (h->caps)); h->recv_rtp_h = gst_harness_new_with_element (h->session, "recv_rtp_sink", "recv_rtp_src"); gst_harness_set_src_caps (h->recv_rtp_h, gst_caps_copy (h->caps)); h->rtcp_h = gst_harness_new_with_element (h->session, "recv_rtcp_sink", "send_rtcp_src"); gst_harness_set_src_caps_str (h->rtcp_h, "application/x-rtcp"); g_signal_connect (h->session, "request-pt-map", (GCallback) _pt_map_requested, h); g_object_get (h->session, "internal-session", &h->internal_session, NULL); return h; }
static void create_destroy_element_harness (gpointer data, gpointer user_data) { GstElement *element = user_data; GstHarness *h = gst_harness_new_with_element (element, NULL, NULL); gst_harness_teardown (h); }
static void new_ssrc_pad_found (GstElement * element, guint ssrc, GstPad * pad, GSList ** src_h) { GstHarness *h; (void) ssrc; h = gst_harness_new_with_element (element, NULL, NULL); gst_harness_add_element_src_pad (h, pad); *src_h = g_slist_prepend (*src_h, h); }