+2005-06-03 Jan Schmidt <thaytan@mad.scientist.com>
+
+ * gst/elements/gstcapsfilter.c: (gst_capsfilter_set_property):
+ Free existing caps if the capsfilter changes. Add a FIXME about
+ setting those caps on the pads.
+
+ * gst/gstutils.c: (gst_element_get_compatible_pad), (ghost_up):
+ Before adding a ghost pad to a parent bin, check that there isn't
+ already one for the element on the bin. Prevents infinite recursion
+ when using decodebin in parse pipelines. Andy says he'll rewrite the
+ way this works anyway, so ignore the hack.
+
2005-06-02 Andy Wingo <wingo@pobox.com>
* gst/elements/gsttypefindelement.c (do_pull_typefind): Query the
capsfilter = GST_CAPSFILTER (object);
switch (prop_id) {
- case PROP_FILTER_CAPS:
- capsfilter->filter_caps = gst_caps_copy (gst_value_get_caps (value));
+ case PROP_FILTER_CAPS:{
+ GstCaps *new_caps = gst_caps_copy (gst_value_get_caps (value));
+
+ g_return_if_fail (new_caps != NULL);
+
+ gst_caps_unref (capsfilter->filter_caps);
+ capsfilter->filter_caps = new_caps;
+
+ /* FIXME: Need to activate these caps on the pads */
break;
+ }
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
current = GST_PAD (padptr);
- GST_CAT_LOG (GST_CAT_ELEMENT_PADS, "examing pad %s:%s",
+ GST_CAT_LOG (GST_CAT_ELEMENT_PADS, "examining pad %s:%s",
GST_DEBUG_PAD_NAME (current));
peer = gst_pad_get_peer (current);
static gint ghost_pad_index = 0;
GstPad *gpad;
gchar *name;
+ GList *gpads;
+ GstObject *parent = GST_OBJECT_PARENT (e);
+
+ /* Check if the pad already has a ghost on the element */
+ for (gpads = g_list_first (GST_PAD_REALIZE (pad)->ghostpads); gpads != NULL;
+ gpads = g_list_next (gpads)) {
+ if (GST_OBJECT_PARENT (GST_PAD (gpads->data)) == parent) {
+ GST_DEBUG ("Found existing ghost pad of %s on element %s\n",
+ GST_OBJECT_NAME (pad), GST_OBJECT_NAME (parent));
+ return GST_PAD (gpads->data);
+ }
+ }
name = g_strdup_printf ("ghost%d", ghost_pad_index++);
gpad = gst_ghost_pad_new (name, pad);
g_free (name);
- if (!gst_element_add_pad ((GstElement *) GST_OBJECT_PARENT (e), gpad)) {
+ if (!gst_element_add_pad ((GstElement *) parent, gpad)) {
g_warning ("Pad named %s already exists in element %s\n",
- GST_OBJECT_NAME (gpad), GST_OBJECT_NAME (GST_OBJECT_PARENT (e)));
+ GST_OBJECT_NAME (gpad), GST_OBJECT_NAME (parent));
gst_object_unref ((GstObject *) gpad);
return NULL;
}
capsfilter = GST_CAPSFILTER (object);
switch (prop_id) {
- case PROP_FILTER_CAPS:
- capsfilter->filter_caps = gst_caps_copy (gst_value_get_caps (value));
+ case PROP_FILTER_CAPS:{
+ GstCaps *new_caps = gst_caps_copy (gst_value_get_caps (value));
+
+ g_return_if_fail (new_caps != NULL);
+
+ gst_caps_unref (capsfilter->filter_caps);
+ capsfilter->filter_caps = new_caps;
+
+ /* FIXME: Need to activate these caps on the pads */
break;
+ }
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;