mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 02:01:12 +00:00
rtpsrc/sink: Use g_signal_connect_object()
rtpbin can still emit signals when it is being disposed, and while rtpbin is inside rtpsrc/rtpsink it can still live longer. So we either have disconnect all signals at some point, or let GObject take care of that automatically. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1412>
This commit is contained in:
parent
9c2982d22c
commit
b812d1c743
2 changed files with 16 additions and 16 deletions
|
@ -589,12 +589,12 @@ gst_rtp_sink_init (GstRtpSink * self)
|
|||
gst_bin_add (GST_BIN (self), self->rtpbin);
|
||||
|
||||
/* Add rtpbin callbacks to monitor the operation of rtpbin */
|
||||
g_signal_connect (self->rtpbin, "element-added",
|
||||
G_CALLBACK (gst_rtp_sink_rtpbin_element_added_cb), self);
|
||||
g_signal_connect (self->rtpbin, "pad-added",
|
||||
G_CALLBACK (gst_rtp_sink_rtpbin_pad_added_cb), self);
|
||||
g_signal_connect (self->rtpbin, "pad-removed",
|
||||
G_CALLBACK (gst_rtp_sink_rtpbin_pad_removed_cb), self);
|
||||
g_signal_connect_object (self->rtpbin, "element-added",
|
||||
G_CALLBACK (gst_rtp_sink_rtpbin_element_added_cb), self, 0);
|
||||
g_signal_connect_object (self->rtpbin, "pad-added",
|
||||
G_CALLBACK (gst_rtp_sink_rtpbin_pad_added_cb), self, 0);
|
||||
g_signal_connect_object (self->rtpbin, "pad-removed",
|
||||
G_CALLBACK (gst_rtp_sink_rtpbin_pad_removed_cb), self, 0);
|
||||
|
||||
GST_OBJECT_FLAG_SET (GST_OBJECT (self), GST_ELEMENT_FLAG_SINK);
|
||||
gst_bin_set_suppressed_flags (GST_BIN (self),
|
||||
|
|
|
@ -705,16 +705,16 @@ gst_rtp_src_init (GstRtpSrc * self)
|
|||
gst_bin_add (GST_BIN (self), self->rtpbin);
|
||||
|
||||
/* Add rtpbin callbacks to monitor the operation of rtpbin */
|
||||
g_signal_connect (self->rtpbin, "pad-added",
|
||||
G_CALLBACK (gst_rtp_src_rtpbin_pad_added_cb), self);
|
||||
g_signal_connect (self->rtpbin, "pad-removed",
|
||||
G_CALLBACK (gst_rtp_src_rtpbin_pad_removed_cb), self);
|
||||
g_signal_connect (self->rtpbin, "request-pt-map",
|
||||
G_CALLBACK (gst_rtp_src_rtpbin_request_pt_map_cb), self);
|
||||
g_signal_connect (self->rtpbin, "on-new-ssrc",
|
||||
G_CALLBACK (gst_rtp_src_rtpbin_on_new_ssrc_cb), self);
|
||||
g_signal_connect (self->rtpbin, "on-ssrc-collision",
|
||||
G_CALLBACK (gst_rtp_src_rtpbin_on_ssrc_collision_cb), self);
|
||||
g_signal_connect_object (self->rtpbin, "pad-added",
|
||||
G_CALLBACK (gst_rtp_src_rtpbin_pad_added_cb), self, 0);
|
||||
g_signal_connect_object (self->rtpbin, "pad-removed",
|
||||
G_CALLBACK (gst_rtp_src_rtpbin_pad_removed_cb), self, 0);
|
||||
g_signal_connect_object (self->rtpbin, "request-pt-map",
|
||||
G_CALLBACK (gst_rtp_src_rtpbin_request_pt_map_cb), self, 0);
|
||||
g_signal_connect_object (self->rtpbin, "on-new-ssrc",
|
||||
G_CALLBACK (gst_rtp_src_rtpbin_on_new_ssrc_cb), self, 0);
|
||||
g_signal_connect_object (self->rtpbin, "on-ssrc-collision",
|
||||
G_CALLBACK (gst_rtp_src_rtpbin_on_ssrc_collision_cb), self, 0);
|
||||
|
||||
self->rtp_src = gst_element_factory_make ("udpsrc", "rtp_rtp_udpsrc0");
|
||||
if (self->rtp_src == NULL) {
|
||||
|
|
Loading…
Reference in a new issue