After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 795917 - "multicast-iface" parameter for "udpsink" and "udpsrc" under Windows is ignored
"multicast-iface" parameter for "udpsink" and "udpsrc" under Windows is ignored
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
1.13.90
Other Windows
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2018-05-08 10:38 UTC by Myzhar
Modified: 2018-11-03 15:29 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Myzhar 2018-05-08 10:38:39 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.
Comment 1 Nicolas Dufresne (ndufresne) 2018-05-08 13:51:18 UTC
Well, there was no equivalent on Windows when we implemented that. Did anything changed ?
Comment 2 Myzhar 2018-05-08 14:35:27 UTC
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 ;)
Comment 3 Sebastian Dröge (slomo) 2018-05-08 15:36:19 UTC
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?
Comment 4 Sebastian Dröge (slomo) 2018-05-08 15:36:45 UTC
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.
Comment 5 Myzhar 2018-05-09 06:02:45 UTC
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.
Comment 6 Sebastian Dröge (slomo) 2018-05-09 07:31:15 UTC
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;
}
Comment 7 Myzhar 2018-05-09 09:25:41 UTC
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?
Comment 8 Sebastian Dröge (slomo) 2018-05-09 09:34:22 UTC
You use the correct name. There's probably some Windows tool to print it for you
Comment 9 GStreamer system administrator 2018-11-03 15:29:51 UTC
-- 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.