File farstream-0.1.2.patch of Package mingw64-farstream
--- configure.ac 0.1.2
+++ configure.ac fixed
@@ -185,6 +185,19 @@
dnl *** checks for platform ***
+# Check Operating System
+AC_MSG_CHECKING([operating system])
+case "$host" in
+ *-*-*mingw*|*-*-*cygwin*)
+ platform=win32
+ AC_MSG_RESULT($platform)
+ ;;
+ *)
+ platform=linux/other
+ AC_MSG_RESULT($platform)
+ ;;
+esac
+
dnl * hardware/architecture *
AG_GST_ARCH
@@ -250,9 +263,14 @@
AC_DEFINE(GLIB_VERSION_MAX_REQUIRED, GLIB_VERSION_2_30, [Prevent post 2.30 APIs])
-PKG_CHECK_MODULES(GIO_UNIX, gio-unix-2.0 >= 2.16)
-AC_SUBST(GIO_UNIX_CFLAGS)
-AC_SUBST(GIO_UNIX_LIBS)
+have_gio_unix=no
+if test "$platform" != "win32"; then
+ PKG_CHECK_MODULES(GIO_UNIX, gio-unix-2.0 >= 2.16)
+ AC_SUBST(GIO_UNIX_CFLAGS)
+ AC_SUBST(GIO_UNIX_LIBS)
+ have_gio_unix=yes
+fi
+AM_CONDITIONAL(HAVE_GIO_UNIX, test "x$have_gio_unix" = "xyes")
dnl checks for gstreamer
dnl uninstalled is selected preferentially -- see pkg-config(1)
@@ -329,6 +347,9 @@
dnl LDFLAGS really should only contain flags, not libs - they get added before
dnl whatevertarget_LIBS and -L flags here affect the rest of the linking
FS_ALL_LDFLAGS="-no-undefined"
+if test "$platform" = "win32"; then
+ FS_ALL_LDFLAGS="$FS_ALL_LDFLAGS -lws2_32"
+fi
AC_SUBST(FS_ALL_LDFLAGS)
dnl FS_LIB_LDFLAGS
--- examples/commandline/Makefile.am 0.1.2
+++ examples/commandline/Makefile.am fixed
@@ -1,6 +1,9 @@
-noinst_PROGRAMS = simple-call simple-call-shm
+noinst_PROGRAMS = simple-call
+if HAVE_GIO_UNIX
+noinst_PROGRAMS += simple-call-shm
+endif
AM_CFLAGS = \
-I$(top_srcdir)/gst/fsrtpconference/ \
--- farstream/fs-plugin.c 0.1.2
+++ farstream/fs-plugin.c fixed
@@ -84,8 +84,8 @@
{
gchar *path;
- path = g_strjoin (":", env, FS_PLUGIN_PATH, NULL);
- search_paths = g_strsplit (path, ":", -1);
+ path = g_strjoin (G_SEARCHPATH_SEPARATOR_S, env, FS_PLUGIN_PATH, NULL);
+ search_paths = g_strsplit (path, G_SEARCHPATH_SEPARATOR_S, -1);
g_free (path);
}
}
--- gst/fsmsnconference/fs-msn-connection.c 0.1.2
+++ gst/fsmsnconference/fs-msn-connection.c fixed
@@ -30,12 +30,19 @@
#include "fs-msn-connection.h"
+#ifdef _WIN32
+#include <winsock2.h>
+#include <windows.h>
+#define strerror_r(code, msg, msg_size) strerror_s((msg), (msg_size), (code))
+typedef int socklen_t;
+#else
#include <arpa/inet.h>
+#include <netinet/in.h>
+#include <sys/socket.h>
+#endif
#include <errno.h>
#include <fcntl.h>
-#include <netinet/in.h>
#include <string.h>
-#include <sys/socket.h>
#include <unistd.h>
#include <stdio.h>
#ifdef HAVE_STDLIB_H
@@ -485,8 +492,10 @@
goto error;
}
+#ifndef _WIN32
// set non-blocking mode
fcntl(fd, F_SETFL, fcntl(fd, F_GETFL) | O_NONBLOCK);
+#endif
for (;;) {
GST_DEBUG ("Attempting to listen on port %d.....",port);
memset(&myaddr, 0, sizeof(myaddr));
@@ -533,7 +542,7 @@
done:
- if (getsockname (fd, (struct sockaddr *) &myaddr, &myaddr_len) < 0) {
+ if (getsockname (fd, (struct sockaddr *) &myaddr, (void*)&myaddr_len) < 0) {
gchar error_str[256];
strerror_r (errno, error_str, 256);
g_set_error (error, FS_ERROR, FS_ERROR_NETWORK,
@@ -601,8 +610,10 @@
return FALSE;
}
+#ifndef _WIN32
// set non-blocking mode
fcntl(fd, F_SETFL, fcntl(fd, F_GETFL) | O_NONBLOCK);
+#endif
theiraddr.sin_family = AF_INET;
theiraddr.sin_addr.s_addr = inet_addr (candidate->ip);
--- gst/fsmsnconference/fs-msn-stream.c 0.1.2
+++ gst/fsmsnconference/fs-msn-stream.c fixed
@@ -49,10 +49,15 @@
#include "fs-msn-stream.h"
+#ifdef _WIN32
+#include <winsock2.h>
+#include <ws2tcpip.h>
+#else
#include <arpa/inet.h>
-#include <fcntl.h>
#include <netinet/in.h>
#include <sys/socket.h>
+#endif
+#include <fcntl.h>
#include <string.h>
#include <unistd.h>
@@ -820,12 +825,12 @@
if (self->priv->fd < 0)
return;
- if (setsockopt (self->priv->fd, IPPROTO_IP, IP_TOS, &tos, sizeof (tos)) < 0)
+ if (setsockopt (self->priv->fd, IPPROTO_IP, IP_TOS, (const void *)&tos, sizeof (tos)) < 0)
GST_WARNING ( "could not set socket ToS: %s", g_strerror (errno));
#ifdef IPV6_TCLASS
if (setsockopt (self->priv->fd, IPPROTO_IPV6, IPV6_TCLASS,
- &tos, sizeof (tos)) < 0)
+ (const void *)&tos, sizeof (tos)) < 0)
GST_WARNING ("could not set TCLASS: %s", g_strerror (errno));
#endif
}
--- gst/fsrawconference/fs-raw-stream.c 0.1.2
+++ gst/fsrawconference/fs-raw-stream.c fixed
@@ -48,10 +48,15 @@
#include "fs-raw-stream.h"
#include "fs-raw-session.h"
+#ifdef _WIN32
+#include <winsock2.h>
+#include <ws2tcpip.h>
+#else
#include <arpa/inet.h>
-#include <fcntl.h>
#include <netinet/in.h>
#include <sys/socket.h>
+#endif
+#include <fcntl.h>
#include <string.h>
#include <unistd.h>
--- gst/fsrtpconference/fs-rtp-codec-specific.c 0.1.2
+++ gst/fsrtpconference/fs-rtp-codec-specific.c fixed
@@ -1484,8 +1484,8 @@
local_level_idc = 0xFF & local_value;
nego_level_idc = MIN (remote_level_idc, local_level_idc);
- g_snprintf (buf, 7, "%02hhX%02hhX%02hhX", local_profile_idc, nego_profile_iop,
- nego_level_idc);
+ g_snprintf (buf, 7, "%02hX%02hX%02hX", local_profile_idc & 0xFF, nego_profile_iop & 0xFF,
+ nego_level_idc & 0xFF);
fs_codec_add_optional_parameter (negotiated_codec, sdp_param->name, buf);
--- gst/fsrtpconference/fs-rtp-discover-codecs.c 0.1.2
+++ gst/fsrtpconference/fs-rtp-discover-codecs.c fixed
@@ -1296,7 +1296,8 @@
GstElementFactory *factory = GST_ELEMENT_FACTORY (walk->data);
/* Ignore unranked plugins */
- if (gst_plugin_feature_get_rank (factory) == GST_RANK_NONE)
+ if (gst_plugin_feature_get_rank (GST_PLUGIN_FEATURE(factory)) ==
+ GST_RANK_NONE)
continue;
if (!filter (factory))
--- gst/fsrtpconference/fs-rtp-tfrc.c 0.1.2
+++ gst/fsrtpconference/fs-rtp-tfrc.c fixed
@@ -894,7 +894,7 @@
buf += 4;
loss_event_rate = (gdouble) GST_READ_UINT32_BE (buf) / (gdouble) G_MAXUINT;
GST_LOG_OBJECT (self, "Got RTCP TFRC packet last_sent_ts: %u"
- " delay: %u x_recv: %u loss_event_rate: %f", ts, delay, x_recv,
+ " delay: %u x_recv: %u loss_event_rate: %f", (unsigned int)ts, delay, x_recv,
loss_event_rate);
GST_OBJECT_LOCK (self);
@@ -947,7 +947,7 @@
if (rtt > 10 * 1000 * 1000)
{
- GST_WARNING_OBJECT (self, "Impossible RTT %u ms, ignoring", rtt);
+ GST_WARNING_OBJECT (self, "Impossible RTT %u ms, ignoring", (unsigned int)rtt);
goto done;
}
--- tests/Makefile.am 0.1.2
+++ tests/Makefile.am fixed
@@ -4,6 +4,7 @@
SUBDIRS_CHECK += check
endif
-SUBDIRS = $(SUBDIRS_CHECK) rtp
+#XXX: there should be an option to disable tests
+#SUBDIRS = $(SUBDIRS_CHECK) rtp
DIST_SUBDIRS = check rtp
--- transmitters/multicast/fs-multicast-transmitter.c 0.1.2
+++ transmitters/multicast/fs-multicast-transmitter.c fixed
@@ -670,12 +670,12 @@
}
if (setsockopt (sock, IPPROTO_IP, IP_TOS,
- &type_of_service, sizeof (type_of_service)) < 0)
+ (const void*)&type_of_service, sizeof (type_of_service)) < 0)
GST_WARNING ("could not set socket ToS: %s", g_strerror (errno));
#ifdef IPV6_TCLASS
if (setsockopt (sock, IPPROTO_IPV6, IPV6_TCLASS,
- &type_of_service, sizeof (type_of_service)) < 0)
+ (const void*)&type_of_service, sizeof (type_of_service)) < 0)
GST_WARNING ("could not set TCLASS: %s", g_strerror (errno));
#endif
@@ -1199,12 +1199,12 @@
UdpSock *udpsock = item->data;
if (setsockopt (udpsock->fd, IPPROTO_IP, IP_TOS,
- &tos, sizeof (tos)) < 0)
+ (const void*)&tos, sizeof (tos)) < 0)
GST_WARNING ( "could not set socket tos: %s", g_strerror (errno));
#ifdef IPV6_TCLASS
if (setsockopt (udpsock->fd, IPPROTO_IPV6, IPV6_TCLASS,
- &tos, sizeof (tos)) < 0)
+ (const void*)&tos, sizeof (tos)) < 0)
GST_WARNING ("could not set TCLASS: %s", g_strerror (errno));
#endif
}
--- transmitters/rawudp/fs-rawudp-transmitter.c 0.1.2
+++ transmitters/rawudp/fs-rawudp-transmitter.c fixed
@@ -628,11 +628,11 @@
*used_port = port;
- if (setsockopt (sock, IPPROTO_IP, IP_TOS, &tos, sizeof (tos)) < 0)
+ if (setsockopt (sock, IPPROTO_IP, IP_TOS, (const void*)&tos, sizeof (tos)) < 0)
GST_WARNING ("could not set socket ToS: %s", g_strerror (errno));
#ifdef IPV6_TCLASS
- if (setsockopt (sock, IPPROTO_IPV6, IPV6_TCLASS, &tos, sizeof (tos)) < 0)
+ if (setsockopt (sock, IPPROTO_IPV6, IPV6_TCLASS, (const void*)&tos, sizeof (tos)) < 0)
GST_WARNING ("could not set TCLASS: %s", g_strerror (errno));
#endif
@@ -1293,12 +1293,12 @@
{
UdpPort *udpport = item->data;
- if (setsockopt (udpport->fd, IPPROTO_IP, IP_TOS, &tos, sizeof (tos)) < 0)
+ if (setsockopt (udpport->fd, IPPROTO_IP, IP_TOS, (const void*)&tos, sizeof (tos)) < 0)
GST_WARNING ( "could not set socket ToS: %s", g_strerror (errno));
#ifdef IPV6_TCLASS
if (setsockopt (udpport->fd, IPPROTO_IPV6, IPV6_TCLASS,
- &tos, sizeof (tos)) < 0)
+ (const void*)&tos, sizeof (tos)) < 0)
GST_WARNING ("could not set TCLASS: %s", g_strerror (errno));
#endif
}
--- transmitters/shm/fs-shm-stream-transmitter.c 0.1.2
+++ transmitters/shm/fs-shm-stream-transmitter.c fixed
@@ -542,6 +542,21 @@
return streamtransmitter;
}
+#ifdef _WIN32
+
+static char*
+mkdtemp(char *template)
+{
+ errno_t ret;
+
+ ret = _mktemp_s(template, strlen(template));
+ if (ret != 0)
+ return NULL;
+
+ return template;
+}
+
+#endif
static gboolean
fs_shm_stream_transmitter_gather_local_candidates (