mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
rfbsrc: call WSAStartup/Cleanup on win32
If we link against libwinsock2, we should probably call Startup/Cleanup as well. https://bugzilla.gnome.org/show_bug.cgi?id=675415
This commit is contained in:
parent
2f20ec7312
commit
9503daa56a
1 changed files with 20 additions and 4 deletions
|
@ -34,6 +34,10 @@
|
||||||
#include <X11/Xlib.h>
|
#include <X11/Xlib.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef G_OS_WIN32
|
||||||
|
#include <winsock2.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
ARG_0,
|
ARG_0,
|
||||||
|
@ -70,7 +74,7 @@ GST_STATIC_PAD_TEMPLATE ("src",
|
||||||
"height = (int) [ 16, 4096 ], " "framerate = (fraction) 0/1")
|
"height = (int) [ 16, 4096 ], " "framerate = (fraction) 0/1")
|
||||||
);
|
);
|
||||||
|
|
||||||
static void gst_rfb_src_dispose (GObject * object);
|
static void gst_rfb_src_finalize (GObject * object);
|
||||||
static void gst_rfb_src_set_property (GObject * object, guint prop_id,
|
static void gst_rfb_src_set_property (GObject * object, guint prop_id,
|
||||||
const GValue * value, GParamSpec * pspec);
|
const GValue * value, GParamSpec * pspec);
|
||||||
static void gst_rfb_src_get_property (GObject * object, guint prop_id,
|
static void gst_rfb_src_get_property (GObject * object, guint prop_id,
|
||||||
|
@ -114,7 +118,7 @@ gst_rfb_src_class_init (GstRfbSrcClass * klass)
|
||||||
gstbasesrc_class = (GstBaseSrcClass *) klass;
|
gstbasesrc_class = (GstBaseSrcClass *) klass;
|
||||||
gstpushsrc_class = (GstPushSrcClass *) klass;
|
gstpushsrc_class = (GstPushSrcClass *) klass;
|
||||||
|
|
||||||
gobject_class->dispose = gst_rfb_src_dispose;
|
gobject_class->finalize = gst_rfb_src_finalize;
|
||||||
gobject_class->set_property = gst_rfb_src_set_property;
|
gobject_class->set_property = gst_rfb_src_set_property;
|
||||||
gobject_class->get_property = gst_rfb_src_get_property;
|
gobject_class->get_property = gst_rfb_src_get_property;
|
||||||
|
|
||||||
|
@ -188,10 +192,19 @@ gst_rfb_src_init (GstRfbSrc * src, GstRfbSrcClass * klass)
|
||||||
|
|
||||||
src->decoder = rfb_decoder_new ();
|
src->decoder = rfb_decoder_new ();
|
||||||
|
|
||||||
|
#ifdef G_OS_WIN32
|
||||||
|
{
|
||||||
|
WSADATA wsa_data;
|
||||||
|
|
||||||
|
if (WSAStartup (MAKEWORD (2, 2), &wsa_data) != 0) {
|
||||||
|
GST_ERROR_OBJECT (sink, "WSAStartup failed: 0x%08x", WSAGetLastError ());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_rfb_src_dispose (GObject * object)
|
gst_rfb_src_finalize (GObject * object)
|
||||||
{
|
{
|
||||||
GstRfbSrc *src = GST_RFB_SRC (object);
|
GstRfbSrc *src = GST_RFB_SRC (object);
|
||||||
|
|
||||||
|
@ -201,8 +214,11 @@ gst_rfb_src_dispose (GObject * object)
|
||||||
g_free (src->decoder);
|
g_free (src->decoder);
|
||||||
src->decoder = NULL;
|
src->decoder = NULL;
|
||||||
}
|
}
|
||||||
|
#ifdef G_OS_WIN32
|
||||||
|
WSACleanup ();
|
||||||
|
#endif
|
||||||
|
|
||||||
G_OBJECT_CLASS (parent_class)->dispose (object);
|
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Reference in a new issue