extension);
for (l = type_list; l; l = next) {
+ const gchar *const *ext;
GstTypeFindFactory *factory;
- gint i;
- gchar **ext;
next = l->next;
GST_LOG_OBJECT (obj, "testing factory %s for extension %s",
GST_OBJECT_NAME (factory), extension);
- for (i = 0; ext[i]; i++) {
- if (strcmp (ext[i], extension) == 0) {
+ while (*ext != NULL) {
+ if (strcmp (*ext, extension) == 0) {
/* found extension, move in front */
GST_LOG_OBJECT (obj, "moving typefind for extension %s to head",
extension);
pos++;
break;
}
+ ++ext;
}
}
}
for (l = type_list; l; l = g_list_next (l)) {
GstTypeFindFactory *factory;
- gchar **ext;
- gint i;
+ const gchar *const *ext;
factory = GST_TYPE_FIND_FACTORY (l->data);
/* there are extension, see if one of them matches the requested
* extension */
- for (i = 0; ext[i]; i++) {
- if (strcmp (ext[i], extension) == 0) {
+ while (*ext != NULL) {
+ if (strcmp (*ext, extension) == 0) {
/* we found a matching extension, take the caps */
if ((result = gst_type_find_factory_get_caps (factory))) {
gst_caps_ref (result);
goto done;
}
}
+ ++ext;
}
}
done:
#endif
} else if (GST_IS_TYPE_FIND_FACTORY (feature)) {
GstTypeFindFactory *factory;
+ const gchar *const *extensions;
factory = GST_TYPE_FIND_FACTORY (feature);
if (!print_all)
g_print ("%s: %s: ", gst_plugin_get_name (plugin),
gst_plugin_feature_get_name (feature));
- if (factory->extensions) {
+
+ extensions = gst_type_find_factory_get_extensions (factory);
+ if (extensions != NULL) {
guint i = 0;
- while (factory->extensions[i]) {
+ while (extensions[i]) {
if (!print_all)
- g_print ("%s%s", i > 0 ? ", " : "", factory->extensions[i]);
+ g_print ("%s%s", i > 0 ? ", " : "", extensions[i]);
i++;
}
if (!print_all)
#endif
} else if (GST_IS_TYPE_FIND_FACTORY (feature)) {
GstTypeFindFactory *factory;
+ const gchar *const *extensions;
factory = GST_TYPE_FIND_FACTORY (feature);
- if (factory->extensions) {
+ extensions = gst_type_find_factory_get_extensions (factory);
+ if (extensions) {
guint i = 0;
g_print ("%s: %s: ", gst_plugin_get_name (plugin),
gst_plugin_feature_get_name (feature));
- while (factory->extensions[i]) {
- g_print ("%s%s", i > 0 ? ", " : "", factory->extensions[i]);
+ while (extensions[i]) {
+ g_print ("%s%s", i > 0 ? ", " : "", extensions[i]);
i++;
}
g_print ("\n");