mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-15 22:01:27 +00:00
gst/gstcaps.c: unset GValue after use
Original commit message from CVS: * gst/gstcaps.c: (gst_caps_structure_simplify): unset GValue after use * gst/gstcaps.c: (gst_caps_append), * gst/gstpad.c: (gst_pad_link_fixate), (gst_pad_template_new): use gst_caps_simplify (reduces registry size by 30%) * gst/gstpad.c: (gst_pad_template_new): don't allow NULL caps
This commit is contained in:
parent
03a9d6a747
commit
a79d06fe59
3 changed files with 19 additions and 2 deletions
10
ChangeLog
10
ChangeLog
|
@ -1,3 +1,13 @@
|
||||||
|
2004-04-22 Benjamin Otte <otte@gnome.org>
|
||||||
|
|
||||||
|
* gst/gstcaps.c: (gst_caps_structure_simplify):
|
||||||
|
unset GValue after use
|
||||||
|
* gst/gstcaps.c: (gst_caps_append),
|
||||||
|
* gst/gstpad.c: (gst_pad_link_fixate), (gst_pad_template_new):
|
||||||
|
use gst_caps_simplify (reduces registry size by 30%)
|
||||||
|
* gst/gstpad.c: (gst_pad_template_new):
|
||||||
|
don't allow NULL caps
|
||||||
|
|
||||||
2004-04-22 Benjamin Otte <otte@gnome.org>
|
2004-04-22 Benjamin Otte <otte@gnome.org>
|
||||||
|
|
||||||
* docs/gst/gstreamer-sections.txt:
|
* docs/gst/gstreamer-sections.txt:
|
||||||
|
|
|
@ -298,6 +298,7 @@ gst_caps_append (GstCaps * caps1, GstCaps * caps2)
|
||||||
structure = gst_caps_get_structure (caps2, i);
|
structure = gst_caps_get_structure (caps2, i);
|
||||||
gst_caps_append_structure (caps1, structure);
|
gst_caps_append_structure (caps1, structure);
|
||||||
}
|
}
|
||||||
|
gst_caps_do_simplify (caps1);
|
||||||
}
|
}
|
||||||
g_ptr_array_free (caps2->structs, TRUE);
|
g_ptr_array_free (caps2->structs, TRUE);
|
||||||
#ifdef USE_POISONING
|
#ifdef USE_POISONING
|
||||||
|
@ -1186,6 +1187,7 @@ gst_caps_structure_simplify (const GstStructure * simplify,
|
||||||
g_assert (field.name != 0);
|
g_assert (field.name != 0);
|
||||||
gst_structure_id_set_value (compare, field.name, &field.value);
|
gst_structure_id_set_value (compare, field.name, &field.value);
|
||||||
gst_structure_free (ret);
|
gst_structure_free (ret);
|
||||||
|
g_value_unset (&field.value);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1193,7 +1195,7 @@ gst_caps_structure_simplify (const GstStructure * simplify,
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gst_caps_simplify:
|
* gst_caps_do_simplify:
|
||||||
* @caps: a #GstCaps to simplify
|
* @caps: a #GstCaps to simplify
|
||||||
*
|
*
|
||||||
* Modifies the given @caps inplace into a representation that represents the
|
* Modifies the given @caps inplace into a representation that represents the
|
||||||
|
|
|
@ -1151,6 +1151,7 @@ gst_pad_link_fixate (GstPadLink * link)
|
||||||
|
|
||||||
GST_DEBUG ("trying to fixate caps %" GST_PTR_FORMAT, caps);
|
GST_DEBUG ("trying to fixate caps %" GST_PTR_FORMAT, caps);
|
||||||
|
|
||||||
|
gst_caps_do_simplify (caps);
|
||||||
while (!gst_caps_is_fixed (caps)) {
|
while (!gst_caps_is_fixed (caps)) {
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
@ -1196,9 +1197,11 @@ gst_pad_link_fixate (GstPadLink * link)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (newcaps) {
|
if (newcaps) {
|
||||||
|
G_GNUC_UNUSED gboolean bad;
|
||||||
|
|
||||||
|
gst_caps_do_simplify (newcaps);
|
||||||
#ifndef G_DISABLE_CHECKS
|
#ifndef G_DISABLE_CHECKS
|
||||||
/* some mad checking for correctly working fixation functions */
|
/* some mad checking for correctly working fixation functions */
|
||||||
gboolean bad;
|
|
||||||
|
|
||||||
if (i == 4) {
|
if (i == 4) {
|
||||||
/* we trust the default fixation function unconditionally */
|
/* we trust the default fixation function unconditionally */
|
||||||
|
@ -3578,6 +3581,7 @@ gst_pad_template_new (const gchar * name_template,
|
||||||
GstPadTemplate *new;
|
GstPadTemplate *new;
|
||||||
|
|
||||||
g_return_val_if_fail (name_template != NULL, NULL);
|
g_return_val_if_fail (name_template != NULL, NULL);
|
||||||
|
g_return_val_if_fail (caps != NULL, NULL);
|
||||||
|
|
||||||
if (!name_is_valid (name_template, presence))
|
if (!name_is_valid (name_template, presence))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -3598,6 +3602,7 @@ gst_pad_template_new (const gchar * name_template,
|
||||||
GST_PAD_TEMPLATE_NAME_TEMPLATE (new) = g_strdup (name_template);
|
GST_PAD_TEMPLATE_NAME_TEMPLATE (new) = g_strdup (name_template);
|
||||||
GST_PAD_TEMPLATE_DIRECTION (new) = direction;
|
GST_PAD_TEMPLATE_DIRECTION (new) = direction;
|
||||||
GST_PAD_TEMPLATE_PRESENCE (new) = presence;
|
GST_PAD_TEMPLATE_PRESENCE (new) = presence;
|
||||||
|
gst_caps_do_simplify (caps);
|
||||||
GST_PAD_TEMPLATE_CAPS (new) = caps;
|
GST_PAD_TEMPLATE_CAPS (new) = caps;
|
||||||
|
|
||||||
return new;
|
return new;
|
||||||
|
|
Loading…
Reference in a new issue