2006-08-20 Stefan Kost <ensonic@users.sf.net>
+ * gst/gst.c:
+ * gst/gstpad.c: (gst_pad_set_active):
+ * libs/gst/base/gstbasetransform.c:
+ (gst_base_transform_transform_caps):
+ Simplify caps to get rid of duplicates, fixes #345444
+
+2006-08-20 Stefan Kost <ensonic@users.sf.net>
+
* gst/gstvalue.c:
* gst/gstvalue.h:
Use these optimizations only internaly.
#ifndef GST_DISABLE_REGISTRY
+/*
+ * scan_and_update_registry:
+ * @default_registry: the #GstRegistry
+ * @registry_file: registry filename
+ * @write_changes: write registry if it has changed?
+ *
+ * Scans for registry changes and evntualy updates the registry cache.
+ *
+ * Return: %TRUE if the registry could be updated
+ */
static gboolean
scan_and_update_registry (GstRegistry * default_registry,
const gchar * registry_file, gboolean write_changes)
}
}
- if (!active && !ret) {
+ if (!ret) {
GST_OBJECT_LOCK (pad);
- g_critical ("Failed to deactivate pad %s:%s, very bad",
- GST_DEBUG_PAD_NAME (pad));
+ if (!active) {
+ g_critical ("Failed to deactivate pad %s:%s, very bad",
+ GST_DEBUG_PAD_NAME (pad));
+ } else {
+ GST_WARNING ("Failed to activate pad %s:%s", GST_DEBUG_PAD_NAME (pad));
+ }
GST_OBJECT_UNLOCK (pad);
}
/* start with empty caps */
ret = gst_caps_new_empty ();
+ GST_DEBUG_OBJECT (trans, "transform caps (direction = %d)", direction);
if (gst_caps_is_any (caps)) {
/* for any caps we still have to call the transform function */
- GST_DEBUG_OBJECT (trans, "from ANY:");
+ GST_DEBUG_OBJECT (trans, "from: ANY");
temp = klass->transform_caps (trans, direction, caps);
GST_DEBUG_OBJECT (trans, " to: %" GST_PTR_FORMAT, temp);
gst_caps_unref (nth);
GST_DEBUG_OBJECT (trans, " to[%d]: %" GST_PTR_FORMAT, i, temp);
+ /* FIXME: here we need to only append those structures, that are not yet
+ * in there */
temp = gst_caps_make_writable (temp);
gst_caps_append (ret, temp);
}
+ /* for now simplify caps */
+ GST_DEBUG_OBJECT (trans, "merged: (%d)", gst_caps_get_size (ret));
+ gst_caps_do_simplify (ret);
+ GST_DEBUG_OBJECT (trans, "simplified: (%d)", gst_caps_get_size (ret));
}
} else {
/* else use the identity transform */
ret = gst_caps_ref (caps);
}
- GST_DEBUG_OBJECT (trans, "to: %" GST_PTR_FORMAT, ret);
+ GST_DEBUG_OBJECT (trans, "to: (%d) %" GST_PTR_FORMAT, gst_caps_get_size (ret),
+ ret);
return ret;
}