user/system registry
--------------------
-
-first query the user registry, then fall back to system registry.
+There are two be two registries on the system. One system registry and one user registry.
+The user registry should be queried first, then if that doesn't exist or don't contain any
+plugins able to handle the mediatype it should fall back to system registry.
model:
------
{
GstElement *bin;
GstElement *src;
+ char *name;
- bin = gst_bin_new (g_strdup_printf ("bin%d", count));
- src = gst_element_factory_make ("fakesrc", g_strdup_printf ("fakesrc%d", count));
+ name = g_strdup_printf ("bin%d", count);
+ bin = gst_bin_new (name);
+ g_free (name);
+
+ name = g_strdup_printf ("fakesrc%d", count);
+ src = gst_element_factory_make ("fakesrc", name);
+ g_free (name);
gst_bin_add (GST_BIN (bin), src);
gst_spider_identity_start_type_finding (GstSpiderIdentity *ident)
{
GstElement* typefind;
+ gchar *name;
gboolean restart = FALSE;
GST_DEBUG (GST_CAT_AUTOPLUG, "element %s starts typefinding", GST_ELEMENT_NAME(ident));
}
/* create and connect typefind object */
- typefind = gst_element_factory_make ("typefind", g_strdup_printf("%s%s", "typefind", GST_ELEMENT_NAME(ident)));
+ name = g_strdup_printf ("%s%s", "typefind", GST_ELEMENT_NAME(ident));
+ typefind = gst_element_factory_make ("typefind", name);
+ g_free (name);
+
g_signal_connect (G_OBJECT (typefind), "have_type",
G_CALLBACK (callback_type_find_have_type), ident);
gst_bin_add (GST_BIN (GST_ELEMENT_PARENT (ident)), typefind);
pads = g_list_next (pads);
if (gst_caps_check_compatibility (GST_PAD_TEMPLATE_CAPS (templ), info->endcap)) {
- gst_element_add_ghost_pad (info->result, pad, g_strdup_printf("src_%02d", info->i));
+ gchar *name;
+
+ name = g_strdup_printf ("src_%02d", info->i);
+ gst_element_add_ghost_pad (info->result, pad, name);
+ g_free (name);
+
GST_DEBUG (0,"gstpipeline: new dynamic pad %s", GST_PAD_NAME (pad));
break;
}
pads = g_list_next (pads);
if (gst_caps_check_compatibility (GST_PAD_TEMPLATE_CAPS (templ), endcap)) {
- gst_element_add_ghost_pad (result, pad, g_strdup_printf("src_%02d", i));
+ gchar *name;
+
+ name = g_strdup_printf ("src_%02d", i);
+ gst_element_add_ghost_pad (result, pad, name);
+ g_free (name);
+
have_pad = TRUE;
break;
}
name = g_strdup_printf ("sink%d",aggregator->numsinkpads);
sinkpad = gst_pad_new_from_template (templ, name);
+ g_free (name);
+
gst_pad_set_chain_function (sinkpad, gst_aggregator_chain);
gst_element_add_pad (GST_ELEMENT (aggregator), sinkpad);
name = g_strdup_printf ("sink%d", GST_ELEMENT (fakesink)->numsinkpads);
sinkpad = gst_pad_new_from_template (templ, name);
+ g_free (name);
+
gst_element_add_pad (GST_ELEMENT (fakesink), sinkpad);
return sinkpad;
identity->drop_probability = 0.0;
identity->silent = FALSE;
identity->dump = FALSE;
+ identity->last_message = NULL;
}
static void
if (identity->drop_probability > 0.0) {
if ((gfloat)(1.0*rand()/(RAND_MAX)) < identity->drop_probability) {
+ if (identity->last_message != NULL) {
+ g_free (identity->last_message);
+ }
identity->last_message = g_strdup_printf ("dropping ******* (%s:%s)i (%d bytes, %llu)",
GST_DEBUG_PAD_NAME (identity->sinkpad), GST_BUFFER_SIZE (buf), GST_BUFFER_TIMESTAMP (buf));
g_object_notify (G_OBJECT (identity), "last-message");
for (i = identity->duplicate; i; i--) {
if (!identity->silent)
+ if (identity->last_message != NULL) {
+ g_free (identity->last_message);
+ }
identity->last_message = g_strdup_printf ("chain ******* (%s:%s)i (%d bytes, %llu)",
GST_DEBUG_PAD_NAME (identity->sinkpad), GST_BUFFER_SIZE (buf), GST_BUFFER_TIMESTAMP (buf));
g_object_notify (G_OBJECT (identity), "last-message");
spec = specs[i];
if (spec->flags & G_PARAM_READABLE) {
xmlNodePtr param;
+ char *contents;
g_value_init(&value, G_PARAM_SPEC_VALUE_TYPE (spec));
xmlNewChild (param, NULL, "name", spec->name);
if (G_IS_PARAM_SPEC_STRING (spec))
- xmlNewChild (param, NULL, "value", g_value_dup_string (&value));
+ contents = g_value_dup_string (&value);
else if (G_IS_PARAM_SPEC_ENUM (spec))
- xmlNewChild (param, NULL, "value",
- g_strdup_printf ("%d", g_value_get_enum (&value)));
+ contents = g_strdup_printf ("%d", g_value_get_enum (&value));
else if (G_IS_PARAM_SPEC_INT64 (spec))
- xmlNewChild (param, NULL, "value",
- g_strdup_printf ("%lld", g_value_get_int64 (&value)));
+ contents = g_strdup_printf ("%lld", g_value_get_int64 (&value));
else
- xmlNewChild (param, NULL, "value", g_strdup_value_contents (&value));
+ contents = g_strdup_value_contents (&value);
+
+ xmlNewChild (param, NULL, "value", contents);
+ g_free (contents);
g_value_unset(&value);
}
case GST_STATE_READY: return "\033[01;31mREADY\033[00m";break;
case GST_STATE_PLAYING: return "\033[01;32mPLAYING\033[00m";break;
case GST_STATE_PAUSED: return "\033[01;33mPAUSED\033[00m";break;
- default:
+ default:
+ /* This is a memory leak */
return g_strdup_printf ("\033[01;37;41mUNKNOWN!\033[00m(%d)", state);
#else
case GST_STATE_VOID_PENDING: return "NONE_PENDING";break;
xmlNewChild (parent, NULL, "name", GST_PAD_NAME (realpad));
if (GST_RPAD_PEER (realpad) != NULL) {
+ gchar *content;
+
peer = GST_PAD (GST_RPAD_PEER (realpad));
/* first check to see if the peer's parent's parent is the same */
/* we just save it off */
- xmlNewChild (parent, NULL, "peer",
- g_strdup_printf ("%s.%s",
- GST_OBJECT_NAME (GST_PAD_PARENT (peer)),
- GST_PAD_NAME (peer)));
+ content = g_strdup_printf ("%s.%s",
+ GST_OBJECT_NAME (GST_PAD_PARENT (peer)),
+ GST_PAD_NAME (peer));
+ xmlNewChild (parent, NULL, "peer", content);
+ g_free (content);
} else
xmlNewChild (parent, NULL, "peer", "");
name = g_strdup_printf ("sink%d",aggregator->numsinkpads);
sinkpad = gst_pad_new_from_template (templ, name);
+ g_free (name);
+
gst_pad_set_chain_function (sinkpad, gst_aggregator_chain);
gst_element_add_pad (GST_ELEMENT (aggregator), sinkpad);
name = g_strdup_printf ("sink%d", GST_ELEMENT (fakesink)->numsinkpads);
sinkpad = gst_pad_new_from_template (templ, name);
+ g_free (name);
+
gst_element_add_pad (GST_ELEMENT (fakesink), sinkpad);
return sinkpad;
identity->drop_probability = 0.0;
identity->silent = FALSE;
identity->dump = FALSE;
+ identity->last_message = NULL;
}
static void
if (identity->drop_probability > 0.0) {
if ((gfloat)(1.0*rand()/(RAND_MAX)) < identity->drop_probability) {
+ if (identity->last_message != NULL) {
+ g_free (identity->last_message);
+ }
identity->last_message = g_strdup_printf ("dropping ******* (%s:%s)i (%d bytes, %llu)",
GST_DEBUG_PAD_NAME (identity->sinkpad), GST_BUFFER_SIZE (buf), GST_BUFFER_TIMESTAMP (buf));
g_object_notify (G_OBJECT (identity), "last-message");
for (i = identity->duplicate; i; i--) {
if (!identity->silent)
+ if (identity->last_message != NULL) {
+ g_free (identity->last_message);
+ }
identity->last_message = g_strdup_printf ("chain ******* (%s:%s)i (%d bytes, %llu)",
GST_DEBUG_PAD_NAME (identity->sinkpad), GST_BUFFER_SIZE (buf), GST_BUFFER_TIMESTAMP (buf));
g_object_notify (G_OBJECT (identity), "last-message");
{
GstElement *bin;
GstElement *src;
+ char *name;
- bin = gst_bin_new (g_strdup_printf ("bin%d", count));
- src = gst_element_factory_make ("fakesrc", g_strdup_printf ("fakesrc%d", count));
+ name = g_strdup_printf ("bin%d", count);
+ bin = gst_bin_new (name);
+ g_free (name);
+
+ name = g_strdup_printf ("fakesrc%d", count);
+ src = gst_element_factory_make ("fakesrc", name);
+ g_free (name);
gst_bin_add (GST_BIN (bin), src);