plugins/elements/gstcapsfilter.c: Take a reference instead of a copy when setting "caps".

Original commit message from CVS:
Patch by: Tim Angus <tim at ngus dot net>
* plugins/elements/gstcapsfilter.c: (gst_capsfilter_class_init),
(gst_capsfilter_set_property):
Take a reference instead of a copy when setting "caps".
Fix documentation to clarify this behaviour. Fixes #449414.
This commit is contained in:
Tim Angus 2007-06-27 11:24:08 +00:00 committed by Wim Taymans
parent 1756e6aa87
commit 463f0b09f3
2 changed files with 14 additions and 3 deletions

View file

@ -1,3 +1,12 @@
2007-06-27 Wim Taymans <wim@fluendo.com>
Patch by: Tim Angus <tim at ngus dot net>
* plugins/elements/gstcapsfilter.c: (gst_capsfilter_class_init),
(gst_capsfilter_set_property):
Take a reference instead of a copy when setting "caps".
Fix documentation to clarify this behaviour. Fixes #449414.
2007-06-27 Stefan Kost <ensonic@users.sf.net> 2007-06-27 Stefan Kost <ensonic@users.sf.net>
* gst/gstindexfactory.c: (gst_index_factory_get_type): * gst/gstindexfactory.c: (gst_index_factory_get_type):

View file

@ -104,8 +104,9 @@ gst_capsfilter_class_init (GstCapsFilterClass * klass)
g_object_class_install_property (gobject_class, PROP_FILTER_CAPS, g_object_class_install_property (gobject_class, PROP_FILTER_CAPS,
g_param_spec_boxed ("caps", _("Filter caps"), g_param_spec_boxed ("caps", _("Filter caps"),
_("Restrict the possible allowed capabilities (NULL means ANY)"), _("Restrict the possible allowed capabilities (NULL means ANY). "
GST_TYPE_CAPS, G_PARAM_READWRITE)); "Setting this property takes a reference to the supplied GstCaps "
"object."), GST_TYPE_CAPS, G_PARAM_READWRITE));
trans_class = GST_BASE_TRANSFORM_CLASS (klass); trans_class = GST_BASE_TRANSFORM_CLASS (klass);
trans_class->transform_caps = gst_capsfilter_transform_caps; trans_class->transform_caps = gst_capsfilter_transform_caps;
@ -134,7 +135,8 @@ gst_capsfilter_set_property (GObject * object, guint prop_id,
if (new_caps_val == NULL) { if (new_caps_val == NULL) {
new_caps = gst_caps_new_any (); new_caps = gst_caps_new_any ();
} else { } else {
new_caps = gst_caps_copy (new_caps_val); new_caps = (GstCaps *) new_caps_val;
gst_caps_ref (new_caps);
} }
old_caps = capsfilter->filter_caps; old_caps = capsfilter->filter_caps;