+2006-07-10 Wim Taymans <wim@fluendo.com>
+
+ * gst/rtsp/Makefile.am:
+ * gst/rtsp/rtspconnection.c: (rtsp_connection_send),
+ (rtsp_connection_close):
+ * gst/rtsp/rtspdefs.h:
+ replaced closesocket and close in code with one CLOSE_SOCKET.
+ Some more cleanups. Fixes #345301.
+
2006-07-10 Tim-Philipp Müller <tim at centricular dot net>
* gst/autodetect/gstautoaudiosink.c:
libgstrtsp_la_SOURCES = gstrtsp.c gstrtspsrc.c \
gstrtpdec.c \
- rtspconnection.c \
- rtspdefs.c \
- rtspmessage.c \
+ rtspconnection.c \
+ rtspdefs.c \
+ rtspmessage.c \
rtsptransport.c \
rtspurl.c \
sdpmessage.c
libgstrtsp_la_CFLAGS = $(GST_CFLAGS)
-libgstrtsp_la_LIBADD = $(GST_LIBS)
+libgstrtsp_la_LIBADD = $(GST_LIBS) $(WIN32_LIBS)
libgstrtsp_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
check_PROGRAMS = test
test_SOURCES = test.c rtspdefs.c rtspurl.c rtspconnection.c rtspmessage.c rtsptransport.c sdpmessage.c
test_CFLAGS = $(GST_CFLAGS)
-test_LDFLAGS = $(GST_LIBS)
+test_LDFLAGS = $(GST_LIBS) $(WIN32_LIBS)
noinst_HEADERS = gstrtspsrc.h gstrtsp.h gstrtpdec.h rtsptransport.h rtsp.h rtspurl.h rtspconnection.h rtspdefs.h rtspmessage.h sdp.h sdpmessage.h
/* we include this here to get the G_OS_* defines */
#include <glib.h>
-#ifdef G_OS_UNIX
+#ifdef G_OS_WIN32
+#include <winsock2.h>
+#else
#include <netdb.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#endif
-#ifdef G_OS_WIN32
-#include <winsock2.h>
-#endif
#include "rtspconnection.h"
#ifdef G_OS_WIN32
+#define CLOSE_SOCKET(sock) closesocket(sock);
+#else
+#define CLOSE_SOCKET(sock) close(sock);
+#endif
+
+#ifdef G_OS_WIN32
/* note that inet_aton is deprecated on unix because
* inet_addr returns -1 (INADDR_NONE) for the valid 255.255.255.255
* address. */
startup_error:
{
GST_DEBUG_OBJECT (self, "Error %d on WSAStartup", error);
- return RTSP_ERROR;
+ g_warning ("Error %d on WSAStartup", error);
+ return RTSP_EWSASTART;
}
version_error:
{
+ g_warning ("Windows sockets are not version 0x202 (current 0x%x)",
+ w.wVersion);
WSACleanup ();
- return RTSP_ERROR;
+ return RTSP_EWSAVERSION;
}
#endif
write_error:
if (conn == NULL)
return RTSP_EINVAL;
+ res = CLOSE_SOCKET (conn->fd);
#ifdef G_OS_WIN32
- res = socketclose (conn->fd);
WSACleanup ();
-#else
- res = close (conn->fd);
#endif
-
conn->fd = -1;
if (res != 0)
goto sys_error;
G_BEGIN_DECLS
typedef enum {
- RTSP_OK = 0,
+ RTSP_OK = 0,
/* errors */
- RTSP_EINVAL = -1,
- RTSP_ENOMEM = -2,
- RTSP_ERESOLV = -3,
- RTSP_ENOTIMPL = -4,
- RTSP_ESYS = -5,
- RTSP_EPARSE = -6,
+ RTSP_EINVAL = -1,
+ RTSP_ENOMEM = -2,
+ RTSP_ERESOLV = -3,
+ RTSP_ENOTIMPL = -4,
+ RTSP_ESYS = -5,
+ RTSP_EPARSE = -6,
+ RTSP_EWSASTART = -7,
+ RTSP_EWSAVERSION = -8,
+
} RTSPResult;
typedef enum {