Commit 2d46903e authored by Thibault Saunier's avatar Thibault Saunier 🌵 Committed by Mathieu Duponchelle
Browse files

Remove old school plugins listing generator

parent 7159236b
This diff is collapsed.
This diff is collapsed.
<plugins module_name="gstreamer">
<plugin>
<name>coreelements</name>
<description>GStreamer core elements</description>
<filename>../../plugins/elements/.libs/libgstcoreelements.so</filename>
<basename>libgstcoreelements.so</basename>
<version>1.10.1</version>
<license>LGPL</license>
<source>gstreamer</source>
<package>GStreamer source release</package>
<origin>Unknown package origin</origin>
<elements>
<element>
<name>capsfilter</name>
<longname>CapsFilter</longname>
<class>Generic</class>
<description>Pass data without modification, limiting formats</description>
<author>David Schleef &lt;ds@schleef.org&gt;</author>
<pads>
<caps>
<name>sink</name>
<direction>sink</direction>
<presence>always</presence>
<details>ANY</details>
</caps>
<caps>
<name>src</name>
<direction>source</direction>
<presence>always</presence>
<details>ANY</details>
</caps>
</pads>
</element>
<element>
<name>concat</name>
<longname>Concat</longname>
<class>Generic</class>
<description>Concatenate multiple streams</description>
<author>Sebastian Dröge &lt;sebastian@centricular.com&gt;</author>
<pads>
<caps>
<name>sink_%u</name>
<direction>sink</direction>
<presence>request</presence>
<details>ANY</details>
</caps>
<caps>
<name>src</name>
<direction>source</direction>
<presence>always</presence>
<details>ANY</details>
</caps>
</pads>
</element>
<element>
<name>downloadbuffer</name>
<longname>DownloadBuffer</longname>
<class>Generic</class>
<description>Download Buffer element</description>
<author>Wim Taymans &lt;wim.taymans@gmail.com&gt;</author>
<pads>
<caps>
<name>sink</name>
<direction>sink</direction>
<presence>always</presence>
<details>ANY</details>
</caps>
<caps>
<name>src</name>
<direction>source</direction>
<presence>always</presence>
<details>ANY</details>
</caps>
</pads>
</element>
<element>
<name>fakesink</name>
<longname>Fake Sink</longname>
<class>Sink</class>
<description>Black hole for data</description>
<author>Erik Walthinsen &lt;omega@cse.ogi.edu&gt;, Wim Taymans &lt;wim@fluendo.com&gt;, Mr. &apos;frag-me-more&apos; Vanderwingo &lt;wingo@fluendo.com&gt;</author>
<pads>
<caps>
<name>sink</name>
<direction>sink</direction>
<presence>always</presence>
<details>ANY</details>
</caps>
</pads>
</element>
<element>
<name>fakesrc</name>
<longname>Fake Source</longname>
<class>Source</class>
<description>Push empty (no data) buffers around</description>
<author>Erik Walthinsen &lt;omega@cse.ogi.edu&gt;, Wim Taymans &lt;wim@fluendo.com&gt;</author>
<pads>
<caps>
<name>src</name>
<direction>source</direction>
<presence>always</presence>
<details>ANY</details>
</caps>
</pads>
</element>
<element>
<name>fdsink</name>
<longname>Filedescriptor Sink</longname>
<class>Sink/File</class>
<description>Write data to a file descriptor</description>
<author>Erik Walthinsen &lt;omega@cse.ogi.edu&gt;</author>
<pads>
<caps>
<name>sink</name>
<direction>sink</direction>
<presence>always</presence>
<details>ANY</details>
</caps>
</pads>
</element>
<element>
<name>fdsrc</name>
<longname>Filedescriptor Source</longname>
<class>Source/File</class>
<description>Read from a file descriptor</description>
<author>Erik Walthinsen &lt;omega@cse.ogi.edu&gt;</author>
<pads>
<caps>
<name>src</name>
<direction>source</direction>
<presence>always</presence>
<details>ANY</details>
</caps>
</pads>
</element>
<element>
<name>filesink</name>
<longname>File Sink</longname>
<class>Sink/File</class>
<description>Write stream to a file</description>
<author>Thomas Vander Stichele &lt;thomas at apestaart dot org&gt;</author>
<pads>
<caps>
<name>sink</name>
<direction>sink</direction>
<presence>always</presence>
<details>ANY</details>
</caps>
</pads>
</element>
<element>
<name>filesrc</name>
<longname>File Source</longname>
<class>Source/File</class>
<description>Read from arbitrary point in a file</description>
<author>Erik Walthinsen &lt;omega@cse.ogi.edu&gt;</author>
<pads>
<caps>
<name>src</name>
<direction>source</direction>
<presence>always</presence>
<details>ANY</details>
</caps>
</pads>
</element>
<element>
<name>funnel</name>
<longname>Funnel pipe fitting</longname>
<class>Generic</class>
<description>N-to-1 pipe fitting</description>
<author>Olivier Crete &lt;olivier.crete@collabora.co.uk&gt;</author>
<pads>
<caps>
<name>sink_%u</name>
<direction>sink</direction>
<presence>request</presence>
<details>ANY</details>
</caps>
<caps>
<name>src</name>
<direction>source</direction>
<presence>always</presence>
<details>ANY</details>
</caps>
</pads>
</element>
<element>
<name>identity</name>
<longname>Identity</longname>
<class>Generic</class>
<description>Pass data without modification</description>
<author>Erik Walthinsen &lt;omega@cse.ogi.edu&gt;</author>
<pads>
<caps>
<name>sink</name>
<direction>sink</direction>
<presence>always</presence>
<details>ANY</details>
</caps>
<caps>
<name>src</name>
<direction>source</direction>
<presence>always</presence>
<details>ANY</details>
</caps>
</pads>
</element>
<element>
<name>input-selector</name>
<longname>Input selector</longname>
<class>Generic</class>
<description>N-to-1 input stream selector</description>
<author>Julien Moutte &lt;julien@moutte.net&gt;, Jan Schmidt &lt;thaytan@mad.scientist.com&gt;, Wim Taymans &lt;wim.taymans@gmail.com&gt;</author>
<pads>
<caps>
<name>sink_%u</name>
<direction>sink</direction>
<presence>request</presence>
<details>ANY</details>
</caps>
<caps>
<name>src</name>
<direction>source</direction>
<presence>always</presence>
<details>ANY</details>
</caps>
</pads>
</element>
<element>
<name>multiqueue</name>
<longname>MultiQueue</longname>
<class>Generic</class>
<description>Multiple data queue</description>
<author>Edward Hervey &lt;edward@fluendo.com&gt;</author>
<pads>
<caps>
<name>sink_%u</name>
<direction>sink</direction>
<presence>request</presence>
<details>ANY</details>
</caps>
<caps>
<name>src_%u</name>
<direction>source</direction>
<presence>sometimes</presence>
<details>ANY</details>
</caps>
</pads>
</element>
<element>
<name>output-selector</name>
<longname>Output selector</longname>
<class>Generic</class>
<description>1-to-N output stream selector</description>
<author>Stefan Kost &lt;stefan.kost@nokia.com&gt;</author>
<pads>
<caps>
<name>sink</name>
<direction>sink</direction>
<presence>always</presence>
<details>ANY</details>
</caps>
<caps>
<name>src_%u</name>
<direction>source</direction>
<presence>request</presence>
<details>ANY</details>
</caps>
</pads>
</element>
<element>
<name>queue</name>
<longname>Queue</longname>
<class>Generic</class>
<description>Simple data queue</description>
<author>Erik Walthinsen &lt;omega@cse.ogi.edu&gt;</author>
<pads>
<caps>
<name>sink</name>
<direction>sink</direction>
<presence>always</presence>
<details>ANY</details>
</caps>
<caps>
<name>src</name>
<direction>source</direction>
<presence>always</presence>
<details>ANY</details>
</caps>
</pads>
</element>
<element>
<name>queue2</name>
<longname>Queue 2</longname>
<class>Generic</class>
<description>Simple data queue</description>
<author>Erik Walthinsen &lt;omega@cse.ogi.edu&gt;, Wim Taymans &lt;wim.taymans@gmail.com&gt;</author>
<pads>
<caps>
<name>sink</name>
<direction>sink</direction>
<presence>always</presence>
<details>ANY</details>
</caps>
<caps>
<name>src</name>
<direction>source</direction>
<presence>always</presence>
<details>ANY</details>
</caps>
</pads>
</element>
<element>
<name>streamiddemux</name>
<longname>Streamid Demux</longname>
<class>Generic</class>
<description>1-to-N output stream by stream-id</description>
<author>HoonHee Lee &lt;hoonhee.lee@lge.com&gt;</author>
<pads>
<caps>
<name>sink</name>
<direction>sink</direction>
<presence>always</presence>
<details>ANY</details>
</caps>
<caps>
<name>src_%u</name>
<direction>source</direction>
<presence>sometimes</presence>
<details>ANY</details>
</caps>
</pads>
</element>
<element>
<name>tee</name>
<longname>Tee pipe fitting</longname>
<class>Generic</class>
<description>1-to-N pipe fitting</description>
<author>Erik Walthinsen &lt;omega@cse.ogi.edu&gt;, Wim Taymans &lt;wim@fluendo.com&gt;</author>
<pads>
<caps>
<name>sink</name>
<direction>sink</direction>
<presence>always</presence>
<details>ANY</details>
</caps>
<caps>
<name>src_%u</name>
<direction>source</direction>
<presence>request</presence>
<details>ANY</details>
</caps>
</pads>
</element>
<element>
<name>typefind</name>
<longname>TypeFind</longname>
<class>Generic</class>
<description>Finds the media type of a stream</description>
<author>Benjamin Otte &lt;in7y118@public.uni-hamburg.de&gt;</author>
<pads>
<caps>
<name>sink</name>
<direction>sink</direction>
<presence>always</presence>
<details>ANY</details>
</caps>
<caps>
<name>src</name>
<direction>source</direction>
<presence>always</presence>
<details>ANY</details>
</caps>
</pads>
</element>
<element>
<name>valve</name>
<longname>Valve element</longname>
<class>Filter</class>
<description>Drops buffers and events or lets them through</description>
<author>Olivier Crete &lt;olivier.crete@collabora.co.uk&gt;</author>
<pads>
<caps>
<name>sink</name>
<direction>sink</direction>
<presence>always</presence>
<details>ANY</details>
</caps>
<caps>
<name>src</name>
<direction>source</direction>
<presence>always</presence>
<details>ANY</details>
</caps>
</pads>
</element>
</elements>
</plugin></plugins>
#!/usr/bin/python3
#
# Copyright (C) 2016 Tim-Philipp Müller
#
# License: this script is made available under the following licenses:
# Simplified BSD License/FreeBSD License, MIT License, and/or LGPLv2.1+ license.
#
# Reads plugin introspection .xml files (one per module) and outputs a
# list of all plugins in markdown format. We may want to do something
# more fancy here in future, for now this is just to provide a replacement
# for the xltsproc-generated list in the www module
#
# XML files were generated like this (we'll want to automate that at some point):
#
# echo '<plugins module_name="gstreamer">' > core.xml; \
# cat ~/gst/1.10/gstreamer/docs/plugins/inspect/plugin-* >> core.xml; \
# echo '</plugins>' >> core.xml
#
# for m in base good ugly bad; do \
# echo '<plugins module_name="gst-plugins-'$m'">' > $m.xml; \
# cat ~/gst/1.10/gst-plugins-$m/docs/plugins/inspect/plugin-* >> $m.xml; \
# echo '</plugins>' >> $m.xml; \
# done
import xml.etree.ElementTree as xmltree
import http.client as httpclient
import urllib.parse as urlparse
import pickle
import sys
import os
allow_offline = False
is_offline = False
modules = {}
all_elements = {}
all_plugins = {}
url_cache = {}
url_conn = None
# check if an url exists or not
def check_url(url):
global url_conn
if is_offline and allow_offline:
return True
if url in url_cache:
return url_cache[url]
r = urlparse.urlparse(url)
# Reuse existing conn if possible
is_gst_fdo = url.startswith('https://gstreamer.freedesktop.org')
if is_gst_fdo and url_conn is not None:
connection = url_conn
else:
connection = httpclient.HTTPSConnection(r.netloc)
if is_gst_fdo:
url_conn = connection
connection.request('HEAD', r.path)
response = connection.getresponse()
response.read()
exists = response.status < 400
url_cache[url] = exists
sys.stderr.write('Checking if {0} exists: {1}\n'.format(url,exists))
return exists
# load url cache
def load_url_cache():
global url_cache
try:
with open('cache/url_cache.pkl', 'rb') as f:
url_cache = pickle.load(f)
except:
url_cache = {}
# save url cache
def save_url_cache():
global url_cache
if not os.path.exists('cache'):
os.makedirs('cache')
with open('cache/url_cache.pkl', 'wb') as f:
pickle.dump(url_cache, f)
def parse_plugin_element(element_node):
element = {}
for detail in element_node:
if detail.tag in ['pads']:
pass
elif detail.text:
element[detail.tag] = detail.text
return element
def parse_plugin_elements(elements_node):
element_list = []
for enode in elements_node:
element = parse_plugin_element(enode)
element_list.append(element)
return element_list
def parse_plugin(plugin_node):
plugin = {}
for detail in plugin_node:
if detail.tag == 'elements':
plugin['elements'] = parse_plugin_elements(detail)
elif detail.text:
plugin[detail.tag] = detail.text
return plugin
def parse_plugins(xml_fn):
plugin_list = []
tree = xmltree.parse(xml_fn)
root = tree.getroot()
for pnode in root:
plugin = parse_plugin(pnode)
plugin_list.append(plugin)
return plugin_list
def process_plugins(short_name):
module = {}
elements = []
plugins = parse_plugins(short_name + '.xml')
module['plugins'] = plugins
for p in plugins:
p['module_name'] = short_name
elist = p['elements']
for e in elist:
e['plugin_name'] = p['name']
e['module_name'] = short_name
elements.append(e)
name = e['name']
if name in all_elements:
print('Element {0} already exists in element list! {1}'.format(name, all_elements[name]))
else:
all_elements[name] = e
if p['name'] in all_plugins:
print('Plugin {0} already exists in plugin list! {1}'.format(name, all_plugins[p['name']]))
else:
all_plugins[p['name']] = p
module['elements'] = elements
modules[short_name] = module
# __main__
load_url_cache()
if not check_url('https://www.google.com'):
if not allow_offline:
raise Exception('URL checking does not seem to work, are you online?')
else:
print ('URL checking does not seem to work, continuing in offline mode')
is_offline = True
for m in ['core', 'base', 'good', 'bad', 'ugly']:
process_plugins(m)
plugins_page = '''# List of Elements and Plugins
<!-- WARNING: This page is generated! Any modifications will be overwritten -->
Note: this list is not complete! It does not contain OS-specific plugins
for Android, Windows, macOS, iOS, or wrapper plugins (gst-libav, gst-omx),
nor gst-rtsp-server or gstreamer-vaapi elements.
There may be links to pages that don't exist, this means that the element or
plugin does not have documentation yet or the documentation is not hooked up
properly (help welcome!).
| Element | Description | Plugin | Module |
|---------|-------------|---------|--------|
'''
plugin_names = []
element_links = []
plugin_links = []
element_names = []
for e in all_elements:
element_names.append(e)
element_names.sort()
for e in element_names:
element_name = e
element_desc = all_elements[e]['description']
plugin_name = all_elements[e]['plugin_name']
module_nick = all_elements[e]['module_name']
if module_nick == 'core':
module_name = 'gstreamer'
else:
module_name = 'gst-plugins-' + module_nick
# column 1: element name
edoc_url = 'https://gstreamer.freedesktop.org/data/doc/gstreamer/head/' + \
'{1}-plugins/html/{1}-plugins-{0}.html'.format(element_name, module_name)
if check_url(edoc_url):
element_links.append('[element-{0}]: {1}\n'.format(element_name, edoc_url))
plugins_page += '|[{0}][element-{0}]'.format(element_name)
else:
plugins_page += '|{0}'.format(element_name)
# column 2: element description