From 463f0b09f3c15cdb376a3a03331a90a2a7ce975b Mon Sep 17 00:00:00 2001 From: Tim Angus Date: Wed, 27 Jun 2007 11:24:08 +0000 Subject: [PATCH] plugins/elements/gstcapsfilter.c: Take a reference instead of a copy when setting "caps". Original commit message from CVS: Patch by: Tim Angus * 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. --- ChangeLog | 9 +++++++++ plugins/elements/gstcapsfilter.c | 8 +++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index d96183a4d0..9cd75f3849 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2007-06-27 Wim Taymans + + Patch by: Tim Angus + + * 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 * gst/gstindexfactory.c: (gst_index_factory_get_type): diff --git a/plugins/elements/gstcapsfilter.c b/plugins/elements/gstcapsfilter.c index d9d35cfddb..ae31999587 100644 --- a/plugins/elements/gstcapsfilter.c +++ b/plugins/elements/gstcapsfilter.c @@ -104,8 +104,9 @@ gst_capsfilter_class_init (GstCapsFilterClass * klass) g_object_class_install_property (gobject_class, PROP_FILTER_CAPS, g_param_spec_boxed ("caps", _("Filter caps"), - _("Restrict the possible allowed capabilities (NULL means ANY)"), - GST_TYPE_CAPS, G_PARAM_READWRITE)); + _("Restrict the possible allowed capabilities (NULL means ANY). " + "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->transform_caps = gst_capsfilter_transform_caps; @@ -134,7 +135,8 @@ gst_capsfilter_set_property (GObject * object, guint prop_id, if (new_caps_val == NULL) { new_caps = gst_caps_new_any (); } 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;