X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=gstdoc-scangobj;h=09039a56c36d00767a61af321e837ba3fa1aeae0;hb=HEAD;hp=f31bd465cbc75ffd5e17b2066a490301531119dd;hpb=2686cafce7c34f55074ba0d97f045fd8fc5254a0;p=platform%2Fupstream%2Fgst-common.git diff --git a/gstdoc-scangobj b/gstdoc-scangobj index f31bd46..09039a5 100755 --- a/gstdoc-scangobj +++ b/gstdoc-scangobj @@ -16,7 +16,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. # # @@ -142,6 +142,9 @@ for () { $ntypes = @types + @impl_types + 1; print OUTPUT < #include #include @@ -182,7 +185,9 @@ xmlprint (gint indent, const gchar *tag, const gchar *data) static gint gst_feature_sort_compare (gconstpointer a, gconstpointer b) { - return strcmp (((GstPluginFeature *)a)->name, ((GstPluginFeature *)b)->name); + const gchar *name_a = gst_plugin_feature_get_name ((GstPluginFeature *) a); + const gchar *name_b = gst_plugin_feature_get_name ((GstPluginFeature *) b); + return strcmp (name_a, name_b); } static gint @@ -216,7 +221,7 @@ get_object_types (void) gboolean reinspect; /* get a list of features from plugins in our source module */ - plugins = gst_registry_get_plugin_list (gst_registry_get_default()); + plugins = gst_registry_get_plugin_list (gst_registry_get ()); xmlstr = g_string_new (""); @@ -240,11 +245,13 @@ get_object_types (void) if (gst_plugin_get_filename (plugin) == NULL) continue; - $debug_log ("plugin: %s source: %s", plugin->desc.name, source); + $debug_log ("plugin: %s source: %s", gst_plugin_get_name (plugin), source); if (reinspect) { + gchar *basename; + inspect_name = g_strdup_printf ("$INSPECT_DIR" G_DIR_SEPARATOR_S "plugin-%s.xml", - plugin->desc.name); + gst_plugin_get_name (plugin)); inspect = fopen (inspect_name, "w"); if (inspect == NULL) { g_error ("Could not open %s for writing: %s\\n", inspect_name, @@ -252,23 +259,27 @@ get_object_types (void) } g_free (inspect_name); + basename = g_path_get_basename (gst_plugin_get_filename (plugin)); + /* output plugin data */ fputs ("\\n",inspect); - fputs (xmlprint(2, "name", plugin->desc.name),inspect); - fputs (xmlprint(2, "description", plugin->desc.description),inspect); - fputs (xmlprint(2, "filename", plugin->filename),inspect); - fputs (xmlprint(2, "basename", plugin->basename),inspect); - fputs (xmlprint(2, "version", plugin->desc.version),inspect); - fputs (xmlprint(2, "license", plugin->desc.license),inspect); - fputs (xmlprint(2, "source", plugin->desc.source),inspect); - fputs (xmlprint(2, "package", plugin->desc.package),inspect); - fputs (xmlprint(2, "origin", plugin->desc.origin),inspect); + fputs (xmlprint(2, "name", gst_plugin_get_name (plugin)),inspect); + fputs (xmlprint(2, "description", gst_plugin_get_description (plugin)),inspect); + fputs (xmlprint(2, "filename", gst_plugin_get_filename (plugin)),inspect); + fputs (xmlprint(2, "basename", basename),inspect); + fputs (xmlprint(2, "version", gst_plugin_get_version (plugin)),inspect); + fputs (xmlprint(2, "license", gst_plugin_get_license (plugin)),inspect); + fputs (xmlprint(2, "source", gst_plugin_get_source (plugin)),inspect); + fputs (xmlprint(2, "package", gst_plugin_get_package (plugin)),inspect); + fputs (xmlprint(2, "origin", gst_plugin_get_origin (plugin)),inspect); fputs (" \\n", inspect); + + g_free (basename); } features = - gst_registry_get_feature_list_by_plugin (gst_registry_get_default (), - plugin->desc.name); + gst_registry_get_feature_list_by_plugin (gst_registry_get (), + gst_plugin_get_name (plugin)); /* sort factories by feature->name */ features = g_list_sort (features, gst_feature_sort_compare); @@ -287,7 +298,7 @@ get_object_types (void) const gchar *pad_pres[] = { "always","sometimes","request" }; GList *pads, *pad; - $debug_log (" feature: %s", feature->name); + $debug_log (" feature: %s", gst_plugin_feature_get_name (feature)); factory = GST_ELEMENT_FACTORY (feature); factories = g_list_prepend (factories, factory); @@ -295,11 +306,11 @@ get_object_types (void) if (reinspect) { /* output element data */ fputs (" \\n", inspect); - fputs (xmlprint(6, "name", feature->name),inspect); - fputs (xmlprint(6, "longname", gst_element_factory_get_longname (factory)),inspect); - fputs (xmlprint(6, "class", gst_element_factory_get_klass (factory)),inspect); - fputs (xmlprint(6, "description", gst_element_factory_get_description (factory)),inspect); - fputs (xmlprint(6, "author", gst_element_factory_get_author (factory)),inspect); + fputs (xmlprint(6, "name", gst_plugin_feature_get_name (feature)),inspect); + fputs (xmlprint(6, "longname", gst_element_factory_get_metadata (factory, GST_ELEMENT_METADATA_LONGNAME)),inspect); + fputs (xmlprint(6, "class", gst_element_factory_get_metadata (factory, GST_ELEMENT_METADATA_KLASS)),inspect); + fputs (xmlprint(6, "description", gst_element_factory_get_metadata (factory, GST_ELEMENT_METADATA_DESCRIPTION)),inspect); + fputs (xmlprint(6, "author", gst_element_factory_get_metadata (factory, GST_ELEMENT_METADATA_AUTHOR)),inspect); fputs (" \\n", inspect); /* output pad-template data */ @@ -343,11 +354,11 @@ get_object_types (void) factory = GST_ELEMENT_FACTORY (l->data); type = gst_element_factory_get_element_type (factory); if (type != 0) { - $debug_log ("adding type for factory %s", gst_element_factory_get_longname (factory)); + $debug_log ("adding type for factory %s", gst_element_factory_get_metadata (factory, GST_ELEMENT_METADATA_LONGNAME)); object_types[i++] = type; } else { g_message ("type info for factory %s not found", - gst_element_factory_get_longname (factory)); + gst_element_factory_get_metadata (factory, GST_ELEMENT_METADATA_LONGNAME)); } l = g_list_next (l); } @@ -775,6 +786,16 @@ output_object_hierarchy (void) fclose (fp); } +static int +compare_types (const void *a, const void *b) +{ + const char *na = g_type_name (*((GType *)a)); + const char *nb = g_type_name (*((GType *)b)); + + return g_strcmp0 (na, nb); +} + + /* This is called recursively to output the hierarchy of a object. */ static void output_hierarchy (FILE *fp, @@ -793,6 +814,8 @@ output_hierarchy (FILE *fp, fprintf (fp, "%s\\n", g_type_name (type)); children = g_type_children (type, &n_children); + qsort (children, n_children, sizeof (GType), compare_types); + for (i=0; i < n_children; i++) output_hierarchy (fp, children[i], level + 1); @@ -1578,9 +1601,9 @@ if (!defined($ENV{"GTK_DOC_KEEP_INTERMEDIATE"})) { } &UpdateFileIfChanged ($old_hierarchy_filename, $new_hierarchy_filename, 0); -&UpdateFileIfChanged ($old_interfaces_filename, $new_interfaces_filename, 0); -&UpdateFileIfChanged ($old_prerequisites_filename, $new_prerequisites_filename, 0); # we will merge these in scangobj-merge.py +#&UpdateFileIfChanged ($old_interfaces_filename, $new_interfaces_filename, 0); +#&UpdateFileIfChanged ($old_prerequisites_filename, $new_prerequisites_filename, 0); #&UpdateFileIfChanged ($old_signals_filename, $new_signals_filename, 0); #&UpdateFileIfChanged ($old_args_filename, $new_args_filename, 0);