mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-04 22:48:54 +00:00
ristsrc: Apply BINDTODEVICE to socket created by udpsrc too
This commit is contained in:
parent
f6b4e24f72
commit
3a9c224ac2
1 changed files with 18 additions and 0 deletions
|
@ -62,6 +62,10 @@
|
|||
/* for strtol() */
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
#include <sys/socket.h>
|
||||
#endif
|
||||
|
||||
#include "gstrist.h"
|
||||
|
||||
GST_DEBUG_CATEGORY_STATIC (gst_rist_src_debug);
|
||||
|
@ -599,6 +603,20 @@ gst_rist_src_setup_rtcp_socket (GstRistSrc * src, RistReceiverBond * bond)
|
|||
gst_rist_src_on_send_rtcp, src, NULL);
|
||||
gst_object_unref (pad);
|
||||
|
||||
if (bond->multicast_iface) {
|
||||
#ifdef SO_BINDTODEVICE
|
||||
if (setsockopt (g_socket_get_fd (socket), SOL_SOCKET,
|
||||
SO_BINDTODEVICE, bond->multicast_iface,
|
||||
strlen (bond->multicast_iface)) < 0)
|
||||
GST_WARNING_OBJECT (src, "setsockopt SO_BINDTODEVICE failed: %s",
|
||||
strerror (errno));
|
||||
#else
|
||||
GST_WARNING_OBJECT (src, "Tried to set a multicast interface while"
|
||||
" GStreamer was compiled on a platform without SO_BINDTODEVICE");
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/* share the socket created by the source */
|
||||
g_object_set (bond->rtcp_sink, "socket", socket, "close-socket", FALSE, NULL);
|
||||
g_object_unref (socket);
|
||||
|
|
Loading…
Reference in a new issue