mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-09-28 06:42:16 +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>
|
2006-08-20 Stefan Kost <ensonic@users.sf.net>
|
||||||
|
|
||||||
* gst/gstvalue.c:
|
* gst/gstvalue.c:
|
||||||
|
|
10
gst/gst.c
10
gst/gst.c
|
@ -565,6 +565,16 @@ static GstPluginDesc plugin_desc = {
|
||||||
|
|
||||||
#ifndef GST_DISABLE_REGISTRY
|
#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
|
static gboolean
|
||||||
scan_and_update_registry (GstRegistry * default_registry,
|
scan_and_update_registry (GstRegistry * default_registry,
|
||||||
const gchar * registry_file, gboolean write_changes)
|
const gchar * registry_file, gboolean write_changes)
|
||||||
|
|
|
@ -662,10 +662,14 @@ gst_pad_set_active (GstPad * pad, gboolean active)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!active && !ret) {
|
if (!ret) {
|
||||||
GST_OBJECT_LOCK (pad);
|
GST_OBJECT_LOCK (pad);
|
||||||
|
if (!active) {
|
||||||
g_critical ("Failed to deactivate pad %s:%s, very bad",
|
g_critical ("Failed to deactivate pad %s:%s, very bad",
|
||||||
GST_DEBUG_PAD_NAME (pad));
|
GST_DEBUG_PAD_NAME (pad));
|
||||||
|
} else {
|
||||||
|
GST_WARNING ("Failed to activate pad %s:%s", GST_DEBUG_PAD_NAME (pad));
|
||||||
|
}
|
||||||
GST_OBJECT_UNLOCK (pad);
|
GST_OBJECT_UNLOCK (pad);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -431,10 +431,11 @@ gst_base_transform_transform_caps (GstBaseTransform * trans,
|
||||||
|
|
||||||
/* start with empty caps */
|
/* start with empty caps */
|
||||||
ret = gst_caps_new_empty ();
|
ret = gst_caps_new_empty ();
|
||||||
|
GST_DEBUG_OBJECT (trans, "transform caps (direction = %d)", direction);
|
||||||
|
|
||||||
if (gst_caps_is_any (caps)) {
|
if (gst_caps_is_any (caps)) {
|
||||||
/* for any caps we still have to call the transform function */
|
/* 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);
|
temp = klass->transform_caps (trans, direction, caps);
|
||||||
GST_DEBUG_OBJECT (trans, " to: %" GST_PTR_FORMAT, temp);
|
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_caps_unref (nth);
|
||||||
GST_DEBUG_OBJECT (trans, " to[%d]: %" GST_PTR_FORMAT, i, temp);
|
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);
|
temp = gst_caps_make_writable (temp);
|
||||||
gst_caps_append (ret, 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 {
|
||||||
/* else use the identity transform */
|
/* else use the identity transform */
|
||||||
ret = gst_caps_ref (caps);
|
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;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue