From dc8590962b40564b22d15343b01a18c1c1033abc Mon Sep 17 00:00:00 2001 From: "David I. Lehn" Date: Wed, 9 Jul 2003 23:51:45 +0000 Subject: [PATCH] redo autobuilt docs system with fancy XInclude features Original commit message from CVS: redo autobuilt docs system with fancy XInclude features --- ChangeLog | 6 +- docs/AUTHORS.xml | 87 +++++++++++++ docs/Makefile.am | 85 +++++++++++-- docs/NEWS.xml | 44 +++++++ docs/README.xml | 332 +++++++++++++++++++++++++++++++++++++++++++++++++ docs/RELNOTES.xml | 27 ++++ docs/TODO.xml | 60 +++++++++ docs/common.xsl | 1 - docs/full.xsl | 6 + docs/gst-python.ent.in | 2 + docs/part.xsl | 10 ++ 11 files changed, 646 insertions(+), 14 deletions(-) create mode 100644 docs/AUTHORS.xml create mode 100644 docs/NEWS.xml create mode 100644 docs/README.xml create mode 100644 docs/RELNOTES.xml create mode 100644 docs/TODO.xml create mode 100644 docs/full.xsl create mode 100644 docs/gst-python.ent.in create mode 100644 docs/part.xsl diff --git a/ChangeLog b/ChangeLog index ec1f6eb..17c176c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -11,7 +11,11 @@ * README, AUTHORS, NEWS, TODO: removed (generated from docs/*) - * docs/.cvsignore: add generated files + * .cvsignore, docs/.cvsignore: add generated files + + * docs/{AUTHORS.xml, NEWS.xml, README.xml, RELNOTES.xml, TODO.xml, + gst-python.ent.in, common.xsl, full.xsl, part.xsl, Makefile.am}: redo + autobuilt docs system with fancy XInclude features 2003-06-26 David I. Lehn diff --git a/docs/AUTHORS.xml b/docs/AUTHORS.xml new file mode 100644 index 0000000..7c17cb1 --- /dev/null +++ b/docs/AUTHORS.xml @@ -0,0 +1,87 @@ + + + %ents; +]> + +
+ + + + + Gst-Python &version; Authors + 2003David I. Lehn + &pubdate; + + + David + I. + Lehn + dlehn@users.sourceforge.net + + + + + + +
+Authors + + +Please feel free to contact the developers. They hang out on IRC () and the mailing lists (). + + + + +
+Maintainer + + +David I. Lehn dlehn@users.sourceforge.net + +
+ + + +
+Contributions + +Patches, suggestions, and other help: + + + +Kenichi Sato ksato at users.sourceforge.net: misc patches +Thomas Vander Stichele thomas at apestaart.org: misc patches, build framework patches, Red Hat support + + + +Much of the framework for gst-python stolen from the excellent gtk and gconf bindings by: + + + +James Henstridge james at daa.com.au +Johan Dahlin jdahlin at telia.com +Matt Wilson msw at redhat.com +and many more... + + +
+ + + +
+GStreamer Team + +And of course, none of this would be possible without the extreme hacker mojo +of the whole GStreamer crew! + +
+ + + +
+ + + +
diff --git a/docs/Makefile.am b/docs/Makefile.am index c0d9007..4366a28 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -1,21 +1,82 @@ -XMLFILES = gst-python.xml -XSLFILES = common.xsl html.xsl +READMEXMLFILES = README.xml NEWS.xml TODO.xml AUTHORS.xml +READMEFILES = $(READMEXMLFILES) gst-python.ent + +RELNOTESXMLFILES = RELNOTES.xml +RELNOTESFILES = $(RELNOTESXMLFILES) $(READMEXMLFILES) gst-python.ent + +XMLFILES = $(READMEXMLFILES) $(RELNOTESXMLFILES) +XSLFILES = common.xsl full.xsl part.xsl html.xsl pdf.xsl CSSFILES = gst-python.css -DOCS = gst-python.txt gst-python.html +EXTRA_DIST = $(XMLFILES) $(XSLFILES) $(CSSFILES) + +DOCS = README.txt README.html #gst-python.pdf +TOPDOCS = README.txt NEWS.txt TODO.txt AUTHORS.txt +RELNOTES = RELNOTES.txt + +CLEANFILES = $(DOCS) $(TOPDOCS) $(RELNOTES) tmpbuildcatalog + +if BUILD_DOCS + +XMLTO = xmlto +XMLTOFLAGS = --skip-validation -o $(CURDIR) +XMLLINT = xmllint +XMLLINTFLAGS = --xinclude --noout --loaddtd --catalogs --postvalid all: $(DOCS) -gst-python.txt: gst-python.xml - xmlto txt $< -# cp gst-python.txt $(top_builddir)/../README +tmpbuildcatalog: gst-python.ent + xmlcatalog --noout --create $@ + xmlcatalog --noout --add system `cd $(srcdir) && pwd`/gst-python.ent $(CURDIR)/gst-python.ent $@ + xmlcatalog --noout --add system $(srcdir)/gst-python.ent $(CURDIR)/gst-python.ent $@ -gst-python.html: gst-python.xml common.xsl html.xsl - xmlto -m common.xsl -m html.xsl xhtml-nochunks $< +check: tmpbuildcatalog + for d in $(XMLFILES); do \ + SGML_CATALOG_FILES=$$SGML_CATALOG_FILES\ $(CURDIR)/tmpbuildcatalog \ + $(XMLLINT) $(XMLLINTFLAGS) $(srcdir)/$$d; \ + done -gst-python.pdf: gst-python.xml common.xsl pdf.xsl - xmlto -m common.xsl -m pdf.xsl pdf $< +dist-docs: $(TOPDOCS) -CLEANFILES = $(DOCS) +dist-hook: dist-docs + for d in $(TOPDOCS); do \ + mv $$d ../`basename $$d .txt`; \ + done -EXTRA_DIST = $(XMLFILES) $(XSLFILES) $(CSSFILES) +# full docs + +# filter out xsl deps and make xslto flags +xmltoxslflags = $(foreach xsl,$(filter %xsl,$(filter-out $(1),$(2))),-m $(srcdir)/$(xsl)) +FULLDEPS = common.xsl full.xsl tmpbuildcatalog + +README.txt: $(READMEFILES) $(FULLDEPS) + XML_CATALOG_FILES=$$XML_CATALOG_FILES\ $(CURDIR)/tmpbuildcatalog \ + $(XMLTO) $(XMLTOFLAGS) $(call xmltoxslflags,$<,$+) txt $< + +README.html: $(READMEFILES) $(FULLDEPS) html.xsl + XML_CATALOG_FILES=$$XML_CATALOG_FILES\ $(CURDIR)/tmpbuildcatalog \ + $(XMLTO) $(XMLTOFLAGS) $(call xmltoxslflags,$<,$+) xhtml-nochunks $< + +README.pdf: $(READMEFILES) $(FULLDEPS) pdf.xsl + XML_CATALOG_FILES=$$XML_CATALOG_FILES\ $(CURDIR)/tmpbuildcatalog \ + $(XMLTO) $(XMLTOFLAGS) $(call xmltoxslflags,$<,$+) pdf $< + +# partial docs + +PARTIALDEPS = gst-python.ent common.xsl part.xsl tmpbuildcatalog + +RELNOTES.txt: $(RELNOTESFILES) $(PARTIALDEPS) + XML_CATALOG_FILES=$$XML_CATALOG_FILES\ $(CURDIR)/tmpbuildcatalog \ + $(XMLTO) $(XMLTOFLAGS) $(call xmltoxslflags,$<,$+) txt $< + +%.txt: %.xml $(PARTIALDEPS) + XML_CATALOG_FILES=$$XML_CATALOG_FILES\ $(CURDIR)/tmpbuildcatalog \ + $(XMLTO) $(XMLTOFLAGS) $(call xmltoxslflags,$<,$+) txt $< + +else + +dist-hook: + @echo "Error: Doc building must be enabled for autogeneration of README, NEWS, TODO, and AUTHORS for distribution." + @false + +endif diff --git a/docs/NEWS.xml b/docs/NEWS.xml new file mode 100644 index 0000000..5a5076f --- /dev/null +++ b/docs/NEWS.xml @@ -0,0 +1,44 @@ + + + %ents; +]> + +
+ + + + + Gst-Python &version; News + 2003David I. Lehn + &pubdate; + + + David + I. + Lehn + dlehn@users.sourceforge.net + + + + + + +
+News + +
+ 2003-07-09 - 0.1.0 - David I. Lehn <email>dlehn@users.sourceforge.net</email> + + + First release + + +
+ +
+ + + +
diff --git a/docs/README.xml b/docs/README.xml new file mode 100644 index 0000000..0007b41 --- /dev/null +++ b/docs/README.xml @@ -0,0 +1,332 @@ + + + + %ents; +]> + +
+ + Gst-Python &version;: A Python Interface to GStreamer + The GStreamer Development Team + &pubdate; + 2003David I. Lehn + gst-python + + + David + I. + Lehn + dlehn@users.sourceforge.net + + + + Introductory information for the GStreamer Python bindings. + + + + + 0.1.0 + 2003-07-09 + dil + Initial version. + + + + + + +
+About + + +gst-python: the Python bindings for the GStreamer project. These bindings provide access to almost all of the GStreamer C API through an object oriented Python API. + + +
+ + + + + + + +
+Installation + + + +
+Requirements + + +Python 2.2 () + + +GStreamer 0.6.x (except 0.6.1) () + + +PyGTK 1.99.14 () + + +
+ + + +
+Building and Installation + + +For build and install information please refer to the "INSTALL" file. Installation is optional, gst-python can be used from the build directory. The quick instructions: build and install PyGTK and GStreamer then build gst-python: + + + + + $ ./configure && make + + + +
+ + + +
+Using + +You either need to install the package or add the root directory to your +Python path: + + + + + $ export PYTHONPATH=$PYTHONPATH:`pwd` + + + + +Try running examples: + + + + + $ cd examples/gstreamer/ + $ python cp.py <input file> <output file> + $ cmp <input file> <output file> + $ python vorbisplay.py <an Ogg Vorbis file> + + + +
+ + + +
+ + + +
+Programming + + + +
+General API + + +The gst-python bindings are directly generated from the GStreamer headers. Look at the GStreamer documentation at for general API and programming issues. In most cases the GStreamer classes and boxed types map directly to Python classes. The function-based GObject methods also map onto Python methods. + + +
+ + + +
+Divergence From C API + +Due to the nature of C and Python some of the GStreamer API is handled +slightly different in Python than C. There are a few of the GStreamer C +functions that are not yet provided in gst-python. These are mostly related to +creating . A +few others remain that return GList* or return values in their parameters. +These have been wrapped as needed. Please file a bug if you need one of the unwrapped functions. + +API changes: + + + + gst_props_entry_get_type is accessed + through PropsEntry.get_props_type(). This is due to the + _get_type function extention being normally used for + GType access and is inaccessable + otherwise. + + Special pipeline + iteration support through the following functions: + + + + add_iterate_bin(bin) -> id: used + to iterate a bin with a C idle loop callback instead of a Python + callback. + + remove_iterate_bin(id): used to remove the + add_iterate_bin idle loop callback + id. + + iterate_bin_all(bin): releases locks, calls + gst_bin_iterate until it returns 0, reacquires locks + and completes + + + + + Python Elements support through the following currently horribly inefficient functions: + + + + Buffer.get_data() -> + string: converts buffer data to a string and + returns it. + + Buffer.set_data(string): sets the buffer data from a + string. + + + + + +
+ + + +
+Examples + +The best documentation right now are the examples in ./examples/gstreamer/. Read them. + +
+ + + +
+Threads + +Threading is a tricky subject for gst-python. There are a few lock you +need to be aware of: + +
+GIL + +The CPython interpreter is single threaded. Code execution in the +interpreter is protected by a Global Interpreter Lock (GIL). This means that C +code can run in other threads in parallel but only one thread will be running +Python code at any one point. Most of this is handled internally by means of +locking and unlocking the GIL at appropriate times. Callback code and other +various code paths between Python and C *should* be setup to do proper GIL +handling. + +However, it is possible that you may encounter a situation where proper +locking is not done. This is most likely due to calling a wrapper function +that follows a sequence like this: + + +Python calls wrapper function +wrapper function calls C GStreamer function +C GStreamer function calls side effect code +side effect code calls callback +callback tries to acquire Python GIL but it's already locked +deadlocked... + + +This has been fixed for commonly called functions that have side effects +which are likely to re-enter the interpreter. It just involves lock/unlock +around the call to the C gst function. But doing it for every function could +have performance issues and, more importantly, is not an automated +process. + +Please file a bug if you have problems +related to this and need other functions to be specially handled. + +
+ +
+Gdk Lock + +If you are using PyGTK you will have to deal with Gdk locking. Make sure +you're holding the Gdk lock while executing Gdk/Gtk calls. See PyGTK +documentation and FAQ list for more information. + +
+ +
+ + + +
+Pipeline Iteration + +There are a number of ways to iterate pipelines. +./examples/gstreamer/bps.py is a small test program to +measure the performance in buffers per second of these various techniques. +Please see the example for how to use these techniques. + + +Bin.iterate() in Python from the gtk idle loop +gst_bin_iterate() in C from gtk idle loop +Bin.iterate() in a Python loop +gst_bin_iterate() in a C loop + + +The method you chose depends on your application. The idle loop methods +are slightly slower yet more flexible. Probably useful for interactive GUI +applications. + +The basic loop methods are faster but probably more use for +non-interactive applications. A variation on these loops would be to also +check for a stop condition which may provide performance increase and some +level of control. + +
+ + + +
+Python Elements + + It is possible to write Python subclasses of GstElement. This support +is very primitive and likely to change. See +./examples/gstreamer/rot13.py for an example. + +
+ + + +
+ + + +
+Bugs + +Please submit gst-python bugs, patches, or suggestions to GNOME Bugzilla (). Product: GStreamer, Component: gst-python. Or alternatively send a message to the gstreamer-devel list or the maintainer. Thank you. + +
+ + + + + + + + + + + +
diff --git a/docs/RELNOTES.xml b/docs/RELNOTES.xml new file mode 100644 index 0000000..ce9aeff --- /dev/null +++ b/docs/RELNOTES.xml @@ -0,0 +1,27 @@ + + + + %ents; +]> + +
+ + + + + Gst-Python &version; Release Notes + + + + + + + + + + + + +
diff --git a/docs/TODO.xml b/docs/TODO.xml new file mode 100644 index 0000000..279db76 --- /dev/null +++ b/docs/TODO.xml @@ -0,0 +1,60 @@ + + + %ents; +]> + +
+ + + + + Gst-Python &version; ToDo + 2003David I. Lehn + &pubdate; + + + David + I. + Lehn + dlehn@users.sourceforge.net + + + + + + +
+ToDo + +handle more of the functions that need manual wrapping code +add check that pygtk built with --enable-thread +improve Python gstreamer.Element creation + + perhaps drop _set_foo_function() calls in favor of object methods + sane buffer handling with buffer type or Numeric? + + +docs + + API ref + manual + tutorial + + +more examples +convert build system to distutils +wrap other GStreamer helper libs +add some standard widgets + + gtk video widget (similar to widget gst-player is using) + + +testsuite + +
+ + + +
diff --git a/docs/common.xsl b/docs/common.xsl index 8495981..2404eab 100644 --- a/docs/common.xsl +++ b/docs/common.xsl @@ -1,7 +1,6 @@ - diff --git a/docs/full.xsl b/docs/full.xsl new file mode 100644 index 0000000..2722f5b --- /dev/null +++ b/docs/full.xsl @@ -0,0 +1,6 @@ + + + + + diff --git a/docs/gst-python.ent.in b/docs/gst-python.ent.in new file mode 100644 index 0000000..e3913d3 --- /dev/null +++ b/docs/gst-python.ent.in @@ -0,0 +1,2 @@ + + diff --git a/docs/part.xsl b/docs/part.xsl new file mode 100644 index 0000000..cdc6d96 --- /dev/null +++ b/docs/part.xsl @@ -0,0 +1,10 @@ + + + + + +article nop + + + -- 2.7.4