mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-20 04:56:24 +00:00
plugins/elements/gstcapsfilter.c: Make setting the caps more threadsafe.
Original commit message from CVS: * plugins/elements/gstcapsfilter.c: (gst_capsfilter_set_property), (gst_capsfilter_get_property), (gst_capsfilter_transform_caps): Make setting the caps more threadsafe.
This commit is contained in:
parent
d022bc7a12
commit
f688febd0f
2 changed files with 21 additions and 2 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2008-07-31 Wim Taymans <wim.taymans@collabora.co.uk>
|
||||||
|
|
||||||
|
* plugins/elements/gstcapsfilter.c: (gst_capsfilter_set_property),
|
||||||
|
(gst_capsfilter_get_property), (gst_capsfilter_transform_caps):
|
||||||
|
Make setting the caps more threadsafe.
|
||||||
|
|
||||||
2008-07-31 Wim Taymans <wim.taymans@collabora.co.uk>
|
2008-07-31 Wim Taymans <wim.taymans@collabora.co.uk>
|
||||||
|
|
||||||
* docs/design/part-element-transform.txt:
|
* docs/design/part-element-transform.txt:
|
||||||
|
|
|
@ -143,8 +143,11 @@ gst_capsfilter_set_property (GObject * object, guint prop_id,
|
||||||
gst_caps_ref (new_caps);
|
gst_caps_ref (new_caps);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GST_OBJECT_LOCK (capsfilter);
|
||||||
old_caps = capsfilter->filter_caps;
|
old_caps = capsfilter->filter_caps;
|
||||||
capsfilter->filter_caps = new_caps;
|
capsfilter->filter_caps = new_caps;
|
||||||
|
GST_OBJECT_UNLOCK (capsfilter);
|
||||||
|
|
||||||
gst_caps_unref (old_caps);
|
gst_caps_unref (old_caps);
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (capsfilter, "set new caps %" GST_PTR_FORMAT, new_caps);
|
GST_DEBUG_OBJECT (capsfilter, "set new caps %" GST_PTR_FORMAT, new_caps);
|
||||||
|
@ -168,7 +171,9 @@ gst_capsfilter_get_property (GObject * object, guint prop_id, GValue * value,
|
||||||
|
|
||||||
switch (prop_id) {
|
switch (prop_id) {
|
||||||
case PROP_FILTER_CAPS:
|
case PROP_FILTER_CAPS:
|
||||||
|
GST_OBJECT_LOCK (capsfilter);
|
||||||
gst_value_set_caps (value, capsfilter->filter_caps);
|
gst_value_set_caps (value, capsfilter->filter_caps);
|
||||||
|
GST_OBJECT_UNLOCK (capsfilter);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
|
@ -191,9 +196,17 @@ gst_capsfilter_transform_caps (GstBaseTransform * base,
|
||||||
GstPadDirection direction, GstCaps * caps)
|
GstPadDirection direction, GstCaps * caps)
|
||||||
{
|
{
|
||||||
GstCapsFilter *capsfilter = GST_CAPSFILTER (base);
|
GstCapsFilter *capsfilter = GST_CAPSFILTER (base);
|
||||||
GstCaps *ret;
|
GstCaps *ret, *filter_caps;
|
||||||
|
|
||||||
ret = gst_caps_intersect (caps, capsfilter->filter_caps);
|
GST_OBJECT_LOCK (capsfilter);
|
||||||
|
filter_caps = gst_caps_ref (capsfilter->filter_caps);
|
||||||
|
GST_OBJECT_UNLOCK (capsfilter);
|
||||||
|
|
||||||
|
ret = gst_caps_intersect (caps, filter_caps);
|
||||||
|
GST_DEBUG_OBJECT (capsfilter, "filter: %" GST_PTR_FORMAT, filter_caps);
|
||||||
|
GST_DEBUG_OBJECT (capsfilter, "intersect: %" GST_PTR_FORMAT, ret);
|
||||||
|
|
||||||
|
gst_caps_unref (filter_caps);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue