void
gst_element_add_pad (GstElement *element, GstPad *pad)
{
- g_return_if_fail (element != NULL);
g_return_if_fail (GST_IS_ELEMENT (element));
- g_return_if_fail (pad != NULL);
g_return_if_fail (GST_IS_PAD (pad));
/* first check to make sure the pad's parent is already set */
/* set the pad's parent */
GST_DEBUG (GST_CAT_ELEMENT_PADS,"setting parent of pad '%s' to '%s'",
- GST_PAD_NAME (pad), GST_ELEMENT_NAME (element));
+ GST_PAD_NAME (pad), GST_STR_NULL (GST_ELEMENT_NAME (element)));
gst_object_set_parent (GST_OBJECT (pad), GST_OBJECT (element));
/* add it to the list */
GST_DEBUG (GST_CAT_ELEMENT_FACTORY,
"creating element from factory \"%s\" (name \"%s\", type %d)",
- GST_PLUGIN_FEATURE_NAME (factory), name, (gint) factory->type);
+ GST_PLUGIN_FEATURE_NAME (factory), GST_STR_NULL (name), (gint) factory->type);
if (factory->type == 0) {
g_critical ("Factory for `%s' has no type",
g_return_val_if_fail (factoryname != NULL, NULL);
GST_DEBUG (GST_CAT_ELEMENT_FACTORY, "gstelementfactory: make \"%s\" \"%s\"",
- factoryname, name);
+ factoryname, GST_STR_NULL (name));
/* gst_plugin_load_element_factory (factoryname); */
factory = gst_element_factory_find (factoryname);
if (element && GST_IS_ELEMENT (element))
#ifdef GST_DEBUG_COLOR
elementname = g_strdup_printf (" \033[04m[%s]\033[00m",
- GST_OBJECT_NAME (element));
+ GST_STR_NULL (GST_OBJECT_NAME (element)));
#else
elementname = g_strdup_printf (" [%s]", GST_OBJECT_NAME (element));
#endif
gchar *_gst_debug_nameof_funcptr (void *ptr) G_GNUC_NO_INSTRUMENT;
+/* This function MUST NOT return NULL */
gchar *
_gst_debug_nameof_funcptr (void *ptr)
{
} else {
return g_strdup_printf("%p",ptr);
}
- return NULL;
}
void *
/********** some convenience macros for debugging **********/
#define GST_DEBUG_PAD_NAME(pad) \
(GST_OBJECT_PARENT(pad) != NULL) ? \
- GST_OBJECT_NAME (GST_OBJECT_PARENT(pad)) : \
+ GST_STR_NULL (GST_OBJECT_NAME (GST_OBJECT_PARENT(pad))) : \
"''", GST_OBJECT_NAME (pad)
#ifdef G_HAVE_ISO_VARARGS
g_return_val_if_fail (GST_IS_OBJECT (object), NULL);
GST_DEBUG (GST_CAT_REFCOUNTING, "ref %p '%s' %d->%d", object,
- GST_OBJECT_NAME (object),
+ GST_STR_NULL (GST_OBJECT_NAME (object)),
G_OBJECT (object)->ref_count,
G_OBJECT (object)->ref_count + 1);
g_return_if_fail (G_OBJECT (object)->ref_count > 0);
GST_DEBUG (GST_CAT_REFCOUNTING, "unref %p '%s' %d->%d", object,
- GST_OBJECT_NAME (object),
+ GST_STR_NULL (GST_OBJECT_NAME (object)),
G_OBJECT (object)->ref_count,
G_OBJECT (object)->ref_count - 1);
g_return_if_fail (object != NULL);
g_return_if_fail (GST_IS_OBJECT (object));
- GST_DEBUG (GST_CAT_REFCOUNTING, "sink %p '%s'", object, GST_OBJECT_NAME (object));
+ GST_DEBUG (GST_CAT_REFCOUNTING, "sink %p '%s'", object, GST_STR_NULL (GST_OBJECT_NAME (object)));
if (GST_OBJECT_FLOATING (object)) {
GST_FLAG_UNSET (object, GST_FLOATING);
static void
gst_object_dispose (GObject *object)
{
- GST_DEBUG (GST_CAT_REFCOUNTING, "dispose %p '%s'", object, GST_OBJECT_NAME (object));
+ GST_DEBUG (GST_CAT_REFCOUNTING, "dispose %p '%s'", object, GST_STR_NULL (GST_OBJECT_NAME (object)));
GST_FLAG_SET (GST_OBJECT (object), GST_DESTROYED);
GST_OBJECT_PARENT (object) = NULL;
{
GstObject *gstobject = GST_OBJECT (object);
- GST_DEBUG (GST_CAT_REFCOUNTING, "finalize %p '%s'", object, GST_OBJECT_NAME (object));
+ GST_DEBUG (GST_CAT_REFCOUNTING, "finalize %p '%s'", object, GST_STR_NULL (GST_OBJECT_NAME (object)));
g_signal_handlers_destroy (object);
- if (gstobject->name != NULL)
- g_free (gstobject->name);
+ g_free (gstobject->name);
g_mutex_free (gstobject->lock);