GST_START_TEST (test_find_feature)
{
GstPluginFeature *feature;
+ GstPlugin *plugin;
feature = gst_registry_find_feature (gst_registry_get (),
"identity", GST_TYPE_ELEMENT_FACTORY);
fail_if (feature == NULL, "Failed to find identity element factory");
- fail_if (strcmp (feature->plugin_name, "coreelements"),
- "Expected identity to be from coreelements plugin");
+
+ plugin = gst_plugin_feature_get_plugin (feature);
+ fail_unless (plugin != NULL);
+ fail_unless_equals_string (gst_plugin_get_name (plugin), "coreelements");
+ gst_object_unref (plugin);
fail_if (GST_OBJECT_REFCOUNT_VALUE (feature) != 2,
"Refcount of feature should be 2");
print_factory_details_info (GstElementFactory * factory)
{
gchar **keys, **k;
+ GstRank rank;
char s[20];
+ rank = gst_plugin_feature_get_rank (GST_PLUGIN_FEATURE (factory));
n_print ("Factory Details:\n");
- n_print (" Rank:\t\t%s (%d)\n",
- get_rank_name (s, GST_PLUGIN_FEATURE (factory)->rank),
- GST_PLUGIN_FEATURE (factory)->rank);
+ n_print (" Rank:\t\t%s (%d)\n", get_rank_name (s, rank), rank);
keys = gst_element_factory_get_metadata_keys (factory);
if (keys != NULL) {
print_element_info (GstElementFactory * factory, gboolean print_names)
{
GstElement *element;
+ GstPlugin *plugin;
gint maxlevel = 0;
factory =
_name = NULL;
print_factory_details_info (factory);
- if (GST_PLUGIN_FEATURE (factory)->plugin_name) {
- GstPlugin *plugin;
- plugin = gst_registry_find_plugin (gst_registry_get (),
- GST_PLUGIN_FEATURE (factory)->plugin_name);
- if (plugin) {
- print_plugin_info (plugin);
- }
+ plugin = gst_plugin_feature_get_plugin (GST_PLUGIN_FEATURE (factory));
+ if (plugin) {
+ print_plugin_info (plugin);
+ gst_object_unref (plugin);
}
print_hierarchy (G_OBJECT_TYPE (element), 0, &maxlevel);
static void
print_plugin_automatic_install_info (GstPlugin * plugin)
{
- const gchar *plugin_name;
GList *features, *l;
- plugin_name = gst_plugin_get_name (plugin);
-
/* not interested in typefind factories, only element factories */
features = gst_registry_get_feature_list (gst_registry_get (),
GST_TYPE_ELEMENT_FACTORY);
for (l = features; l != NULL; l = l->next) {
GstPluginFeature *feature;
+ GstPlugin *feature_plugin;
feature = GST_PLUGIN_FEATURE (l->data);
/* only interested in the ones that are in the plugin we just loaded */
- if (g_str_equal (plugin_name, feature->plugin_name)) {
+ feature_plugin = gst_plugin_feature_get_plugin (feature);
+ if (feature_plugin == plugin) {
GstElementFactory *factory;
g_print ("element-%s\n", gst_plugin_feature_get_name (feature));
print_plugin_automatic_install_info_protocols (factory);
print_plugin_automatic_install_info_codecs (factory);
}
+ if (feature_plugin)
+ gst_object_unref (feature_plugin);
}
g_list_foreach (features, (GFunc) gst_object_unref, NULL);