mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-08 16:35:40 +00:00
Avoid unneeded type checks
This commit is contained in:
parent
ceb74fe2cf
commit
761b0e39c1
5 changed files with 16 additions and 19 deletions
|
@ -258,8 +258,9 @@ gst_element_register (GstPlugin * plugin, const gchar * name, guint rank,
|
|||
g_return_val_if_fail (name != NULL, FALSE);
|
||||
g_return_val_if_fail (g_type_is_a (type, GST_TYPE_ELEMENT), FALSE);
|
||||
|
||||
factory = GST_ELEMENT_FACTORY (g_object_new (GST_TYPE_ELEMENT_FACTORY, NULL));
|
||||
gst_plugin_feature_set_name (GST_PLUGIN_FEATURE (factory), name);
|
||||
factory =
|
||||
GST_ELEMENT_FACTORY_CAST (g_object_new (GST_TYPE_ELEMENT_FACTORY, NULL));
|
||||
gst_plugin_feature_set_name (GST_PLUGIN_FEATURE_CAST (factory), name);
|
||||
GST_LOG_OBJECT (factory, "Created new elementfactory for type %s",
|
||||
g_type_name (type));
|
||||
|
||||
|
@ -314,15 +315,15 @@ gst_element_register (GstPlugin * plugin, const gchar * name, guint rank,
|
|||
g_free (interfaces);
|
||||
|
||||
if (plugin && plugin->desc.name) {
|
||||
GST_PLUGIN_FEATURE (factory)->plugin_name = plugin->desc.name;
|
||||
GST_PLUGIN_FEATURE_CAST (factory)->plugin_name = plugin->desc.name;
|
||||
} else {
|
||||
GST_PLUGIN_FEATURE (factory)->plugin_name = "NULL";
|
||||
GST_PLUGIN_FEATURE_CAST (factory)->plugin_name = "NULL";
|
||||
}
|
||||
gst_plugin_feature_set_rank (GST_PLUGIN_FEATURE (factory), rank);
|
||||
GST_PLUGIN_FEATURE (factory)->loaded = TRUE;
|
||||
gst_plugin_feature_set_rank (GST_PLUGIN_FEATURE_CAST (factory), rank);
|
||||
GST_PLUGIN_FEATURE_CAST (factory)->loaded = TRUE;
|
||||
|
||||
gst_registry_add_feature (gst_registry_get_default (),
|
||||
GST_PLUGIN_FEATURE (factory));
|
||||
GST_PLUGIN_FEATURE_CAST (factory));
|
||||
|
||||
return TRUE;
|
||||
|
||||
|
@ -397,7 +398,7 @@ gst_element_factory_create (GstElementFactory * factory, const gchar * name)
|
|||
gst_object_unref (factory);
|
||||
|
||||
if (name)
|
||||
gst_object_set_name (GST_OBJECT (element), name);
|
||||
gst_object_set_name (GST_OBJECT_CAST (element), name);
|
||||
|
||||
GST_DEBUG ("created element \"%s\"", GST_PLUGIN_FEATURE_NAME (factory));
|
||||
|
||||
|
|
|
@ -794,7 +794,7 @@ gst_object_set_parent (GstObject * object, GstObject * parent)
|
|||
gst_object_ref (object);
|
||||
}
|
||||
|
||||
g_signal_emit (G_OBJECT (object), gst_object_signals[PARENT_SET], 0, parent);
|
||||
g_signal_emit (object, gst_object_signals[PARENT_SET], 0, parent);
|
||||
|
||||
return TRUE;
|
||||
|
||||
|
@ -860,8 +860,7 @@ gst_object_unparent (GstObject * object)
|
|||
object->parent = NULL;
|
||||
GST_OBJECT_UNLOCK (object);
|
||||
|
||||
g_signal_emit (G_OBJECT (object), gst_object_signals[PARENT_UNSET], 0,
|
||||
parent);
|
||||
g_signal_emit (object, gst_object_signals[PARENT_UNSET], 0, parent);
|
||||
|
||||
gst_object_unref (object);
|
||||
} else {
|
||||
|
@ -966,8 +965,7 @@ gst_object_save_thyself (GstObject * object, xmlNodePtr parent)
|
|||
if (oclass->save_thyself)
|
||||
oclass->save_thyself (object, parent);
|
||||
|
||||
g_signal_emit (G_OBJECT (object), gst_object_signals[OBJECT_SAVED], 0,
|
||||
parent);
|
||||
g_signal_emit (object, gst_object_signals[OBJECT_SAVED], 0, parent);
|
||||
|
||||
return parent;
|
||||
}
|
||||
|
|
|
@ -185,7 +185,7 @@ gst_plugin_feature_set_name (GstPluginFeature * feature, const gchar * name)
|
|||
} else {
|
||||
feature->name = g_strdup (name);
|
||||
}
|
||||
gst_object_set_name (GST_OBJECT (feature), feature->name);
|
||||
gst_object_set_name (GST_OBJECT_CAST (feature), feature->name);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -357,8 +357,7 @@ gst_registry_add_plugin (GstRegistry * registry, GstPlugin * plugin)
|
|||
|
||||
GST_LOG_OBJECT (registry, "emitting plugin-added for filename \"%s\"",
|
||||
GST_STR_NULL (plugin->filename));
|
||||
g_signal_emit (G_OBJECT (registry), gst_registry_signals[PLUGIN_ADDED], 0,
|
||||
plugin);
|
||||
g_signal_emit (registry, gst_registry_signals[PLUGIN_ADDED], 0, plugin);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -465,8 +464,7 @@ gst_registry_add_feature (GstRegistry * registry, GstPluginFeature * feature)
|
|||
GST_OBJECT_UNLOCK (registry);
|
||||
|
||||
GST_LOG_OBJECT (registry, "emitting feature-added for %s", feature->name);
|
||||
g_signal_emit (G_OBJECT (registry), gst_registry_signals[FEATURE_ADDED], 0,
|
||||
feature);
|
||||
g_signal_emit (registry, gst_registry_signals[FEATURE_ADDED], 0, feature);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
@ -938,7 +938,7 @@ gst_registry_binary_load_feature (GstRegistry * registry, gchar ** in,
|
|||
|
||||
if (GST_IS_ELEMENT_FACTORY (feature)) {
|
||||
GstBinaryElementFactory *ef;
|
||||
GstElementFactory *factory = GST_ELEMENT_FACTORY (feature);
|
||||
GstElementFactory *factory = GST_ELEMENT_FACTORY_CAST (feature);
|
||||
|
||||
align (*in);
|
||||
GST_LOG ("Reading/casting for GstBinaryElementFactory at address %p", *in);
|
||||
|
|
Loading…
Reference in a new issue