mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-22 16:26:39 +00:00
Simplify caps to get rid of duplicates, fixes #345444
Original commit message from CVS: * 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
This commit is contained in:
parent
6ab8345121
commit
c789a10963
4 changed files with 35 additions and 5 deletions
|
@ -1,3 +1,11 @@
|
|||
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:
|
||||
|
|
10
gst/gst.c
10
gst/gst.c
|
@ -565,6 +565,16 @@ static GstPluginDesc plugin_desc = {
|
|||
|
||||
#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)
|
||||
|
|
10
gst/gstpad.c
10
gst/gstpad.c
|
@ -662,10 +662,14 @@ gst_pad_set_active (GstPad * pad, gboolean active)
|
|||
}
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
|
|
|
@ -431,10 +431,11 @@ gst_base_transform_transform_caps (GstBaseTransform * trans,
|
|||
|
||||
/* 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);
|
||||
|
||||
|
@ -452,16 +453,23 @@ gst_base_transform_transform_caps (GstBaseTransform * trans,
|
|||
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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue