GSocket *socket = NULL;
gint rtp_port = -1, rtcp_port = -1, rtcp_fb_port = -1;
gboolean do_rtcp, do_rtcp_fb;
+ GstPadLinkReturn res = GST_PAD_LINK_REFUSED;
const gchar *destination = NULL;
gchar *uri = NULL;
GstPad *rtcp_fb_pad = NULL;
pad = gst_element_get_request_pad (src->session, "send_rtcp_src");
/* and link */
- if (pad && rtcppad) {
- gst_pad_link_full (pad, rtcppad, GST_PAD_LINK_CHECK_NOTHING);
- }
+ if (pad && rtcppad)
+ res = gst_pad_link_full (pad, rtcppad, GST_PAD_LINK_CHECK_NOTHING);
+
if (pad)
gst_object_unref (pad);
if (rtcppad)
gst_object_unref (rtcppad);
+ if (res != GST_PAD_LINK_OK)
+ goto link_failed;
}
if (do_rtcp_fb) {
pad = gst_element_get_static_pad (src->requester, "rtcp_src");
/* and link */
- if (rtcp_fb_pad && pad) {
- gst_pad_link (pad, rtcp_fb_pad);
- }
+ if (rtcp_fb_pad && pad)
+ res = gst_pad_link (pad, rtcp_fb_pad);
if (pad)
gst_object_unref (pad);
if (rtcp_fb_pad)
gst_object_unref (rtcp_fb_pad);
+ if (res != GST_PAD_LINK_OK)
+ goto link_failed;
}
return TRUE;
/* ERRORS */
no_destination:
{
- GST_DEBUG_OBJECT (src, "no destination address specified");
+ GST_ERROR_OBJECT (src, "no destination address specified");
return FALSE;
}
no_sink_element:
{
- GST_DEBUG_OBJECT (src, "no UDP sink element found");
+ GST_ERROR_OBJECT (src, "no UDP sink element found");
+ return FALSE;
+ }
+link_failed:
+ {
+ GST_ERROR_OBJECT (src, "pad linking is failed [%d]", res);
return FALSE;
}
}