G_DEFINE_TYPE (GstStreamCombiner, gst_stream_combiner, GST_TYPE_ELEMENT);
-#define STREAMS_LOCK(obj) (g_mutex_lock(obj->lock))
-#define STREAMS_UNLOCK(obj) (g_mutex_unlock(obj->lock))
+#define STREAMS_LOCK(obj) (g_mutex_lock(&obj->lock))
+#define STREAMS_UNLOCK(obj) (g_mutex_unlock(&obj->lock))
-static void gst_stream_combiner_dispose (GObject * object);
+static void gst_stream_combiner_finalize (GObject * object);
static GstPad *gst_stream_combiner_request_new_pad (GstElement * element,
GstPadTemplate * templ, const gchar * name, const GstCaps * caps);
gobject_klass = (GObjectClass *) klass;
gstelement_klass = (GstElementClass *) klass;
- gobject_klass->dispose = gst_stream_combiner_dispose;
+ gobject_klass->finalize = gst_stream_combiner_finalize;
GST_DEBUG_CATEGORY_INIT (gst_stream_combiner_debug, "streamcombiner", 0,
"Stream Combiner");
}
static void
-gst_stream_combiner_dispose (GObject * object)
+gst_stream_combiner_finalize (GObject * object)
{
GstStreamCombiner *stream_combiner = (GstStreamCombiner *) object;
- if (stream_combiner->lock) {
- g_mutex_free (stream_combiner->lock);
- stream_combiner->lock = NULL;
- }
+ g_mutex_clear (&stream_combiner->lock);
- G_OBJECT_CLASS (gst_stream_combiner_parent_class)->dispose (object);
+ G_OBJECT_CLASS (gst_stream_combiner_parent_class)->finalize (object);
}
static GstFlowReturn
gst_stream_combiner_src_query);
gst_element_add_pad (GST_ELEMENT (stream_combiner), stream_combiner->srcpad);
- stream_combiner->lock = g_mutex_new ();
+ g_mutex_init (&stream_combiner->lock);
}
static GstPad *
G_DEFINE_TYPE (GstStreamSplitter, gst_stream_splitter, GST_TYPE_ELEMENT);
-#define STREAMS_LOCK(obj) (g_mutex_lock(obj->lock))
-#define STREAMS_UNLOCK(obj) (g_mutex_unlock(obj->lock))
+#define STREAMS_LOCK(obj) (g_mutex_lock(&obj->lock))
+#define STREAMS_UNLOCK(obj) (g_mutex_unlock(&obj->lock))
static void gst_stream_splitter_dispose (GObject * object);
+static void gst_stream_splitter_finalize (GObject * object);
static gboolean gst_stream_splitter_sink_setcaps (GstPad * pad, GstCaps * caps);
gstelement_klass = (GstElementClass *) klass;
gobject_klass->dispose = gst_stream_splitter_dispose;
+ gobject_klass->finalize = gst_stream_splitter_finalize;
GST_DEBUG_CATEGORY_INIT (gst_stream_splitter_debug, "streamsplitter", 0,
"Stream Splitter");
{
GstStreamSplitter *stream_splitter = (GstStreamSplitter *) object;
- if (stream_splitter->lock) {
- g_mutex_free (stream_splitter->lock);
- stream_splitter->lock = NULL;
- }
-
g_list_foreach (stream_splitter->pending_events, (GFunc) gst_event_unref,
NULL);
g_list_free (stream_splitter->pending_events);
G_OBJECT_CLASS (gst_stream_splitter_parent_class)->dispose (object);
}
+static void
+gst_stream_splitter_finalize (GObject * object)
+{
+ GstStreamSplitter *stream_splitter = (GstStreamSplitter *) object;
+
+ g_mutex_clear (&stream_splitter->lock);
+
+ G_OBJECT_CLASS (gst_stream_splitter_parent_class)->finalize (object);
+}
+
static GstFlowReturn
gst_stream_splitter_chain (GstPad * pad, GstObject * parent, GstBuffer * buf)
{
gst_stream_splitter_sink_query);
gst_element_add_pad (GST_ELEMENT (stream_splitter), stream_splitter->sinkpad);
- stream_splitter->lock = g_mutex_new ();
+ g_mutex_init (&stream_splitter->lock);
}
static GstPad *