GNOME Bugzilla – Bug 795917
"multicast-iface" parameter for "udpsink" and "udpsrc" under Windows is ignored
Last modified: 2018-11-03 15:29:51 UTC
While under Linux the parameter "multicast-iface" does its work, under windows is ignored, indeed "udpsink" and "udpsrc" bind using the default network card instead of the one indicated. I confirmed the problem receiving a multicast stream on a network card and trying to transmit it on another network card, with Wireshark I see the stream transmitted on the first card.
Well, there was no equivalent on Windows when we implemented that. Did anything changed ?
I do not know what library you used, but using Qt5 when I do data streaming in UDP multicast I can select the network interface to bind to. However if under Windows you cannot use "multicast-iface" it should be indicated in the documentation to avoid to waste time trying to understand what is not working ;)
We're just using GLib API, and GLib has support for this on Windows. I know of people successfully using this property on Windows. See https://gitlab.gnome.org/GNOME/glib/blob/6acece5074d00f54c65a018498d9913664fa52ba/gio/gsocket.c#L2210-2214 So the question is why this code does not work. Can you check inside the GLib code what happens there for your case?
Also what interface name do you use? There are multiple different classes of interface names on Windows, you need to use the correct one here.
In Windows usually the interface name is the one you see using the "ipconfig" command, but I tried all the solution that I found without any result.
You have to use a name that if_nametoindex() can take, see https://msdn.microsoft.com/en-us/library/windows/desktop/bb408409(v=vs.85).aspx IIRC those looked like UNIX interface names. A compatible implementation of if_nametoindex() is the following, that should help to find the correct name. static guint if_nametoindex (const gchar *iface) { PIP_ADAPTER_ADDRESSES addresses = NULL, p; gulong addresses_len = 0; guint idx = 0; DWORD res; if (ws2funcs.pIfNameToIndex != NULL) return ws2funcs.pIfNameToIndex (iface); res = GetAdaptersAddresses (AF_UNSPEC, 0, NULL, NULL, &addresses_len); if (res != NO_ERROR && res != ERROR_BUFFER_OVERFLOW) { if (res == ERROR_NO_DATA) errno = ENXIO; else errno = EINVAL; return 0; } addresses = g_malloc (addresses_len); res = GetAdaptersAddresses (AF_UNSPEC, 0, NULL, addresses, &addresses_len); if (res != NO_ERROR) { g_free (addresses); if (res == ERROR_NO_DATA) errno = ENXIO; else errno = EINVAL; return 0; } p = addresses; while (p) { if (strcmp (p->AdapterName, iface) == 0) { idx = p->IfIndex; break; } p = p->Next; } if (p == NULL) errno = ENXIO; g_free (addresses); return idx; }
Ok, that's an approach to follow if you code the pipeline, but if you run it by command line how can you solve the problem?
You use the correct name. There's probably some Windows tool to print it for you
-- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/issues/472.