GstElement *udpsrc0, *udpsrc1;
gint tmp_rtp, tmp_rtcp;
guint count;
+ const gchar *host;
src = stream->parent;
/* Start with random port */
tmp_rtp = 0;
+ if (stream->is_ipv6)
+ host = "udp://[::0]";
+ else
+ host = "udp://0.0.0.0";
+
/* try to allocate 2 UDP ports, the RTP port should be an even
* number and the RTCP port should be the next (uneven) port */
again:
- udpsrc0 = gst_element_make_from_uri (GST_URI_SRC, "udp://0.0.0.0", NULL);
+ udpsrc0 = gst_element_make_from_uri (GST_URI_SRC, host, NULL);
if (udpsrc0 == NULL)
goto no_udp_protocol;
g_object_set (G_OBJECT (udpsrc0), "port", tmp_rtp, NULL);
}
/* allocate port+1 for RTCP now */
- udpsrc1 = gst_element_make_from_uri (GST_URI_SRC, "udp://0.0.0.0", NULL);
+ udpsrc1 = gst_element_make_from_uri (GST_URI_SRC, host, NULL);
if (udpsrc1 == NULL)
goto no_udp_rtcp_protocol;