From: Stefan Kost Date: Mon, 25 Jun 2007 10:06:54 +0000 (+0000) Subject: Also extract element caps for plugin-docs. Fixes parts of #117692. X-Git-Tag: RELEASE-0_10_3~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e6a9941c662289c0743e5d8f4150458a664226f2;p=platform%2Fupstream%2Fgst-common.git Also extract element caps for plugin-docs. Fixes parts of #117692. Original commit message from CVS: * gst-xmlinspect.py: * plugins.xsl: Also extract element caps for plugin-docs. Fixes parts of #117692. --- diff --git a/ChangeLog b/ChangeLog index 720c7ae..b2bcb51 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2007-06-25 Stefan Kost + + * gst-xmlinspect.py: + * plugins.xsl: + Also extract element caps for plugin-docs. Fixes parts of #117692. + 2007-06-21 Tim-Philipp Müller Patch by: Andreas Schwab diff --git a/gst-xmlinspect.py b/gst-xmlinspect.py index ea6fc47..0d7f696 100644 --- a/gst-xmlinspect.py +++ b/gst-xmlinspect.py @@ -15,12 +15,23 @@ import gst INDENT_SIZE = 2 # all templates + +PAD_TEMPLATE = """ + %(name)s + %(direction)s + %(presence)s +
%(details)s
+
""" + ELEMENT_TEMPLATE = """ %(name)s %(longname)s %(class)s %(description)s %(author)s + +%(pads)s + """ PLUGIN_TEMPLATE = """ @@ -50,17 +61,40 @@ def xmlencode(line): def get_offset(indent): return " " * INDENT_SIZE * indent +def output_pad_template(pt, indent=0): + print "PAD TEMPLATE", pt.name_template + paddir = ("unknown","source","sink") + padpres = ("always","sometimes","request") + + d = { + 'name': xmlencode(pt.name_template), + 'direction': xmlencode(paddir[pt.direction]), + 'presence': xmlencode(padpres[pt.presence]), + 'details': xmlencode(pt.static_caps.string), + } + block = PAD_TEMPLATE % d + + offset = get_offset(indent) + return offset + ("\n" + offset).join(block.split("\n")) + def output_element_factory(elf, indent=0): print "ELEMENT", elf.get_name() + + padsoutput = [] + padtemplates = elf.get_static_pad_templates() + for padtemplate in padtemplates: + padsoutput.append(output_pad_template(padtemplate, indent)) + d = { 'name': xmlencode(elf.get_name()), 'longname': xmlencode(elf.get_longname()), 'class': xmlencode(elf.get_klass()), 'description': xmlencode(elf.get_description()), 'author': xmlencode(elf.get_author()), + 'pads': "\n".join(padsoutput), } block = ELEMENT_TEMPLATE % d - + offset = get_offset(indent) return offset + ("\n" + offset).join(block.split("\n")) diff --git a/plugins.xsl b/plugins.xsl index 9cf3dc4..150087f 100644 --- a/plugins.xsl +++ b/plugins.xsl @@ -10,6 +10,7 @@ doctype-system = "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd"/> + @@ -26,37 +27,76 @@ - - Element Information + + Element Information + + + + + plugin + + + + plugin- + + + + + + + + author + + + + + + + class + + + + + + + + Element Pads + + - - - plugin + name - - - plugin- - - - + - + - author + direction - + - + - class + presence - + + + + details + + + + + + + + +