GNOME Bugzilla – Bug 702819
udpsink multicast-iface does not seem to work correctly
Last modified: 2013-06-24 20:54:20 UTC
I was trying to use the multicast-iface property of udpsink/udpsrc elements on 2 machines with 2 network cards. Setting this property on udpsrc worked fine but not for udpsink whereas this property is set when joining the multicast in both elements. Here are my pipelines: gst-launch-1.0 --gst-debug=*udp*:5 audiotestsrc ! audioconvert ! rtpL16pay ! udpsink host=239.5.5.5 port=5555 multicast-iface=eth1 gst-launch-1.0 --gst-debug=*udp*:5 udpsrc uri=udp://239.5.5.5:5555 multicast-iface=eth1 ! application/x-rtp, media=audio, clock-rate=44100, encoding-name=L16, channels=1, payload=96 ! rtpL16depay ! audioconvert ! alsasink and my routing table: Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 172.16.86.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 172.16.86.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1 0.0.0.0 172.16.86.1 0.0.0.0 UG 0 0 0 eth0 udpsrc will correctly get the stream from eth1 whereas udpsink will send the stream on eth0. Of course, if I change the default gateway on eth1 or add a static route for my stream, the stream will be sent on eth1 but not using multicast-iface for udpsink. I also tried to set the option like this: if (sink->multi_iface) setsockopt (g_socket_get_fd (sink->used_socket), SOL_SOCKET, SO_BINDTODEVICE, sink->multi_iface, strlen (sink->multi_iface) * sizeof (gchar)); after creating the socket in gst_multiudpsink_start and in this case it was using the good interface. Any idea, why it does not work like it udpsrc? Cheers, Paul HENRYS
There is nothing in the code to bind to an interface. There is some attempt to join a multicast group on the interface but that doesn't work for senders.
Ok Wim. Thx for the answer.
This should fix it: commit 35f6e79b947dbcefc4573898b7d6f135161676c0 Author: Wim Taymans <wim.taymans@collabora.co.uk> Date: Mon Jun 24 17:11:35 2013 +0200 udpsink: bind to the given interface Actually call BINDTODEVICE to bind to the interface as given by the property. Fixes https://bugzilla.gnome.org/show_bug.cgi?id=702819