summaryrefslogtreecommitdiff
path: root/gst/frei0r/gstfrei0rmixer.c
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian.droege@collabora.co.uk>2010-02-27 19:08:49 +0100
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2010-03-09 21:05:50 +0000
commit125efbffcc72e53bad3921d0e60b92c4e0f67859 (patch)
treee06719694c0e55c69cc2d76665dc851d38ef64cd /gst/frei0r/gstfrei0rmixer.c
parent678f7ddb16e99deb1fb08913302dfa82c118ab9f (diff)
downloadgstreamer-plugins-bad-125efbffcc72e53bad3921d0e60b92c4e0f67859.tar.gz
frei0r: Protect set/get property and processing functions from concurrent access
The frei0r documentation says that these functions must not be called on the same instance from different threads at the same time. All other functions are guaranteed to be threadsafe.
Diffstat (limited to 'gst/frei0r/gstfrei0rmixer.c')
-rw-r--r--gst/frei0r/gstfrei0rmixer.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gst/frei0r/gstfrei0rmixer.c b/gst/frei0r/gstfrei0rmixer.c
index cd315e185..486e96e45 100644
--- a/gst/frei0r/gstfrei0rmixer.c
+++ b/gst/frei0r/gstfrei0rmixer.c
@@ -84,10 +84,12 @@ gst_frei0r_mixer_get_property (GObject * object, guint prop_id, GValue * value,
GstFrei0rMixer *self = GST_FREI0R_MIXER (object);
GstFrei0rMixerClass *klass = GST_FREI0R_MIXER_GET_CLASS (object);
+ GST_OBJECT_LOCK (self);
if (!gst_frei0r_get_property (self->f0r_instance, klass->ftable,
klass->properties, klass->n_properties, self->property_cache, prop_id,
value))
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ GST_OBJECT_UNLOCK (self);
}
static void
@@ -97,10 +99,12 @@ gst_frei0r_mixer_set_property (GObject * object, guint prop_id,
GstFrei0rMixer *self = GST_FREI0R_MIXER (object);
GstFrei0rMixerClass *klass = GST_FREI0R_MIXER_GET_CLASS (object);
+ GST_OBJECT_LOCK (self);
if (!gst_frei0r_set_property (self->f0r_instance, klass->ftable,
klass->properties, klass->n_properties, self->property_cache, prop_id,
value))
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ GST_OBJECT_UNLOCK (self);
}
static GstStateChangeReturn
@@ -584,11 +588,13 @@ gst_frei0r_mixer_collected (GstCollectPads * pads, GstFrei0rMixer * self)
GST_BUFFER_COPY_FLAGS | GST_BUFFER_COPY_TIMESTAMPS);
time = ((gdouble) GST_BUFFER_TIMESTAMP (outbuf)) / GST_SECOND;
+ GST_OBJECT_LOCK (self);
klass->ftable->update2 (self->f0r_instance, time,
(const guint32 *) GST_BUFFER_DATA (inbuf0),
(const guint32 *) GST_BUFFER_DATA (inbuf1),
(inbuf2) ? (const guint32 *) GST_BUFFER_DATA (inbuf2) : NULL,
(guint32 *) GST_BUFFER_DATA (outbuf));
+ GST_OBJECT_UNLOCK (self);
gst_buffer_unref (inbuf0);
gst_buffer_unref (inbuf1);