Commit 761b0e39 authored by Wim Taymans's avatar Wim Taymans Committed by Wim Taymans
Browse files

Avoid unneeded type checks

parent ceb74fe2
...@@ -258,8 +258,9 @@ gst_element_register (GstPlugin * plugin, const gchar * name, guint rank, ...@@ -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 (name != NULL, FALSE);
g_return_val_if_fail (g_type_is_a (type, GST_TYPE_ELEMENT), 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)); factory =
gst_plugin_feature_set_name (GST_PLUGIN_FEATURE (factory), name); 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", GST_LOG_OBJECT (factory, "Created new elementfactory for type %s",
g_type_name (type)); g_type_name (type));
...@@ -314,15 +315,15 @@ gst_element_register (GstPlugin * plugin, const gchar * name, guint rank, ...@@ -314,15 +315,15 @@ gst_element_register (GstPlugin * plugin, const gchar * name, guint rank,
g_free (interfaces); g_free (interfaces);
if (plugin && plugin->desc.name) { 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 { } 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_set_rank (GST_PLUGIN_FEATURE_CAST (factory), rank);
GST_PLUGIN_FEATURE (factory)->loaded = TRUE; GST_PLUGIN_FEATURE_CAST (factory)->loaded = TRUE;
gst_registry_add_feature (gst_registry_get_default (), gst_registry_add_feature (gst_registry_get_default (),
GST_PLUGIN_FEATURE (factory)); GST_PLUGIN_FEATURE_CAST (factory));
return TRUE; return TRUE;
...@@ -397,7 +398,7 @@ gst_element_factory_create (GstElementFactory * factory, const gchar * name) ...@@ -397,7 +398,7 @@ gst_element_factory_create (GstElementFactory * factory, const gchar * name)
gst_object_unref (factory); gst_object_unref (factory);
if (name) 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)); GST_DEBUG ("created element \"%s\"", GST_PLUGIN_FEATURE_NAME (factory));
......
...@@ -794,7 +794,7 @@ gst_object_set_parent (GstObject * object, GstObject * parent) ...@@ -794,7 +794,7 @@ gst_object_set_parent (GstObject * object, GstObject * parent)
gst_object_ref (object); 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; return TRUE;
...@@ -860,8 +860,7 @@ gst_object_unparent (GstObject * object) ...@@ -860,8 +860,7 @@ gst_object_unparent (GstObject * object)
object->parent = NULL; object->parent = NULL;
GST_OBJECT_UNLOCK (object); GST_OBJECT_UNLOCK (object);
g_signal_emit (G_OBJECT (object), gst_object_signals[PARENT_UNSET], 0, g_signal_emit (object, gst_object_signals[PARENT_UNSET], 0, parent);
parent);
gst_object_unref (object); gst_object_unref (object);
} else { } else {
...@@ -966,8 +965,7 @@ gst_object_save_thyself (GstObject * object, xmlNodePtr parent) ...@@ -966,8 +965,7 @@ gst_object_save_thyself (GstObject * object, xmlNodePtr parent)
if (oclass->save_thyself) if (oclass->save_thyself)
oclass->save_thyself (object, parent); oclass->save_thyself (object, parent);
g_signal_emit (G_OBJECT (object), gst_object_signals[OBJECT_SAVED], 0, g_signal_emit (object, gst_object_signals[OBJECT_SAVED], 0, parent);
parent);
return parent; return parent;
} }
......
...@@ -185,7 +185,7 @@ gst_plugin_feature_set_name (GstPluginFeature * feature, const gchar * name) ...@@ -185,7 +185,7 @@ gst_plugin_feature_set_name (GstPluginFeature * feature, const gchar * name)
} else { } else {
feature->name = g_strdup (name); 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) ...@@ -357,8 +357,7 @@ gst_registry_add_plugin (GstRegistry * registry, GstPlugin * plugin)
GST_LOG_OBJECT (registry, "emitting plugin-added for filename \"%s\"", GST_LOG_OBJECT (registry, "emitting plugin-added for filename \"%s\"",
GST_STR_NULL (plugin->filename)); GST_STR_NULL (plugin->filename));
g_signal_emit (G_OBJECT (registry), gst_registry_signals[PLUGIN_ADDED], 0, g_signal_emit (registry, gst_registry_signals[PLUGIN_ADDED], 0, plugin);
plugin);
return TRUE; return TRUE;
} }
...@@ -465,8 +464,7 @@ gst_registry_add_feature (GstRegistry * registry, GstPluginFeature * feature) ...@@ -465,8 +464,7 @@ gst_registry_add_feature (GstRegistry * registry, GstPluginFeature * feature)
GST_OBJECT_UNLOCK (registry); GST_OBJECT_UNLOCK (registry);
GST_LOG_OBJECT (registry, "emitting feature-added for %s", feature->name); GST_LOG_OBJECT (registry, "emitting feature-added for %s", feature->name);
g_signal_emit (G_OBJECT (registry), gst_registry_signals[FEATURE_ADDED], 0, g_signal_emit (registry, gst_registry_signals[FEATURE_ADDED], 0, feature);
feature);
return TRUE; return TRUE;
} }
......
...@@ -938,7 +938,7 @@ gst_registry_binary_load_feature (GstRegistry * registry, gchar ** in, ...@@ -938,7 +938,7 @@ gst_registry_binary_load_feature (GstRegistry * registry, gchar ** in,
if (GST_IS_ELEMENT_FACTORY (feature)) { if (GST_IS_ELEMENT_FACTORY (feature)) {
GstBinaryElementFactory *ef; GstBinaryElementFactory *ef;
GstElementFactory *factory = GST_ELEMENT_FACTORY (feature); GstElementFactory *factory = GST_ELEMENT_FACTORY_CAST (feature);
align (*in); align (*in);
GST_LOG ("Reading/casting for GstBinaryElementFactory at address %p", *in); GST_LOG ("Reading/casting for GstBinaryElementFactory at address %p", *in);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment