rtpbin: avoid some pad link checks

Link pads without checks, we know it will work.
This commit is contained in:
Wim Taymans 2013-09-25 17:36:15 +02:00
parent 4a91a93d4e
commit 2efd58fc84

View file

@ -1439,7 +1439,8 @@ create_stream (GstRtpBinSession * session, guint32 ssrc)
/* link stuff */ /* link stuff */
if (demux) if (demux)
gst_element_link (buffer, demux); gst_element_link_pads_full (buffer, "src", demux, "sink",
GST_PAD_LINK_CHECK_NOTHING);
if (rtpbin->buffering) { if (rtpbin->buffering) {
guint64 last_out; guint64 last_out;
@ -2563,7 +2564,7 @@ new_ssrc_pad_found (GstElement * element, guint ssrc, GstPad * pad,
srcpad = gst_element_get_static_pad (element, padname); srcpad = gst_element_get_static_pad (element, padname);
g_free (padname); g_free (padname);
sinkpad = gst_element_get_static_pad (stream->buffer, "sink"); sinkpad = gst_element_get_static_pad (stream->buffer, "sink");
gst_pad_link (srcpad, sinkpad); gst_pad_link_full (srcpad, sinkpad, GST_PAD_LINK_CHECK_NOTHING);
gst_object_unref (sinkpad); gst_object_unref (sinkpad);
gst_object_unref (srcpad); gst_object_unref (srcpad);
@ -2572,7 +2573,7 @@ new_ssrc_pad_found (GstElement * element, guint ssrc, GstPad * pad,
srcpad = gst_element_get_static_pad (element, padname); srcpad = gst_element_get_static_pad (element, padname);
g_free (padname); g_free (padname);
sinkpad = gst_element_get_request_pad (stream->buffer, "sink_rtcp"); sinkpad = gst_element_get_request_pad (stream->buffer, "sink_rtcp");
gst_pad_link (srcpad, sinkpad); gst_pad_link_full (srcpad, sinkpad, GST_PAD_LINK_CHECK_NOTHING);
gst_object_unref (sinkpad); gst_object_unref (sinkpad);
gst_object_unref (srcpad); gst_object_unref (srcpad);
@ -2649,7 +2650,6 @@ create_recv_rtp (GstRtpBin * rtpbin, GstPadTemplate * templ, const gchar * name)
GstPad *sinkdpad; GstPad *sinkdpad;
guint sessid; guint sessid;
GstRtpBinSession *session; GstRtpBinSession *session;
GstPadLinkReturn lres;
/* first get the session number */ /* first get the session number */
if (name == NULL || sscanf (name, "recv_rtp_sink_%u", &sessid) != 1) if (name == NULL || sscanf (name, "recv_rtp_sink_%u", &sessid) != 1)
@ -2691,10 +2691,9 @@ create_recv_rtp (GstRtpBin * rtpbin, GstPadTemplate * templ, const gchar * name)
GST_DEBUG_OBJECT (rtpbin, "getting demuxer RTP sink pad"); GST_DEBUG_OBJECT (rtpbin, "getting demuxer RTP sink pad");
sinkdpad = gst_element_get_static_pad (session->demux, "sink"); sinkdpad = gst_element_get_static_pad (session->demux, "sink");
GST_DEBUG_OBJECT (rtpbin, "linking demuxer RTP sink pad"); GST_DEBUG_OBJECT (rtpbin, "linking demuxer RTP sink pad");
lres = gst_pad_link (session->recv_rtp_src, sinkdpad); gst_pad_link_full (session->recv_rtp_src, sinkdpad,
GST_PAD_LINK_CHECK_NOTHING);
gst_object_unref (sinkdpad); gst_object_unref (sinkdpad);
if (lres != GST_PAD_LINK_OK)
goto link_failed;
/* connect to the new-ssrc-pad signal of the SSRC demuxer */ /* connect to the new-ssrc-pad signal of the SSRC demuxer */
session->demux_newpad_sig = g_signal_connect (session->demux, session->demux_newpad_sig = g_signal_connect (session->demux,
@ -2726,11 +2725,6 @@ pad_failed:
g_warning ("rtpbin: failed to get session pad"); g_warning ("rtpbin: failed to get session pad");
return NULL; return NULL;
} }
link_failed:
{
g_warning ("rtpbin: failed to link pads");
return NULL;
}
} }
static void static void
@ -2771,7 +2765,6 @@ create_recv_rtcp (GstRtpBin * rtpbin, GstPadTemplate * templ,
guint sessid; guint sessid;
GstRtpBinSession *session; GstRtpBinSession *session;
GstPad *sinkdpad; GstPad *sinkdpad;
GstPadLinkReturn lres;
/* first get the session number */ /* first get the session number */
if (name == NULL || sscanf (name, "recv_rtcp_sink_%u", &sessid) != 1) if (name == NULL || sscanf (name, "recv_rtcp_sink_%u", &sessid) != 1)
@ -2808,10 +2801,8 @@ create_recv_rtcp (GstRtpBin * rtpbin, GstPadTemplate * templ,
GST_DEBUG_OBJECT (rtpbin, "getting demuxer RTCP sink pad"); GST_DEBUG_OBJECT (rtpbin, "getting demuxer RTCP sink pad");
sinkdpad = gst_element_get_static_pad (session->demux, "rtcp_sink"); sinkdpad = gst_element_get_static_pad (session->demux, "rtcp_sink");
lres = gst_pad_link (session->sync_src, sinkdpad); gst_pad_link_full (session->sync_src, sinkdpad, GST_PAD_LINK_CHECK_NOTHING);
gst_object_unref (sinkdpad); gst_object_unref (sinkdpad);
if (lres != GST_PAD_LINK_OK)
goto link_failed;
session->recv_rtcp_sink_ghost = session->recv_rtcp_sink_ghost =
gst_ghost_pad_new_from_template (name, session->recv_rtcp_sink, templ); gst_ghost_pad_new_from_template (name, session->recv_rtcp_sink, templ);
@ -2837,11 +2828,6 @@ pad_failed:
g_warning ("rtpbin: failed to get session pad"); g_warning ("rtpbin: failed to get session pad");
return NULL; return NULL;
} }
link_failed:
{
g_warning ("rtpbin: failed to link pads");
return NULL;
}
} }
static void static void