Commit af741f07 authored by Nicolas Dufresne's avatar Nicolas Dufresne Committed by GStreamer Merge Bot

rist: Use g_signal_connect_object()

rtpbin can still emit signals when it is being disposed, and while
rtpbin is inside ristsrc/ristsink it can still live longer.

So we either have disconnect all signals at some point, or let GObject
take care of that automatically.

Related to !1412

Part-of: <!1413>
parent 7346e7c1
Pipeline #172886 waiting for manual action with stages
in 1 minute and 5 seconds
......@@ -452,9 +452,10 @@ gst_rist_sink_on_new_sender_ssrc (GstRistSink * sink, guint session_id,
if (ssrc & 1) {
g_object_set (source, "disable-rtcp", TRUE, NULL);
} else {
g_signal_connect (session, "on-app-rtcp", (GCallback) on_app_rtcp, sink);
g_signal_connect (session, "on-receiving-rtcp",
(GCallback) on_receiving_rtcp, sink);
g_signal_connect_object (session, "on-app-rtcp",
(GCallback) on_app_rtcp, sink, 0);
g_signal_connect_object (session, "on-receiving-rtcp",
(GCallback) on_receiving_rtcp, sink, 0);
}
g_object_unref (source);
......@@ -585,14 +586,14 @@ gst_rist_sink_init (GstRistSink * sink)
"sdes", sdes, NULL);
gst_structure_free (sdes);
g_signal_connect_swapped (sink->rtpbin, "request-pt-map",
G_CALLBACK (gst_rist_sink_request_pt_map), sink);
g_signal_connect_swapped (sink->rtpbin, "request-aux-sender",
G_CALLBACK (gst_rist_sink_request_aux_sender), sink);
g_signal_connect_swapped (sink->rtpbin, "on-new-sender-ssrc",
G_CALLBACK (gst_rist_sink_on_new_sender_ssrc), sink);
g_signal_connect_swapped (sink->rtpbin, "on-new-ssrc",
G_CALLBACK (gst_rist_sink_on_new_receiver_ssrc), sink);
g_signal_connect_object (sink->rtpbin, "request-pt-map",
G_CALLBACK (gst_rist_sink_request_pt_map), sink, G_CONNECT_SWAPPED);
g_signal_connect_object (sink->rtpbin, "request-aux-sender",
G_CALLBACK (gst_rist_sink_request_aux_sender), sink, G_CONNECT_SWAPPED);
g_signal_connect_object (sink->rtpbin, "on-new-sender-ssrc",
G_CALLBACK (gst_rist_sink_on_new_sender_ssrc), sink, G_CONNECT_SWAPPED);
g_signal_connect_object (sink->rtpbin, "on-new-ssrc",
G_CALLBACK (gst_rist_sink_on_new_receiver_ssrc), sink, G_CONNECT_SWAPPED);
sink->rtxbin = gst_bin_new ("rist_send_rtxbin");
g_object_ref_sink (sink->rtxbin);
......
......@@ -434,10 +434,10 @@ gst_rist_src_init (GstRistSrc * src)
"sdes", sdes, NULL);
gst_structure_free (sdes);
g_signal_connect_swapped (src->rtpbin, "request-pt-map",
G_CALLBACK (gst_rist_src_request_pt_map), src);
g_signal_connect_swapped (src->rtpbin, "request-aux-receiver",
G_CALLBACK (gst_rist_src_request_aux_receiver), src);
g_signal_connect_object (src->rtpbin, "request-pt-map",
G_CALLBACK (gst_rist_src_request_pt_map), src, G_CONNECT_SWAPPED);
g_signal_connect_object (src->rtpbin, "request-aux-receiver",
G_CALLBACK (gst_rist_src_request_aux_receiver), src, G_CONNECT_SWAPPED);
src->rtxbin = gst_bin_new ("rist_recv_rtxbin");
g_object_ref_sink (src->rtxbin);
......@@ -454,12 +454,12 @@ gst_rist_src_init (GstRistSrc * src)
gst_object_unref (pad);
gst_element_add_pad (src->rtxbin, gpad);
g_signal_connect_swapped (src->rtpbin, "pad-added",
G_CALLBACK (gst_rist_src_pad_added), src);
g_signal_connect_swapped (src->rtpbin, "on-new-ssrc",
G_CALLBACK (gst_rist_src_on_new_ssrc), src);
g_signal_connect_swapped (src->rtpbin, "new-jitterbuffer",
G_CALLBACK (gst_rist_src_new_jitterbuffer), src);
g_signal_connect_object (src->rtpbin, "pad-added",
G_CALLBACK (gst_rist_src_pad_added), src, G_CONNECT_SWAPPED);
g_signal_connect_object (src->rtpbin, "on-new-ssrc",
G_CALLBACK (gst_rist_src_on_new_ssrc), src, G_CONNECT_SWAPPED);
g_signal_connect_object (src->rtpbin, "new-jitterbuffer",
G_CALLBACK (gst_rist_src_new_jitterbuffer), src, G_CONNECT_SWAPPED);
bond = gst_rist_src_add_bond (src);
if (!bond)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment