Merge commit '26d6add9457f00ce8ec13844368466f0e3816e5d' into 0.11

Conflicts:
	ext/rtmp/gstrtmpsink.c
This commit is contained in:
Tim-Philipp Müller 2011-11-28 23:20:02 +00:00
commit 2a78a3010d
2 changed files with 40 additions and 0 deletions

View file

@ -43,6 +43,10 @@
#include "gstrtmpsink.h"
#ifdef G_OS_WIN32
#include <winsock2.h>
#endif
GST_DEBUG_CATEGORY_STATIC (gst_rtmp_sink_debug);
#define GST_CAT_DEFAULT gst_rtmp_sink_debug
@ -71,6 +75,7 @@ static void gst_rtmp_sink_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec);
static void gst_rtmp_sink_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec);
static void gst_rtmp_sink_finalize (GObject * object);
static gboolean gst_rtmp_sink_stop (GstBaseSink * sink);
static gboolean gst_rtmp_sink_start (GstBaseSink * sink);
static GstFlowReturn gst_rtmp_sink_render (GstBaseSink * sink, GstBuffer * buf);
@ -92,6 +97,7 @@ gst_rtmp_sink_class_init (GstRTMPSinkClass * klass)
gstelement_class = (GstElementClass *) klass;
gstbasesink_class = (GstBaseSinkClass *) klass;
gobject_class->finalize = gst_rtmp_sink_finalize;
gobject_class->set_property = gst_rtmp_sink_set_property;
gobject_class->get_property = gst_rtmp_sink_get_property;
@ -120,8 +126,26 @@ gst_rtmp_sink_class_init (GstRTMPSinkClass * klass)
static void
gst_rtmp_sink_init (GstRTMPSink * sink)
{
#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
gst_rtmp_sink_finalize (GObject * object)
{
#ifdef G_OS_WIN32
WSACleanup ();
#endif
G_OBJECT_CLASS (parent_class)->finalize (object);
}
static gboolean
gst_rtmp_sink_start (GstBaseSink * basesink)
{

View file

@ -53,6 +53,10 @@
#include <gst/gst.h>
#ifdef G_OS_WIN32
#include <winsock2.h>
#endif
GST_DEBUG_CATEGORY_STATIC (rtmpsrc_debug);
#define GST_CAT_DEFAULT rtmpsrc_debug
@ -139,6 +143,14 @@ gst_rtmp_src_class_init (GstRTMPSrcClass * klass)
static void
gst_rtmp_src_init (GstRTMPSrc * rtmpsrc)
{
#ifdef G_OS_WIN32
WSADATA wsa_data;
if (WSAStartup (MAKEWORD (2, 2), &wsa_data) != 0) {
GST_ERROR_OBJECT (rtmpsrc, "WSAStartup failed: 0x%08x", WSAGetLastError ());
}
#endif
rtmpsrc->cur_offset = 0;
rtmpsrc->last_timestamp = 0;
@ -153,6 +165,10 @@ gst_rtmp_src_finalize (GObject * object)
g_free (rtmpsrc->uri);
rtmpsrc->uri = NULL;
#ifdef G_OS_WIN32
WSACleanup ();
#endif
G_OBJECT_CLASS (parent_class)->finalize (object);
}