From: Vineeth TM Date: Thu, 9 Jul 2015 02:18:37 +0000 (+0900) Subject: Adding gst-python package X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=febdb8c33ce4eb562e5a900fecc593f6898fad96;hp=3d2437b30b7912964bbaddec1026fc7f4a7c2cbb;p=platform%2Fupstream%2Fgst-python.git Adding gst-python package Change-Id: I06cf7e0a20593314c15e37aaebbb2af42457c3fd Signed-off-by: Vineeth TM --- diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..92ffc66 --- /dev/null +++ b/AUTHORS @@ -0,0 +1 @@ +This file will be autogenerated. Please read README-docs. diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..7e854f4 --- /dev/null +++ b/COPYING @@ -0,0 +1,510 @@ + + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations +below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it +becomes a de-facto standard. To achieve this, non-free programs must +be allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control +compilation and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at least + three years, to give the same user the materials specified in + Subsection 6a, above, for a charge no more than the cost of + performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply, and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License +may add an explicit geographical distribution limitation excluding those +countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms +of the ordinary General Public License). + + To apply these terms, attach the following notices to the library. +It is safest to attach them to the start of each source file to most +effectively convey the exclusion of warranty; and each file should +have at least the "copyright" line and a pointer to where the full +notice is found. + + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or +your school, if any, to sign a "copyright disclaimer" for the library, +if necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James + Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + + diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 0000000..684ca16 --- /dev/null +++ b/ChangeLog @@ -0,0 +1,6415 @@ +=== release 1.5.2 === + +2015-06-24 Thibault Saunier + + * configure.ac: + releasing 1.5.2 + +2015-04-24 10:35:14 +0200 Thibault Saunier + + * gi/overrides/Gst.py: + * testsuite/overrides_hack.py: + * testsuite/test_gst.py: + tests: Fix tests in python2 + Python2 core checks that the first argument of a method is of the type + of the object if it does not have any info about the method, so when + using Gst not initialized it raiser a TypeError and not a + Gst.NotInitialized as expected. + + And fix a typo + +2015-04-24 09:37:24 +0200 Thibault Saunier + + * testsuite/Makefile.am: + * testsuite/old/test_fraction.py: + * testsuite/test_fraction.py: + tests: Add test_fraction back in the testsuite + Properly porting it and adding a small test about getting fraction + from a Gst.Structure + +2015-04-24 10:27:47 +0200 Thibault Saunier + + * gi/overrides/Gst.py: + overrides: Do not use inspect.signature as it is not avalaible in python2 + Fix regression from https://bugzilla.gnome.org/show_bug.cgi?id=746329 + +2015-04-15 19:57:43 +0200 Thibault Saunier + + * Makefile.am: + * configure.ac: + * testsuite/Makefile.am: + * testsuite/common.py: + * testsuite/old/test-object.c: + * testsuite/old/test-object.h: + * testsuite/old/test_adapter.py: + * testsuite/old/test_audio.py: + * testsuite/old/test_bin.py: + * testsuite/old/test_buffer.py: + * testsuite/old/test_bus.py: + * testsuite/old/test_caps.py: + * testsuite/old/test_element.py: + * testsuite/old/test_event.py: + * testsuite/old/test_fraction.py: + * testsuite/old/test_ghostpad.py: + * testsuite/old/test_interface.py: + * testsuite/old/test_iterator.py: + * testsuite/old/test_libtag.py: + * testsuite/old/test_message.py: + * testsuite/old/test_pad.py: + * testsuite/old/test_pbutils.py: + * testsuite/old/test_pipeline.py: + * testsuite/old/test_registry.py: + * testsuite/old/test_segment.py: + * testsuite/old/test_struct.py: + * testsuite/old/test_taglist.py: + * testsuite/old/test_typefind.py: + * testsuite/old/test_xml.py: + * testsuite/old/testhelpermodule.c: + * testsuite/overrides_hack.py: + * testsuite/runtests.py: + * testsuite/test-object.c: + * testsuite/test-object.h: + * testsuite/test_adapter.py: + * testsuite/test_audio.py: + * testsuite/test_bin.py: + * testsuite/test_buffer.py: + * testsuite/test_bus.py: + * testsuite/test_caps.py: + * testsuite/test_element.py: + * testsuite/test_event.py: + * testsuite/test_fraction.py: + * testsuite/test_ghostpad.py: + * testsuite/test_gst.py: + * testsuite/test_interface.py: + * testsuite/test_iterator.py: + * testsuite/test_libtag.py: + * testsuite/test_message.py: + * testsuite/test_pad.py: + * testsuite/test_pbutils.py: + * testsuite/test_pipeline.py: + * testsuite/test_registry.py: + * testsuite/test_segment.py: + * testsuite/test_struct.py: + * testsuite/test_taglist.py: + * testsuite/test_typefind.py: + * testsuite/test_xml.py: + * testsuite/testhelpermodule.c: + test: Bring back the testsuite and test if the initialization override works + Summary: + Simplify the Makefile taking example on pitivi and copy several pitivi + testing files, simplifying them a bit for our use case + Reviewers: Mathieu_Du + Differential Revision: http://phabricator.freedesktop.org/D97 + +2015-04-15 19:55:16 +0200 Thibault Saunier + + * gi/overrides/Gst.py: + overrides: Disable all GStreamer APIs until Gst has been initialized + Summary: + And throw an exception if the user tries to call any Gst API without + initializing gst. + https://bugzilla.gnome.org/show_bug.cgi?id=747555 + Reviewers: Mathieu_Du + Differential Revision: http://phabricator.freedesktop.org/D87 + +2015-04-22 10:40:48 +0200 Sebastian Dröge + + * INSTALL: + Remove INSTALL file + autotools automatically generate this, and when using different versions + for autogen.sh there will always be changes to a file tracked by git. + +2015-03-18 13:53:55 +0100 Thibault Saunier + + * gi/overrides/Gst.py: + overrides: Try hard to make the query writable in the pad query function + Summary: + We know that the bindings will get an extra ref but we know that + it is not actually needed, so we are safe to decrease the refcount + by one in that particular context making sure we give PyGI its + ref back when we are done. + Reviewers: Mathieu_Du + Differential Revision: http://phabricator.freedesktop.org/D41 + https://bugzilla.gnome.org/show_bug.cgi?id=746329 + +2015-03-06 19:25:57 +0100 Thibault Saunier + + * plugin/Makefile.am: + plugin: Name differently between python2 and python3 + Those are 2 different binaries and thus should have different + .so names. Just use the $PYTHON_SO for that to happen. + https://bugzilla.gnome.org/show_bug.cgi?id=738157 + +2014-10-20 13:40:05 +0200 Thibault Saunier + + * configure.ac: + Back to development + +=== release 1.4.0 === + +2014-10-20 11:24:58 +0200 Thibault Saunier + + * ChangeLog: + * NEWS: + * RELEASE: + * configure.ac: + * gst-python.doap: + Release 1.4.0 + +2014-10-19 13:34:59 +0200 Sebastian Dröge + + * plugin/gstpythonplugin.c: + pythonplugin: Fix compiler warning about unused format string argument + CC libgstpythonplugin_la-gstpythonplugin.lo + gstpythonplugin.c:192:65: warning: data argument not used by format string + [-Wformat-extra-args] + GST_DEBUG ("GST_PLUGIN_SYSTEM_PATH set to %s", plugin_path, plugin_path); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ + +=== release 1.3.90 === + +2014-09-24 11:13:45 +0200 Thibault Saunier + + * ChangeLog: + * NEWS: + * RELEASE: + * configure.ac: + * gst-python.doap: + Release 1.3.90 + +2014-06-10 16:04:15 +0200 Rico Tzschichholz + + * plugin/Makefile.am: + plugin: Do not version the plugin library + +2014-06-05 19:54:13 +0200 Thibault Saunier + + * examples/.gitignore: + * examples/Makefile.am: + * examples/audio-controller.py: + * examples/audioconcat.py: + * examples/bps.py: + * examples/buffer-draw.py: + * examples/cp.py: + * examples/cutter.py: + * examples/debugslider.py: + * examples/decodebin.py: + * examples/f2f.py: + * examples/filesrc.py: + * examples/fvumeter.py: + * examples/gst-discover: + * examples/gstfile.py: + * examples/helloworld.py: + * examples/maemogst.py: + * examples/mixer.py: + * examples/option-parser.py: + * examples/pipeline-tester: + * examples/play.py: + * examples/plugins/python/sinkelement.py: + * examples/pyidentity.py: + * examples/python/sinkelement.py: + * examples/remuxer.py: + * examples/segments.py: + * examples/sinkelement-registry.py: + * examples/sinkelement.py: + * examples/switch.py: + * examples/synchronizer.py: + * examples/tagsetter.py: + * examples/video-controller.py: + * examples/vumeter.py: + * old_examples/.gitignore: + * old_examples/Makefile.am: + * old_examples/audio-controller.py: + * old_examples/audioconcat.py: + * old_examples/bps.py: + * old_examples/buffer-draw.py: + * old_examples/cp.py: + * old_examples/cutter.py: + * old_examples/debugslider.py: + * old_examples/decodebin.py: + * old_examples/f2f.py: + * old_examples/filesrc.py: + * old_examples/fvumeter.py: + * old_examples/gst-discover: + * old_examples/gstfile.py: + * old_examples/helloworld.py: + * old_examples/maemogst.py: + * old_examples/mixer.py: + * old_examples/option-parser.py: + * old_examples/pipeline-tester: + * old_examples/play.py: + * old_examples/pyidentity.py: + * old_examples/remuxer.py: + * old_examples/segments.py: + * old_examples/sinkelement-registry.py: + * old_examples/sinkelement.py: + * old_examples/switch.py: + * old_examples/synchronizer.py: + * old_examples/tagsetter.py: + * old_examples/video-controller.py: + * old_examples/vumeter.py: + Move old example to a dedicated folder so user know it is no up to date + +2014-06-06 10:30:07 +0200 Thibault Saunier + + * examples/python/sinkelement.py: + * gi/overrides/Gst.py: + Add an example sink element and override the chain and event functions of pads + Otherwize we will get 2 time acces to the element in it, which does + not make much sense. The _full variant can still be used. + +2014-02-06 16:17:03 +0100 Thibault Saunier + + * Makefile.am: + * acinclude.m4: + * configure.ac: + * plugin/Makefile.am: + * plugin/gstpythonplugin.c: + Reimplement gstpython plugin on top of PyGobject + +2014-06-05 17:22:23 +0200 Thibault Saunier + + * common: + Update common submodule + +2014-05-22 22:48:09 +0200 Christoph Reiter + + * gi/overrides/Gst.py: + overrides: Don't pass arguments to Boxed base class __init__() in Gst.Caps override. + This is needed since: https://git.gnome.org/browse/pygobject/commit/?id=3a2bfc8bf01fcae3863 + https://bugzilla.gnome.org/show_bug.cgi?id=730596 + +2014-03-23 10:34:10 +0100 Lubosz Sarnecki + + * gi/overrides/Gst.py: + python3: apply pep 238 for division overload + Python 3 needs an __truediv__ operator method, used in GstFraction. + see: http://legacy.python.org/dev/peps/pep-0238/ + https://bugzilla.gnome.org/show_bug.cgi?id=726920 + +2014-04-01 09:53:21 +0200 Thibault Saunier + + * gi/overrides/Gst.py: + overrides: Import the _gi_gst module relative + We always expect it to be in the same directory and it fixes its import + with python3 + https://bugzilla.gnome.org/show_bug.cgi?id=726921 + +2014-03-29 15:15:27 +0100 Sebastian Dröge + + * configure.ac: + Modernize configure.ac a bit + Especially create tar.xz files instead of tar.gz + +2014-03-29 15:01:26 +0100 Sebastian Dröge + + * gi/overrides/Makefile.am: + Fix automake warning + INCLUDES is the old name of AM_CPPFLAGS and is deprecated. + +2014-03-29 14:51:39 +0100 Sebastian Dröge + + * configure.ac: + * gi/overrides/Makefile.am: + Fix extension of native Python module + When building debug modules this e.g. has to be _d.so instead of just .so + +2014-03-15 18:26:40 +0100 Thibault Saunier + + * configure.ac: + Back to development + +=== release 1.2.0 === + +2014-03-15 18:02:45 +0100 Thibault Saunier + + * ChangeLog: + * NEWS: + * RELEASE: + * configure.ac: + * gst-python.doap: + Release 1.2.0 + +2014-03-15 12:40:32 +0100 Thibault Saunier + + * configure.ac: + We actually depend on python 2.5 not 2.7 + +2014-03-15 15:45:43 +0100 Thibault Saunier + + * gi/overrides/Gst.py: + overrides: Checking an empty caps should return False + +2013-12-12 11:20:12 +0000 Simon Farnsworth + + * COPYING: + * examples/audioconcat.py: + * examples/bps.py: + * examples/cp.py: + * examples/cutter.py: + * examples/debugslider.py: + * examples/decodebin.py: + * examples/f2f.py: + * examples/filesrc.py: + * examples/fvumeter.py: + * examples/gst-discover: + * examples/pipeline-tester: + * examples/tagsetter.py: + * examples/vumeter.py: + * gi/__init__.py: + * gi/overrides/Gst.py: + * gi/overrides/GstPbutils.py: + * gi/overrides/gstmodule.c: + * pygst.py.in: + * testsuite/common.py: + * testsuite/runtests.py: + * testsuite/test_adapter.py: + * testsuite/test_audio.py: + * testsuite/test_bin.py: + * testsuite/test_buffer.py: + * testsuite/test_bus.py: + * testsuite/test_caps.py: + * testsuite/test_element.py: + * testsuite/test_event.py: + * testsuite/test_fraction.py: + * testsuite/test_ghostpad.py: + * testsuite/test_gst.py: + * testsuite/test_interface.py: + * testsuite/test_iterator.py: + * testsuite/test_libtag.py: + * testsuite/test_message.py: + * testsuite/test_pad.py: + * testsuite/test_pbutils.py: + * testsuite/test_pipeline.py: + * testsuite/test_registry.py: + * testsuite/test_segment.py: + * testsuite/test_struct.py: + * testsuite/test_taglist.py: + * testsuite/test_typefind.py: + * testsuite/test_xml.py: + Fix zip code of new FSF address + I missed the zip code last time round - fix it. Thanks to Michael Schwendt + in https://bugzilla.redhat.com/show_bug.cgi?id=1034341#c11 for pointing this + out to me. + Signed-off-by: Simon Farnsworth + https://bugzilla.gnome.org/show_bug.cgi?id=720317 + +2013-12-03 17:49:11 -0500 Olivier Crête + + * gi/overrides/Gst.py: + Gst: Add python version of GST_TIME_ARGS + +2013-12-03 17:36:07 -0500 Olivier Crête + + * .gitignore: + Add *.so to gitignore + +2013-11-25 17:01:48 +0000 Simon Farnsworth + + * COPYING: + * examples/audioconcat.py: + * examples/bps.py: + * examples/cp.py: + * examples/cutter.py: + * examples/debugslider.py: + * examples/decodebin.py: + * examples/f2f.py: + * examples/filesrc.py: + * examples/fvumeter.py: + * examples/gst-discover: + * examples/pipeline-tester: + * examples/tagsetter.py: + * examples/vumeter.py: + * gi/__init__.py: + * gi/overrides/Gst.py: + * gi/overrides/GstPbutils.py: + * gi/overrides/gstmodule.c: + * pygst.py.in: + * testsuite/common.py: + * testsuite/runtests.py: + * testsuite/test_adapter.py: + * testsuite/test_audio.py: + * testsuite/test_bin.py: + * testsuite/test_buffer.py: + * testsuite/test_bus.py: + * testsuite/test_caps.py: + * testsuite/test_element.py: + * testsuite/test_event.py: + * testsuite/test_fraction.py: + * testsuite/test_ghostpad.py: + * testsuite/test_gst.py: + * testsuite/test_interface.py: + * testsuite/test_iterator.py: + * testsuite/test_libtag.py: + * testsuite/test_message.py: + * testsuite/test_pad.py: + * testsuite/test_pbutils.py: + * testsuite/test_pipeline.py: + * testsuite/test_registry.py: + * testsuite/test_segment.py: + * testsuite/test_struct.py: + * testsuite/test_taglist.py: + * testsuite/test_typefind.py: + * testsuite/test_xml.py: + Update FSF address + The FSF has moved since these files were created. Update the address, in + order to keep packaging tools such as rpmlint quiet. + Signed-off-by: Simon Farnsworth + https://bugzilla.gnome.org/show_bug.cgi?id=715182 + +2013-09-30 13:27:33 +0200 Sebastian Dröge + + * gi/overrides/__init__.py: + Fix another syntax error with newer Python versions + +2013-09-30 13:07:03 +0200 Sebastian Dröge + + * configure.ac: + configure: Fix typo + +2013-09-30 12:45:59 +0200 Sebastian Dröge + + * gi/overrides/gstmodule.c: + Fix compilation with Python 3.0 + Changes partially taken from pygobject. + +2013-09-30 12:30:43 +0200 Sebastian Dröge + + * acinclude.m4: + configure: Fix Python configure checks to work with all Python versions between 2.7 and 3.3 + +2013-09-28 21:07:47 +0200 Thibault Saunier + + * configure.ac: + Back to development + +=== release 1.1.90 === + +2013-09-28 20:48:40 +0200 Thibault Saunier + + * ChangeLog: + * configure.ac: + * gst-python.doap: + Release 1.1.90 + +2013-08-27 01:07:48 +0200 Andoni Morales Alastruey + + * configure.ac: + configure: fail if pygobject is not found + https://bugzilla.gnome.org/show_bug.cgi?id=706853 + +2013-08-26 17:35:48 -0400 Thibault Saunier + + * gi/overrides/Gst.py: + Gst: Do not initialize Gst at init + Letting the user choose when to initialize it himself + +2013-08-23 23:18:57 -0400 Thibault Saunier + + * TODO: + todo: Update the todo + +2013-08-23 23:08:27 -0400 Thibault Saunier + + * Makefile.am: + * configure.ac: + Disable examples amd testsuite as long as they have not been ported + +2013-08-23 22:01:46 -0400 Thibault Saunier + + * gi/overrides/Makefile.am: + overrides: Force symlinks when making + Making make distcheck pass + +2013-08-23 21:42:37 -0400 Thibault Saunier + + * gi/overrides/gstmodule.c: + gstmodule: Check that we could retrieve the module before using it + And plug a small leak + +2013-02-07 16:12:23 -0600 George McCollister + + * configure.ac: + configure: replace deprecated AM_CONFIG_HEADER with AC_CONFIG_HEADERS + AM_CONFIG_HEADER was removed in automake 1.13 + https://bugzilla.gnome.org/show_bug.cgi?id=693367 + +2012-12-30 16:11:30 +0100 Mark Nauwelaerts + + * gi/overrides/Makefile.am: + overrides: symlink some more to use uninstalled out-of-source build + +2012-12-07 14:18:21 -0300 Thibault Saunier + + * gi/overrides/Gst.py: + overrides: implement Gst.Structure.__setitem__ + +2012-11-22 07:11:45 +0100 Alessandro Decina + + * gi/overrides/Gst.py: + overrides: implement Gst.Structure.__getitem__ + +2012-11-04 17:02:24 +0100 Alessandro Decina + + * gi/overrides/Gst.py: + overrides: move add(*args) override from Gst.Pipeline to Gst.Bin + +2012-11-04 17:00:14 +0100 Alessandro Decina + + * gi/overrides/Gst.py: + overrides: move the Gst.Pad override before Gst.GhostPad + ...else gi will screw up the type hierarchy and GhostPad will inherit from the + non-overridden Gst.Pad. Got it? + +2012-10-24 20:47:07 +0200 Alessandro Decina + + * gi/overrides/Gst.py: + overrides: override GhostPad.__init__ + +2012-10-15 09:56:43 +0200 Alessandro Decina + + * gi/overrides/Gst.py: + overrides: make Gst.Pad.link still return Gst.PadLinkReturn when successful + +2012-10-15 09:49:00 +0200 Alessandro Decina + + * gi/overrides/GstPbutils.py: + * gi/overrides/Makefile.am: + overrides: add encoding profile(s) overrides in GstPbutils + +2012-10-15 09:18:00 +0200 Alessandro Decina + + * gi/overrides/Gst.py: + overrides: make filter arg in Gst.Pad.query_caps(filter) default to None + +2012-10-15 09:15:21 +0200 Alessandro Decina + + * gi/overrides/Gst.py: + overrides: set default value for name arg in ElementFactory.make(factory, name) + So you can use Gst.ElementFactory.make('fakesrc') instead of + Gst.ElementFactory.make('fakesrc', None) + +2012-10-15 09:13:44 +0200 Alessandro Decina + + * gi/overrides/Gst.py: + overrides: make Gst.Pad.link raise Gst.LinkError + +2012-10-15 09:12:33 +0200 Alessandro Decina + + * gi/overrides/Gst.py: + overrides: implement Gst.Pipeline.add(e1, e2, ...) + +2012-10-15 09:10:25 +0200 Alessandro Decina + + * gi/overrides/Gst.py: + overrides: implement the python iterator protocol for Gst.Iterator + So that you can use: for value in gst_iterator: ... + +2012-10-15 09:00:03 +0200 Alessandro Decina + + * gi/overrides/Gst.py: + overrides: implement caps[i] and len(caps) + +2012-10-15 08:58:59 +0200 Alessandro Decina + + * gi/overrides/Makefile.am: + overrides: don't install our gi/overrides/__init__.py + We don't want to override the gi/overrides/__init__.py from pygobject + +2012-09-27 14:41:29 +0200 Mark Nauwelaerts + + * gi/overrides/Gst.py: + * gi/overrides/gstmodule.c: + overrides: provide for gst-python style debug logging + Also provide a default debug category for the binding glue code. + +2012-09-27 14:19:52 +0200 Mark Nauwelaerts + + * gi/overrides/Makefile.am: + overrides: symlink some more to use uninstalled + +2012-08-29 10:05:37 -0700 René Stadler + + * gi/overrides/gstmodule.c: + overrides: Fix crash in add_template + templ vs. templates. Moved variable declarations to the inner scope to prevent + such a mistake. + +2012-08-19 22:40:06 -0400 Thibault Saunier + + * gi/overrides/Gst.py: + * gi/overrides/Makefile.am: + Make it possible to use uninstalled symlinking the .so file + +2012-08-19 02:25:13 -0400 Thibault Saunier + + * gi/overrides/gstmodule.c: + overrides: Make it possible to add metadatas and PadTemplates to GstElementClass + +2012-08-08 14:00:05 -0400 Thibault Saunier + + * autogen.sh: + * configure.ac: + * gi/overrides/Gst.py: + * gi/overrides/Makefile.am: + * gi/overrides/gstmodule.c: + Implement the glue code so GstFraction works + +2012-08-08 13:59:09 -0400 Thibault Saunier + + * Makefile.am: + * configure.ac: + * gi/Makefile.am: + * gi/__init__.py: + * gi/overrides/Gst.py: + * gi/overrides/Makefile.am: + * gi/overrides/__init__.py: + Add overrides for GObject Introspection + +2012-07-30 16:24:10 -0400 Thibault Saunier + + * Makefile.am: + * codegen/.gitignore: + * codegen/Makefile.am: + * codegen/__init__.py: + * codegen/argtypes.py: + * codegen/code-coverage.py: + * codegen/codegen.py: + * codegen/definitions.py: + * codegen/defsparser.py: + * codegen/docextract.py: + * codegen/docgen.py: + * codegen/h2def.py: + * codegen/mergedefs.py: + * codegen/mkskel.py: + * codegen/override.py: + * codegen/reversewrapper.py: + * codegen/scmexpr.py: + * configure.ac: + * gst/.gitignore: + * gst/Makefile.am: + * gst/__init__.py.in: + * gst/arg-types.py: + * gst/audio.defs: + * gst/audio.override: + * gst/audiomodule.c: + * gst/base.defs: + * gst/common.h: + * gst/extend/.gitignore: + * gst/extend/Makefile.am: + * gst/extend/__init__.py: + * gst/extend/discoverer.py: + * gst/extend/jukebox.py: + * gst/extend/leveller.py: + * gst/extend/pygobject.py: + * gst/extend/sources.py: + * gst/extend/utils.py: + * gst/gst-0.10.21.ignore: + * gst/gst-0.10.22.ignore: + * gst/gst-0.10.23.ignore: + * gst/gst-0.10.24.ignore: + * gst/gst-0.10.25.ignore: + * gst/gst-0.10.26.ignore: + * gst/gst-0.10.29.ignore: + * gst/gst-0.10.30.ignore: + * gst/gst-0.10.31.ignore: + * gst/gst-0.10.32.ignore: + * gst/gst-0.10.36.ignore: + * gst/gst-argtypes.c: + * gst/gst-disable-loadsave.ignore: + * gst/gst-extrafuncs.defs: + * gst/gst-pb-0.10.23.ignore: + * gst/gst-pb-0.10.25.ignore: + * gst/gst-pb-0.10.26.ignore: + * gst/gst-pb-0.10.29.ignore: + * gst/gst-pb-0.10.30.ignore: + * gst/gst-pb-0.10.31.ignore: + * gst/gst-pb-0.10.32.ignore: + * gst/gst-pb-0.10.36.ignore: + * gst/gst-types.defs: + * gst/gst.defs: + * gst/gst.override: + * gst/gstbase.override: + * gst/gstbin.override: + * gst/gstbuffer.override: + * gst/gstbus.override: + * gst/gstcaps.override: + * gst/gstelement.override: + * gst/gstelementfactory.override: + * gst/gstevent.override: + * gst/gstlibs.override: + * gst/gstmessage.override: + * gst/gstmodule.c: + * gst/gstobject.override: + * gst/gstpad.override: + * gst/gstquery.override: + * gst/gstreamer.py: + * gst/gststructure.override: + * gst/gsttaglist.override: + * gst/gstversion.override.in: + * gst/interfaces.defs: + * gst/interfaces.override: + * gst/interfacesmodule.c: + * gst/libs.defs: + * gst/pbutils.defs: + * gst/pbutils.override: + * gst/pbutilsmodule.c: + * gst/pygst-private.h: + * gst/pygst.h: + * gst/pygstexception.c: + * gst/pygstexception.h: + * gst/pygstiterator.c: + * gst/pygstminiobject-private.h: + * gst/pygstminiobject.c: + * gst/pygstminiobject.h: + * gst/pygstvalue.c: + * gst/pygstvalue.h: + * gst/tag.defs: + * gst/tag.override: + * gst/tagmodule.c: + * gst/video.defs: + * gst/video.override: + * gst/videomodule.c: + * gst/xoverlay.defs: + * gst/xoverlay.override: + * gstlibtoolimporter.py: + * gstltihooks.py: + * gstoptionmodule.c: + * pkgconfig/.gitignore: + * pkgconfig/Makefile.am: + * pkgconfig/gst-python-uninstalled.pc.in: + * pkgconfig/gst-python.pc.in: + * plugin/Makefile.am: + * plugin/gstpythonplugin.c: + * testsuite/Makefile.am: + Keep only the testsuite as we are now using GObject Introspection for bindings + +2012-04-08 00:01:12 +0100 Tim-Philipp Müller + + * configure.ac: + Revert nonsense that happened to git master, but make configure error out with an error message pointing people to the 0.10 branch. + +2012-03-07 16:50:11 +0000 Tim-Philipp Müller + + * gst/gstpad.override: + pad: fix unit test again after previous commit + https://bugzilla.gnome.org/show_bug.cgi?id=660357 + +2011-09-28 15:16:07 +0200 Andoni Morales Alastruey + + * gst/gstpad.override: + pad: fix Py_DECREF of null pointer in pad probe and pad block marshallers + https://bugzilla.gnome.org/show_bug.cgi?id=660357 + +2012-01-26 13:20:53 +0100 Mark Nauwelaerts + + * gst/pbutils.override: + pbutils: fix copy-and-mutate-paste for gst_encoding_list_all_targets + +2011-12-29 16:02:29 +0100 Alessandro Decina + + * gst/pbutils.defs: + pbutils: fix EncodingContainerProfile.add_profile refcount + +2011-12-19 13:09:42 +0000 Tim-Philipp Müller + + * gst/videomodule.c: + videomodule: fix compiler warning + videomodule.c:43:21: error: variable 'gst' set but not used + +2011-12-18 20:45:52 +0000 Tim-Philipp Müller + + * gst-python.spec.in: + rpm: add new header files to .spec file, add -devel package for that + Not actually tested though. + +2011-12-09 17:24:40 +0000 Tim-Philipp Müller + + * gst/pbutilsmodule.c: + pbutilsmodule: avoid unused-but-set-variable compiler warning + https://bugzilla.gnome.org/show_bug.cgi?id=665868 + +2011-12-09 17:22:31 +0000 Tim-Philipp Müller + + * configure.ac: + * gst/gst-0.10.36.ignore: + * gst/gstversion.override.in: + Add gst-0.10.36.ignore file + So things still compile with older versions of GStreamer. + +2011-12-09 14:05:12 +0100 Stefan Sauer + + * gst/gst.defs: + preset: expose new gst.preset_{set,get}_app_dir() on python + +2011-08-07 19:05:14 +0200 Alessandro Decina + + * configure.ac: + * gst/Makefile.am: + * gst/gst-pb-0.10.36.ignore: + * gst/gstversion.override.in: + * gst/video.defs: + * gst/video.override: + video: wrap force key unit API + +2011-10-31 10:51:46 +0000 Tim-Philipp Müller + + * configure.ac: + configure: back to development + Apparently. + +2011-10-31 10:49:41 +0100 Stefan Sauer + + * examples/Makefile.am: + * examples/helloworld.py: + examples: add helloworld example + Add a straight 1:1 copy from cores' helloworld.c to show how the c api maps into + the pythong bindings. It would rock to have the same in other bindings. + +2011-10-31 10:48:29 +0100 Stefan Sauer + + * gst/gst.defs: + uri: add filename_to_uri to bindings + +=== release 0.10.22 === + +2011-10-29 17:49:01 +0100 Tim-Philipp Müller + + * ChangeLog: + * NEWS: + * RELEASE: + * configure.ac: + * gst-python.doap: + Release 0.10.22 + +2011-10-29 16:01:24 +0100 Tim-Philipp Müller + + * configure.ac: + configure: use AG_GST_SET_PACKAGE_RELEASE_DATETIME_WITH_NANO + For python plugin, but also to ensure there's an entry in the + doap file for releases. + +2011-10-20 13:24:59 +0100 Tim-Philipp Müller + + * configure.ac: + 0.10.21.2 pre-release + +2011-08-26 15:22:16 +0200 Sebastian Dröge + + * pkgconfig/gst-python-uninstalled.pc.in: + * pkgconfig/gst-python.pc.in: + pkgconfig: Add Cflags with the include path for the headers + https://bugzilla.gnome.org/show_bug.cgi?id=657435 + +2011-10-11 23:33:21 +0100 Tim-Philipp Müller + + * gst/Makefile.am: + * gst/audio.override: + * gst/common.h: + * gst/interfaces.override: + * gst/pbutils.override: + * gst/pygst-private.h: + * gst/pygst.h: + * gst/pygstminiobject.c: + * gst/pygstminiobject.h: + * gst/pygstvalue.h: + * gst/tag.override: + * gst/video.override: + Don't install common.h and remove from public headers + Doesn't seem to be needed anyway. Also remove duplicate + pygobject.h include in common.h while at it. + https://bugzilla.gnome.org/show_bug.cgi?id=657435 + +2011-10-11 22:59:05 +0100 Tim-Philipp Müller + + * gst/Makefile.am: + Install headers into $includedir/gstreamer-0.10/gst not .../pygst/ + This matches the directory layout in the source tree and makes it + possible to find the headers (e.g. from g-e-s) in an uninstalled + setup. + https://bugzilla.gnome.org/show_bug.cgi?id=657435 + +2011-10-11 22:57:30 +0100 Tim-Philipp Müller + + * gst/Makefile.am: + Keep pygst-private.h in noinst_HEADERS + Makes sure it gets disted. + +2011-01-13 14:59:16 +0000 Vincent Penquerc'h + + * examples/remuxer.py: + remuxer.py: allow more than one stream of the same type + Queue names would collide otherwise, so just pass None for now. Also + guarantees that we don't get silly names like "queue_audio/x-foobar". + https://bugzilla.gnome.org/show_bug.cgi?id=639427 + +2011-01-13 14:15:34 +0000 Vincent Penquerc'h + + * examples/remuxer.py: + remuxer.py: do not crash when clicking open without having selected a file + https://bugzilla.gnome.org/show_bug.cgi?id=639421 + +2011-01-13 14:19:05 +0000 Vincent Penquerc'h + + * examples/remuxer.py: + remuxer.py: list files named *.og[gvax], not only *.ogg + These are all recommended extensions for Ogg streams. + https://bugzilla.gnome.org/show_bug.cgi?id=639423 + +2011-09-06 21:53:08 +0200 Stefan Sauer + + * common: + Automatic update of common submodule + From a39eb83 to 11f0cd5 + +2011-09-06 19:13:44 +0100 Tim-Philipp Müller + + * gst/gstcaps.override: + caps.override: fix compiler warning + Re-use the already-extracted caps and structure pointers, instead + of getting them again, thus fixing: + gstcaps.override: In function 'pygst_caps_sq_item': + gstcaps.override:361:16: error: variable 'structure' set but not used + +2011-09-06 19:07:35 +0100 Tim-Philipp Müller + + * gst/gstpad.override: + pad.override: fix pad probe return value handling + Don't forget to return the return value, makes buffer and event probes + work much better. + +2011-09-06 16:06:39 +0200 Stefan Sauer + + * common: + Automatic update of common submodule + From 605cd9a to a39eb83 + +2011-08-10 17:10:01 +0200 Thibault Saunier + + * configure.ac: + * gst/Makefile.am: + * pkgconfig/gst-python.pc.in: + Install pygst.h so it can be reused by other bindings + Also add a PYGST_CFLAGS + https://bugzilla.gnome.org/show_bug.cgi?id=656289 + +2011-08-10 17:13:17 +0200 Thibault Saunier + + * gst/pygst.h: + * gst/pygstminiobject.c: + * gst/pygstminiobject.h: + gst: Move PyGstMiniObject to public API. + Allows it to be reused from 3rd party modules. + https://bugzilla.gnome.org/show_bug.cgi?id=656289 + +2011-06-23 11:29:46 -0700 David Schleef + + * common: + Automatic update of common submodule + From 69b981f to 605cd9a + +2011-05-25 09:38:22 +0200 Sebastian Dröge + + * gst/gstpad.override: + gst: Don't use private GstPad API to add data/buffer/event probes + This does not work anymore with latest core because of the + pad cache that enables use of a fast path during data passing + in many situations. + Fixes bug #650987. + +2011-05-24 19:20:44 +0200 Andoni Morales Alastruey + + * gst/gstpad.override: + gst: Fix override of pad probes + Fixes bug #650986. + +2011-05-19 22:59:28 +0300 Stefan Kost + + * common: + Automatic update of common submodule + From 9e5bbd5 to 69b981f + +2011-05-18 16:13:11 +0300 Stefan Kost + + * common: + Automatic update of common submodule + From fd35073 to 9e5bbd5 + +2011-05-18 12:26:36 +0300 Stefan Kost + + * common: + Automatic update of common submodule + From 46dfcea to fd35073 + +2011-05-03 09:37:36 -0300 Thiago Santos + + * gst/pbutils.defs: + pbutils: Encoding profiles accept null caps restrictions + Add 'null-ok' for encoding video/audio profiles constructor + so they accept None as caps restriction parameter + +2011-05-02 16:59:30 -0300 Thiago Santos + + * gst/gstmodule.c: + gstmodule: Check for Py_None when setting a miniobject + Check if we got a None value before trying to use it as a + PyGstMiniObject. + https://bugzilla.gnome.org/show_bug.cgi?id=649227 + +2011-04-24 14:05:55 +0100 Tim-Philipp Müller + + * common: + Automatic update of common submodule + From c3cafe1 to 46dfcea + +2011-04-04 15:58:52 +0300 Stefan Kost + + * common: + Automatic update of common submodule + From 1ccbe09 to c3cafe1 + +2011-03-25 22:35:52 +0100 Sebastian Dröge + + * common: + Automatic update of common submodule + From 193b717 to 1ccbe09 + +2011-03-25 14:57:27 +0200 Stefan Kost + + * common: + Automatic update of common submodule + From b77e2bf to 193b717 + +2011-03-25 09:34:04 +0100 Sebastian Dröge + + * common: + Automatic update of common submodule + From d8814b6 to b77e2bf + +2011-03-25 09:10:14 +0100 Sebastian Dröge + + * common: + Automatic update of common submodule + From 6aaa286 to d8814b6 + +2011-03-24 18:50:52 +0200 Stefan Kost + + * common: + Automatic update of common submodule + From 6aec6b9 to 6aaa286 + +2011-03-22 13:04:02 +0100 Luis de Bethencourt + + * configure.ac: + configure.ac: redundant uses of AC_MSG_RESULT() + cleaned the redundant uses of AC_MSG_RESULT() in configure.ac + +2011-03-18 19:34:57 +0100 Luis de Bethencourt + + * autogen.sh: + autogen: wingo signed comment + +2011-02-28 18:34:03 +0100 Mark Nauwelaerts + + * common: + Automatic update of common submodule + From 1de7f6a to 6aec6b9 + +2011-02-14 12:54:46 +0200 Stefan Kost + + * common: + Automatic update of common submodule + From f94d739 to 1de7f6a + +2011-02-09 09:40:17 +0000 Tim-Philipp Müller + + * gst/gst-0.10.31.ignore: + gst-0.10.31.ignore: fix build against core 0.10.30 + +2011-01-24 17:55:55 +0530 Arun Raghavan + + * codegen/codegen.py: + codegen: Respect ignore-type for miniobjects + https://bugzilla.gnome.org/show_bug.cgi?id=640410 + +2011-01-24 17:56:16 +0530 Arun Raghavan + + * codegen/override.py: + codegen: Handle empty lines in overrides gracefully + Without this, having an empty line in an override will cause codegen to + unceremoniously choke to death. + https://bugzilla.gnome.org/show_bug.cgi?id=640341 + +2011-02-06 12:08:14 +0100 Edward Hervey + + * gst/pbutils.defs: + pbutils: Specify which string variables can be NULL + Without this you can't pass None to the various methods/constructors + +2011-01-28 16:59:11 +0000 Tim-Philipp Müller + + * gst/gstmodule.c: + gstmodule: remove unused label to fix compiler warning + gstmodule.c: In function 'pygst_fraction_to_value': + gstmodule.c:129:1: error: label 'out' defined but not used + https://bugzilla.gnome.org/show_bug.cgi?id=640837 + +2011-01-21 18:13:57 +0100 Andoni Morales Alastruey + + * testsuite/runtests.py: + tests: fix checks when the locale is not the default one + Some tests (test_pbutils.py) checks against strings for the + english locale, so we should force it before running any test + https://bugzilla.gnome.org/show_bug.cgi?id=640207 + +2011-01-25 11:17:12 +0100 Edward Hervey + + * configure.ac: + configure.ac: And back to development we go + +=== release 0.10.21 === + +2011-01-20 21:16:38 +0100 Edward Hervey + + * ChangeLog: + * NEWS: + * RELEASE: + * configure.ac: + * gst-python.doap: + Release 0.10.21 + +2011-01-06 17:40:28 +0000 christian schaller + + * gst-python.spec.in: + Update spec file with latest changes + +2011-01-16 14:58:37 +0100 Edward Hervey + + * gst/gstmodule.c: + gstmodule: Add tags introduced in 0.10.31 + Fixes #639632 + +2011-01-16 14:55:26 +0100 Edward Hervey + + * gst/gstmodule.c: + gstmodule: Use a macro to register tags + Avoids human error when registering them (like USER_RATING previously + being TRACK_PEAK). + +2011-01-12 18:12:29 +0530 Arun Raghavan + + * codegen/codegen.py: + codegen: Ignore functions whose return type is ignored + This makes sure that if X is an ignored type, then functions that return + an object of type X (or a pointer type based on X) are also ignored. + Fixes #639293 + +2011-01-12 18:11:23 +0530 Arun Raghavan + + * codegen/override.py: + codegen: Handle pointer types in is_type_ignored() + This ensures that if type X is ignored, then pointers to X (and pointers + to pointers to X, etc.) are also ignored. + Caveat: this also means that ignore-type should only be used with base + types and not pointer types. + Fixes #639293 + +2011-01-12 15:01:39 +0100 Edward Hervey + + * testsuite/Makefile.am: + testsuite: Add a make command to run tests forever + And will stop once they fail. Useful to debug racy tests. + +2011-01-11 20:31:59 +0100 Edward Hervey + + * configure.ac: + 0.10.20.3 pre-release + +2011-01-11 15:51:55 +0200 Stefan Kost + + * common: + Automatic update of common submodule + From e572c87 to f94d739 + +2011-01-10 16:38:09 +0000 Tim-Philipp Müller + + * common: + Automatic update of common submodule + From ccbaa85 to e572c87 + +2011-01-10 14:55:31 +0000 Tim-Philipp Müller + + * common: + Automatic update of common submodule + From 46445ad to ccbaa85 + +2011-01-07 21:52:03 +0100 Edward Hervey + + * gst/pbutils.defs: + pbutils: Fix discoverer miniobject methods + They were declared as functions and not methods :( + +2011-01-07 17:20:44 +0100 Edward Hervey + + * configure.ac: + 0.10.20.2 pre-release + +2011-01-07 17:17:05 +0100 Edward Hervey + + * gst/pbutils.override: + pbutils: Add overrides for new API + +2011-01-05 22:18:46 +0100 Edward Hervey + + * gst/pbutils.defs: + encoding: encoding_profile_get_output_caps => _get_input_caps + +2011-01-05 21:28:12 +0100 Edward Hervey + + * gst/gst-0.10.32.ignore: + * gst/gst.defs: + gst: update for latest API addition + +2011-01-05 21:25:37 +0100 Edward Hervey + + * gst/gst-pb-0.10.32.ignore: + * gst/pbutils.defs: + pbutils: Update .defs for latest addition + +2011-01-05 15:04:05 +0100 Edward Hervey + + * configure.ac: + * gst/Makefile.am: + * gst/gst-0.10.32.ignore: + * gst/gst-pb-0.10.32.ignore: + * gst/gst-types.defs: + * gst/gst.defs: + * gst/gstversion.override.in: + * gst/pbutils.defs: + * gst/video.defs: + gst: Update to 0.10.32 core/base API + +2011-01-05 15:04:25 +0100 Edward Hervey + + * gst/arg-types.py: + arg-types: Properly handle const-GstCaps* return values + +2010-12-20 17:48:03 +0100 Edward Hervey + + * common: + Automatic update of common submodule + From 169462a to 46445ad + +2010-12-15 14:57:05 +0200 Stefan Kost + + * common: + Automatic update of common submodule + From 20742ae to 169462a + +2010-12-13 16:24:39 +0200 Stefan Kost + + * common: + Automatic update of common submodule + From 011bcc8 to 20742ae + +2010-12-05 14:08:05 +0100 Edward Hervey + + * testsuite/test_pad.py: + test_pad: Fix pad refcount checking due to fix in core + The event source wasn't previously set correctly. Now that it is, + check the refcount on the proper pad. + +2010-12-03 14:49:13 +0100 Edward Hervey + + * configure.ac: + configure.ac: back to development + And the crowd goes mad \o/ + +=== release 0.10.20 === + +2010-12-01 23:43:57 +0100 Edward Hervey + + * ChangeLog: + * NEWS: + * RELEASE: + * configure.ac: + Release 0.10.20 + +2010-11-22 13:27:15 +0000 Tim-Philipp Müller + + * .gitignore: + * configure.ac: + 0.10.19.5 pre-release + +2010-11-22 14:18:05 +0100 Alessandro Decina + + * gst/Makefile.am: + * testsuite/common.py: + Fix distcheck some more. + In testsuite/common.py look for gst/__init__.py in builddir now. + Clean gst/__init__.pyc after make check. + +2010-11-22 13:41:17 +0100 Alessandro Decina + + * configure.ac: + * gst/Makefile.am: + * gst/__init__.py: + * gst/__init__.py.in: + Fix distcheck. + Before this change gst/__init__.py wasn't being copied to + $(top_builddir)/gst/, making make check fail to import gst. + +2010-11-17 09:36:44 -0300 Thiago Santos + + * gst/gst.defs: + gst: updating datetime functions + Updating datetime _from_unix functions for the new 2 variants (utc/local) + https://bugzilla.gnome.org/show_bug.cgi?id=635031 + +2010-11-09 10:58:04 +0100 Edward Hervey + + * gst/pbutilsmodule.c: + pbutils: Check that pygst_init() succeeded + +2010-11-09 11:00:16 +0100 Edward Hervey + + * gst/audiomodule.c: + * gst/gst-argtypes.c: + * gst/interfacesmodule.c: + * gst/pbutilsmodule.c: + * gst/pygstexception.c: + * gst/pygstiterator.c: + * gst/pygstminiobject.c: + * gst/tagmodule.c: + * gst/videomodule.c: + gst: run gst-indent all C files + We hadn't done it since the switch to git... whoops + +2010-11-09 10:57:31 +0100 Edward Hervey + + * gst/pygst.h: + pygst: Get the _PyGst_API symbol from the proper module + https://bugzilla.gnome.org/show_bug.cgi?id=634365 + +2010-11-08 19:01:50 +0100 Edward Hervey + + * gst/pbutils.defs: + * gst/pbutils.override: + pbutils: Update for latest API change in gstdiscoverer + +2010-11-01 19:37:03 +0000 Tim-Philipp Müller + + * configure.ac: + configure.ac: 0.10.19.4 pre-release + Skip .3 to align number with the other pre-releases. + +2010-10-30 16:18:59 +0100 Tim-Philipp Müller + + * gst/pbutils.defs: + pbutils: update for discoverer API changes in last gst-plugins-base pre-release + https://bugzilla.gnome.org/show_bug.cgi?id=633311 + +2010-10-27 16:58:12 +0200 David Hoyt + + * plugin/gstpythonplugin.c: + plugin: Fix build on MSVC + Fixes #633141 + +2010-10-27 13:17:57 +0100 Jan Schmidt + + * common: + Automatic update of common submodule + From 7bbd708 to 011bcc8 + +2010-10-26 17:53:42 +0100 Jan Schmidt + + * examples/filesrc.py: + filesrc.py: Call gobject.threads_init() in the example + Fixes: #633033 + +2010-10-22 18:17:34 +0200 Edward Hervey + + * configure.ac: + configure.ac: 0.10.19.2 pre-release + +2010-10-22 13:28:03 +0200 Edward Hervey + + * gst/pbutils.defs: + * gst/pbutils.override: + pbutils: Overrides for GstDiscoverer API + +2010-10-22 13:27:33 +0200 Edward Hervey + + * gst/gstmodule.c: + gst: Register new GST_ELEMENT_FACTORY_LIST_TYPE constants + +2010-10-22 13:27:02 +0200 Edward Hervey + + * gst/gstmessage.override: + gst: Add override for new qos messages + +2010-10-22 13:26:44 +0200 Edward Hervey + + * gst/gstevent.override: + gst: Add override for gst_event_parse_sink_message + +2010-10-22 13:26:21 +0200 Edward Hervey + + * gst/gstelementfactory.override: + gst: Add overrides for new GstElementFactoryList functions + +2010-10-22 13:25:45 +0200 Edward Hervey + + * gst/arg-types.py: + arg-types: GstElementFactoryListType is a guint64 + +2010-10-22 13:25:22 +0200 Edward Hervey + + * gst/gst-types.defs: + gst: Add GstDateTime as a boxed + +2010-10-18 11:59:03 +0200 Edward Hervey + + * gst/audio.override: + * gst/audiomodule.c: + * gst/interfaces.override: + * gst/interfacesmodule.c: + * gst/pbutils.override: + * gst/pbutilsmodule.c: + * gst/tag.override: + * gst/tagmodule.c: + * gst/video.override: + * gst/videomodule.c: + gst: Make all libraries use shared PyGst_API + Fixes #590348 + +2010-10-18 11:50:19 +0200 Edward Hervey + + * gst/Makefile.am: + * gst/common.h: + * gst/gst.override: + * gst/gstmodule.c: + * gst/pygst-private.h: + * gst/pygst.h: + * gst/pygstiterator.c: + * gst/pygstminiobject.h: + * gst/pygstvalue.c: + gst: Export some pygst API to be used by external modules + Partially fixes #590348 + +2010-10-18 10:14:19 +0200 Edward Hervey + + * configure.ac: + * gst/Makefile.am: + * gst/gst-0.10.20.ignore: + * gst/gst.override: + * gst/gstmodule.c: + * gst/gstversion.override.in: + * gst/pbutilsmodule.c: + gst: Bump required core/base to 0.10.20 + And clean up code accordingly + +2010-10-18 09:36:13 +0200 Edward Hervey + + * configure.ac: + * gst/Makefile.am: + * gst/audio.defs: + * gst/base.defs: + * gst/gst-0.10.31.ignore: + * gst/gst-pb-0.10.31.ignore: + * gst/gst.defs: + * gst/gstversion.override.in: + * gst/pbutils.defs: + * gst/video.defs: + gst: Update to latest 0.10.31 core/base API + +2010-10-14 12:32:36 -0700 David Schleef + + * common: + Automatic update of common submodule + From 5a668bf to 7bbd708 + +2010-10-08 12:45:07 -0700 David Schleef + + * common: + Automatic update of common submodule + From c4a8adc to 5a668bf + +2010-10-08 12:56:45 +0200 Sebastian Dröge + + * common: + Automatic update of common submodule + From 5e3c9bf to c4a8adc + +2010-09-21 18:34:55 +0200 Edward Hervey + + * common: + Automatic update of common submodule + From aa0d1d0 to 5e3c9bf + +2010-09-07 14:28:14 +0300 Артём Попов + + * examples/segments.py: + examples: add an example to show looping using segments + Fixes #339772. + +2010-09-07 11:43:30 +0100 Tim-Philipp Müller + + * common: + Automatic update of common submodule + From c2e10bf to aa0d1d0 + +2010-09-05 18:59:06 -0700 David Schleef + + * common: + Automatic update of common submodule + From d3d9acf to c2e10bf + +2010-09-05 12:21:07 +0200 Sebastian Dröge + + * common: + Automatic update of common submodule + From ec60217 to d3d9acf + +2010-08-30 17:12:12 +0200 Alessandro Decina + + * acinclude.m4: + acinclude.m4: also look in ${py_prefix}/lib for libpythonX.Y.so. + Fixes loading the python plugin loader in gentoo. + +2010-08-30 11:57:07 +0200 Leo Singer + + * plugin/gstpythonplugin.c: + plugin: fix spurious exceptions in pygst_require. Fixes #624592. + +2010-08-30 11:52:58 +0200 Leo Singer + + * plugin/gstpythonplugin.c: + plugin: refresh the plugin registry when plugins change. + +2010-08-27 13:20:24 +0200 Alessandro Decina + + * plugin/gstpythonplugin.c: + plugin: call pygtk.require("2.0") before importing pygobject. Fixes #623105. + Based on a patch from Leo Singer. + +2010-08-27 12:43:09 +0200 Leo Singer + + * gst/gst.defs: + gst: add bindings for more gst.util_uint64_scale_* + +2010-08-27 01:16:43 +0200 Alessandro Decina + + * plugin/gstpythonplugin.c: + plugin: remove an unneeded PyType_Check call. Makes it work on centos for real. + +2010-08-26 23:34:04 +0200 Alessandro Decina + + * plugin/gstpythonplugin.c: + plugin: declare _PyGstElement_Type as void*. + Declaring _PyGstElement_Type as PyTypeObject makes the loader on centos fail + because of a missing symbol. + +2010-08-26 17:14:32 +0200 Alessandro Decina + + * acinclude.m4: + * plugin/Makefile.am: + * plugin/gstpythonplugin.c: + Make the plugin loader work on OSX with the standard python install. + +2010-08-26 14:45:06 +0200 Alessandro Decina + + Merge branch 'master' of ssh://git.freedesktop.org/git/gstreamer/gst-python + +2010-08-26 12:14:33 +0200 Alessandro Decina + + * plugin/Makefile.am: + plugin: don't link to libpython + +2010-08-26 12:13:34 +0200 Alessandro Decina + + * acinclude.m4: + acinclude.m4: use a better way to find the correct PYTHON_LIB_LOC. + +2010-08-26 12:09:31 +0200 Alessandro Decina + + * plugin/gstpythonplugin.c: + plugin: refactor the initialization code. + Remove references to global python objects from the initialization code. This + makes it possible to avoid linking to libpython. + +2010-08-25 12:36:14 +0200 Alessandro Decina + + * acinclude.m4: + * plugin/Makefile.am: + plugin: fix the manual loading of libpythonX.Y.so. + +2010-08-25 11:08:15 +0200 Alessandro Decina + + * plugin/gstpythonplugin.c: + plugin: check for _Py_NoneStruct instead of Py_None. + When checking if CPython is already loaded, don't check for Py_None which is a + macro but use _Py_NoneStruct which is a real symbol. + +2010-08-13 17:25:05 +0300 Stefan Kost + + * common: + Automatic update of common submodule + From 3e8db1d to ec60217 + +2010-08-10 10:59:39 +0100 Tim-Philipp Müller + + * common: + Automatic update of common submodule + From bd2054b to 3e8db1d + +2010-08-06 23:18:02 +0200 Alessandro Decina + + * gst/gststructure.override: + * gst/pygstvalue.c: + * testsuite/test_caps.py: + gst.Structure: raise TypeError when assigning None to a key + +2010-08-05 13:57:53 +0300 Stefan Kost + + * common: + Automatic update of common submodule + From a519571 to bd2054b + +2010-08-04 19:31:40 +0200 Sebastian Dröge + + * configure.ac: + configure: Check if the compiler supports ISO C89 or C99 and which parameters are required + This first checks what is required for ISO C99 support and sets the relevant + compiler parameters and if no C99 compiler is found, it checks for a + C89 compiler. This enables us to check for and use C89/C99 functions + that gcc hides from us without the correct compiler parameters. + +2010-07-26 19:41:43 +0200 Alessandro Decina + + * testsuite/test_fraction.py: + test_fraction: add a test for gobject property marshalling. + +2010-07-26 19:29:53 +0200 Alessandro Decina + + * gst/gstmodule.c: + gst: implement getters and setters for GST_TYPE_FRACTION properties. Fixes #624882. + +2010-07-16 12:44:46 +0200 Edward Hervey + + * configure.ac: + Back to development. + +=== release 0.10.19 === + +2010-07-15 21:01:35 +0200 Edward Hervey + + * ChangeLog: + * NEWS: + * RELEASE: + * configure.ac: + * gst-python.doap: + Release 0.10.19 "Insert Casablanca quote here" + +2010-07-14 12:33:58 +0200 Alessandro Decina + + * gst/gst.defs: + * testsuite/test_ghostpad.py: + gst.GhostPad: allow set_target(None) to unset the target. Fixes #590735. + +2010-07-07 12:08:29 +0200 Edward Hervey + + * configure.ac: + configure.ac: 0.10.18.4 pre-release + +2010-07-07 12:11:46 +0200 Edward Hervey + + * gst/gstmodule.c: + gst: Add GST_TAG_IMAGE_ORIENTATION + +2010-07-07 12:07:55 +0200 Edward Hervey + + * gst/base.defs: + * gst/gst-0.10.30.ignore: + base: Add new GstBaseSink methods + +2010-06-30 10:26:25 +0200 Edward Hervey + + * configure.ac: + configure.ac: 0.10.18.3 pre-release + +2010-06-30 10:25:50 +0200 Edward Hervey + + * autogen.sh: + * configure.ac: + Bump automake requirements to 1.10 and autoconf to 2.60 + +2010-06-27 10:46:14 +0200 Edward Hervey + + * configure.ac: + 0.10.18.2 pre-release + +2010-06-27 10:35:55 +0200 Edward Hervey + + * configure.ac: + * gst/Makefile.am: + * gst/gst-pb-0.10.29.ignore: + * gst/gst-pb-0.10.30.ignore: + * gst/gstversion.override.in: + * gst/tag.defs: + * gst/video.defs: + * gst/xoverlay.defs: + Add gst-plugins-base 0.10.29/0.10.30 API additions + +2010-06-27 10:14:58 +0200 Edward Hervey + + * gst/base.defs: + * gst/gst-0.10.30.ignore: + Add new core library API from 0.10.30 + +2010-06-27 10:07:28 +0200 Edward Hervey + + * configure.ac: + * gst/Makefile.am: + * gst/gst-0.10.29.ignore: + * gst/gst-0.10.30.ignore: + * gst/gst-types.defs: + * gst/gst.defs: + * gst/gstversion.override.in: + Add new core 0.10.29 and 0.10.30 API definitions + +2010-06-24 15:10:08 +0300 Stefan Kost + + * common: + Automatic update of common submodule + From 35617c2 to a519571 + +2010-06-15 16:50:48 +0200 Edward Hervey + + * common: + Automatic update of common submodule + From 9339ccc to 35617c2 + +2010-06-15 16:55:09 +0300 Stefan Kost + + * common: + Automatic update of common submodule + From 5adb1ca to 9339ccc + +2010-06-15 16:36:19 +0300 Stefan Kost + + * common: + Automatic update of common submodule + From 57c89b7 to 5adb1ca + +2010-06-15 15:50:39 +0300 Stefan Kost + + * common: + Automatic update of common submodule + From c804988 to 57c89b7 + +2010-06-14 13:28:28 +0200 Sebastian Dröge + + * configure.ac: + configure: Use GLIB_EXTRA_CFLAGS + +2010-06-14 13:05:52 +0200 Sebastian Dröge + + * common: + Automatic update of common submodule + From 7a0fdf5 to c804988 + +2010-06-14 11:35:37 +0200 Sebastian Dröge + + * common: + Automatic update of common submodule + From 6da3bab to 7a0fdf5 + +2010-06-12 08:29:58 +0200 Sebastian Dröge + + * common: + Automatic update of common submodule + From 733fca9 to 6da3bab + +2010-06-09 12:40:32 -0700 David Schleef + + * common: + Automatic update of common submodule + From fad145b to 733fca9 + +2010-06-09 12:34:26 -0700 David Schleef + + * common: + Automatic update of common submodule + From 47683c1 to fad145b + +2010-06-09 17:07:40 +0200 Edward Hervey + + * pkgconfig/gst-python-uninstalled.pc.in: + * pkgconfig/gst-python.pc.in: + pkgconfig: Remove the includedir variables + First of all because we don't install anything (doh!), and secondly + because it confuses the hell out of 3rd party python modules + using the values from those .pc files. + +2010-06-03 13:09:28 +0100 Tim-Philipp Müller + + * autogen.sh: + autogen.sh: remove undefined configure options + +2010-06-01 23:49:45 -0700 David Schleef + + * common: + Automatic update of common submodule + From 17f89e5 to 47683c1 + +2010-06-01 22:55:32 -0700 David Schleef + + * common: + Automatic update of common submodule + From fd7ca04 to 17f89e5 + +2010-05-28 10:32:28 +0100 Tim-Philipp Müller + + * .gitignore: + * Makefile.am: + * autogen.sh: + * configure.ac: + build: put build files into m4/ instead of common/m4/ + We don't want the common submodule directory contaminated with + random build cruft. + +2010-04-26 00:33:04 +0100 Tim-Philipp Müller + + * gst-python.doap: + doap: update repository info from cvs->git and maintainers + +2010-05-26 11:56:24 +0100 Tim-Philipp Müller + + * common: + Automatic update of common submodule + From 357b0db to fd7ca04 + +2010-05-14 18:26:13 +0100 Tim-Philipp Müller + + * common: + Automatic update of common submodule + From 4d67bd6 to 357b0db + +2010-04-28 01:12:25 -0300 Thiago Santos + + * gst/gstmodule.c: + gstmodule: Add missing tags + Map GST_TAG_* that were missing in gst-python bindings + +2009-07-24 17:36:18 +0200 Olivier Aubert + + * gst/gstbuffer.override: + Implement setter for gst.Buffer.size + https://bugzilla.gnome.org/show_bug.cgi?id=589582 + +2010-04-28 00:27:43 -0300 Thiago Santos + + * gst/tag.defs: + * testsuite/test_libtag.py: + tag: Adds xmp functions mappings + Maps gst_tag_list_from_xmp_buffer and + gst_tag_list_to_xmp_buffer + https://bugzilla.gnome.org/show_bug.cgi?id=617068 + +2010-04-28 00:26:50 -0300 Thiago Santos + + * gst/arg-types.py: + arg-types: Map const GstMiniObject + Adds GstMiniObjectArg to be able to use GstMiniObject objects + and its const versions in functions + https://bugzilla.gnome.org/show_bug.cgi?id=617068 + +2010-04-29 16:02:20 +0200 Edward Hervey + + * testsuite/test_interface.py: + test_interface: Don't assert the missing mixer, gracefully ignore it + Fixes make check on systems that don't have a GstMixer element available + +2010-04-23 14:42:16 +0100 Tim-Philipp Müller + + * common: + Automatic update of common submodule + From fc85867 to 4d67bd6 + +2010-04-09 11:23:51 +0200 Sebastian Dröge + + * common: + Automatic update of common submodule + From c1d07dd to fc85867 + +2010-03-24 18:56:05 +0100 Edward Hervey + + * common: + Automatic update of common submodule + From 55cd514 to c1d07dd + +2010-03-15 10:26:25 +0100 Emilio Pozuelo Monfort + + * gst/__init__.py: + Fix import on GNU/Hurd + +2010-03-12 14:00:28 +0100 Edward Hervey + + * common: + Automatic update of common submodule + From e272f71 to 55cd514 + +2010-03-11 11:21:39 +0100 Benjamin Otte + + * common: + Automatic update of common submodule + From df8a7c8 to e272f71 + +2010-03-10 21:52:56 +0100 Benjamin Otte + + * common: + Automatic update of common submodule + From 9720a7d to df8a7c8 + +2010-03-10 20:44:42 +0100 Benjamin Otte + + * common: + Automatic update of common submodule + From 0b6e072 to 9720a7d + +2010-03-10 16:10:41 +0100 Benjamin Otte + + * common: + Automatic update of common submodule + From 7cc5eb4 to 0b6e072 + +2010-03-10 01:11:23 +0000 Tim-Philipp Müller + + * common: + Automatic update of common submodule + From 7aa65b5 to 7cc5eb4 + +2010-03-09 21:41:38 +0000 Sebastian Dröge + + * common: + Automatic update of common submodule + From 44ecce7 to 7aa65b5 + +2010-02-26 16:37:50 +0100 Sebastian Dröge + + * gst/Makefile.am: + * pkgconfig/Makefile.am: + * testsuite/Makefile.am: + build: Make some more rules silent if requested + +2010-02-26 15:46:58 +0100 Sebastian Dröge + + * configure.ac: + configure: Use automake 1.11 silent rules instead of shave if available + This makes sure that we use something that is still maintained and + also brings back libtool 1.5 support. + +2010-02-14 23:19:13 +0100 Sebastian Dröge + + * common: + Automatic update of common submodule + From 96dc793 to 44ecce7 + +2010-02-12 11:38:54 +0100 Edward Hervey + + * configure.ac: + configure.ac: And back to development we go + +=== release 0.10.18 === + +2010-02-11 16:33:04 +0100 Edward Hervey + + * ChangeLog: + * NEWS: + * RELEASE: + * configure.ac: + Release 0.10.18 "A pigeon carrying a 500ton block" + +2010-01-30 15:20:24 +0000 Tim-Philipp Müller + + * common: + Automatic update of common submodule + From 15d47a6 to 96dc793 + +2010-01-25 20:27:39 +0100 Edward Hervey + + * configure.ac: + configure.ac: 0.10.17.2 pre-release + +2010-01-23 12:39:46 +0100 Luca Bruno + + * gst/__init__.py: + Fix importing of gst module on GNU/kFreeBSD + +2010-01-20 00:55:39 +0000 Tim-Philipp Müller + + * common: + Automatic update of common submodule + From 14cec89 to 15d47a6 + +2010-01-15 17:49:03 +0100 Edward Hervey + + * configure.ac: + * gst/Makefile.am: + * gst/gst-0.10.13.ignore: + * gst/gst-0.10.14.ignore: + * gst/gst-0.10.15.ignore: + * gst/gst-0.10.16.ignore: + * gst/gst-0.10.18.ignore: + * gst/gst-pb-0.10.14.ignore: + * gst/gst-pb-0.10.16.ignore: + * gst/gst-pb-0.10.18.ignore: + * gst/gstversion.override.in: + * gst/interfaces.override: + * gst/pbutils.override: + bump minimum requirement to 0.10.18 and remove cruft + +2010-01-15 17:44:41 +0100 Edward Hervey + + * configure.ac: + * gst/Makefile.am: + * gst/gst-0.10.26.ignore: + * gst/gst-pb-0.10.26.ignore: + * gst/gstversion.override.in: + ignore new API additions for 0.10.26 core/base releases + +2010-01-15 17:26:20 +0100 Edward Hervey + + * gst/base.defs: + * gst/gst-types.defs: + * gst/gst.defs: + * gst/tag.defs: + * gst/video.defs: + gst: Update .defs to new API + +2010-01-18 09:06:28 -0300 Thiago Santos + + * gst/extend/discoverer.py: + python: Do not pop tags in discoverer.py + Do not use pop on dicts because it destroys the tags info. + Fixes #592459 + +2009-12-21 19:13:28 +0100 Mark Nauwelaerts + + * common: + Automatic update of common submodule + From 47cb23a to 14cec89 + +2009-12-01 15:08:40 +0000 Tim-Philipp Müller + + * common: + Automatic update of common submodule + From 87bf428 to 47cb23a + +2009-12-01 14:18:28 +0100 Sebastian Dröge + + * common: + Automatic update of common submodule + From da4c75c to 87bf428 + +2009-11-27 18:56:43 +0100 Edward Hervey + + * common: + Automatic update of common submodule + From 53a2485 to da4c75c + +2009-11-19 10:31:56 +0000 Tim-Philipp Müller + + * common: + Automatic update of common submodule + From 0702fe1 to 53a2485 + +2009-10-16 10:17:39 +0300 Stefan Kost + + * common: + Automatic update of common submodule + From 85d1530 to 0702fe1 + +2009-10-15 14:15:37 +0100 Zaheer Abbas Merali + + * examples/Makefile.am: + * examples/maemogst.py: + examples: add a simple Maemo 5 example + +2009-10-14 10:42:11 +0200 Edward Hervey + + * common: + Automatic update of common submodule + From a3e3ce4 to 85d1530 + +2009-10-08 11:01:32 +0100 Jan Schmidt + + * common: + Automatic update of common submodule + From 19fa4f3 to a3e3ce4 + +2009-10-06 19:48:48 +0100 Jan Schmidt + + * configure.ac: + back to development -> 0.10.17.1 + +2009-10-05 14:29:41 +0100 Jan Schmidt + + * gst-python.doap: + Add 0.10.17 release to the doap file + +=== release 0.10.17 === + +2009-10-05 14:06:11 +0100 Jan Schmidt + + * ChangeLog: + * NEWS: + * RELEASE: + * configure.ac: + Release 0.10.17 + +2009-09-17 01:21:47 +0100 Jan Schmidt + + * configure.ac: + 0.10.16.3 pre-release + +2009-09-16 16:23:27 +0200 Edward Hervey + + * configure.ac: + * gst/Makefile.am: + * gst/gst-0.10.25.ignore: + * gst/gst-pb-0.10.25.ignore: + * gst/gst.defs: + * gst/gstversion.override.in: + * gst/interfaces.defs: + * gst/interfaces.override: + Update definitions and ignores for core/base 0.10.25. Fixes #587432 + +2009-09-12 00:26:57 +0100 Jan Schmidt + + * ChangeLog: + * configure.ac: + 0.10.16.2 pre-release + +2009-09-11 22:41:28 +0100 Jan Schmidt + + * testsuite/test_message.py: + test: Fix the structure_changed message test + The core changed to use sink pads for the structure changed + message instead of source pads. Might as well fix the test too. + +2009-09-05 10:25:19 +0200 Sebastian Dröge + + * common: + Automatic update of common submodule + From 94f95e3 to 19fa4f3 + +2009-08-21 16:41:29 +0200 Edward Hervey + + * testsuite/Makefile.am: + * testsuite/test_audio.py: + Add test_audio.py. + +2009-08-21 16:22:38 +0200 Johannes Berg + + * gst/Makefile.am: + Use only one copy of pygstminiobject. Fixes #590348. + Instead of linking pygstminiobject.c into all the modules, + we can link it only into _gst and export the symbols for + the other modules. This fixes bug #590348 because now the + class key/id is common for all modules as a side-effect. + Also makes the modules smaller. + +2009-08-20 15:46:53 +0200 Alessandro Decina + + * gst/base.defs: + Fix leak in gst_base_sink_get_lasy_buffer. Fixes #592447. + +2009-08-18 14:45:41 +0100 Christian Schaller + + * gst-python.spec.in: + Update spec file + +2009-08-13 11:45:51 +0200 Alessandro Decina + + * gst/gstpad.override: + Release the GIL around gst_pad_link. + +2009-08-13 11:00:49 +0200 Edward Hervey + + * gst/gstpad.override: + gstpad: Don't forget to acquire/release the GIL in pac_block_destroy_data + +2009-08-08 22:49:16 +0200 Sebastian Dröge + + * testsuite/Makefile.am: + Use LC_ALL=C for the tests as some are comparing localized strings + Fixes bug #590803. + +2009-05-10 11:17:26 +0200 Marc-Andre Lureau + + * autogen.sh: + Run libtoolize before aclocal + This unbreaks the build in some cases. Fixes bug #582021 + +2009-08-06 01:45:07 +0100 Jan Schmidt + + * configure.ac: + back to development -> 0.10.16.1 + +2009-08-05 02:04:12 +0100 Jan Schmidt + + * gst-python.doap: + Add 0.10.16 release to the doap file + +=== release 0.10.16 === + +2009-08-05 01:34:03 +0100 Jan Schmidt + + * ChangeLog: + * NEWS: + * RELEASE: + * configure.ac: + Release 0.10.16 + +2009-07-24 00:43:35 +0300 Stefan Kost + + * common: + Automatic update of common submodule + From fedaaee to 94f95e3 + +2009-07-20 17:52:10 +0100 Jan Schmidt + + * configure.ac: + 0.10.15.3 pre-release + +2009-07-17 11:34:50 +0200 Edward Hervey + + * gst/base.defs: + * gst/gst-0.10.24.ignore: + gst: More API additions to gstreamer core. Fixes #587432 + +2009-07-14 19:00:28 +0100 Jan Schmidt + + * ChangeLog: + * configure.ac: + 0.10.15.2 pre-release + +2009-07-13 12:24:35 -0400 Olivier Crête + + * common: + Automatic update of common submodule + From 5845b63 to fedaaee + +2009-07-01 16:01:53 +0200 Edward Hervey + + * gst/gstquery.override: + gstquery.override: Wrap remainig gst_query_parse*() methods. + +2009-07-01 16:01:41 +0200 Edward Hervey + + * gst/gstevent.override: + gstevent.override: Fix typos. + +2009-07-01 13:54:57 +0200 Edward Hervey + + * gst/gstmessage.override: + * testsuite/test_message.py: + gst.Message: Wrap remaining parse_*() methods. + +2009-07-01 13:54:40 +0200 Edward Hervey + + * gst/gstevent.override: + gst.Event: wrap parse_new_segment_full() + +2009-07-01 13:53:54 +0200 Edward Hervey + + * gst/gst.defs: + gst.defs: Properly mark functions returning new objects + +2009-07-01 12:29:22 +0200 Edward Hervey + + * gst/gstmessage.override: + * testsuite/test_message.py: + gst.Message: Add overrides for new 0.10.24 messages + +2009-07-01 12:28:52 +0200 Edward Hervey + + * gst/gstevent.override: + * testsuite/test_event.py: + gst.Event: Add override for step event + +2009-07-01 10:58:42 +0200 Edward Hervey + + * configure.ac: + * gst/Makefile.am: + * gst/gst-0.10.24.ignore: + * gst/gst-types.defs: + * gst/gst.defs: + * gst/gstversion.override.in: + Update .defs for core API additions + +2009-07-01 10:57:29 +0200 Edward Hervey + + * codegen/argtypes.py: + codegen: Fix const GBoxed return wrapping. + +2009-06-26 13:43:51 +0100 Jan Schmidt + + * common: + Automatic update of common submodule + From f810030 to 5845b63 + +2009-06-24 15:16:20 +0100 Jan Schmidt + + * common: + Automatic update of common submodule + From c572721 to f810030 + +2009-06-05 23:26:11 +0100 Jan Schmidt + + * gst/pygstvalue.c: + values: Fix segfault in the testsuite + It seems pygst_value_from_pyobject should not unref the passed + in object. Wrap the original pygst_value_from_pyobject in a function + that converts unicode python objects and then unrefs the temporary + object after extraction into a GValue. + +2009-06-01 22:02:47 +0200 Thomas Vander Stichele + + * gst/gsttaglist.override: + * gst/tag.override: + * testsuite/common.py: + * testsuite/test_pipeline.py: + * testsuite/test_taglist.py: + wrap gst_tag_to_vorbis_comment; fix uint tag setting + Setting gst.TAG_TRACK_NUMBER was failing because GStreamer + expects a uint while Python object -> GValue conversion was + giving an int. gst_tag_to_vorbis_comment was wrapped so + this conversion could be tested and failed on properly. + +2009-06-01 19:08:47 +0200 Thomas Vander Stichele + + * gst/pygstvalue.c: + * testsuite/test_struct.py: + * testsuite/test_taglist.py: + Convert unicode objects to utf-8 encoded G_STRINGs + +2009-06-01 12:46:03 +0200 Thomas Vander Stichele + + * gst/gst.override: + fix some grammar, add some debug + +2009-05-26 21:01:35 +0200 Edward Hervey + + * gst/gst.defs: + gst.defs: Replace gchar** by GStrv to wrap more methods. Fixes #580992 + +2009-05-26 17:20:32 +0100 Jan Schmidt + + * common: + Automatic update of common submodule + From 888e0a2 to c572721 + +2009-05-22 12:05:28 +0200 Edward Hervey + + * plugin/gstpythonplugin.c: + gstpythonplugin: Don't use pyg_gil_* in pure python. Fixes #583378 + At this point, pygobject wasn't loaded yet ... cause pyg_gil_state_ensured + to not be initialized to the proper method. + +2009-05-22 10:21:17 +0100 Jan Schmidt + + * common: + Automatic update of common submodule + From 6ab11d1 to 888e0a2 + +2009-05-12 11:52:11 +0200 Edward Hervey + + * gst/gst-pb-0.10.23.ignore: + gst-pb-0.10.23.ignore: Remove stray empty line. + This caused some issues on some systems. + +2009-05-11 21:22:35 +0100 Jan Schmidt + + * configure.ac: + Back to development -> 0.10.15.1 + +=== release 0.10.15 === + +2009-05-11 00:11:58 +0100 Jan Schmidt + + * ChangeLog: + * NEWS: + * RELEASE: + * configure.ac: + * gst-python.doap: + Release 0.10.15 + +2009-05-07 14:57:57 +0200 Edward Hervey + + * configure.ac: + 0.10.14.5 pre-release + +2009-05-07 13:49:18 +0200 Edward Hervey + + * gst/gst-pb-0.10.23.ignore: + gst-pb-0.10.23: Fix the ignores, globs need to go in a special section. + Finishes fixing #581729 + +2009-05-07 13:48:54 +0200 Edward Hervey + + * gst/gst-0.10.23.ignore: + gst-0.10.23.ignore: Add newly added enum values. Partially fixes #581729 + +2009-05-07 13:48:01 +0200 Edward Hervey + + * codegen/codegen.py: + codegen: Allow ignoring enum values. Partially fixes #581729 + This is needed to ignore new enum values that are added in new gstreamer + core/base versions. + +2009-05-06 23:38:54 +0100 Jan Schmidt + + * examples/switch.py: + examples: Port switch.py to input-selector + The switch element hasn't existed for a while now - use the + replacement element input-selector instead. + Partially (and finally) fixes #581737 + +2009-05-06 23:38:08 +0100 Jan Schmidt + + * examples/play.py: + * examples/remuxer.py: + * examples/switch.py: + * examples/synchronizer.py: + examples: Make xoverlay installation thread safe using the GDK lock. + We can't call into the GDK functions in our sync-message handler + without taking the GDK lock, so do so. + Partially fixes #581737 + +2009-05-06 16:48:40 +0100 Jan Schmidt + + * configure.ac: + 0.10.14.4 pre-release + +2009-04-23 17:14:20 +0200 Edward Hervey + + * testsuite/Makefile.am: + testsuite: Dist new test file. + +2009-04-18 23:52:08 +0200 Thomas Vander Stichele + + * gst/gst.override: + * testsuite/test_gst.py: + TIME_ARGS: Catch bad input. Fixes #579455 + +2009-04-21 21:14:21 +0100 Jan Schmidt + + * configure.ac: + 0.10.14.3 pre-release + +2009-04-21 22:14:07 +0100 Jan Schmidt + + * common: + Automatic update of common submodule + From b3941ea to 6ab11d1 + +2009-04-18 17:13:12 +0100 Jan Schmidt + + Merge branch 'master' of ssh://git.freedesktop.org/git/gstreamer/gst-python + +2009-04-18 16:39:42 +0100 Jan Schmidt + + * gst/gstelement.override: + * gst/gstmessage.override: + * gst/gstpad.override: + python: Fix some locking problems + Add some python pyg_begin_allow_threads/end_allow_threads when calling into some gstreamer functions that might + call into python. + +2009-04-18 09:05:09 +0200 Edward Hervey + + * plugin/gstpythonplugin.c: + gstpythonplugin: Use strcmp for old glib. Fixes #579383 + +2009-04-17 19:34:23 +0200 Edward Hervey + + * Makefile.am: + Don't forget to dist gstlibtoolimporter.py. Fixes #579325 + +2009-04-17 19:28:08 +0200 Edward Hervey + + * configure.ac: + * gst/Makefile.am: + * gst/audio.defs: + * gst/audio.override: + * gst/gst-pb-0.10.23.ignore: + * gst/gstversion.override.in: + * gst/interfaces.defs: + * gst/interfaces.override: + * gst/video.defs: + Wrap gst-plugins-base-0.10.23 API additions. Partially fixes #578848 + +2009-04-17 18:51:40 +0200 Edward Hervey + + * configure.ac: + * gst/Makefile.am: + * gst/base.defs: + * gst/gst-0.10.23.ignore: + * gst/gst-extrafuncs.defs: + * gst/gst-types.defs: + * gst/gst.defs: + * gst/gst.override: + * gst/gstmodule.c: + * gst/gstversion.override.in: + * gst/libs.defs: + Wrap new API added in gstreamer-0.10.23. Partially fixes #578848 + +2009-04-17 11:33:18 +0200 Mark Nauwelaerts + + * gst/gst.defs: + query_new_seeking wrapper must return query with refcount 1. Fixes #579183. + +2009-04-15 22:58:56 +0100 Jan Schmidt + + * configure.ac: + 0.10.14.2 pre-release + +2009-04-15 22:57:36 +0100 Jan Schmidt + + * ChangeLog: + ChangeLog: regenerate changelog with the gen-changelog script + +2009-04-15 22:38:28 +0200 Thomas Vander Stichele + + Merge branch 'bz-577735' + +2009-04-12 21:27:33 +0200 Edward Hervey + + * gst/__init__.py: + * plugin/gstpythonplugin.c: + registry: fix deadlock with recursive registry scanning. + The way to properly fix this issue was in fact to disable the registry + scanning when we import gst from the python plugin loader since... + we are 100% guaranteed this is being called from a registry scan :) + +2009-04-11 16:58:25 +0200 Laszlo Pandy + + * gst/gst.override: + debug: Implement gst.debug_log. Fixes #571380 + +2009-04-11 16:54:00 +0200 Olivier Crete + + * pkgconfig/gst-python-uninstalled.pc.in: + * pkgconfig/gst-python.pc.in: + pkgconfig: We require pygobject and not pygtk. Fixes #578435 + +2009-04-11 16:37:16 +0200 Edward Hervey + + * gst/gstbase.override: + adapter: overrides for _take/_peek. Fixes #576505. + This creates strings of the proper size, unlike the previous patch. + +2009-04-11 16:48:31 +0200 Edward Hervey + + * testsuite/test_adapter.py: + test_adapter: No longer use slices (which was wrong to start with). + +2009-04-11 16:47:07 +0200 Edward Hervey + + * gst/arg-types.py: + arg-types: Remove guint8* argtype. + Partially reverts 7aef2834cff525906db15b4af0ee54b723bdd083 + +2009-04-11 16:08:51 +0200 Edward Hervey + + * gst/__init__.py: + __init__: Postpone registry update during initialization. Fixes #576145 + +2009-04-11 16:20:11 +0200 Alessandro Decina + + * gst/__init__.py: + * gstlibtoolimporter.py: + * gstltihooks.py: + * testsuite/common.py: + Fix uninstalled usage with python 2.6. Fixes #576546 + Also imports submodules as mentionned by Philippe Normand. + +2009-04-10 15:43:35 +0200 Thomas Vander Stichele + + Merge branch 'master' of ssh://thomasvs@git.freedesktop.org/git/gstreamer/gst-python into bz-577735 + +2009-04-04 21:19:46 +0300 Felipe Contreras + + * common: + Automatic update of common submodule + From d0ea89e to b3941ea + +2009-04-04 14:55:08 +0200 Edward Hervey + + * common: + Automatic update of common submodule + From f8b3d91 to d0ea89e + +2009-04-04 12:55:47 +0200 Thomas Vander Stichele + + * gst/gstobject.override: + handle actual GObject having been set to NULL in repr + (For example, when doing weak ref tracking) + +2009-04-04 10:05:50 +0200 Edward Hervey + + * pygst.py.in: + pygst.py.in: Fix license (LGPL). + +2009-02-10 12:07:52 +0100 Mark Nauwelaerts + + * gst/gst.defs: + * gst/gst.override: + Provide wrapper for gst_tag_get_type. Fixes #571156. + +2009-04-02 18:06:12 +0200 Thomas Vander Stichele + + * testsuite/test_pipeline.py: + make sure that we actually get the clock-provide message + +2009-04-02 17:21:58 +0200 Thomas Vander Stichele + + * gst/gstbin.override: + * testsuite/test_pipeline.py: + Fix for #577735: do_handle_message leaks messages + +2009-03-26 16:18:04 +0100 Edward Hervey + + * gst/base.defs: + Fix some leaks. + +2009-03-26 16:13:48 +0100 Edward Hervey + + * gst/arg-types.py: + * testsuite/Makefile.am: + * testsuite/test_adapter.py: + New guint8* ArgType. Wraps the various GstAdapter methods. Fixes #576505 + +2009-03-17 15:03:09 +0100 Alessandro Decina + + * gst/gstbus.override: + * testsuite/test_bus.py: + gstbus: fix refcounting in gst.Bus.set_sync_handler. + +2009-03-10 19:29:51 +0100 Edward Hervey + + * gst/base.defs: + base.defs: Allow passing NULL/None to gst.BaseTransform.suggest() + +2009-03-09 23:14:12 +0000 Jan Schmidt + + * common: + Automatic update of common submodule + From 7032163 to f8b3d91 + +2009-03-08 12:06:40 +0100 Sebastian Dröge + + * common: + Automatic update of common submodule + From ffa738d to 7032163 + +2009-03-08 11:22:17 +0100 Sebastian Dröge + + * common: + Automatic update of common submodule + From 3f13e4e to ffa738d + +2009-03-07 11:47:49 +0100 Sebastian Dröge + + * common: + Automatic update of common submodule + From 3c7456b to 3f13e4e + +2009-03-07 10:47:56 +0100 Sebastian Dröge + + * common: + Automatic update of common submodule + From 57c83f2 to 3c7456b + +2009-03-05 13:59:30 +0100 Edward Hervey + + * gst/gstcaps.override: + gstcaps: Remove dead code. + Those two lines will never be called, because caps2 will always be NULL + if we go to error (either we haven't used it yet (first goto and in this + case it's NULL), or.. it's NULL (second goto)). + +2009-03-05 13:45:07 +0100 Edward Hervey + + * gst/pbutils.override: + pbutils: Fix leaked GStrv. Fixes #574258 + +2009-03-05 13:21:19 +0100 Edward Hervey + + * gst/gst.override: + Fix leak in gst_flow_get_name() wrapper function. Fixes #574251 + PyString_FromString will make a copy of the provided string. + +2009-03-02 15:22:33 +0100 Edward Hervey + + * .gitignore: + .gitignore: Reorder ignores and add *~ + +2009-02-27 12:29:04 +0100 Edward Hervey + + * plugin/gstpythonplugin.c: + plugin: Don't import modules that were already imported. + This avoids warnings for the cases where pygst.require() was already + called. + +2009-02-25 15:14:42 +0000 Jan Schmidt + + * common: + * configure.ac: + build: Update shave init statement for changes in common. Bump common. + +2009-02-25 11:33:13 +0000 Jan Schmidt + + * common: + Automatic update of common submodule + From 9cf8c9b to a6ce5c6 + +2009-02-24 11:43:41 +0100 Alessandro Decina + + * gst/gstbase.override: + Don't steal a ref to event in gst.BaseTransform.do_src_event. + +2009-02-22 20:39:39 +0000 Jan Schmidt + + * configure.ac: + Use shave for the build output + +2009-02-22 20:08:54 +0100 Edward Hervey + + * gst/gstbus.override: + gstbus.override: Allow using set_sync_handler with None as a parameter + +2009-02-22 20:12:23 +0100 Edward Hervey + + * gst/gstpad.override: + * testsuite/test_pad.py: + GstPad: Use gst_pad_set_blocked_async_full() if available. + Avoids leaking arguments. + Fixes #514717 + +2009-02-22 16:01:49 +0000 Jan Schmidt + + * common: + Automatic update of common submodule + From 5d7c9cc to 9cf8c9b + +2009-02-21 11:14:13 -0800 David Schleef + + * common: + Automatic update of common submodule + From 80c627d to 5d7c9cc + +2009-02-20 18:29:20 +0100 Edward Hervey + + * gst/gstpad.override: + gstpad.override: Take a copy of gst_static_pad_template_get_caps() + This means that we take a completely new caps for the sole usage of + gst-python. The GstCaps return by gst_static_pad_template_get_caps() are + (surprise) static and therefore will always exist... as long as the + GstStaticPadTemplate (and the factory providing it) still exist. + This solves the case of getting the caps of a static pad template *before* + any element was created using the GstElementFactory. When the factory is + used to create an element, a new factory is created, replacing the old one, + and plainly discarding any static values (including those caps). + +2009-02-17 10:48:25 +0100 Edward Hervey + + * plugin/gstpythonplugin.c: + Plugin Loader: Don't register non-gstElement subclasses + +2009-02-20 08:34:38 +0100 Edward Hervey + + * gstltihooks.py: + gstltihooks: Sync with upstream pygobject/ltihooks.py commit. + Apply commit from James Henstridge 2009-02-20 : "I've updated the + license block in pygtk/ltihooks.py to LGPL (not sure why I + didn't just use LGPL like the rest of pygtk)." + Partially fixes #572487 + +2009-02-09 14:02:41 +0100 Edward Hervey + + * plugin/Makefile.am: + plugin/Makefile.am : Remove commented lines + +2009-01-19 08:38:10 +0100 Edward Hervey + + * Makefile.am: + * acinclude.m4: + * configure.ac: + * plugin/Makefile.am: + * plugin/gstpythonplugin.c: + Python plugin loader implementation. + Fixes #304361. + +2009-02-09 13:23:45 +0100 Edward Hervey + + * testsuite/Makefile.am: + Add a rule to generate valgrind suppressions for a single test. + +2009-02-09 13:25:11 +0100 Edward Hervey + + * gst/arg-types.py: + GstMiniObject: Re-increment the C refcount after using a miniobject. + This behaviour is symmetrical to what we do at the very beginning (incrementing + the Python refcount of the wrapper object and decrementing the C refcount of the + actual object). + +2009-02-09 12:04:04 +0100 Edward Hervey + + * common: + Bump revision to use for common submodule. + +2009-01-30 17:41:18 +0000 Jan Schmidt + + * common: + Bump common + +2009-01-30 09:06:31 +0100 Edward Hervey + + * autogen.sh: + Fix previous commit, wasn't actually setting up a symbolic link + +2009-01-30 08:59:21 +0100 Edward Hervey + + * autogen.sh: + * common: + Use a symbolic link for the pre-commit client-side hook + +2009-01-30 08:59:07 +0100 Edward Hervey + + * gst/.gitignore: + Ignore new auto-generated .c files + +2009-01-26 11:11:18 +0200 Stefan Kost + + * examples/cp.py: + Add progress report element to cp example. + +2009-01-23 22:17:21 +0200 Stefan Kost + + * examples/tagsetter.py: + Add an example for using the tagsetter iface. + +2009-01-22 13:50:33 +0100 Sebastian Dröge + + * common: + Fix pre-commit hook + +2009-01-22 12:00:08 +0000 Jan Schmidt + + * configure.ac: + Back to devel -> 0.10.14.1 + +2009-01-22 06:10:50 +0100 Edward Hervey + + * autogen.sh: + * common: + Install and use pre-commit indentation hook from common + +2009-01-21 04:36:02 +0100 Edward Hervey + + * autogen.sh: + autogen.sh : Use git submodule + +=== release 0.10.14 === + +2009-01-19 23:18:26 +0000 Jan Schmidt + + * ChangeLog: + * NEWS: + * RELEASE: + * configure.ac: + * gst-python.doap: + Release 0.10.14 + Original commit message from CVS: + Release 0.10.14 + +2009-01-09 23:45:36 +0000 Jan Schmidt + + configure.ac: 0.10.13.3 pre-release + Original commit message from CVS: + * configure.ac: + 0.10.13.3 pre-release + +2009-01-08 12:25:26 +0000 Edward Hervey + + Raise an Exception when wrapping a NULL GstIterator. + Original commit message from CVS: + * gst/pygstiterator.c: (pygst_iterator_new): + * testsuite/test_iterator.py: + Raise an Exception when wrapping a NULL GstIterator. + Fixes #566903 + +2009-01-05 11:05:32 +0000 Vincent GENIEUX + + gst/gststructure.override: Don't leak key names in _wrap_gst_structure_keys. + Original commit message from CVS: + patch by: Vincent GENIEUX + * gst/gststructure.override: + Don't leak key names in _wrap_gst_structure_keys. + +2009-01-02 21:46:30 +0000 Edward Hervey + + gst/: Wrap more GstIndexEntry methods and properties. + Original commit message from CVS: + * gst/gst-types.defs: + * gst/gst.defs: + * gst/gst.override: + Wrap more GstIndexEntry methods and properties. + +2008-12-31 13:32:58 +0000 Edward Hervey + + Wrap gst-plugins-base's tag helper library. + Original commit message from CVS: + * configure.ac: + * gst/Makefile.am: + * gst/tag.defs: + * gst/tag.override: + * gst/tagmodule.c: (inittag): + Wrap gst-plugins-base's tag helper library. + Partially fixes #565762 + +2008-12-31 13:06:58 +0000 Edward Hervey + + Wrap gst-plugins-base's video helper library. + Original commit message from CVS: + * configure.ac: + * gst/Makefile.am: + * gst/video.defs: + * gst/video.override: + * gst/videomodule.c: (initvideo): + Wrap gst-plugins-base's video helper library. + Partially fixes #565762 + +2008-12-31 12:01:02 +0000 Edward Hervey + + Wrap gst-plugins-base's audio helper library. + Original commit message from CVS: + * configure.ac: + * gst/Makefile.am: + * gst/audio.defs: + * gst/audio.override: + * gst/audiomodule.c: (initaudio): + Wrap gst-plugins-base's audio helper library. + Partially fixes #565762 + +2008-12-30 19:20:31 +0000 Edward Hervey + + Updated core API additions + Original commit message from CVS: + * configure.ac: + * gst/Makefile.am: + * gst/gst-0.10.20.ignore: + * gst/gst-0.10.22.ignore: + * gst/gst-types.defs: + * gst/gst.defs: + * gst/gstversion.override.in: + Updated core API additions + +2008-12-09 14:30:43 +0000 Alessandro Decina + + gst/__init__.py: Add gst.Fourcc.__eq__ and gst.Fourcc.__ne__. + Original commit message from CVS: + * gst/__init__.py: + Add gst.Fourcc.__eq__ and gst.Fourcc.__ne__. + +2008-12-09 11:48:15 +0000 Edward Hervey + + gst/Makefile.am: Don't forget to dist/install gst-0.10.21.ignore + Original commit message from CVS: + * gst/Makefile.am: + Don't forget to dist/install gst-0.10.21.ignore + +2008-12-09 10:16:08 +0000 Vincent Genieux + + gst/arg-types.py: Fix memory leak for GstMiniObjects used as parameters in class method overrides. + Original commit message from CVS: + Patch by : Vincent Genieux + * gst/arg-types.py: + Fix memory leak for GstMiniObjects used as parameters in class method + overrides. + Fixes #543961 + +2008-12-06 15:52:31 +0000 Edward Hervey + + gst/gstpad.override: Fix memory leak for functions that return a newly created buffer as a function argument. + Original commit message from CVS: + * gst/gstpad.override: + Fix memory leak for functions that return a newly created buffer as + a function argument. + Fixes #554545 + +2008-12-06 15:41:41 +0000 Edward Hervey + + codegen/argtypes.py: Add handling of 'keep-refcount' for GBoxed arguments. + Original commit message from CVS: + * codegen/argtypes.py: + Add handling of 'keep-refcount' for GBoxed arguments. + * gst/gst.defs: + Mark the appropriate 'gst_message_new_*' arguments when the method + takes the ownership of the passed gst.Structure/gst.TagList + * testsuite/test_message.py: + Test for creating messages that take a gst.Structure/gst.TagList as + argument and make sure they're properly created. + Fixes #556054 + +2008-12-06 15:39:01 +0000 Edward Hervey + + testsuite/Makefile.am: Add a way to run individual tests. 'make test_bin.py.check' for example. + Original commit message from CVS: + * testsuite/Makefile.am: + Add a way to run individual tests. + 'make test_bin.py.check' for example. + +2008-12-06 14:13:55 +0000 Edward Hervey + + examples/gst-discover: Beautify output of discoverer's duration. + Original commit message from CVS: + * examples/gst-discover: + Beautify output of discoverer's duration. + +2008-12-06 14:10:51 +0000 Edward Hervey + + testsuite/test_event.py: Sinks now send GST_EVENT_LATENCY events upstream. Adapt test for that new behaviour. + Original commit message from CVS: + * testsuite/test_event.py: + Sinks now send GST_EVENT_LATENCY events upstream. Adapt test for that + new behaviour. + +2008-12-05 08:49:05 +0000 Sebastian Dröge + + Add common to SUBDIRS and generate common/Makefile and common/m4/Makefile. + Original commit message from CVS: + * Makefile.am: + * configure.ac: + Add common to SUBDIRS and generate common/Makefile and + common/m4/Makefile. + +2008-12-04 20:11:53 +0000 Sebastian Dröge + + configure.ac: Apparently AC_CONFIG_MACRO_DIR breaks when using more than one macro directory, reverting last change. + Original commit message from CVS: + * configure.ac: + Apparently AC_CONFIG_MACRO_DIR breaks when using more + than one macro directory, reverting last change. + +2008-12-04 19:50:23 +0000 Sebastian Dröge + + configure.ac: Set AC_CONFIG_MACRO_DIR to common/m4 to point autoconf to our M4 macros. + Original commit message from CVS: + * configure.ac: + Set AC_CONFIG_MACRO_DIR to common/m4 to point autoconf to + our M4 macros. + +2008-11-23 12:31:42 +0000 Thomas Vander Stichele + + * common: + * gst/extend/utils.py: + pep-8 cleanups + Original commit message from CVS: + pep-8 cleanups + +2008-11-19 16:54:58 +0000 Alessandro Decina + + Wrap gst_type_find_peek. + Original commit message from CVS: + * gst/gst.override: + * testsuite/test_typefind.py: + Wrap gst_type_find_peek. + +2008-11-08 12:16:31 +0000 Alessandro Decina + + gst/: Add GstBaseTransform::transform_size virtual. + Original commit message from CVS: + * gst/base.defs: + * gst/gstbase.override: + Add GstBaseTransform::transform_size virtual. + +2008-11-08 11:49:30 +0000 Alessandro Decina + + gst/__init__.py: Fix on systems that don't have dlopen or don't support RTLD_GLOBAL and + Original commit message from CVS: + reviewed by: Edward Hervey + * gst/__init__.py: + Fix on systems that don't have dlopen or don't support RTLD_GLOBAL and + RTLD_LAZY. + +2008-11-07 22:29:06 +0000 Jan Schmidt + + gst/gst.override: Fix compiler warning about missing format string. + Original commit message from CVS: + * gst/gst.override: + Fix compiler warning about missing format string. + +2008-10-05 11:36:16 +0000 Jan Schmidt + + configure.ac: Back to development -> 0.10.13.1 + Original commit message from CVS: + * configure.ac: + Back to development -> 0.10.13.1 + +2008-10-05 08:16:38 +0000 Thiemo Seufer + + gst/__init__.py: Use correct values for RTLD_GLOBAL and RTLD_LAZY on Linux/MIPS as the values are different there fro... + Original commit message from CVS: + Patch by: Thiemo Seufer + * gst/__init__.py: + Use correct values for RTLD_GLOBAL and RTLD_LAZY on Linux/MIPS + as the values are different there from all other Linux platforms. + Fixes bug #553134. + +2008-10-05 08:14:42 +0000 Alexander Wirt + + gst/__init__.py: Import modules in the correct order, i.e. libxml2 before + Original commit message from CVS: + Patch by: Alexander Wirt + * gst/__init__.py: + Import modules in the correct order, i.e. libxml2 before + GStreamer stuff, to prevent unresolved symbols. Fixes bug #553131. + +=== release 0.10.13 === + +2008-10-03 00:08:42 +0000 Jan Schmidt + + * ChangeLog: + * NEWS: + * RELEASE: + * configure.ac: + * gst-python.doap: + Release 0.10.13 + Original commit message from CVS: + Release 0.10.13 + +2008-09-17 13:37:30 +0000 Jan Schmidt + + configure.ac: 0.10.20.2 pre-release + Original commit message from CVS: + * configure.ac: + 0.10.20.2 pre-release + +2008-09-09 10:41:27 +0000 Edward Hervey + + Add API additions for upcoming 0.10.21 core release + Original commit message from CVS: + * configure.ac: + * gst/base.defs: + * gst/gst-0.10.21.ignore: + * gst/gst.defs: + * gst/gstversion.override.in: + Add API additions for upcoming 0.10.21 core release + +2008-09-04 17:57:50 +0000 Brian Cameron + + examples/pipeline-tester: Don't hardcode audio/video source and sinks, and instead use more generic sources. + Original commit message from CVS: + * examples/pipeline-tester: + Don't hardcode audio/video source and sinks, and instead use more + generic sources. + Based on a patch by Brian Cameron + Fixes #517993 + +2008-08-26 15:58:15 +0000 Edward Hervey + + gst/gstcaps.override: Override gst_caps_append_structure() and make a copy of the structure given as argument. + Original commit message from CVS: + * gst/gstcaps.override: + Override gst_caps_append_structure() and make a copy of the structure + given as argument. + Fixes #549450 + +2008-08-11 16:40:45 +0000 Edward Hervey + + gst/: Add gstdebugutils.[ch] methods that weren't wrapped previously. + Original commit message from CVS: + * gst/gst-0.10.15.ignore: + * gst/gst-types.defs: + * gst/gst.defs: + Add gstdebugutils.[ch] methods that weren't wrapped previously. + We can now dump pipeline graphviz files from python ! :) + +2008-07-02 11:23:39 +0000 Edward Hervey + + update upstream API changes + Original commit message from CVS: + * configure.ac: + * gst/Makefile.am: + * gst/base.defs: + * gst/gst-0.10.18.ignore: + * gst/gst-0.10.20.ignore: + * gst/gst-pb-0.10.18.ignore: + * gst/gst-types.defs: + * gst/gst.defs: + * gst/gstversion.override.in: + * gst/interfaces.defs: + update upstream API changes + +2008-06-27 10:42:38 +0000 Edward Hervey + + testsuite/test_interface.py: Don't hardcode 'alsasrc' for testing GstMixer and GstPropertyProbe interfaces, but inste... + Original commit message from CVS: + * testsuite/test_interface.py: + Don't hardcode 'alsasrc' for testing GstMixer and GstPropertyProbe + interfaces, but instead search one through the registry. + If none are available, return gracefully. + +2008-06-27 10:29:58 +0000 Edward Hervey + + testsuite/test_xml.py: Don't attempt to test gst.XML if there's no available libxml2 module. + Original commit message from CVS: + * testsuite/test_xml.py: + Don't attempt to test gst.XML if there's no available libxml2 module. + +2008-06-27 08:39:37 +0000 Jan Schmidt + + gst/gstbuffer.override: the GstBuffer overrides seem to be confused about whether they're mini-objects or a GBoxed, a... + Original commit message from CVS: + * gst/gstbuffer.override: + the GstBuffer overrides seem to be confused about whether they're + mini-objects or a GBoxed, and it makes copy_on_write no actually + return a usable gst.Buffer. Fix up places where GstBuffers are + treated as GBoxed to use pygstminiobject functions. + Makes gst.Buffer('blah').copy_on_write() work. + * testsuite/test_buffer.py: + Add test for copy-on-write writability + * examples/buffer-draw.py: + Add an example of drawing on a GStreamer buffer with cairo + * gst/gstpad.override: + Make function static + +2008-06-26 14:57:29 +0000 Edward Hervey + + gst/: Fix double-import issues on macosx. + Original commit message from CVS: + * gst/common.h: + * gst/gstmodule.c: + * gst/interfaces.override: + * gst/pbutils.override: + * gst/pygstiterator.c: + * gst/pygstminiobject.c: + * gst/pygstminiobject.h: + Fix double-import issues on macosx. + Fixes #461838 + +2008-06-26 09:14:51 +0000 Edward Hervey + + gst/gstmodule.c: Return None if GstMiniObject GValue doesn't contain anything (NULL). + Original commit message from CVS: + * gst/gstmodule.c: (pygstminiobject_from_gvalue): + Return None if GstMiniObject GValue doesn't contain anything (NULL). + Fixes #540221 + +2008-06-20 08:55:48 +0000 Jan Schmidt + + configure.ac: Bump version back to dev -> 0.10.12.1 + Original commit message from CVS: + * configure.ac: + Bump version back to dev -> 0.10.12.1 + +=== release 0.10.12 === + +2008-06-18 14:50:35 +0000 Jan Schmidt + + * ChangeLog: + * NEWS: + * RELEASE: + * configure.ac: + * gst-python.doap: + Release 0.10.12 + Original commit message from CVS: + Release 0.10.12 + +2008-06-13 11:21:27 +0000 Edward Hervey + + configure.ac: 0.10.11.3 pre-release + Original commit message from CVS: + * configure.ac: + 0.10.11.3 pre-release + +2008-06-13 11:11:38 +0000 Edward Hervey + + Re-opens #530417 + Original commit message from CVS: + * gst/__init__.py: + * gst/gstelement.override: + * testsuite/test_element.py: + Revert 2008-05-08 Edward Hervey + Re-opens #530417 + +2008-06-12 11:11:49 +0000 Edward Hervey + + Re-opens #514717 + Original commit message from CVS: + * gst/gstpad.override: + * testsuite/test_pad.py: + Revert 2008-02-10 Alessandro Decina + Re-opens #514717 + +2008-06-05 09:51:17 +0000 Jan Schmidt + + configure.ac: 0.10.11.2 pre-release + Original commit message from CVS: + * configure.ac: + 0.10.11.2 pre-release + +2008-05-26 10:20:06 +0000 Edward Hervey + + gst/gstevent.override: gst_event_new_tag takes ownership of the GstTagList given as argument, therefore make a copy b... + Original commit message from CVS: + * gst/gstevent.override: + gst_event_new_tag takes ownership of the GstTagList given + as argument, therefore make a copy before calling the + C function. + Fixes #534888 + +2008-05-17 13:13:05 +0000 Edward Hervey + + gst/extend/discoverer.py: Add timeout property. + Original commit message from CVS: + * gst/extend/discoverer.py: + Add timeout property. + Fix typos. + Beautify debugging. + Fix email. + +2008-05-14 16:00:39 +0000 Jan Schmidt + + gst/__init__.py: Make gst.Fraction simplify like the C counterpart + Original commit message from CVS: + Patch by: Jan Schmidt + * gst/__init__.py: + Make gst.Fraction simplify like the C counterpart + Fixes #532809 + +2008-05-14 15:48:18 +0000 Edward Hervey + + gst/gstcaps.override: Fix typo + Original commit message from CVS: + * gst/gstcaps.override: + Fix typo + +2008-05-08 14:06:45 +0000 Johan Dahlin + + New 'fancy' constructor for gst.Element, allows creating elements in a more pythonic way (i.e. myelement = gst.Elemen... + Original commit message from CVS: + Patch by: Johan Dahlin + * gst/__init__.py: + * gst/gstelement.override: + * testsuite/test_element.py: + New 'fancy' constructor for gst.Element, allows creating elements in a + more pythonic way (i.e. myelement = gst.Element("oggmux")). + Fixes #530417 + +2008-05-08 14:03:17 +0000 Edward Hervey + + gst/: Fix broken indentation + Original commit message from CVS: + * gst/__init__.py: + * gst/arg-types.py: + Fix broken indentation + Fixes #531697 + +2008-05-08 10:59:48 +0000 Edward Hervey + + gst/: Use G_GSSIZE_FORMAT for ssize_t types. + Original commit message from CVS: + * gst/gst.override: + * gst/gstbuffer.override: + Use G_GSSIZE_FORMAT for ssize_t types. + Fixes build on macosx. + +2008-05-07 16:05:19 +0000 Christian Schaller + + * common: + * gst-python.spec.in: + update spec file with latest changes + Original commit message from CVS: + update spec file with latest changes + +2008-04-28 10:49:03 +0000 Alessandro Decina + + gst/gst.override: Add wrapping of gst_type_find_register. + Original commit message from CVS: + Patch by: Alessandro Decina + * gst/gst.override: + Add wrapping of gst_type_find_register. + Fixes #529728 + +2008-04-28 10:36:10 +0000 Alessandro Decina + + gst/gstelementfactory.override: Release GIL in gst_element_factory_overrides. + Original commit message from CVS: + Patch by: Alessandro Decina + * gst/gstelementfactory.override: + Release GIL in gst_element_factory_overrides. + Fixes #529731 + +2008-04-24 11:35:38 +0000 Jan Schmidt + + examples/: Sync with the X server before giving an XID to our sink with a different display connection. This avoids s... + Original commit message from CVS: + * examples/play.py: + * examples/remuxer.py: + * examples/switch.py: + * examples/synchronizer.py: + Sync with the X server before giving an XID to our sink with a different + display connection. This avoids spurious X servers where the sink's + display connection doesn't know the XID that the GDK thread's does. + +2008-04-06 08:58:39 +0000 Damien Lespiau + + configure.ac: Actually build dlls when cross-compiling with mingw32. + Original commit message from CVS: + Patch by: Damien Lespiau + * configure.ac: + Actually build dlls when cross-compiling with mingw32. + Fixes bug #526247. + +2008-03-21 00:37:01 +0000 Jan Schmidt + + configure.ac: Back to development - 0.10.11.1 + Original commit message from CVS: + * configure.ac: + Back to development - 0.10.11.1 + +=== release 0.10.11 === + +2008-03-21 00:31:44 +0000 Jan Schmidt + + * ChangeLog: + * NEWS: + * RELEASE: + * common: + * configure.ac: + * gst-python.doap: + Release 0.10.11 + Original commit message from CVS: + Release 0.10.11 + +2008-03-04 00:31:22 +0000 Jan Schmidt + + configure.ac: 0.10.10.2 pre-release + Original commit message from CVS: + * configure.ac: + 0.10.10.2 pre-release + +2008-02-29 12:37:43 +0000 Rene Stadler + + gst/gst.override: Don't crash by unreffing NULL when calling the do_get_protocols_full method raises an exception. + Original commit message from CVS: + * gst/gst.override: + (_wrap_GstURIHandler__proxy_do_get_protocols_full): + Don't crash by unreffing NULL when calling the + do_get_protocols_full method raises an exception. + +2008-02-10 13:33:26 +0000 Edward Hervey + + Fix memleak in gst.Pad.set_blocked_async() + Original commit message from CVS: + reviewed by: Edward Hervey + * gst/gstpad.override: + * testsuite/test_pad.py: + Fix memleak in gst.Pad.set_blocked_async() + Fixes #514717 + +2008-02-10 13:30:11 +0000 Edward Hervey + + gst/gstpad.override: Wrap gst.Pad.start_task(). + Original commit message from CVS: + * gst/gstpad.override: + Wrap gst.Pad.start_task(). + +2008-02-08 08:37:36 +0000 Edward Hervey + + gst/base.defs: gst_adapter_push steals the refcount. + Original commit message from CVS: + * gst/base.defs: + gst_adapter_push steals the refcount. + +2008-01-31 19:57:26 +0000 Stefan Kost + + examples/video-controller.py: Demo how to use the controller on videomixer. + Original commit message from CVS: + * examples/video-controller.py: + Demo how to use the controller on videomixer. + +2008-01-31 14:14:50 +0000 Jan Schmidt + + gst/.cvsignore: Ignore generated pbutils.c + Original commit message from CVS: + * gst/.cvsignore: + Ignore generated pbutils.c + * gst/gst.override: + Fix compiler warning about the return type. + +2008-01-30 12:36:06 +0000 Edward Hervey + + gst/gstmodule.c: Remove do_pending_calls timeout which has been handled more gracefully in pygobject MainLoop for the... + Original commit message from CVS: + * gst/gstmodule.c: (init_gst): + Remove do_pending_calls timeout which has been handled more gracefully + in pygobject MainLoop for the past 3 years. + Fixes #512916 + +2008-01-28 23:37:31 +0000 Jan Schmidt + + configure.ac: Back to CVS + Original commit message from CVS: + * configure.ac: + Back to CVS + +=== release 0.10.10 === + +2008-01-28 23:36:10 +0000 Jan Schmidt + + * ChangeLog: + * NEWS: + * RELEASE: + * common: + * configure.ac: + * gst-python.doap: + Release 0.10.10 + Original commit message from CVS: + Release 0.10.10 + +2008-01-21 21:34:12 +0000 Jan Schmidt + + configure.ac: 0.10.9.4 pre-release + Original commit message from CVS: + * configure.ac: + 0.10.9.4 pre-release + +2008-01-21 21:21:00 +0000 Luca Ferretti + + Makefile.am: Include PYTHON_INCLUDES in the common CFLAGS in the top-level. + Original commit message from CVS: + * Makefile.am: + Include PYTHON_INCLUDES in the common CFLAGS in the top-level. + Fixes: #510437 + Patch By: Luca Ferretti + +2008-01-17 16:35:28 +0000 Edward Hervey + + configure.ac: 0.10.9.3 pre-release + Original commit message from CVS: + * configure.ac: + 0.10.9.3 pre-release + +2008-01-16 16:09:39 +0000 Edward Hervey + + Fix symbol generation for win32. + Original commit message from CVS: + Reviewed by : Edward Hervey + * configure.ac: + * win32/common/config.h.in: + Fix symbol generation for win32. + Fixes #509766 + +2008-01-15 11:41:51 +0000 Jan Schmidt + + gst/pbutils.override: Fix compilation against Python 2.4. + Original commit message from CVS: + * gst/pbutils.override: + Fix compilation against Python 2.4. + Fixes: #509522 + +2008-01-14 18:42:39 +0000 Edward Hervey + + configure.ac: 0.10.9.2 pre-release + Original commit message from CVS: + * configure.ac: + 0.10.9.2 pre-release + +2008-01-14 12:44:06 +0000 Edward Hervey + + Series of update for new API added to 0.10.16. + Original commit message from CVS: + * configure.ac: + * gst/Makefile.am: + * gst/base.defs: + * gst/gst-0.10.15.ignore: + * gst/gst-0.10.16.ignore: + * gst/gst-pb-0.10.15.ignore: + * gst/gst-pb-0.10.16.ignore: + * gst/gst.defs: + * gst/gstversion.override.in: + * gst/pbutils.override: + * testsuite/test_pbutils.py: + Series of update for new API added to 0.10.16. + Remove wrong ignore file for 0.10.15 -base. + +2008-01-13 21:51:31 +0000 Edward Hervey + + configure.ac: Bump requirement to core and -base >= 0.10.12 . + Original commit message from CVS: + * configure.ac: + Bump requirement to core and -base >= 0.10.12 . + * gst/Makefile.am: + * gst/gstversion.override.in: + * gst/gst-0.10.10.ignore: + * gst/gst-0.10.11.ignore: + * gst/gst-0.10.12.ignore: + * gst/gst-0.10.3.ignore: + * gst/gst-0.10.4.ignore: + * gst/gst-0.10.5.ignore: + * gst/gst-0.10.6.ignore: + * gst/gst-0.10.7.ignore: + * gst/gst-pb-0.10.11.ignore: + Remove no-longer needed files. + +2008-01-13 21:46:22 +0000 Sébastien Moutte + + win32/vs6/libgstpython.dsp: Setup two different builds, one for Python24 and one for Python25. + Original commit message from CVS: + * win32/vs6/libgstpython.dsp: + Setup two different builds, one for Python24 and one for Python25. + +2008-01-13 17:57:48 +0000 Edward Hervey + + Re-implement wrapping of gst_pad_add_*probe in order to avoid leaks of user-data associated with the probes. + Original commit message from CVS: + reviewed by: Edward Hervey + * gst/gstpad.override: + * testsuite/test_pad.py: + Re-implement wrapping of gst_pad_add_*probe in order to avoid leaks of + user-data associated with the probes. + Fixes #504786 + +2008-01-13 17:24:42 +0000 Edward Hervey + + gst/pbutils.override: Finish wrapping gst.pbutils by adding install_plugins_async() + Original commit message from CVS: + * gst/pbutils.override: + Finish wrapping gst.pbutils by adding install_plugins_async() + +2008-01-11 16:30:45 +0000 Edward Hervey + + gst/Makefile.am: gst.pbutils also needs to handle miniobjects + Original commit message from CVS: + * gst/Makefile.am: + gst.pbutils also needs to handle miniobjects + * gst/pbutils.defs: + Add new InstallPluginsContext boxed definition. + All the *_new() functions should be accessible (and not act as + constructors). + * gst/pbutils.override: + Add override for install_plugins_sync(). + * gst/pbutilsmodule.c: + Add pygst_debug debug category in this module too. + * testsuite/test_pbutils.py: + Test existence of new API. Needs more tests. + +2008-01-10 12:51:21 +0000 Sebastian Dröge + + autogen.sh: Add -Wno-portability to the automake parameters to stop warnings about GNU make extensions being used. We... + Original commit message from CVS: + * autogen.sh: + Add -Wno-portability to the automake parameters to stop warnings + about GNU make extensions being used. We require GNU make in almost + every Makefile anyway. + * configure.ac: + Check for a working C compiler with AC_PROG_CC. + Use AM_PROG_CC_C_O as a compiler that accepts both -c and -o + at the same time is required for per target flags. + +2008-01-01 13:22:21 +0000 Edward Hervey + + gst/: new gst.pbutils module that wraps the gst-plugins-base pbutils helper library. + Original commit message from CVS: + * gst/Makefile.am: + * gst/common.h: + * gst/pbutils.defs: + * gst/pbutils.override: + * gst/pbutilsmodule.c: (initpbutils): + new gst.pbutils module that wraps the gst-plugins-base pbutils + helper library. + * testsuite/Makefile.am: + * testsuite/common.py: + * testsuite/test_pbutils.py: + Test case for gst.pbutils + Fixes #472822 + +2007-12-18 16:48:32 +0000 Andy Wingo + + examples/switch.py: New file, a basic demo for a single-stream switcher. Could be expanded later -- look at flumotion... + Original commit message from CVS: + 2007-12-18 Andy Wingo + * examples/switch.py: New file, a basic demo for a single-stream + switcher. Could be expanded later -- look at + flumotion.component.combiners.switch.switch for some inspiration. + +2007-12-18 09:42:57 +0000 Tim-Philipp Müller + + Makefile.am: Include common/win32.mak for CRLF check of win32 project files (see #393626). + Original commit message from CVS: + * Makefile.am: + Include common/win32.mak for CRLF check of win32 project + files (see #393626). + * win32/vs6/gst_python.dsw: + * win32/vs6/libgstpython.dsp: + * win32/vs6/pygenfiles.dsp: + Fix line endings and do cvs admin -kb. + +2007-11-29 15:02:03 +0000 Sebastian Dröge + + acinclude.m4: Use pythonX.Y-config to detect the include path for the python version and use the old values as fallba... + Original commit message from CVS: + * acinclude.m4: + Use pythonX.Y-config to detect the include path for the python + version and use the old values as fallback if pythonX.Y-config + doesn't exist. + +2007-11-28 09:48:45 +0000 Edward Hervey + + configure.ac: Back to development cycle + Original commit message from CVS: + * configure.ac: + Back to development cycle + +=== release 0.10.9 === + +2007-11-28 09:46:34 +0000 Edward Hervey + + * ChangeLog: + * NEWS: + * RELEASE: + * configure.ac: + * gst-python.doap: + Releasing 0.10.9 + Original commit message from CVS: + Releasing 0.10.9 + +2007-11-24 18:14:25 +0000 Edward Hervey + + configure.ac: 0.10.8.2 pre-releases + Original commit message from CVS: + * configure.ac: + 0.10.8.2 pre-releases + +2007-11-08 19:56:54 +0000 Edward Hervey + + gst/: Update API changes for core+base pre-releases + Original commit message from CVS: + * gst/base.defs: + * gst/gst-0.10.15.ignore: + * gst/gst.defs: + * gst/gst.override: + * gst/gstmodule.c: (init_gst): + Update API changes for core+base pre-releases + +2007-11-08 10:51:07 +0000 Johan Dahlin + + Add a new module, gstoption which allows you to fetch the + Original commit message from CVS: + 2007-11-05 Johan Dahlin + * gstoptionmodule.c: + * Makefile.am: + * configure.ac: + Add a new module, gstoption which allows you to fetch the + GOptionGroup from gstreamer without initializing and parsing + the command line arguments. Requires PyGObject 2.15.0 + Fixes #425847 + * examples/option-parser.py (main): Example + +2007-11-01 16:39:17 +0000 Johan Dahlin + + gst/: Make sure it still builds with GStreamer 0.10.14. + Original commit message from CVS: + 2007-11-01 Johan Dahlin + * gst/gst.override: + * gst/gst-0.10.15.ignore: + Make sure it still builds with GStreamer 0.10.14. + +2007-10-25 16:18:55 +0000 Alessandro Decina + + gst/gst.*: Patch from Alessandro Decina adding get_type_full and get_protocols_full private vfuncs to the URIHandler ... + Original commit message from CVS: + * gst/gst.defs: + * gst/gst.override: + Patch from Alessandro Decina adding get_type_full and + get_protocols_full private vfuncs to the URIHandler interface + to allow bindings to support creating URI handlers. + Partially fixes: #339279 + +2007-10-18 15:10:44 +0000 Jan Schmidt + + examples/play.py: Fix the sample player slightly so that the expose method actually gets called by pyGTK. + Original commit message from CVS: + * examples/play.py: + Fix the sample player slightly so that the expose method + actually gets called by pyGTK. + +2007-10-18 08:44:43 +0000 Edward Hervey + + gst/gst.*: Thanks to Sebastien Merle for resurrecting a patch I'd forgotten about that adds a constructor method for ... + Original commit message from CVS: + * gst/gst.defs: + * gst/gst.override: + Thanks to Sebastien Merle for resurrecting a patch I'd forgotten about + that adds a constructor method for gst.GError, so you can create + error gst.Message. + Added a few GIL releases for overrides. + +2007-10-16 15:01:59 +0000 Christian Schaller + + * gst-python.spec.in: + update spec file with latest changes + Original commit message from CVS: + update spec file with latest changes + +2007-10-13 16:32:52 +0000 Edward Hervey + + gst/gstobject.override: Release the GIL when calling gst_object_get_path_string() since it can cause deadlocks with n... + Original commit message from CVS: + * gst/gstobject.override: + Release the GIL when calling gst_object_get_path_string() since it can + cause deadlocks with new pygobject behaviour. + +2007-10-13 16:31:35 +0000 Edward Hervey + + gst/gstmodule.c: Added new gst.TAG_COMPOSER constant that appeared in core 0.10.15. + Original commit message from CVS: + * gst/gstmodule.c: (init_gst): + Added new gst.TAG_COMPOSER constant that appeared in core 0.10.15. + +2007-10-09 16:17:28 +0000 Edward Hervey + + gst/: Update API definitions for GStreamer core and gst-plugins-base. + Original commit message from CVS: + * gst/base.defs: + * gst/libs.defs: + * gst/gst.defs: + * gst/gst.override: + Update API definitions for GStreamer core and gst-plugins-base. + * configure.ac: + * gst/Makefile.am: + * gst/gst-0.10.15.ignore: + * gst/gst-pb-0.10.15.ignore: + * gst/gstversion.override.in: + New .ignore for 0.10.14.* API + +2007-10-09 14:27:18 +0000 Edward Hervey + + testsuite/: Fix unit tests for pygobject >= 2.13.0 + Original commit message from CVS: + * testsuite/common.py: + * testsuite/test_bin.py: + * testsuite/test_element.py: + * testsuite/test_ghostpad.py: + * testsuite/test_pad.py: + * testsuite/test_pipeline.py: + Fix unit tests for pygobject >= 2.13.0 + See the pygobject bug #320428 for more information about the changes. + +2007-10-08 22:05:29 +0000 Sébastien Moutte + + win32/vs6/: win32/MANIFEST + Original commit message from CVS: + * win32/vs6/gst_python.dsw: + * win32/vs6/libgstpython.dsp: + * win32/vs6/pygenfiles.dsp: + * win32/MANIFEST + Add new project files to build with VS6. + +2007-10-08 22:04:18 +0000 Sébastien Moutte + + gst/pygstminiobject.c: Move up variable declaration to the top of the function. + Original commit message from CVS: + * gst/pygstminiobject.c: (pygstminiobject_dealloc): + Move up variable declaration to the top of the function. + * win32/vs6/gst_python.dsw: + * win32/vs6/libgstpython.dsp: + * win32/vs6/pygenfiles.dsp: + * win32/MANIFEST + Add new project files to build with VS6. + +2007-09-11 11:49:50 +0000 Andy Wingo + + gst/gstmodule.c (DL_EXPORT): Remove the atexit(gst_deinit). + Original commit message from CVS: + 2007-09-11 Andy Wingo + * gst/gstmodule.c (DL_EXPORT): Remove the atexit(gst_deinit). + Atexit handlers are run after python has finalized (see Py_Exit in + pythonrun.c), but gst_deinit can potentially call back into python + e.g. for python-defined plugins. Not sure how other people are + avoiding this segfault, but I see it all the time on Gusty x86-64 + with Flumotion. + +2007-08-16 12:42:13 +0000 Stefan Kost + + gst/: Make ro memory to share. + Original commit message from CVS: + * ChangeLog: + * gst/pygstminiobject.c: + Make ro memory to share. + +2007-08-01 17:18:05 +0000 Edward Hervey + + configure.ac: Back to development cycle. + Original commit message from CVS: + * configure.ac: + Back to development cycle. + +=== release 0.10.8 === + +2007-08-01 17:14:09 +0000 Edward Hervey + + * ChangeLog: + * NEWS: + * RELEASE: + * configure.ac: + Releasing 0.10.8 + Original commit message from CVS: + Releasing 0.10.8 + +2007-07-30 16:10:03 +0000 Edward Hervey + + configure.ac: 0.10.7.2 pre-release + Original commit message from CVS: + * configure.ac: + 0.10.7.2 pre-release + +2007-07-30 11:57:26 +0000 Edward Hervey + + gst/gst.override: And the dataqueue header only landed in 0.10.11 too. + Original commit message from CVS: + * gst/gst.override: + And the dataqueue header only landed in 0.10.11 too. + +2007-07-30 11:39:08 +0000 Edward Hervey + + gst/gst-0.10.11.ignore: GstDataQueue was added in gstreamer-0.10.11 + Original commit message from CVS: + * gst/gst-0.10.11.ignore: + GstDataQueue was added in gstreamer-0.10.11 + * gst/gst-0.10.14.ignore: + some GstDataQueue methods were added in 0.10.14 + +2007-07-28 14:26:54 +0000 Edward Hervey + + gst/: Adding new API additions + Original commit message from CVS: + * gst/base.defs: + * gst/gst.defs: + * gst/interfaces.defs: + * gst/libs.defs: + * gst/gst.override: + * gst/gstmodule.c: (init_gst): + Adding new API additions + * gst/gstmessage.override: + wrap GstMessage.parse_buffering. + * gst/interfaces.override: + wrap gst_mixer_message_parse_*() functions. + wrap GstVideoOrientation::get_*() methods. + +2007-07-28 14:22:49 +0000 Edward Hervey + + Adding version overrides for new core/base releases. + Original commit message from CVS: + * configure.ac: + * gst/Makefile.am: + * gst/gst-0.10.14.ignore: + * gst/gst-pb-0.10.14.ignore: + * gst/gstversion.override.in: + Adding version overrides for new core/base releases. + +2007-07-28 13:41:22 +0000 Edward Hervey + + gst/interfaces.override: Add more threadsafety in the overrides. + Original commit message from CVS: + * gst/interfaces.override: + Add more threadsafety in the overrides. + +2007-07-27 11:47:16 +0000 Edward Hervey + + Add win32 requirements. + Original commit message from CVS: + * Makefile.am: + * configure.ac: + * win32/MANIFEST: + * win32/common/.cvsignore: + * win32/common/config.h.in: + Add win32 requirements. + Fixes #433375 + +2007-07-27 11:21:31 +0000 Edward Hervey + + gst/gst.defs: Make .get_uri_type() methods return a GstURIType enum instead of an integer. + Original commit message from CVS: + reviewed by: Edward Hervey + * gst/gst.defs: + Make .get_uri_type() methods return a GstURIType enum instead of an + integer. + Fixes #436620 + +2007-07-27 11:12:33 +0000 Edward Hervey + + gst/extend/discoverer.py: New parameter to the discoverer to change the default maximum frame interleave. + Original commit message from CVS: + reviewed by: Edward Hervey + * gst/extend/discoverer.py: + New parameter to the discoverer to change the default maximum frame + interleave. + Fixes #418222 + +2007-07-27 11:04:55 +0000 Edward Hervey + + examples/gst-discover: Show duration of audio/video streams. + Original commit message from CVS: + reviewed by: Edward Hervey + * examples/gst-discover: + Show duration of audio/video streams. + Specify units for values. + Fixes #432521 + +2007-07-20 08:50:18 +0000 Stefan Kost + + gst/gst-disable-loadsave.ignore: Override more when having now xml. + Original commit message from CVS: + * gst/gst-disable-loadsave.ignore: + Override more when having now xml. + +2007-07-09 19:42:31 +0000 Edward Hervey + + gst/gstelement.override: Override the proxy method for GstElement::request_new_pad virtual methods since it can be ca... + Original commit message from CVS: + * gst/gstelement.override: + Override the proxy method for GstElement::request_new_pad virtual + methods since it can be called with NULL as the name. + Fixes #454259 + +2007-07-09 19:30:26 +0000 Zaheer Abbas Merali + + gst/gstevent.override: Copy the GstStructure given as argument to gst_event_new_custom and gst_event_new_navigation, ... + Original commit message from CVS: + Patch by: Zaheer Abbas Merali + * gst/gstevent.override: + Copy the GstStructure given as argument to gst_event_new_custom + and gst_event_new_navigation, else it would be freed when the python + object wrapping that structure goes out of scope. + Fixes #450117 + +2007-07-05 13:57:41 +0000 Rene Stadler + + gst/: Handle 'gchar**' (GStrv) arguments in a uniform way. + Original commit message from CVS: + Patch by: Rene Stadler + * gst/arg-types.py: + * gst/gst.defs: + * gst/gst.override: + Handle 'gchar**' (GStrv) arguments in a uniform way. + Fixes #385841 + +2007-06-27 15:40:12 +0000 Edward Hervey + + gst/gstbuffer.override: whoapadoooo wabada bada ... + Original commit message from CVS: + * gst/gstbuffer.override: + whoapadoooo wabada bada ... + nothing here... :) + Fixes #451645 + +2007-06-16 12:08:45 +0000 Edward Hervey + + gst/extend/: Fixes for thread-safety, changes in behaviour with gst.Pad and cleanup. Still has some issues. + Original commit message from CVS: + * gst/extend/jukebox.py: + * gst/extend/sources.py: + Fixes for thread-safety, changes in behaviour with gst.Pad and + cleanup. Still has some issues. + +2007-06-14 14:53:28 +0000 Edward Hervey + + gst/__init__.py: Cleaner way of checking for existence of symbols in gst module. + Original commit message from CVS: + * gst/__init__.py: + Cleaner way of checking for existence of symbols in gst module. + +2007-06-14 14:14:12 +0000 Jan Schmidt + + examples/sinkelement-registry.py: A quick modification of the sinkelement.py example that shows how to register a pur... + Original commit message from CVS: + * examples/sinkelement-registry.py: + A quick modification of the sinkelement.py example that + shows how to register a pure-python gst.Element into the + registry for use in autoplugging or parse_launch lines. + +2007-06-12 19:01:25 +0000 Edward Hervey + + gst/__init__.py: Fix API cleanups that cause API breakage. + Original commit message from CVS: + * gst/__init__.py: + Fix API cleanups that cause API breakage. + Fixes #446674 + +2007-06-11 22:00:20 +0000 Jan Schmidt + + gst/gstpad.override: Wrap gst_pad_set_blocked_async in pyg thread unlock/lock. + Original commit message from CVS: + * gst/gstpad.override: + Wrap gst_pad_set_blocked_async in pyg thread unlock/lock. + +2007-06-08 16:16:34 +0000 Michael Smith + + gst/extend/discoverer.py: Better support for demuxers that don't create all pads at startup. + Original commit message from CVS: + Patch by : Michael Smith + * gst/extend/discoverer.py: + Better support for demuxers that don't create all pads at startup. + Fixes #380966 + +2007-06-08 16:06:10 +0000 Edward Hervey + + gst/gst-0.10.12.ignore: Add more API additions that weren't explicit in the release notes. + Original commit message from CVS: + * gst/gst-0.10.12.ignore: + Add more API additions that weren't explicit in the release notes. + * gst/gst-0.10.13.ignore: + Personal note : remember to save file before commiting it. + +2007-06-08 15:16:08 +0000 Edward Hervey + + Updating ignores for API additions + Original commit message from CVS: + * configure.ac: + * gst/Makefile.am: + * gst/gst-0.10.12.ignore: + * gst/gst-0.10.13.ignore: + * gst/gstversion.override.in: + Updating ignores for API additions + * gst/base.defs: + * gst/gst-types.defs: + * gst/gst.defs: + * gst/interfaces.defs: + * gst/libs.defs: + Massive wrapping of new API additions + * gst/gstbase.override: + * gst/gstevent.override: + * gst/gstmessage.override: + * gst/gstquery.override: + Overrides for methods with return values as arguments. + * gst/xwindowlistener.defs: + What the $#@# is this file still doing here ?? Removing it. + +2007-05-23 09:49:07 +0000 Edward Hervey + + Example of how to properly ignore methods that aren't available if some feature is disabled in GStreamer core. + Original commit message from CVS: + * configure.ac: + * gst/Makefile.am: + * gst/gst-disable-loadsave.ignore: + * gst/gstversion.override.in: + Example of how to properly ignore methods that aren't available if + some feature is disabled in GStreamer core. + +2007-04-23 14:42:25 +0000 Stefan Kost + + configure.ac: Add example for the new AG_GST_PARSE_SUBSYSTEM_DISABLE macro. + Original commit message from CVS: + * configure.ac: + Add example for the new AG_GST_PARSE_SUBSYSTEM_DISABLE macro. + +2007-04-19 15:43:16 +0000 Edward Hervey + + gst/gstbin.override: Release the GIL in GstBin overrides. + Original commit message from CVS: + * gst/gstbin.override: + Release the GIL in GstBin overrides. + +2007-04-13 11:26:43 +0000 Jan Schmidt + + gst/gstelement.override: Release the python lock when performing GStreamer calls that might result in callbacks into ... + Original commit message from CVS: + * gst/gstelement.override: + Release the python lock when performing GStreamer calls that might + result in callbacks into python. + +2007-04-11 09:33:37 +0000 Jan Schmidt + + gst/gstbase.override: Unroll the GIL state in an error case where it was missing. + Original commit message from CVS: + * gst/gstbase.override: + Unroll the GIL state in an error case where it was missing. + +2007-04-11 09:22:15 +0000 Jan Schmidt + + gst/gstpad.override: Release the GIL lock while executing queries in GStreamer. + Original commit message from CVS: + * gst/gstpad.override: + Release the GIL lock while executing queries in GStreamer. + +2007-04-10 18:01:25 +0000 Jan Schmidt + + Implement pad query proxying so that python elements can answer pad queries. Fixes: #428299 + Original commit message from CVS: + * examples/pyidentity.py: + * gst/common.h: + * gst/gstpad.override: + Implement pad query proxying so that python elements can + answer pad queries. Fixes: #428299 + +2007-04-10 12:44:44 +0000 Jan Schmidt + + examples/pyidentity.py: Add a simple example that implements an identity-like element in python and passes buffers th... + Original commit message from CVS: + * examples/pyidentity.py: + Add a simple example that implements an identity-like element in + python and passes buffers through. It lacks buffer-alloc & query + handling at the moment, because the required gstreamer funcs aren't + wrapped. + * examples/sinkelement.py: + Make sure to call gobject.threads_init() in the example. + +2007-04-04 12:57:32 +0000 Edward Hervey + + codegen/codegen.py: Also ignore pointers and boxed if they're in ignore-type. + Original commit message from CVS: + * codegen/codegen.py: + Also ignore pointers and boxed if they're in ignore-type. + * gst/gst-0.10.7.ignore: + Add gst_type_find_factory_call_function to functions ignored before + 0.10.7 since it requires GstTypeFind arguments. + +2007-04-04 12:27:03 +0000 Jan Schmidt + + * ChangeLog: + Changelog surgery: Attribute the previous release to Monsieur Hervey + Original commit message from CVS: + Changelog surgery: Attribute the previous release to Monsieur Hervey + +2007-04-04 12:22:03 +0000 Jan Schmidt + + gst/: Fix the build for x86_64 when compiling against Python 2.5. + Original commit message from CVS: + * gst/common.h: + * gst/gst.override: + * gst/gstbuffer.override: + * gst/gstcaps.override: + * gst/gststructure.override: + * gst/gsttaglist.override: + * gst/interfaces.override: + Fix the build for x86_64 when compiling against Python 2.5. + Keeps backwards compatibility with Python 2.4. Tested on Ubuntu + Edgy 32-bit with python 2.4 & Feisty 64-bit with Python 2.4 & 2.5 + Fixes #415003. + +2007-03-25 19:02:23 +0000 Tim-Philipp Müller + + gst/interfaces.defs: GstTunerChannel and GstTunerNorm are not GstObjects, only GObjects. + Original commit message from CVS: + * gst/interfaces.defs: + GstTunerChannel and GstTunerNorm are not GstObjects, only GObjects. + +2007-03-19 01:21:12 +0000 Johan Dahlin + + gst/: Make it compilable on Python 2.4 and Python 2.5 + Original commit message from CVS: + * gst/common.h: + * gst/gsttaglist.override: + Make it compilable on Python 2.4 and Python 2.5 + +2007-03-18 17:45:16 +0000 Johan Dahlin + + gst/__init__.py: Implement multiplication, divison and float coercing for fractions. + Original commit message from CVS: + * gst/__init__.py: Implement multiplication, divison and float + coercing for fractions. + * testsuite/test_fraction.py: + Add fraction tests + +2007-03-17 13:36:48 +0000 Johan Dahlin + + Implement sq_contains and add tests for gst.TagList. + Original commit message from CVS: + * gst/gsttaglist.override (_wrap_gst_tag_list_contains): + * testsuite/test_taglist.py (TestTagList.testKeys): + Implement sq_contains and add tests for gst.TagList. + +2007-03-02 11:03:46 +0000 Edward Hervey + + gst/__init__.py: Import libxml2 (if available) at import time with GLOBAL and LAZY flags. + Original commit message from CVS: + * gst/__init__.py: + Import libxml2 (if available) at import time with GLOBAL and LAZY flags. + Fixes #398567 + +2007-03-01 14:21:52 +0000 Edward Hervey + + gst/__init__.py: Added __eq__ method to fractions so we can check if two fractions are equal. + Original commit message from CVS: + * gst/__init__.py: + Added __eq__ method to fractions so we can check if two fractions are + equal. + * gst/pygstvalue.c: (my_gcd), (pygst_value_from_pyobject): + Attempt to simplify gst.Fraction before filling in a GValue. + Fixes #381243 + * testsuite/test_caps.py: + * testsuite/test_struct.py: + Minor beauty fixes. framerates are fractions, not floats. + +2007-03-01 13:47:12 +0000 Edward Hervey + + gst/interfacesmodule.c: initialize pygobject in the gst.interfaces modules. The absence of it causes segfaults on Sol... + Original commit message from CVS: + reviewed by: Edward Hervey + * gst/interfacesmodule.c: (initinterfaces): + initialize pygobject in the gst.interfaces modules. The absence of it + causes segfaults on Solaris and MIPS machines. + Fixes #343980 + +2007-02-28 22:09:33 +0000 Thomas Vander Stichele + + * common: + * configure.ac: + trigger rebuild + Original commit message from CVS: + trigger rebuild + +2007-02-27 10:44:21 +0000 Michael Smith + + gst/base.defs: Limitations in the code generator mean that we can't handle PushSrc in a way which works, so just comm... + Original commit message from CVS: + * gst/base.defs: + Limitations in the code generator mean that we can't handle PushSrc + in a way which works, so just comment this out until someone wants + to tackle this more completely. + +2007-02-25 12:11:34 +0000 Michael Smith + + gst/pygstvalue.c: Make buffers-in-gvalues more generic: handle all miniobjects + Original commit message from CVS: + * gst/pygstvalue.c: (pygst_value_init_for_pyobject), + (pygst_value_from_pyobject): + Make buffers-in-gvalues more generic: handle all miniobjects + * testsuite/test_caps.py: + Add a bit to one the test for buffers in caps. + +2007-02-24 14:14:14 +0000 Michael Smith + + testsuite/test_caps.py: Add test for gst.Buffer in caps. + Original commit message from CVS: + * testsuite/test_caps.py: + Add test for gst.Buffer in caps. + +2007-02-22 16:13:53 +0000 Michael Smith + + gst/pygstvalue.c: Implement gst.Buffer support in GValues (e.g. for caps containing buffers) + Original commit message from CVS: + * gst/pygstvalue.c: (pygst_value_as_pyobject), + (pygst_value_init_for_pyobject), (pygst_value_from_pyobject): + Implement gst.Buffer support in GValues (e.g. for caps containing + buffers) + +2007-02-16 02:39:56 +0000 David Schleef + + Makefile.am: Add ACLOCAL_AMFLAGS + Original commit message from CVS: + * Makefile.am: Add ACLOCAL_AMFLAGS + +2007-02-04 11:40:09 +0000 Edward Hervey + + testsuite/common.py: A private variable of unittest.TestCase changed name in python 2.5. + Original commit message from CVS: + * testsuite/common.py: + A private variable of unittest.TestCase changed name in python 2.5. + This fixes make check with python2.5 + +2007-02-04 10:54:48 +0000 Edward Hervey + + gst/gstpad.override: Allow removing the negotiated pads of a cap by setting them to None. + Original commit message from CVS: + reviewed by: Edward Hervey + * gst/gstpad.override: + Allow removing the negotiated pads of a cap by setting them to None. + * testsuite/test_pad.py: + Added un-negotian of pads' caps to test above patch. + Fixes #363795 + +2007-02-04 10:44:40 +0000 Edward Hervey + + gst/interfaces.override: Gracefully handle the case where gst_property_probe_get_values_name() returns NULL. + Original commit message from CVS: + * gst/interfaces.override: + Gracefully handle the case where gst_property_probe_get_values_name() + returns NULL. + +2007-02-04 10:23:38 +0000 Edward Hervey + + Fully implement GstPropertyProbe interface, with unit test. + Original commit message from CVS: + reviewed by: Edward Hervey + * gst/interfaces.defs: + * gst/interfaces.override: + * testsuite/test_interface.py: + Fully implement GstPropertyProbe interface, with unit test. + Fixes #376996 + +2007-01-31 16:53:15 +0000 Edward Hervey + + configure.ac: Back to development cycle. + Original commit message from CVS: + * configure.ac: + Back to development cycle. + +=== release 0.10.7 === + +2007-01-31 16:51:37 +0000 Edward Hervey + + * ChangeLog: + * NEWS: + * RELEASE: + * configure.ac: + Releasing 0.10.7 + Original commit message from CVS: + Releasing 0.10.7 + +2007-01-29 12:27:46 +0000 Edward Hervey + + codegen/codegen.py: Don't register interface if it is ignored + Original commit message from CVS: + * codegen/codegen.py: + Don't register interface if it is ignored + * configure.ac: + GST_PB_MINOR_VERSION doesn't appear by magic, you actually have to + parse it from pkg-config ! + * gst/gst-pb-0.10.11.ignore: + Ignore GstVideoOrientation type altogether. + * gst/interfaces.override: + Include gstversion.override so that non-existent API is properly ignored. + Should fix #401051 once and for good now. + +2007-01-29 11:17:45 +0000 Edward Hervey + + * ChangeLog: + ChangeLog surgery : Indicate which bug last ocmmit fixed. + Original commit message from CVS: + ChangeLog surgery : Indicate which bug last ocmmit fixed. + ---------------------------------------------------------------------- + +2007-01-29 11:16:35 +0000 Edward Hervey + + configure.ac: Check for availability of video-orientation interface + Original commit message from CVS: + * configure.ac: + Check for availability of video-orientation interface + * gst/gst.override: + don't forget to increment the refcount of Py_None before returning it. + * gst/interfaces.override: + If video-orientation interface isn't available, don't include the + header. + +2007-01-26 11:58:55 +0000 Edward Hervey + + Add ignore file for 0.10.12 API additions + Original commit message from CVS: + * configure.ac: + * gst/Makefile.am: + * gst/gstversion.override.in: + * gst/gst-0.10.12.ignore: + Add ignore file for 0.10.12 API additions + * gst/gst.defs: + * gst/base.defs: + * gst/gst-types.defs: + Add new API definitions + * gst/gst-0.10.10.ignore: + * gst/gst-0.10.11.ignore: + Fixup ignore files. + * testsuite/test_segment.py: + The update return value is uncertain and will soon be deprecated, don't + check against it anymore. + +2007-01-17 11:22:04 +0000 Thomas Vander Stichele + + wrap mixer set_volume, use tuple to match get_volume + Original commit message from CVS: + * examples/mixer.py: + * gst/interfaces.override: + wrap mixer set_volume, use tuple to match get_volume + +2007-01-17 07:30:11 +0000 Thomas Vander Stichele + + gst/pygstexception.*: gst.element_factory_make should raise ElementNotFoundError. + Original commit message from CVS: + * gst/pygstexception.c: (element_not_found_error_init), + (pygst_exceptions_register_classes): + * gst/pygstexception.h: + gst.element_factory_make should raise ElementNotFoundError. + Subclass it from PluginNotFoundError so we can add it compatibly + and remove the wrong one later. + * gst/gstelementfactory.override: + raise ElementNotFoundError + +2007-01-17 06:27:38 +0000 Thomas Vander Stichele + + gst/interfaces.*: wrap mixer get_volume + Original commit message from CVS: + * gst/interfaces.defs: + * gst/interfaces.override: + wrap mixer get_volume + * examples/Makefile.am: + * examples/mixer.py: + add an example using it + +2007-01-17 06:27:12 +0000 Thomas Vander Stichele + + * gst/gst-pb-0.10.11.ignore: + add pb ignore file + Original commit message from CVS: + add pb ignore file + +2007-01-17 06:15:33 +0000 Thomas Vander Stichele + + configure.ac: fix use of PKG_CHECK_MODULES check for a pygobject of at least 2.11 for a value_from_pyobject fix + Original commit message from CVS: + * configure.ac: + fix use of PKG_CHECK_MODULES + check for a pygobject of at least 2.11 for a value_from_pyobject fix + * gst/gstobject.override: + use it + +2007-01-17 05:02:01 +0000 Thomas Vander Stichele + + gst/extend/discoverer.py: this is a module, not a program, so don't require versions + Original commit message from CVS: + * gst/extend/discoverer.py: + this is a module, not a program, so don't require versions + +2007-01-17 04:40:33 +0000 Thomas Vander Stichele + + configure.ac: check for stuff added in gst-pb 0.10.11 + Original commit message from CVS: + * configure.ac: + check for stuff added in gst-pb 0.10.11 + * gst/Makefile.am: + * gst/interfaces.defs: + * gst/interfaces.override: + add video orientation interface + +2007-01-11 17:45:46 +0000 Edward Hervey + + gst/gst.defs: Add declaration of gst_object_set_property so we can use our MT-safe version of set_property(). + Original commit message from CVS: + * gst/gst.defs: + Add declaration of gst_object_set_property so we can use our MT-safe + version of set_property(). + * gst/gstobject.override: + Implement a MT-safe version of g_object_set_property for GstObject. + The problem is that currently g_object_set_property is called in + pygobject with the GIL lock taken. This can cause deadlocks. + Remove this hack once bug #395048 is fixed in pygobject and we depend on + the fixed version. + Thanks to Lord Wingo of the "realm.py haters club" for proposing the + idea. + +2007-01-10 16:13:29 +0000 Edward Hervey + + codegen/codegen.py: When chaining up to the parent class methods from python to C, we need to allow threads (i.e. rel... + Original commit message from CVS: + * codegen/codegen.py: + When chaining up to the parent class methods from python to C, we need + to allow threads (i.e. release the GIL). + * gst/gstbase.override: + * gst/gstbin.override: + Modify __do_*() overrides in the same way as above. + +2007-01-05 10:48:36 +0000 Thomas Vander Stichele + + gst/extend/discoverer.py: No shebang line needed since there is no main code. + Original commit message from CVS: + * gst/extend/discoverer.py: + No shebang line needed since there is no main code. + +2006-12-19 11:38:01 +0000 Edward Hervey + + gst/gst.defs: Update API definitions. + Original commit message from CVS: + * gst/gst.defs: + Update API definitions. + * gst/common.h: + * gst/gstpad.override: + Add wrapper functions for settings activate, activatepull and + activatepush functions on pads. + * gst/gst.override: + Wrapper for gst_segment_set_seek() and gst_segment_clip() + Remove global ignore for *_init(), allows gst_segment_init() to be + properly code-generated. + * testsuite/Makefile.am: + * testsuite/test_segment.py: + Add unit test for gst.Segment object. + +2006-12-16 15:33:02 +0000 Edward Hervey + + testsuite/test_pad.py: Activate pads before using them. + Original commit message from CVS: + * testsuite/test_pad.py: + Activate pads before using them. + +2006-12-16 15:16:33 +0000 Edward Hervey + + RELEASE: Commit 0.10.6 RELEASE file. Better late than never :( + Original commit message from CVS: + * RELEASE: + Commit 0.10.6 RELEASE file. Better late than never :( + +2006-12-16 14:41:21 +0000 Edward Hervey + + Move GstIterator ArgType definition and usage for the codegenerator to gst/arg-types.py. It has nothing to do in the ... + Original commit message from CVS: + * codegen/argtypes.py: + * gst/arg-types.py: + Move GstIterator ArgType definition and usage for the codegenerator + to gst/arg-types.py. It has nothing to do in the codegenerator code. + +2006-12-15 17:02:31 +0000 Thomas Vander Stichele + + add doap file + Original commit message from CVS: + * Makefile.am: + * gst-python.doap: + * gst-python.spec.in: + add doap file + +2006-12-11 09:58:51 +0000 Tim-Philipp Müller + + gst/interfaces.defs: GstColorBalanceChannel is a GObject, not a GstObject. Fixes #383805. + Original commit message from CVS: + * gst/interfaces.defs: + GstColorBalanceChannel is a GObject, not a GstObject. Fixes #383805. + +2006-12-04 19:54:19 +0000 Edward Hervey + + * ChangeLog: + changelog surgery, remove the conflict that has been there for 7 month + Original commit message from CVS: + changelog surgery, remove the conflict that has been there for 7 month + +2006-12-04 17:54:39 +0000 Edward Hervey + + configure.ac: Back to development cycle + Original commit message from CVS: + * configure.ac: + Back to development cycle + +=== release 0.10.6 === + +2006-12-04 17:19:44 +0000 Edward Hervey + + * ChangeLog: + * NEWS: + * configure.ac: + Releasing gst-python 0.10.6 + Original commit message from CVS: + Releasing gst-python 0.10.6 + +2006-12-04 16:41:12 +0000 Edward Hervey + + configure.ac: 0.10.5.4 pre-release + Original commit message from CVS: + * configure.ac: + 0.10.5.4 pre-release + +2006-12-01 17:41:28 +0000 Edward Hervey + + gst/: Add implementation of gst.Pad.set_setcaps_function(). + Original commit message from CVS: + * gst/common.h: + * gst/gstpad.override: + Add implementation of gst.Pad.set_setcaps_function(). + +2006-11-28 15:36:50 +0000 Edward Hervey + + configure.ac: 0.10.5.3 pre-release + Original commit message from CVS: + * configure.ac: + 0.10.5.3 pre-release + +2006-11-22 17:31:02 +0000 Edward Hervey + + examples/audio-controller.py: Fix example, use proper property name. Doesn't change anything to the way it used to wo... + Original commit message from CVS: + * examples/audio-controller.py: + Fix example, use proper property name. Doesn't change anything to the + way it used to work, but since it's an example it should be done + properly. + +2006-11-22 17:20:21 +0000 Edward Hervey + + codegen/override.py: Fix the lookup of override files in the specified search directories. + Original commit message from CVS: + * codegen/override.py: + Fix the lookup of override files in the specified search directories. + * gst/Makefile.am: + Don't distribute gstversion.override + Fixup .defs => .c make instructions + All the above fixes the cases where you're building in a directory + different from the source directory. + +2006-11-20 11:26:46 +0000 Christian Schaller + + * gst-python.spec.in: + Update spec file for latest changes + Original commit message from CVS: + Update spec file for latest changes + +2006-11-15 14:36:39 +0000 Michael Smith + + gst/extend/discoverer.py: Avoid buffering infinite amounts of decoded data if a decoder is feeding us data without a ... + Original commit message from CVS: + * gst/extend/discoverer.py: + Avoid buffering infinite amounts of decoded data if a decoder is + feeding us data without a duration (or with bad duration values). + +2006-11-07 12:24:13 +0000 Edward Hervey + + gst/extend/discoverer.py: Make the queue buffer up 1s of data before outputting to the sinks. This should give time f... + Original commit message from CVS: + * gst/extend/discoverer.py: Make the queue buffer up 1s of data before + outputting to the sinks. This should give time for some demuxers like + mpegdemux or fluasfdemux to discover a bit more about the muxed + stream and add the correct pads. + Fixes #371969 + +2006-11-07 11:47:26 +0000 Andy Wingo + + examples/: New tool, runs the discoverer on a file and prints out what we get. + Original commit message from CVS: + 2006-11-07 Andy Wingo + * examples/Makefile.am (examples_DATA): + * examples/gst-discover: New tool, runs the discoverer on a file + and prints out what we get. + +2006-11-03 15:54:47 +0000 Edward Hervey + + gst/gst.override: Use a copy of the caps. + Original commit message from CVS: + * gst/gst.override: + Use a copy of the caps. + +2006-10-20 11:51:35 +0000 Edward Hervey + + configure.ac: 0.10.5.2 pre-release + Original commit message from CVS: + * configure.ac: + 0.10.5.2 pre-release + +2006-10-20 11:33:01 +0000 Edward Hervey + + gst/gst-0.10.10.ignore: Added symbols added in 0.10.10 + Original commit message from CVS: + * gst/gst-0.10.10.ignore: + Added symbols added in 0.10.10 + * gst/gst-0.10.6.ignore: + gst_dp_packetizer_new() addition + * gst/gst.defs: + Updated API for 0.10.10 symbols + * gst/gstmodule.c: (init_gst): + Added GST_TAG_EXTENDED_COMMENT which appeared in 0.10.10 + * gst/libs.defs: + Added gst_dp_packetizer_new() which was added in 0.10.6. It still won't + work because GstDPPacketizer is a pointer. It needs to have a GBoxed + definition in order to be used properly within gst-python. + Also added controller-related additions + +2006-10-20 10:41:46 +0000 Edward Hervey + + Added ignore files for 0.10.11 gstreamer core + Original commit message from CVS: + * configure.ac: + * gst/Makefile.am: + * gst/gst-0.10.11.ignore: + * gst/gstversion.override.in: + Added ignore files for 0.10.11 gstreamer core + * gst/base.defs: + Updated API for base libs + * gst/gst.defs: + Updated API for core + * gst/gst.override: + remove #ifdef for methods which weren't available in versions of pygtk + we don't support anymore. + * gst/gstbase.override: + Added overrides for GstBaseSink::get_times() virtual method + * gst/gstbin.override: + Added override for GstBin::handle_message() virtual method + +2006-10-20 09:51:25 +0000 Edward Hervey + + examples/Makefile.am: Remove gst123 and vorbisplay.py from sources, and add decodebin.py + Original commit message from CVS: + * examples/Makefile.am: + Remove gst123 and vorbisplay.py from sources, and add decodebin.py + +2006-10-20 09:47:16 +0000 Edward Hervey + + examples/: Removed gst123 and vorbisplay examples which weren't working with 0.10, and replaced them with decodebin.py + Original commit message from CVS: + reviewed by: Edward Hervey + * examples/decodebin.py: + * examples/gst123: + * examples/vorbisplay.py: + Removed gst123 and vorbisplay examples which weren't working with + 0.10, and replaced them with decodebin.py + Closes #362183 and #362202 + +2006-10-20 09:27:43 +0000 Edward Hervey + + examples/: Closes #362290 and #362272 + Original commit message from CVS: + * examples/audioconcat.py: + * examples/cp.py: + Port to 0.10 by Jason Gerard DeRose + Closes #362290 and #362272 + * examples/bps.py: + Indentation fixes by Jason Gerard DeRose + Closes #362011 + Also small fix for Usage string + +2006-10-16 14:46:19 +0000 Tim-Philipp Müller + + gst/gst.defs: Don't use 'interface' as variable name, MingW doesn't like that (fixes #359375). + Original commit message from CVS: + * gst/gst.defs: + Don't use 'interface' as variable name, MingW doesn't like that + (fixes #359375). + +2006-10-12 19:02:41 +0000 Thomas Vander Stichele + + * common: + * gst/extend/.gitignore: + moap ignore + Original commit message from CVS: + moap ignore + +2006-10-05 18:27:58 +0000 Tim-Philipp Müller + + gst/pygstiterator.c: Printf format fix. + Original commit message from CVS: + * gst/pygstiterator.c: (pygst_iterator_new): + Printf format fix. + +2006-10-03 09:24:11 +0000 Edward Hervey + + codegen/argtypes.py: Revert the UInt64Arg modifications from upstream. It forces us to give a PyLong, whereas we can ... + Original commit message from CVS: + * codegen/argtypes.py: + Revert the UInt64Arg modifications from upstream. It forces us to give + a PyLong, whereas we can directly use the 'K' argument parsing for that. + +2006-09-29 09:53:11 +0000 Edward Hervey + + ltihooks.py: Removed + Original commit message from CVS: + * ltihooks.py: + Removed + * testsuite/common.py: + ltihooks is dead, long live gstltihooks. This should complete thomas' + fix of #357310. + +2006-09-28 10:03:22 +0000 Jan Schmidt + + gst/Makefile.am: Explicitly export _PyGObject_API from our modules, as it's apparently needed for import. Previously ... + Original commit message from CVS: + * gst/Makefile.am: + Explicitly export _PyGObject_API from our modules, as it's apparently + needed for import. Previously we implicitly relied on a bug in the + core providing --export-dynamic as a link flag. + +2006-09-23 10:43:18 +0000 Thomas Vander Stichele + + Fix #357310 + Original commit message from CVS: + * Makefile.am: + * gst/__init__.py: + * gstltihooks.py: + Fix #357310 + +2006-09-22 13:21:59 +0000 Rene Stadler + + gst/gstlibs.override: Fixes for GstController creation memleak fixes. + Original commit message from CVS: + Patch by: Rene Stadler + * gst/gstlibs.override: + Fixes for GstController creation + memleak fixes. + +2006-09-12 11:16:08 +0000 Edward Hervey + + gst/extend/Makefile.am: Forgot to add 3 previous files to the Makefile so they get installed. + Original commit message from CVS: + * gst/extend/Makefile.am: + Forgot to add 3 previous files to the Makefile so they get + installed. + +2006-09-12 11:14:24 +0000 Edward Hervey + + gst/extend/: Revival of the jukebox (and leveller) using 0.10 and gnonlin. + Original commit message from CVS: + * gst/extend/jukebox.py: + * gst/extend/leveller.py: + * gst/extend/sources.py: + Revival of the jukebox (and leveller) using 0.10 and gnonlin. + Still needs a bit of love, but functionnal enough. + +2006-09-10 08:56:22 +0000 Edward Hervey + + * ChangeLog: + Give proper credits to the author of the patch + Original commit message from CVS: + Give proper credits to the author of the patch + +2006-09-10 08:53:26 +0000 Edward Hervey + + gst/libs.defs: Add definition for GstParamFlags, extension of the GParamFlags. + Original commit message from CVS: + * gst/libs.defs: + Add definition for GstParamFlags, extension of the GParamFlags. + Only contains one flag, gst.PARAM_CONTROLLABLE. + Closes #355150 + +2006-08-31 14:03:44 +0000 Edward Hervey + + gst/gst-0.10.10.ignore: API addition + Original commit message from CVS: + * gst/gst-0.10.10.ignore: + API addition + * gst/gst.defs: + Added new ghostpad functions. + +2006-08-29 10:05:40 +0000 Edward Hervey + + gst/gst.override: We don't own a reference on the elements contained in the list returned by gst_xml_get_topelements(). + Original commit message from CVS: + * gst/gst.override: + We don't own a reference on the elements contained in the list + returned by gst_xml_get_topelements(). + +2006-08-29 09:23:59 +0000 Edward Hervey + + testsuite/test_pad.py: The bug was not a bug. Fixed the typo. + Original commit message from CVS: + * testsuite/test_pad.py: + The bug was not a bug. Fixed the typo. + +2006-08-29 07:43:42 +0000 Thomas Vander Stichele + + testsuite/test_pad.py: add a test for event probes - shows a bug, for which I commented the failUnless out + Original commit message from CVS: + * testsuite/test_pad.py: + add a test for event probes - shows a bug, for which I commented + the failUnless out + +2006-08-21 12:55:37 +0000 Edward Hervey + + configure.ac: Whoops, typo error :) + Original commit message from CVS: + * configure.ac: + Whoops, typo error :) + +2006-08-21 11:43:01 +0000 Edward Hervey + + configure.ac: attempt to fix build. + Original commit message from CVS: + * configure.ac: + attempt to fix build. + +2006-08-21 11:31:51 +0000 Edward Hervey + + configure.ac: If pygobject is available, only build with it, else try to find pygtk to stay compatible with older ver... + Original commit message from CVS: + * configure.ac: + If pygobject is available, only build with it, else try to find pygtk + to stay compatible with older version. + * gst/Makefile.am: + Switch to pygobject CFLAGS. + * testsuite/Makefile.am: + Switch to pygobject CFLAGS. + +2006-08-08 19:21:51 +0000 Edward Hervey + + codegen/codegen.py: newer pygobject's pyg_constant_strip_prefix() now return a const gchar * whereas PyModule_AddIntC... + Original commit message from CVS: + * codegen/codegen.py: + newer pygobject's pyg_constant_strip_prefix() now return a const gchar * + whereas PyModule_AddIntConstant() takes a normal gchar*. + Closes #349623 + +2006-08-05 17:15:52 +0000 Andy Wingo + + examples/synchronizer.py: Actually appears to work now, will have to try with guadec videos on Monday. + Original commit message from CVS: + 2006-08-05 Andy Wingo + * examples/synchronizer.py: Actually appears to work now, will + have to try with guadec videos on Monday. + * examples/remuxer.py (PlayerWindow.create_ui): Disable the + auto-adjusting of cut in and cut out times, it's annoying. + +2006-08-04 17:04:27 +0000 Andy Wingo + + * examples/synchronizer.py: + small updates, still ui only + Original commit message from CVS: + small updates, still ui only + +2006-08-04 16:42:15 +0000 Andy Wingo + + examples/synchronizer.py: New file, a bit of a hack to remuxer.py, but for resyncing a bad ogg. Only UI at the moment.. + Original commit message from CVS: + 2006-08-04 Andy Wingo + * examples/synchronizer.py: New file, a bit of a hack to + remuxer.py, but for resyncing a bad ogg. Only UI at the moment.. + +2006-07-28 13:56:43 +0000 Andy Wingo + + * ChangeLog: + changelog + Original commit message from CVS: + changelog + +2006-07-28 13:56:20 +0000 James Doc Livingston + + examples/remuxer.py (RemuxBin._do_seek, Remuxer._bus_watch): Use normal seeks instead of segment seeks so that EOS is... + Original commit message from CVS: + 2006-07-28 Andy Wingo + * examples/remuxer.py (RemuxBin._do_seek, Remuxer._bus_watch): Use + normal seeks instead of segment seeks so that EOS is handled + properly. Patch by James "Doc" Livingston . (#348416) + * examples/remuxer.py (RemuxBin._new_demuxed_pad): Increase the + buffer size for dealing with terribly muxed files. + +2006-07-20 17:05:22 +0000 Edward Hervey + + configure.ac: Back to development cycle + Original commit message from CVS: + * configure.ac: + Back to development cycle + +=== release 0.10.5 === + +2006-07-20 17:03:57 +0000 Edward Hervey + + * ChangeLog: + * NEWS: + 0.10.5 "My Little Poney wants some Funk" release + Original commit message from CVS: + 0.10.5 "My Little Poney wants some Funk" release + ---------------------------------------------------------------------- + +2006-07-19 14:21:36 +0000 Edward Hervey + + configure.ac: 0.10.4.2 pre-release + Original commit message from CVS: + * configure.ac: 0.10.4.2 pre-release + +2006-07-18 15:33:41 +0000 Edward Hervey + + Add new ignore for 0.10.10 API additions + Original commit message from CVS: + * configure.ac: + * gst/Makefile.am: + * gst/gst-0.10.10.ignore: + * gst/gstversion.override.in: + Add new ignore for 0.10.10 API additions + * gst/gst.defs: + Added definitions for new segtrap functions + +2006-07-05 11:35:12 +0000 Edward Hervey + + gst/gstmodule.c: Added gst.BUFFER_OFFSET_NONE for proper (guint64) -1 conversion between python and C. + Original commit message from CVS: + * gst/gstmodule.c: (init_gst): + Added gst.BUFFER_OFFSET_NONE for proper (guint64) -1 conversion between + python and C. + +2006-07-03 14:44:20 +0000 Edward Hervey + + gst/: Repeat 100 times : "I shouldn't commit patches without checking them thoroughly, especially if they come from s... + Original commit message from CVS: + * gst/gstelement.override: + * gst/gstevent.override: + * gst/gstmessage.override: + * gst/gstquery.override: + Repeat 100 times : "I shouldn't commit patches without checking + them thoroughly, especially if they come from someone I trust". + Fix the broken Py_BuildValue. + +2006-07-03 13:32:08 +0000 Thomas Vander Stichele + + add gcov stuff + Original commit message from CVS: + * Makefile.am: + * configure.ac: + * gst/Makefile.am: + add gcov stuff + +2006-07-03 13:31:19 +0000 Thomas Vander Stichele + + gst/gstmodule.c: don't crash when error is NULL + Original commit message from CVS: + * gst/gstmodule.c: (init_gst): + don't crash when error is NULL + +2006-07-03 09:31:26 +0000 Edward Hervey + + gst/gstmessage.override: State change is a list and not a tuple + Original commit message from CVS: + * gst/gstmessage.override: + State change is a list and not a tuple + * gst/gstpad.override: + query_position() got busted in previous commit. + +2006-07-03 09:01:18 +0000 Edward Hervey + + gst/: Use Py_BuildValue to construct tuples. + Original commit message from CVS: + reviewed by: Edward Hervey + * gst/gstelement.override: + * gst/gstevent.override: + * gst/gstmessage.override: + * gst/gstpad.override: + * gst/gstquery.override: + Use Py_BuildValue to construct tuples. + Use tuples for collection of different objects. + See http://www.python.org/doc/faq/general/#why-are-there-separate-tuple-and-list-data-types + * testsuite/test_event.py: + [message|query|event].parse_* now return tuples and not list. + Fixes #334548 + +2006-07-02 15:25:04 +0000 Edward Hervey + + Removal of all glib < 2.8 cruft since GStreamer core now requires glib >= 2.8 + Original commit message from CVS: + Removal of all glib < 2.8 cruft since GStreamer core now requires + glib >= 2.8 + * codegen/argtypes.py: + remove gstobject cruft from ObjectArg + * configure.ac: + Require glib >= 2.8.0 + * gst/Makefile.am: + * gst/pygstobject.c: + * gst/pygstobject.h: + Remove pygstobject.[ch] + * gst/common.h: + Don't include removed header file. + * gst/gst.override: + * gst/gstbin.override: + * gst/gstbus.override: + * gst/gstelement.override: + * gst/gstelementfactory.override: + * gst/gstmessage.override: + * gst/gstobject.override: + * gst/gstpad.override: + * gst/interfaces.override: + * gst/pygstiterator.c: (pygst_iterator_iter_next): + Switch from using pygstobject* functions to using pygobject* functions. + * gst/gstmodule.c: (sink_gstobject), (init_gst): + Move GstObject sink function here and use standard gobject refcounting. + +2006-06-22 19:12:36 +0000 Edward Hervey + + configure.ac: 0.10.7 ignore file is for 0.10.7 AND 0.10.8 (due to brown paperbag release). + Original commit message from CVS: + * configure.ac: (GST_LIBS): + 0.10.7 ignore file is for 0.10.7 AND 0.10.8 (due to brown paperbag + release). + +2006-06-15 09:58:08 +0000 Edward Hervey + + codegen/codegen.py: Always unblock threads when going to C. + Original commit message from CVS: + * codegen/codegen.py: + Always unblock threads when going to C. + * gst/gst.defs: + Revert unblock-threads noise. + +2006-06-14 10:00:32 +0000 Edward Hervey + + gst/gst-types.defs: Added fields for GstPadTemplate. + Original commit message from CVS: + * gst/gst-types.defs: + Added fields for GstPadTemplate. + * gst/gst.defs: + Made gst_element_class_get_template_list a GstElement method. + * gst/gstelement.override: + Override for gst.Element.get_template_list() + * gst/gstpad.override: + Override getter for GstStaticPadTemplate.static_caps so that it uses + the correct pointer. + +2006-06-13 17:43:40 +0000 Edward Hervey + + testsuite/gstpython.supp: Keeping suppresions + Original commit message from CVS: + * testsuite/gstpython.supp: + Keeping suppresions + +2006-06-13 16:52:05 +0000 Edward Hervey + + testsuite/gstpython.supp: Tim might have fixed this suppression. Commenting it. + Original commit message from CVS: + * testsuite/gstpython.supp: + Tim might have fixed this suppression. Commenting it. + +2006-06-13 14:43:41 +0000 Edward Hervey + + testsuite/gstpython.supp: One more suppression added to bug #344761 + Original commit message from CVS: + * testsuite/gstpython.supp: + One more suppression added to bug #344761 + +2006-06-13 13:45:33 +0000 Edward Hervey + + .cvsignore: Ignore more files + Original commit message from CVS: + * .cvsignore: + Ignore more files + +2006-06-13 13:28:47 +0000 Edward Hervey + + testsuite/gstpython.supp: Added suppresion for leaks of bug #344761. + Original commit message from CVS: + * testsuite/gstpython.supp: + Added suppresion for leaks of bug #344761. + +2006-06-13 11:05:08 +0000 Edward Hervey + + Ignore log files. + Original commit message from CVS: + * .cvsignore: + * testsuite/.cvsignore: + Ignore log files. + +2006-06-13 10:59:44 +0000 Edward Hervey + + Makefile.am: Cleanup pygst.pyc file. + Original commit message from CVS: + * Makefile.am: (CLEANFILES): + Cleanup pygst.pyc file. + +2006-06-13 10:55:09 +0000 Edward Hervey + + gst/gst.defs: Add 'unblock-threads #t' for critical functions/methods. + Original commit message from CVS: + * gst/gst.defs: + Add 'unblock-threads #t' for critical functions/methods. + +2006-06-12 16:51:36 +0000 Edward Hervey + + testsuite/: Added cleanup file to initialize registry before running checks. + Original commit message from CVS: + * testsuite/Makefile.am: + * testsuite/runtests.py: + * testsuite/cleanup.py: + Added cleanup file to initialize registry before running checks. + Added G_DEBUG=gc-friendly to valgrinding + Only test test_*.py files + +2006-06-11 16:32:18 +0000 Edward Hervey + + .cvsignore: more files to ignore + Original commit message from CVS: + * .cvsignore: + more files to ignore + +2006-06-09 17:21:40 +0000 Edward Hervey + + pygst.py.in: Raise RequiredVersionError(ValueError, AssertionError) wherever applicable. This makes the new system (r... + Original commit message from CVS: + * pygst.py.in: + Raise RequiredVersionError(ValueError, AssertionError) wherever + applicable. This makes the new system (raising an error) compatible + with the old system (assertions). + Fixes #341114 + +2006-06-09 14:19:16 +0000 Edward Hervey + + pygst.py.in: Don't import non-used modules + Original commit message from CVS: + * pygst.py.in: + Don't import non-used modules + * testsuite/Makefile.am: + Heavy valgrinding por favor ! + (%.valgrind): with always-malloc for GSlice + +2006-06-09 14:15:53 +0000 Edward Hervey + + pygst.py.in: Don't import non-used modules + Original commit message from CVS: + * pygst.py.in: + Don't import non-used modules + * testsuite/Makefile.am: + Heavy valgrinding por favor ! + +2006-06-09 10:50:21 +0000 Edward Hervey + + codegen/: Updated codegenerator to current pygtk one. + Original commit message from CVS: + * codegen/Makefile.am: + * codegen/argtypes.py: + * codegen/codegen.py: + * codegen/definitions.py: + * codegen/defsconvert.py: + * codegen/defsparser.py: + * codegen/docextract.py: + * codegen/docextract_to_xml.py: + * codegen/docgen.py: + * codegen/h2def.py: + * codegen/mergedefs.py: + * codegen/missingdefs.py: + * codegen/mkskel.py: + * codegen/override.py: + * codegen/reversewrapper.py: + Updated codegenerator to current pygtk one. + * gst/gst.defs: + * gst/gst.override: + * gst/gstpad.override: + Update defs for new constructor definition. + * testsuite/test_bin.py: + With new constructors, pygobject will try to convert the argument to the + proper GType (here a string). + +2006-06-09 10:12:16 +0000 Edward Hervey + + gst/: Update for API additions. + Original commit message from CVS: + * gst/base.defs: + * gst/gst-0.10.7.ignore: + * gst/gst-types.defs: + * gst/gst.defs: + * gst/gstbase.override: + * gst/libs.defs: + Update for API additions. + * gst/gstmodule.c: (init_gst): + Added new GST_TAG_IMAGE and GST_TAG_PREVIEW_IMAGE + +2006-05-27 12:18:54 +0000 Edward Hervey + + gst/__init__.py: Make gst-python work on OS without dl.so + Original commit message from CVS: + reviewed by: Edward Hervey + * gst/__init__.py: + Make gst-python work on OS without dl.so + Fixes #341799 + +2006-05-27 12:13:46 +0000 Edward Hervey + + examples/filesrc.py: Port to 0.10. + Original commit message from CVS: + reviewed by: Edward Hervey + * examples/filesrc.py: Port to 0.10. + +2006-05-27 12:08:08 +0000 Edward Hervey + + examples/audio-controller.py: Make it work with 0.10, still had cruft from 0.9 + Original commit message from CVS: + * examples/audio-controller.py: + Make it work with 0.10, still had cruft from 0.9 + +2006-05-19 08:48:22 +0000 Edward Hervey + + Added ignore file for core 0.10.7 + Original commit message from CVS: + * configure.ac: + * gst/Makefile.am: + * gst/gst-0.10.7.ignore: + * gst/gstversion.override.in: + Added ignore file for core 0.10.7 + * gst/base.defs: + Added gst_adapter_take_buffer + * gst/gst-0.10.6.ignore: + Filed API addition for 0.10.6 + * gst/gst-types.defs: + Added GstTypeFind pointer definition + * gst/gst.defs: + * gst/gst.override: + Added fake function gst_type_find_new() to create a GstTypeFind that can + be used in all typefinding function. + GstTypeFind * + gst_type_find_new(data, peekfunction, suggestfunction [, getlenghtfunction]) + +2006-05-09 14:24:02 +0000 Edward Hervey + + Update for API changes. + Original commit message from CVS: + * configure.ac: + * gst/Makefile.am: + * gst/gst-0.10.6.ignore: + * gst/gst.defs: + * gst/gstversion.override.in: + Update for API changes. + Added ignore files for core 0.10.6 API additions. + +2006-05-09 14:00:10 +0000 Edward Hervey + + gst/gst.override: Reverting previous patches for conditional ignore. + Original commit message from CVS: + * gst/gst.override: + Reverting previous patches for conditional ignore. + It can't be done from within override files. + The only one left is the python gst_debug_log function + which will do nothing #ifdef GST_DISABLE_GST_DEBUG. + Also removed the conditional ignore for API changes since it didn't + have any effect either. + +2006-05-09 13:36:51 +0000 Edward Hervey + + gst/gst.override: Better conditional ignore for types and methods. + Original commit message from CVS: + * gst/gst.override: + Better conditional ignore for types and methods. + +2006-05-09 13:13:48 +0000 Edward Hervey + + codegen/: Added code to ignore type and the function/methods/classes that use them. + Original commit message from CVS: + * codegen/codegen.py: + * codegen/override.py: + Added code to ignore type and the function/methods/classes that use + them. + * gst/gst.override: + ignore methods/classes/types depending on how GStreamer core was built: + _ GST_DISABLE_GST_DEBUG + _ GST_DISABLE_LOADSAVE + _ GST_DISABLE_PARSE + +2006-05-09 10:25:17 +0000 Edward Hervey + + testsuite/python.supp: Added suppressions for FC5 64 bit + Original commit message from CVS: + * testsuite/python.supp: + Added suppressions for FC5 64 bit + +2006-05-08 11:59:56 +0000 Edward Hervey + + autogen.sh: libtoolize on Darwin/MacOSX is called glibtoolize + Original commit message from CVS: + * autogen.sh: (CONFIGURE_DEF_OPT): + libtoolize on Darwin/MacOSX is called glibtoolize + +2006-05-05 13:32:37 +0000 Andy Wingo + + * examples/remuxer.py: + smaller title + Original commit message from CVS: + smaller title + +2006-05-05 13:30:01 +0000 Andy Wingo + + examples/remuxer.py (PlayerWindow.update_scale_cb): Fix a race condition getting the initial cutin time via inserting... + Original commit message from CVS: + 2006-05-05 Andy Wingo + * examples/remuxer.py (PlayerWindow.update_scale_cb): Fix a race + condition getting the initial cutin time via inserting whitespace. + (all over): UI fixes to make Mike happy. + +2006-05-05 11:00:44 +0000 Andy Wingo + + examples/remuxer.py: Updates! Nothing gstreamery, it's all ui, so I won't bother you with the details. + Original commit message from CVS: + 2006-05-05 Andy Wingo + * examples/remuxer.py: Updates! Nothing gstreamery, it's all ui, + so I won't bother you with the details. + +2006-04-29 16:59:16 +0000 Edward Hervey + + examples/gstfile.py: Threaded application, we NEED gobject.threads_init(). + Original commit message from CVS: + * examples/gstfile.py: + Threaded application, we NEED gobject.threads_init(). + This should finally gets rid of the crashes when used on single files. + * gst/extend/discoverer.py: + Re-order the imports. + +2006-04-28 17:35:26 +0000 Edward Hervey + + gst/arg-types.py: Caps used as arguments of virtual methods should keep their initial refcount when calling the pytho... + Original commit message from CVS: + * gst/arg-types.py: + Caps used as arguments of virtual methods should keep their initial + refcount when calling the python methods. + This is similar to the patch done for GstMiniObjects. + * gst/gstbase.override: + Adjust the gst.BaseTransform.get_unit_size() virtual method for above + fix. + +2006-04-28 15:23:52 +0000 Edward Hervey + + gst/gstbase.override: gst.BaseTransform.get_unit_size() virtual method override. + Original commit message from CVS: + reviewed by: Edward Hervey + * gst/gstbase.override: + gst.BaseTransform.get_unit_size() virtual method override. + Closes #339248 + +2006-04-28 15:07:41 +0000 Edward Hervey + + gst/arg-types.py: GstMiniObject used as virtual methods parameters should be unreffed before calling the method and t... + Original commit message from CVS: + * gst/arg-types.py: + GstMiniObject used as virtual methods parameters should be unreffed + before calling the method and the ref-ed. + Added Params and Returns for const-gchar*, GType and gulong so the + code generator can generate more virtual methods handlers/proxys. + * gst/gst-types.defs: + * gst/gst.defs: + * gst/interfaces.defs: + Added vtable and virtual method definition for interfaces so we can properly use virtual + methods from those interfaces in python. + +2006-04-28 14:55:15 +0000 Edward Hervey + + gst/gstpad.override: (pad_block_callback_marshal) + Original commit message from CVS: + 2006-04-19 Andy Wingo + * gst/gstpad.override: (pad_block_callback_marshal) + (_wrap_gst_pad_set_blocked_async): Fix refcounting problems and + indent. + Fixes #338982 + +2006-04-28 14:54:45 +0000 Edward Hervey + + gst/gstmodule.c: Wrap the gstreamer error domains quark. + Original commit message from CVS: + * gst/gstmodule.c: (init_gst): + Wrap the gstreamer error domains quark. + Fixes #339040 + +2006-04-28 14:51:52 +0000 Edward Hervey + + * ChangeLog: + gst/gstpad.override (pad_block_callback_marshal) + Original commit message from CVS: + * gst/gstpad.override (pad_block_callback_marshal) + (_wrap_gst_pad_set_blocked_async): Fix refcounting problems and + indent. + Fixes #338982 + +2006-04-28 14:07:38 +0000 Thomas Vander Stichele + + * ChangeLog: + * configure.ac: + back to HEAD + Original commit message from CVS: + back to HEAD + +=== release 0.10.4 === + +2006-04-28 14:06:21 +0000 Thomas Vander Stichele + + * ChangeLog: + * NEWS: + * RELEASE: + * configure.ac: + releasing 0.10.4 + Original commit message from CVS: + releasing 0.10.4 + +2006-04-19 12:04:56 +0000 Andy Wingo + + * examples/fvumeter.py: + BPB(tm) + Original commit message from CVS: + BPB(tm) + +2006-04-19 12:04:19 +0000 Andy Wingo + + * ChangeLog: + * examples/fvumeter.py: + * gst/arg-types.py: + gst/arg-types.py (GstCapsArg.write_const_param) + Original commit message from CVS: + 2006-04-19 Andy Wingo + * gst/arg-types.py (GstCapsArg.write_const_param) + (GstCapsArg.write_param): If there is a default value, initialize + the py_caps variable to NULL. PyArgs_Parse* doesn't touch c + variables if the optional arg isn't there. Fixes #339010. + +2006-04-19 11:58:14 +0000 Andy Wingo + + examples/remuxer.py (GstPlayer.seek): Don't do accurate seeks, because the output won't be readable without a keyfram... + Original commit message from CVS: + 2006-04-19 Andy Wingo + * examples/remuxer.py (GstPlayer.seek): Don't do accurate seeks, + because the output won't be readable without a keyframe anyway. + +2006-04-19 08:50:48 +0000 Andy Wingo + + examples/remuxer.py: Another code dump. I know it breaks the freeze but it's just a wee example :) + Original commit message from CVS: + 2006-04-19 Andy Wingo + * examples/remuxer.py: Another code dump. I know it breaks the + freeze but it's just a wee example :) + +2006-04-13 16:38:41 +0000 Thomas Vander Stichele + + * configure.ac: + prereleasing gst-python + Original commit message from CVS: + prereleasing gst-python + +2006-04-10 14:47:19 +0000 Edward Hervey + + gst/gsttaglist.override: Return tag value if present more than once (instead of exactly once). + Original commit message from CVS: + * gst/gsttaglist.override: (tag_foreach_func_list): + Return tag value if present more than once (instead of exactly once). + Fixes #337876 + +2006-04-10 09:21:09 +0000 Edward Hervey + + codegen/argtypes.py: Update from upstream codegen for UInt argtype. + Original commit message from CVS: + * codegen/argtypes.py: + Update from upstream codegen for UInt argtype. + * gst/gst-types.defs: + Added GstIndexEntry boxed type. + * gst/gstbase.override: + Wrapped gst.BaseSrc::get_times() and gst.PushSrc::create() virtual + methods. + gst.BaseSrc and gst.PushSrc virtual methods are now completely wrapped. + +2006-04-08 18:46:44 +0000 Stefan Kost + + testsuite/test-object.h: Fix broken GObject macros + Original commit message from CVS: + * testsuite/test-object.h: + Fix broken GObject macros + +2006-04-07 18:33:35 +0000 Andy Wingo + + examples/remuxer.py: Code dump, work in progress... + Original commit message from CVS: + 2006-04-07 Andy Wingo + * examples/remuxer.py: Code dump, work in progress... + +2006-04-07 17:58:18 +0000 Edward Hervey + + testsuite/test_ghostpad.py: more assertions to figure out an speed issue. + Original commit message from CVS: + * testsuite/test_ghostpad.py: + more assertions to figure out an speed issue. + +2006-04-07 17:21:27 +0000 Andy Wingo + + gst/arg-types.py (GstCapsArg.beforenull): py_caps can be NULL if it is an optional argument. Translate this python no... + Original commit message from CVS: + 2006-04-07 Andy Wingo + * gst/arg-types.py (GstCapsArg.beforenull): py_caps can be NULL if + it is an optional argument. Translate this python non-value to the + C NULL. + * gst/gst.defs (get_compatible_pad): Filter caps is optional and + can be None. It defaults to None. + +2006-04-07 15:41:00 +0000 Edward Hervey + + Makefile.am: make check-valgrind calls make valgrind in the testsuite directory. + Original commit message from CVS: + * Makefile.am: + make check-valgrind calls make valgrind in the testsuite directory. + * testsuite/Makefile.am: + prepend $(top_srcdir) to PYTHONPATH for all tests so it uses the built + library and not the installed one. + * testsuite/python.supp: + Added suppressions discovered on x86/gentoo. + +2006-04-07 14:54:49 +0000 Andy Wingo + + gst/gstelement.override (_wrap_gst_element_link): Allow errors parsing the optional filter caps to propagate up. + Original commit message from CVS: + 2006-04-07 Andy Wingo + * gst/gstelement.override (_wrap_gst_element_link): Allow errors + parsing the optional filter caps to propagate up. + +2006-04-07 14:32:08 +0000 Andy Wingo + + gst/gst.defs (element_make_from_uri): Element name is optional and can be None. It defaults to None. + Original commit message from CVS: + 2006-04-07 Andy Wingo + * gst/gst.defs (element_make_from_uri): Element name is optional + and can be None. It defaults to None. + +2006-04-05 17:05:43 +0000 Edward Hervey + + testsuite/test_message.py: GstBus is flushing in NULL, so we need to set the pipeline to READY in order to receive th... + Original commit message from CVS: + * testsuite/test_message.py: + GstBus is flushing in NULL, so we need to set the pipeline to READY in + order to receive the messages in the bus watch. + +2006-04-05 11:55:48 +0000 Andy Wingo + + configure.ac (PYGST_MICRO_VERSION): Doc fix. + Original commit message from CVS: + 2006-04-05 Andy Wingo + * configure.ac (PYGST_MICRO_VERSION): Doc fix. + (PYGST_NANO_VERSION): New define. + * gst/__init__.py (version): Add as an alias for get_gst_version. + Should use the deprecation infrastructure here. + * gst/gst.defs: Add defs for the new wrapped functions. + * gst/gst.override (_wrap_gst_get_pygst_version) + (_wrap_gst_get_gst_version): New overrides, functions to access + the gstreamer and pygst versions. The first used to be called + gst_version(); we ignore gst_version now. + +2006-04-05 08:37:32 +0000 Andy Wingo + + gst/gstpad.override (_wrap_gst_pad_set_blocked_async): PyObject_IsTrue, not PyBool_Check. Grr. + Original commit message from CVS: + 2006-04-05 Andy Wingo + * gst/gstpad.override (_wrap_gst_pad_set_blocked_async): + PyObject_IsTrue, not PyBool_Check. Grr. + +2006-04-04 16:16:46 +0000 Edward Hervey + + gst/gst.defs: gst_element_post_message: Adding keep-refcount tag to the message since the function will unref it. + Original commit message from CVS: + * gst/gst.defs: + gst_element_post_message: Adding keep-refcount tag to the message since + the function will unref it. + +2006-04-01 10:10:48 +0000 Thomas Vander Stichele + + * examples/Makefile.am: + fix makefile + Original commit message from CVS: + fix makefile + +2006-04-01 10:07:07 +0000 Thomas Vander Stichele + + configure.ac: use AS_VERSION and AS_NANO + Original commit message from CVS: + * configure.ac: + use AS_VERSION and AS_NANO + +2006-03-31 17:12:50 +0000 Andy Wingo + + examples/remuxer.py: Example GUI for a remuxer, unfinished -- dropping it here while I hack on it. Based on player.py. + Original commit message from CVS: + 2006-03-31 Andy Wingo + * examples/remuxer.py: Example GUI for a remuxer, unfinished -- + dropping it here while I hack on it. Based on player.py. + * examples/Makefile.am (examples_DATA): Add remuxer.py, reorder + list. + +2006-03-30 03:46:56 +0000 David I. Lehn + + configure.ac: Better empty string test fix for "Fixes to how we figure out what API to ignore" + Original commit message from CVS: + * configure.ac: + Better empty string test fix for "Fixes to how we figure out what API + to ignore" + +2006-03-24 11:07:22 +0000 Edward Hervey + + configure.ac: Fixes in how we figure out what API to ignore + Original commit message from CVS: + * configure.ac: + Fixes in how we figure out what API to ignore + * gst/Makefile.am: + * gst/gst-0.10.5.ignore: + * gst/gstversion.override.in: + Added file for handling API additions for gstreamer 0.10.5 + * gst/base.defs: + * gst/gst.defs: + New API + * gst/gstpad.override: + Overrides for gst.Pad.query_peer_*() + +2006-03-21 21:49:46 +0000 Jan Schmidt + + * configure.ac: + Bump nano back to CVS + Original commit message from CVS: + Bump nano back to CVS + +=== release 0.10.3 === + +2006-03-21 21:48:08 +0000 Jan Schmidt + + configure.ac: releasing 0.10.3, "Maybe not today. Maybe not tomorrow, but soon..." + Original commit message from CVS: + === release 0.10.3 === + 2006-03-21 Jan Schmidt + * configure.ac: + releasing 0.10.3, "Maybe not today. Maybe not tomorrow, but soon..." + +2006-03-21 14:01:07 +0000 Jan Schmidt + + testsuite/: Another attempt at making the tests deterministic on the buildbots + Original commit message from CVS: + * testsuite/test_ghostpad.py: + * testsuite/test_pad.py: + Another attempt at making the tests deterministic on the buildbots + +2006-03-21 00:14:38 +0000 Jan Schmidt + + configure.ac: pre-release 0.10.2.2 + Original commit message from CVS: + 2006-03-20 Jan Schmidt + * configure.ac: + pre-release 0.10.2.2 + +2006-03-20 19:08:34 +0000 Jan Schmidt + + testsuite/test_ghostpad.py: Add while loop in teardown to wait for the pipeline state to hit NULL. Hopefully this wil... + Original commit message from CVS: + * testsuite/test_ghostpad.py: + Add while loop in teardown to wait for the pipeline state + to hit NULL. Hopefully this will ensure the refcount has always hit 1. + +2006-03-14 12:56:46 +0000 Edward Hervey + + configure.ac: Only require GStreamer core >= 0.10.2 + Original commit message from CVS: + * configure.ac: + Only require GStreamer core >= 0.10.2 + Detect version of core the bindings are being compiled against and + write gst/gstversion.override file with eventual API additions that + should be ignored. + * gst/Makefile.am: + * gst/base.defs: + Added gst_base_sync_[set|get]_[sync|max_lateness]() and + gst_type_find_helper_get_range() definitions + * gst/gst-0.10.3.ignore: + API added in gstreamer core 0.10.3 + * gst/gst-0.10.4.ignore: + API added in gstreamer core 0.10.4 + * gst/gst.override: + Include gstversion.override. + * gst/gstversion.override.in: + Magic file for API additions to ignore. + +2006-03-14 12:25:22 +0000 Edward Hervey + + codegen/: New --extendpath option for codegenerator so we can add extra path to search for included override files. + Original commit message from CVS: + * codegen/codegen.py: + * codegen/override.py: + New --extendpath option for codegenerator so we can add + extra path to search for included override files. + +2006-03-13 11:19:10 +0000 Edward Hervey + + gst/: Added base elements override file. + Original commit message from CVS: + * gst/Makefile.am: + * gst/gst.override: + * gst/gstbase.override: + Added base elements override file. + * gst/gstpad.override: + Added override for gst_pad_alloc_buffer_and_set_caps + +2006-03-10 11:28:01 +0000 Edward Hervey + + gst/gst.override: Commited a bit too much :) + Original commit message from CVS: + * gst/gst.override: + Commited a bit too much :) + +2006-03-10 11:22:31 +0000 Edward Hervey + + gst/base.defs: typo fix for gst_type_find_helper() + Original commit message from CVS: + * gst/base.defs: + typo fix for gst_type_find_helper() + Added new API : gst_type_find_helper_for_buffer() + * gst/gst.override: + override for gst.type_find_helper_for_buffer() + +2006-03-10 10:54:40 +0000 Edward Hervey + + gst/: Added new API: gst_pipeline_[get|set]_auto_flush_bus() gst_uri_has_protocol() + Original commit message from CVS: + * gst/gst-types.defs: + * gst/gst.defs: + Added new API: + gst_pipeline_[get|set]_auto_flush_bus() + gst_uri_has_protocol() + GST_RESOURCE_ERROR_NO_SPACE_LEFT + +2006-03-07 19:44:35 +0000 Edward Hervey + + gst/arg-types.py: Add ReturnType and Parameter for GstCaps. + Original commit message from CVS: + * gst/arg-types.py: + Add ReturnType and Parameter for GstCaps. + This allows the codegenerator to wrap properly more virtual proxies. + +2006-03-07 19:08:43 +0000 Edward Hervey + + gst/base.defs: Update for new check_get_range virtual method in GstBaseSrc + Original commit message from CVS: + * gst/base.defs: + Update for new check_get_range virtual method in GstBaseSrc + +2006-03-06 16:24:53 +0000 Michael Smith + + gst/: Don't leak PyObjects wrapping GValues when indexing into a + Original commit message from CVS: + * gst/gststructure.override: + * gst/gsttaglist.override: + Don't leak PyObjects wrapping GValues when indexing into a + GStStructure. Also fix a copy/paste identical bug in taglists. + +2006-03-02 09:40:13 +0000 Edward Hervey + + gst/pygstminiobject.h: Some crack distributions do weirdo stuff with PYGIL_API_IS_BUGGY. + Original commit message from CVS: + * gst/pygstminiobject.h: + Some crack distributions do weirdo stuff with PYGIL_API_IS_BUGGY. + Let's keep our own detection. + Closes #333055 + +2006-02-28 00:17:45 +0000 Jan Schmidt + + pygst.py.in: Fix a silly logic inversion typo + Original commit message from CVS: + * pygst.py.in: + Fix a silly logic inversion typo + +2006-02-27 16:22:10 +0000 Edward Hervey + + pygst.py.in: use 'raise StandardError' instead of 'assert' so that compiled code raise a noticeable exception. + Original commit message from CVS: + * pygst.py.in: + use 'raise StandardError' instead of 'assert' so that compiled code + raise a noticeable exception. + Closes #332586 + +2006-02-22 10:16:33 +0000 Edward Hervey + + gst/gstmodule.c: gst.gst_version uses the result of gst_version() rather than use the GST_VERSION_* hardcoded values. + Original commit message from CVS: + reviewed by: Edward Hervey + * gst/gstmodule.c: (init_gst): + gst.gst_version uses the result of gst_version() rather than use + the GST_VERSION_* hardcoded values. + Closes #331616 + +2006-02-20 18:07:59 +0000 Edward Hervey + + examples/vumeter.py: In fact it wasn't an application message, but an element message :) + Original commit message from CVS: + * examples/vumeter.py: + In fact it wasn't an application message, but an element message :) + +2006-02-20 16:58:14 +0000 Zaheer Abbas Merali + + * ChangeLog: + * examples/vumeter.py: + fix vumeter example + Original commit message from CVS: + fix vumeter example + +2006-02-17 15:35:34 +0000 Edward Hervey + + gst/: Updated and properly wrapped new GstQuery formats API. + Original commit message from CVS: + * gst/gst.defs: + * gst/gstquery.override: + Updated and properly wrapped new GstQuery formats API. + +2006-02-10 17:49:47 +0000 Andy Wingo + + gst/gst.defs (disable_sync_message_emission) + Original commit message from CVS: + 2006-02-10 Andy Wingo + * gst/gst.defs (disable_sync_message_emission) + (enable_sync_message_emission): Wrap new functions from GStreamer + CVS. + * configure.ac (GST_REQ): Require GStreamer 0.10.3.1. + * examples/play.py: A bit of refactoring. Make use of the + sync-message signals. Reacts to events on the bus. Keeps aspect + ratio. Better scrubbing, play/pause button instead of + play+pause+stop. Not a bad player now, although the code still + lacks cleanliness. + +2006-02-10 10:53:22 +0000 Andy Wingo + + examples/play.py (GstPlayer.query_position) + Original commit message from CVS: + 2006-02-10 Andy Wingo + * examples/play.py (GstPlayer.query_position) + (PlayerWindow.update_scale_cb): Only return position, duration + from query_position -- fixes a bugaboo. + (main): Add some input validation. + * examples/pipeline-tester (data): Add a pipeline to test software + scaling. + +2006-02-07 18:54:52 +0000 Edward Hervey + + gst/: Remove deprecated code dating back from 0.8 era. + Original commit message from CVS: + * gst/gst.override: + * gst/gstmodule.c: (python_do_pending_calls): + Remove deprecated code dating back from 0.8 era. + +2006-02-06 16:24:23 +0000 Andy Wingo + + codegen/argtypes.py (UInt64Arg.write_param): Parse long arguments using ParseTuple and friends; allows ints to passed... + Original commit message from CVS: + 2006-02-06 Andy Wingo + * codegen/argtypes.py (UInt64Arg.write_param): Parse long + arguments using ParseTuple and friends; allows ints to passed for + longs as a side benefit. + +2006-02-02 16:30:01 +0000 Edward Hervey + + gst/gst.override: (gst.TIME_ARGS) return "CLOCK_TIME_NONE" for invalid times instead of outputing gibberish value. + Original commit message from CVS: + * gst/gst.override: + (gst.TIME_ARGS) return "CLOCK_TIME_NONE" for invalid times instead of + outputing gibberish value. + +2006-02-02 15:54:07 +0000 Edward Hervey + + gst/gst.defs: Update for current GStreamer core API + Original commit message from CVS: + * gst/gst.defs: + Update for current GStreamer core API + +2006-02-01 16:37:41 +0000 Edward Hervey + + testsuite/test_event.py: Properly use tempfile + Original commit message from CVS: + * testsuite/test_event.py: + Properly use tempfile + +2006-02-01 14:19:55 +0000 Edward Hervey + + gst/gst.defs: When using gst.Element.send_event() and gst.Pad.send_event() we keep a refcount on the sent event. + Original commit message from CVS: + * gst/gst.defs: + When using gst.Element.send_event() and gst.Pad.send_event() we keep + a refcount on the sent event. + * testsuite/test_event.py: + Uncomment test to prove above fix + +2006-02-01 11:52:04 +0000 Thomas Vander Stichele + + testsuite/test_event.py: add a test case for autoplugging behaviour: create a source, connect probes, store new-segme... + Original commit message from CVS: + * testsuite/test_event.py: + add a test case for autoplugging behaviour: + create a source, connect probes, store new-segment event, + add element in buffer probe callback, and forward event + Currently fails due to refcounting on the stored new-segment + event + +2006-02-01 11:14:20 +0000 Thomas Vander Stichele + + testsuite/test_element.py: add another link test + Original commit message from CVS: + 2006-02-01 Thomas Vander Stichele + * testsuite/test_element.py: + add another link test + +2006-01-30 12:57:02 +0000 Edward Hervey + + Link against Gst Data protocol libraries. + Original commit message from CVS: + * configure.ac: + * gst/Makefile.am: + Link against Gst Data protocol libraries. + * gst/__init__.py: + Restore dlopenflags after importing gst. + Closes #329110 + +2006-01-25 11:23:20 +0000 Christian Schaller + + * common: + * gst-python.spec.in: + update spec file + Original commit message from CVS: + update spec file + +2006-01-16 21:01:03 +0000 Thomas Vander Stichele + + * configure.ac: + back to head + Original commit message from CVS: + back to head + +=== release 0.10.2 === + +2006-01-16 20:59:29 +0000 Thomas Vander Stichele + + * ChangeLog: + * NEWS: + * RELEASE: + * configure.ac: + releasing 0.10.2 + Original commit message from CVS: + releasing 0.10.2 + +2006-01-14 22:59:52 +0000 Thomas Vander Stichele + + * ChangeLog: + * configure.ac: + prerelease + Original commit message from CVS: + prerelease + +2006-01-13 17:40:09 +0000 Edward Hervey + + gst/gstlibs.override: GstController : don't use values that are now in non-public API. + Original commit message from CVS: + * gst/gstlibs.override: + GstController : don't use values that are now in non-public API. + +2006-01-09 11:42:25 +0000 Edward Hervey + + gst/base.defs: Revert guint8* to gchar* modifications for the adapter + Original commit message from CVS: + * gst/base.defs: + Revert guint8* to gchar* modifications for the adapter + * gst/gst.defs: + Cleanups and API additions + +2006-01-08 12:26:35 +0000 Edward Hervey + + gst/gststructure.override: Properly check for gstvalue data types. This makes it possible to set fields with fractions. + Original commit message from CVS: + * gst/gststructure.override: (_wrap_gst_structure_set_value): + Properly check for gstvalue data types. This makes it possible to + set fields with fractions. + * testsuite/test_caps.py: + * testsuite/test_struct.py: + Test for above modifications + +2006-01-05 14:49:27 +0000 Edward Hervey + + gst/base.defs: Use gchar* instead of guint8* for GstAdapter + Original commit message from CVS: + * gst/base.defs: + Use gchar* instead of guint8* for GstAdapter + Added virtual methods definitions for base classes. + Still have to override some functions, and figure + out how to properly add reverse wrappers to the codegenerator. + +2006-01-01 21:18:28 +0000 Edward Hervey + + First step at wrapping base elements in gst-python + Original commit message from CVS: + First step at wrapping base elements in gst-python + * configure.ac: + Commenting out weird debugging statement dating from gst-python's + and which causes problems with gstbasesrc.h anonymous union. + * gst/Makefile.am: + Added base.defs + * gst/base.defs: + New base elements definition files + * gst/gst.defs: + * gst/gst.override: + Add base elements + +2005-12-23 18:16:44 +0000 Thomas Vander Stichele + + * configure.ac: + back to HEAD + Original commit message from CVS: + back to HEAD + +=== release 0.10.1 === + +2005-12-23 18:10:51 +0000 Thomas Vander Stichele + + * ChangeLog: + * NEWS: + * RELEASE: + * configure.ac: + releasing 0.10.1 + Original commit message from CVS: + releasing 0.10.1 + +2005-12-22 19:02:03 +0000 Thomas Vander Stichele + + * pygst.py.in: + duh, typo + Original commit message from CVS: + duh, typo + +2005-12-22 15:56:41 +0000 Thomas Vander Stichele + + install in pyexecdir as well + Original commit message from CVS: + * configure.ac: + * gst/Makefile.am: + * gst/extend/Makefile.am: + install in pyexecdir as well + +2005-12-22 11:20:44 +0000 Thomas Vander Stichele + + pygst.py.in: give the correct error when not finding the version + Original commit message from CVS: + * pygst.py.in: give the correct error when not finding the version + +2005-12-20 15:58:02 +0000 Thomas Vander Stichele + + * configure.ac: + * gst-python.spec.in: + * testsuite/test_message.py: + prereleasing + Original commit message from CVS: + prereleasing + +2005-12-20 11:15:50 +0000 Edward Hervey + + gst/gst-types.defs: Added GstStaticCaps and GstStaticPadTemplate, using the new GType. + Original commit message from CVS: + * gst/gst-types.defs: + Added GstStaticCaps and GstStaticPadTemplate, using the new GType. + * gst/gst.defs: + Doesn't return a const anymore. + * gst/gstelementfactory.override: + Wrapped gst_element_factory_get_static_pad_templates() + +2005-12-19 17:49:30 +0000 Martin Soto + + gst/gstbus.override (_wrap_gst_bus_add_watch): This function incorrectly returned self, which was causing the message... + Original commit message from CVS: + 2005-12-19 Martin Soto + * gst/gstbus.override (_wrap_gst_bus_add_watch): This function + incorrectly returned self, which was causing the message bus to + get prematurely destroyed by the Python interpreter. Now returns + Py_None. + +2005-12-19 16:05:34 +0000 Edward Hervey + + gst/gst.override: ignore gst_object_sink + Original commit message from CVS: + * gst/gst.override: + ignore gst_object_sink + +2005-12-19 10:45:45 +0000 Edward Hervey + + gst/: Properly wrap the gst_dp_* functions (cast gchar* to guint8*). + Original commit message from CVS: + * gst/gstlibs.override: + * gst/libs.defs: + Properly wrap the gst_dp_* functions (cast gchar* to guint8*). + +2005-12-18 18:15:57 +0000 Edward Hervey + + gst/gst.override: ignore gst_plugin_get_module, GModule aren't wrapped in pygtk anyway. + Original commit message from CVS: + * gst/gst.override: + ignore gst_plugin_get_module, GModule aren't wrapped in + pygtk anyway. + wrap gst_clock_get_calibration + * gst/gstbus.override: + Ignore the following: + gst_bus_create_watch, since GSource aren't wrapped in pygtk + gst_bus_sync_signal_handler and gst_bus_async_signal_func since + these functions are used by the default bus handler anyway. + * gst/gstevent.override: + wrapped gst_event_parse_buffer_size + * gst/libs.defs: + Replace all guint8* for gst_dp_ functions by gchar * since they + are the same, but at least get generated properly by the code + generator. + +2005-12-18 17:20:12 +0000 Edward Hervey + + gst/gst.defs: gst_object_sink is a method of GstObject const of enums is a stupidity (_element_make_from_uri) + Original commit message from CVS: + * gst/gst.defs: + gst_object_sink is a method of GstObject + const of enums is a stupidity (_element_make_from_uri) + * gst/gst.override: + Ignore more functions that have no place in bindings or have better + python equivalents (list filtering for example) + Wrapped gst_version() and gst_type_find_factory_get_list() + * gst/gststructure.override: + More ignores + * gst/gsttaglist.override: + ignore gst_is_tag_list. + * gst/interfaces.override: + wrap gst_mixer_options_get_values() + +2005-12-16 14:47:12 +0000 Andy Wingo + + * ChangeLog: + * gst/gstpad.override: + gst/gstpad.override (handle_event_function_exception) + Original commit message from CVS: + 2005-12-16 Andy Wingo + * gst/gstpad.override (handle_event_function_exception) + (handle_chain_function_exception): GCC told me I needed braces + here. + +2005-12-14 17:18:38 +0000 Thomas Vander Stichele + + Follow pygtk's lead in installing pygst.py and .pth in pyexecdir - this will do the right thing on multilib 64 bit + Original commit message from CVS: + * Makefile.am: + * configure.ac: + Follow pygtk's lead in installing pygst.py and .pth in pyexecdir - + this will do the right thing on multilib 64 bit + +2005-12-12 15:15:28 +0000 Edward Hervey + + examples/gstfile.py: Moved the Discoverer class to gst.extend + Original commit message from CVS: + * examples/gstfile.py: + Moved the Discoverer class to gst.extend + Now works asynchronous... bl**dy fast :) + * gst/extend/Makefile.am: + * gst/extend/discoverer.py: + Discoverer has landed in extend and is now asynchronous. + It emits a 'discovered' signal when it has finished. + +2005-12-09 13:06:43 +0000 Edward Hervey + + gst/arg-types.py: This covers for the codegenerator not being able to handle (unsigned) int64 as parameters and retur... + Original commit message from CVS: + * gst/arg-types.py: + This covers for the codegenerator not being able to handle + (unsigned) int64 as parameters and return values. + +2005-12-09 12:49:08 +0000 Edward Hervey + + gst/arg-types.py: Added (reverse_)wrapper for GBoxed and GstMiniObject + Original commit message from CVS: + * gst/arg-types.py: + Added (reverse_)wrapper for GBoxed and GstMiniObject + * gst/gst.defs: + push_event() and chain() takes the reference on the + MiniObject. + +2005-12-07 14:41:37 +0000 Edward Hervey + + gst/gstmessage.override: Fix for memleak + Original commit message from CVS: + * gst/gstmessage.override: + Fix for memleak + +2005-12-05 18:12:42 +0000 Thomas Vander Stichele + + * configure.ac: + back to HEAD + Original commit message from CVS: + back to HEAD + +=== release 0.10.0 === + +2005-12-05 18:04:34 +0000 Thomas Vander Stichele + + * ChangeLog: + * NEWS: + * RELEASE: + * configure.ac: + releasing 0.10.0 + Original commit message from CVS: + releasing 0.10.0 + diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..89d5c14 --- /dev/null +++ b/Makefile.am @@ -0,0 +1,33 @@ +SUBDIRS = common gi plugin testsuite + +# Examples and testsuite need to be ported to 1.0 +#examples testsuite + +# include before EXTRA_DIST for win32 assignment +include $(top_srcdir)/common/win32.mak + +ACLOCAL_AMFLAGS = -I m4 -I common/m4 + +include $(top_srcdir)/common/release.mak + +# Examples and testsuite need to be ported to 1.0 +# check-valgrind: +# cd testsuite/ && make check-valgrind + +check-torture: + @true + +#include $(top_srcdir)/common/coverage/lcov.mak + +CRUFT_FILES = \ + $(top_builddir)/common/shave \ + $(top_builddir)/common/shave-libtool \ + $(top_builddir)/common/m4/libtool.m4 \ + $(top_builddir)/common/m4/ltoptions.m4 \ + $(top_builddir)/common/m4/ltsugar.m4 \ + $(top_builddir)/common/m4/ltversion.m4 \ + $(top_builddir)/common/m4/lt~obsolete.m4 + +include $(top_srcdir)/common/cruft.mak + +all-local: check-cruft diff --git a/NEWS b/NEWS new file mode 100644 index 0000000..c5dd173 --- /dev/null +++ b/NEWS @@ -0,0 +1 @@ +This is GStreamer overrides for PyGobject 1.5.2 release diff --git a/README b/README new file mode 100644 index 0000000..92ffc66 --- /dev/null +++ b/README @@ -0,0 +1 @@ +This file will be autogenerated. Please read README-docs. diff --git a/RELEASE b/RELEASE new file mode 100644 index 0000000..dcc2034 --- /dev/null +++ b/RELEASE @@ -0,0 +1,57 @@ + +Release notes for GStreamer Python bindings 1.5.2 + + +The GStreamer team is proud to announce a new development release +in the 1.5.x stable series of the GstPython PyGObject overrides. + + + + +Features of this release + + +Bugs fixed in this release + + * 738157 : Same plugin name used for Python 3 and Python 2 plugins in Python + +==== Download ==== + +You can find source releases of gst-python in the download +directory: http://gstreamer.freedesktop.org/src/gst-python/ + +The git repository and details how to clone it can be found at +http://cgit.freedesktop.org/gstreamer/gst-python/ + +==== Homepage ==== + +The project's website is http://gstreamer.freedesktop.org/ + +==== Support and Bugs ==== + +We use GNOME's bugzilla for bug reports and feature requests: +http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer + +Please submit patches via bugzilla as well. + +For help and support, please subscribe to and send questions to the +gstreamer-devel mailing list (see below for details). + +There is also a #gstreamer IRC channel on the Freenode IRC network. + +==== Developers ==== + +GStreamer is stored in Git, hosted at git.freedesktop.org, and can be cloned +from there (see link above). + +Interested developers of the core library, plugins, and applications should +subscribe to the gstreamer-devel list. + + +Applications + +Contributors to this release + + * Sebastian Dröge + * Thibault Saunier +  \ No newline at end of file diff --git a/TODO b/TODO new file mode 100644 index 0000000..92039fc --- /dev/null +++ b/TODO @@ -0,0 +1 @@ +Port tests and example to GStreamer 1.0 diff --git a/acinclude.m4 b/acinclude.m4 new file mode 100644 index 0000000..c0d1a5e --- /dev/null +++ b/acinclude.m4 @@ -0,0 +1,132 @@ +## this one is commonly used with AM_PATH_PYTHONDIR ... +dnl AM_CHECK_PYMOD(MODNAME [,SYMBOL [,ACTION-IF-FOUND [,ACTION-IF-NOT-FOUND]]]) +dnl Check if a module containing a given symbol is visible to python. +AC_DEFUN([AM_CHECK_PYMOD], +[AC_REQUIRE([AM_PATH_PYTHON]) +py_mod_var=`echo $1['_']$2 | sed 'y%./+-%__p_%'` +AC_MSG_CHECKING(for ifelse([$2],[],,[$2 in ])python module $1) +AC_CACHE_VAL(py_cv_mod_$py_mod_var, [ +ifelse([$2],[], [prog=" +import sys +try: + import $1 +except ImportError: + sys.exit(1) +except: + sys.exit(0) +sys.exit(0)"], [prog=" +import $1 +$1.$2"]) +if $PYTHON -c "$prog" 1>&AC_FD_CC 2>&AC_FD_CC + then + eval "py_cv_mod_$py_mod_var=yes" + else + eval "py_cv_mod_$py_mod_var=no" + fi +]) +py_val=`eval "echo \`echo '$py_cv_mod_'$py_mod_var\`"` +if test "x$py_val" != xno; then + AC_MSG_RESULT(yes) + ifelse([$3], [],, [$3 +])dnl +else + AC_MSG_RESULT(no) + ifelse([$4], [],, [$4 +])dnl +fi +]) + +dnl a macro to check for ability to create python extensions +dnl AM_CHECK_PYTHON_HEADERS([ACTION-IF-POSSIBLE], [ACTION-IF-NOT-POSSIBLE]) +dnl function also defines PYTHON_INCLUDES +AC_DEFUN([AM_CHECK_PYTHON_HEADERS], +[AC_REQUIRE([AM_PATH_PYTHON]) +AC_MSG_CHECKING(for headers required to compile python extensions) +dnl deduce PYTHON_INCLUDES +py_prefix=`$PYTHON -c "import sys; print(sys.prefix)"` +py_exec_prefix=`$PYTHON -c "import sys; print(sys.exec_prefix)"` +if $PYTHON-config --help 1>/dev/null 2>/dev/null; then + PYTHON_INCLUDES=`$PYTHON-config --includes 2>/dev/null` + if $PYTHON-config --abiflags 1>/dev/null 2>/dev/null; then + PYTHON_ABI_FLAGS=`$PYTHON-config --abiflags 2>/dev/null` + else + PYTHON_ABI_FLAGS= + fi +else + PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}" + if test "$py_prefix" != "$py_exec_prefix"; then + PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_exec_prefix}/include/python${PYTHON_VERSION}" + fi +fi +AC_SUBST(PYTHON_INCLUDES) +dnl check if the headers exist: +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES" +AC_TRY_CPP([#include ],dnl +[AC_MSG_RESULT(found) +$1],dnl +[AC_MSG_RESULT(not found) +$2]) +CPPFLAGS="$save_CPPFLAGS" +]) + +dnl a macro to check for ability to embed python +dnl AM_CHECK_PYTHON_LIBS([ACTION-IF-POSSIBLE], [ACTION-IF-NOT-POSSIBLE]) +dnl function also defines PYTHON_LIBS +AC_DEFUN([AM_CHECK_PYTHON_LIBS], +[AC_REQUIRE([AM_CHECK_PYTHON_HEADERS]) +AC_MSG_CHECKING(for libraries required to embed python) + +dnl deduce PYTHON_LIBS +if $PYTHON-config --help 1>/dev/null 2>/dev/null; then + PYTHON_LIBS=`$PYTHON-config --ldflags 2>/dev/null` + PYTHON_LIB=`$PYTHON -c "import distutils.sysconfig as s; print(s.get_python_lib(standard_lib=1))"` + if echo "$host_os" | grep darwin >/dev/null 2>&1; then + dnl OSX is a pain. Python as shipped by apple installs libpython in /usr/lib + dnl so we hardcode that. Other systems can use --with-libpython-dir to + dnl overrid this. + PYTHON_LIB_LOC=/usr/lib + else + PYTHON_LIB_LOC=$PYTHON_LIB/config + + # default to prefix/lib for distros that don't have a link in + # .../pythonX.Y/config/ + if test ! -e $PYTHON_LIB_LOC/libpython${PYTHON_VERSION}${PYTHON_ABI_FLAGS}.so; then + if test -e ${py_prefix}/lib64/libpython${PYTHON_VERSION}${PYTHON_ABI_FLAGS}.so; then + PYTHON_LIB_LOC=${py_prefix}/lib64 + else + PYTHON_LIB_LOC=${py_prefix}/lib + fi + fi + fi +else + PYTHON_LIBS="-L${py_prefix}/lib -lpython${PYTHON_VERSION}" + PYTHON_LIB_LOC="${py_prefix}/lib" +fi + +AC_ARG_WITH([libpython-dir], + AS_HELP_STRING([--with-libpython-dir], [the directory containing libpython${PYTHON_VERSION}]), + [ + PYTHON_LIB_LOC=`echo "$withval" | sed -e 's/\/$//g'` + ] +) + +if echo "$host_os" | grep darwin >/dev/null 2>&1; then + dnl workaround libtool brokenness under OSX + PYTHON_LIB_SUFFIX=\\\"dylib\\\" +else + PYTHON_LIB_SUFFIX=G_MODULE_SUFFIX +fi + +AC_SUBST(PYTHON_LIBS) +AC_SUBST(PYTHON_LIB_LOC) +AC_SUBST(PYTHON_ABI_FLAGS) +AC_SUBST(PYTHON_LIB_SUFFIX) +dnl check if the headers exist: +save_LIBS="$LIBS" +LIBS="$LIBS $PYTHON_LIBS" +AC_TRY_LINK_FUNC(Py_Initialize, dnl + [LIBS="$save_LIBS"; AC_MSG_RESULT(yes); $1], dnl + [LIBS="$save_LIBS"; AC_MSG_RESULT(no); $2]) + +]) diff --git a/autogen.sh b/autogen.sh new file mode 100755 index 0000000..72df553 --- /dev/null +++ b/autogen.sh @@ -0,0 +1,110 @@ +#!/bin/sh +# Run this to generate all the initial makefiles, etc. + +DIE=0 +package=gst-python +srcfile=gi/overrides/gstmodule.c + +# Make sure we have common +if test ! -f common/gst-autogen.sh; +then + echo "+ Setting up common submodule" + git submodule init +fi +git submodule update + +# ensure that we have the dirs we put ext libs in to appease automake +mkdir -p gst-libs/ext/ffmpeg/ffmpeg + +# source helper functions +if test ! -f common/gst-autogen.sh; +then + echo There is something wrong with your source tree. + echo You are missing common/gst-autogen.sh + exit 1 +fi +. common/gst-autogen.sh + +# install pre-commit hook for doing clean commits +if test ! \( -x .git/hooks/pre-commit -a -L .git/hooks/pre-commit \); +then + rm -f .git/hooks/pre-commit + ln -s ../../common/hooks/pre-commit.hook .git/hooks/pre-commit +fi + + +CONFIGURE_DEF_OPT='--enable-maintainer-mode' + +autogen_options $@ + +echo -n "+ check for build tools" +if test ! -z "$NOCHECK"; then echo " skipped"; else echo; fi +version_check "autoconf" "$AUTOCONF autoconf autoconf270 autoconf269 autoconf268 autoconf267 autoconf266 autoconf265 autoconf264 autoconf263 autoconf262 autoconf261 autoconf260" \ + "ftp://ftp.gnu.org/pub/gnu/autoconf/" 2 60 || DIE=1 +version_check "automake" "$AUTOMAKE automake automake-1.11 automake-1.10" \ + "ftp://ftp.gnu.org/pub/gnu/automake/" 1 10 || DIE=1 +version_check "libtoolize" "$LIBTOOLIZE libtoolize glibtoolize" \ + "ftp://ftp.gnu.org/pub/gnu/libtool/" 1 5 0 || DIE=1 +version_check "pkg-config" "" \ + "http://www.freedesktop.org/software/pkgconfig" 0 8 0 || DIE=1 + +die_check $DIE + +aclocal_check || DIE=1 +autoheader_check || DIE=1 + +die_check $DIE + +# if no arguments specified then this will be printed +if test -z "$*"; then + echo "+ checking for autogen.sh options" + echo " This autogen script will automatically run ./configure as:" + echo " ./configure $CONFIGURE_DEF_OPT" + echo " To pass any additional options, please specify them on the $0" + echo " command line." +fi + +toplevel_check $srcfile + +tool_run "$libtoolize" "--copy --force" +tool_run "$aclocal" "-I m4 -I common/m4 $ACLOCAL_FLAGS" +tool_run "$autoheader" + +# touch the stamp-h.in build stamp so we don't re-run autoheader in maintainer mode +echo timestamp > stamp-h.in 2> /dev/null + +tool_run "$autoconf" +tool_run "$automake" "-a -c -Wno-portability" + +# if enable exists, add an -enable option for each of the lines in that file +if test -f enable; then + for a in `cat enable`; do + CONFIGURE_FILE_OPT="--enable-$a" + done +fi + +# if disable exists, add an -disable option for each of the lines in that file +if test -f disable; then + for a in `cat disable`; do + CONFIGURE_FILE_OPT="$CONFIGURE_FILE_OPT --disable-$a" + done +fi + +test -n "$NOCONFIGURE" && { + echo "+ skipping configure stage for package $package, as requested." + echo "+ autogen.sh done." + exit 0 +} + +echo "+ running configure ... " +test ! -z "$CONFIGURE_DEF_OPT" && echo " ./configure default flags: $CONFIGURE_DEF_OPT" +test ! -z "$CONFIGURE_EXT_OPT" && echo " ./configure external flags: $CONFIGURE_EXT_OPT" +test ! -z "$CONFIGURE_FILE_OPT" && echo " ./configure enable/disable flags: $CONFIGURE_FILE_OPT" +echo + +./configure $CONFIGURE_DEF_OPT $CONFIGURE_EXT_OPT $CONFIGURE_FILE_OPT || { + echo " configure failed" + exit 1 +} + +echo "Now type 'make' to compile $package." diff --git a/common/ChangeLog b/common/ChangeLog new file mode 100644 index 0000000..92d0d25 --- /dev/null +++ b/common/ChangeLog @@ -0,0 +1,1712 @@ +2008-12-17 Edward Hervey + + * gst.supp: + And yet another variation of the GstAudioFilter leak. + +2008-12-15 Sebastian Dröge + + Patch by: Roland Illig + + * m4/gst-parser.m4: + Fix AG_GST_BISON_CHECK to handle version numbers with more than + two components (i.e. 2.4.1). Fixes bug #564507. + +2008-12-14 Edward Hervey + + * gst.supp: + And yet another variant of the GstAudioFilter leak. + +2008-12-13 Edward Hervey + + * gst.supp: + Added variants of leaks of dynamic pad templates created in + GstAudioFilter. + Add conditional jump triggered by getaddrinfo (maybe glibc-2.9). + +2008-12-12 Edward Hervey + + * gst.supp: + Fix leak in GIO called by gnomevfs. Nothing we can do about this. + +2008-12-12 Edward Hervey + + * gst.supp: + Added another suppression for dynamic pad templates, in this case + GstAudioFilter. + Added suppression for PangoLanguage which can never be freed + according to the Pango API. + +2008-12-12 Edward Hervey + + * gst.supp: + A whole bunch of suppressions detected on latest gentoo ~amd64. + Make some existing suppressions more generic (for subtle dependecy + code changes). + Added suppressions for glibc-2.9. + Added suppressions for new variants of ALSA leaks. + Added suppressions for a series of leaks in plugins registrations due + to some pad templates' caps calculated at runtime. + Added suppressions for variants of some leaks in pango/fontconfig. + Added suppressions for leak in gstffmpegcsp.c (nothing we can do + about it, but will only exist once). + +2008-12-04 Sebastian Dröge + + * m4/gst-plugin-docs.m4: + Remove the check if $have_gtk_doc equals yes as it's not defined + and $enable_gtk_doc should be good enough. + Also this restores the build of the plugin documentation. + +2008-12-01 Mark Nauwelaerts + + * gst.supp: + Add suppression variant for Ubuntu Hardy x86/64bit. + +2008-12-01 Stefan Kost + + * gtk-doc-plugins.mak: + * gtk-doc.mak: + Simplily uninstall rule. Its closer to upstream and fixes #150331. + +2008-11-29 Sebastian Dröge + + * m4/glib-gettext.m4: + Update glib-gettext.m4 from latest stable GLib release. + +2008-11-29 Sebastian Dröge + + Patch by: Cygwin Ports maintainer + + + * gettext.patch: + Update the gettext patch for use with gettext 0.17 which is + required to build with libtool 2.2 because of conflicts. + First part of bug #556091. + +2008-11-29 Sebastian Dröge + + * m4/gtk-doc.m4: + * m4/pkg.m4: + Update gtk-doc and pkg-config m4 macros from their latest releases. + +2008-11-20 Michael Smith + + * m4/as-objc.m4: + Fix objective C test macro when none of the compilers are found at all. + +2008-10-30 Stefan Kost + + * gtk-doc.mak: + Also cp the entities here to all xinlcude based docs (workaround for + not being able to set up a search path). + +2008-10-17 Jan Schmidt + + * gtk-doc.mak: + Don't clobber the real registry cache file when + building docs. + +2008-10-07 Jan Schmidt - Sun Microsystems + + * m4/gst-error.m4: + Also disable the bogus "loop not entered at top" warnings appearing on Sparc Forte builds. + +2008-10-06 Stefan Kost + + * gtk-doc.mak: + Apply the same fix as below to gtk-doc.mak. Somehow did not end up in + CVS. + +2008-09-05 David Schleef + + * gtk-doc-plugins.mak: Fix the check for gtkdoc-rebase: don't + pass the 'which' error back to make. This fix is more specific + than what is in upstream. + +2008-09-05 David Schleef + + * gtk-doc.mak: Fix the check for gtkdoc-rebase: don't pass the + 'which' error back to make. This fix is more specific than + what is in upstream. + +2008-09-04 Stefan Kost + + * gtk-doc-plugins.mak: + * gtk-doc.mak: + Get closer to upstream makefiles. Don't install index.sgml twice. Call + gtkdoc-rebase (if exists). + +2008-08-21 Stefan Kost + + * gtk-doc-plugins.mak: + Revert $(top_builddir) -> $(builddir) change of rev. 1.39 as there is + no variable called builddir. + +2008-07-31 Mark Nauwelaerts + + * gst.supp: + Add suppressions for Ubunty Hardy x86/64bit, similar to earlier + versions and 32bit variant. + +2008-07-31 Sebastian Dröge + + * m4/gst-feature.m4: + Remove GST_DISABLE_(ENUMTYPES|INDEX|URI). + +2008-07-21 Tim-Philipp Müller + + * m4/gst-error.m4:: + When checking for GST_ERROR_CXXFLAGS, check each compiler flag + individually, not all together. + +2008-07-20 Tim-Philipp Müller + + * m4/gst-parser.m4:: + Fix bison version number detection for older --version + output format (as bison 1.28 on OSX 10.4 outputs). + Fixes #543853. + +2008-07-12 Stefan Kost + + * plugins.xsl: + Split refsect2 also here to make "Element Pads" subtitle visible. + +2008-07-08 Sebastian Dröge + + * m4/gst-error.m4: + Add compiler flags to warn if declarations after statements or + variable length arrays are used. These are C99/GCC extensions and + are not supported by some compilers we want to support. + +2008-07-02 Mark Nauwelaerts + + * gtk-doc-plugins.mak: + Only clean doc maintainer stamps in maintainer-clean. Fixes #539977. + +2008-06-20 Sebastian Dröge + + * gstdoc-scangobj: + Always use format strings for printf-like functions, even if they just + print a string. Fixes bug #536981. + +2008-06-20 Sebastian Dröge + + * gtk-doc-plugins.mak: + * gtk-doc.mak: + Include CFLAGS and LDFLAGS in GTKDOC_CFLAGS and GTKDOC_LDFLAGS, + otherwise the values passed to configure are ignored. + Fixes bug #536978. + +2008-06-05 Tim-Philipp Müller + + * m4/gst-error.m4: + Add -fno-strict-aliasing when compiling with -Werror, to work around + warnings caused by G_LOCK with recent GLib versions (2.16.x) (#316221). + +2008-06-05 Jan Schmidt + + * gtk-doc.mak: + Don't copy html/*.png files unless they don't already exist + in the destdir. Fixes distcheck failure caused by permissions + problems trying to copy a file into the destdir when it already + exists. + +2008-05-28 Stefan Kost + + * plugins.xsl: + The class was not shown in plugin docs. Fix typo in changelog below. + +2008-05-22 Jan Schmidt + + * gstdoc-scangobj: + Emit warnings if one of the GTypes we're expecting is 0 + when scanning. + +2008-05-21 Felipe Contreras + + * gtk-doc-plugins.mak: + * gtk-doc.mak: + Fix installing png images when gtk-doc is disabled. + +2008-05-21 Felipe Contreras + + * gtk-doc-plugins.mak: + * gtk-doc.mak: + Fix make clean when gtk-doc is disabled and other cleanups. + +2008-05-17 Jan Schmidt + + * gtk-doc-plugins.mak: + Be more quiet when the files don't yet exist. + +2008-05-16 Jan Schmidt + + * gstdoc-scangobj: + Add a mechanism for adding 'implicitly created' GTypes into the + scan, allowing for documenting plugin-private base classes that + provide signals or properties for public elements. + + * gtk-doc-plugins.mak: + Use $(builddir) instead of $(top_builddir) in a few places - there's + no need to hard code 'docs/plugins' as the only useable path. + +2008-05-14 Peter Kjellerstedt + + * m4/gst-feature.m4: + Report plug-ins without external dependencies that will not be built + even when the name of the plug-in is a substring of another plug-in, + e.g., goom vs. goom2k1. + +2008-05-14 Tim-Philipp Müller + + * gst.supp: + Add suppression for glibc bug on gutsy/x86-64 + +2008-05-12 Stefan Kost + + * plugins.xsl: + Improve the layout of the caps, but splitting them on ";". + +2008-05-09 Sebastian Dröge + + Patch by: Brian Cameron + + * m4/gst-default.m4: + Don't set the default audio sink to the default visualizer. + Fixes bug #532295. + +2008-05-07 Tim-Philipp Müller + + * check.mak: (help): + Document GST_CHECKS environment variable in checks 'make help'. + +2008-05-06 Sebastian Dröge + + Patch by: Marc-Andre Lureau + + * scangobj-merge.py: + Don't depend on Twisted just for the OrderedDict but implement our + own ordered dictionary class. Fixes bug #531577. + +2008-04-23 Edward Hervey + + * gst.supp: + Re-arrange latest suppressions. + Add all known suppressions for ubuntu hardy. Same as for older + ubuntus, but with different codepaths. + +2008-04-22 Edward Hervey + + * gst.supp: Make tls leak suppression a bit more generic. + +2008-04-22 Edward Hervey + + * gst.supp: Fix ommission in latest commit. + Make tls leak suppression more generic in order to cover more + distributions (and hopefully also future distributions). + +2008-04-22 Edward Hervey + + * gst.supp: Add suppressions for Hardy. + They're just the newer versions of similar suppressions we had + for the previous versions of ubuntu. + +2008-04-15 Sebastian Dröge + + * Makefile.am: + * m4/Makefile.am: + Dist all files in common. Fixes bug #527984. + +2008-04-14 Tim-Philipp Müller + + * m4/gst-function.m4: + Rename AC_CACHE_VAL cache-ids to contain '_cv_' in order to make + autoconf-2.62 complain less. + +2008-04-13 Tim-Philipp Müller + + * m4/gst-args.m4: + * m4/gst-valgrind.m4: + Bump valgrind requirement to 3.0 (which was released in August 2005). + Fixes #489269. Also, check for version >=REQ and not >REQ. + +2008-04-09 Tim-Philipp Müller + + * m4/gst-default.m4: + Add --with-default-{audiosink|audiosrc|videosink|videosrc|visualizer} + configure switches (#519417). + +2008-04-03 Tim-Philipp Müller + + * m4/gst-args.m4: + Add --disable-foo switch for dependency-less plugins (#525586). + +2008-04-01 Sebastian Dröge + + * m4/gst-parser.m4: + Unconditionally require flex 2.5.31 and bison 1.875. + +2008-03-23 Sebastian Dröge + + * m4/gst-arch.m4: + amd64/x86_64 allows unaligned memory access too. + +2008-03-21 Sebastian Dröge + + * m4/gst-dowhile.m4: + Add macro that checks if the compiler supports do {} while (0) + macros and define HAVE_DOWHILE_MACROS if it does. This is + needed by glib/gmacros.h to use something else than + if (1) else for G_STMT_START/END when compling C++, which + causes compiler warnings because of ambigious else with g++ 4.3. + +2008-03-21 Sebastian Dröge + + * m4/gst-plugin-docs.m4: + * mangle-tmpl.py: + Don't depend on PyXML and use only XML modules that are shipped + with python. Fixes bug #519635. + +2008-03-07 Edward Hervey + + * m4/gtk-doc.m4: (GTK_DOC_CHECK): + The previous commit to this file by Stefan Kost mentionned checking for + SED, but NOT checking for gtkdoc-check (wth is that doing there ??). + Therefore, removing the check for gtkdoc-check + +2008-03-03 David Schleef + + * m4/ax_create_stdint_h.m4: Oops, checked in the wrong copy of + this file. (Update from upstream) + +2008-03-03 David Schleef + + * m4/ax_create_stdint_h.m4: Update from upstream. Fixes a bug + compiling with MSVC. + +2008-03-03 Edward Hervey + + * m4/pkg.m4: + Allow override of pkg-config results, as proposed by configure --help. + This is in fact just a backport from upstream pkg.m4. + Fixes #518892 + +2008-03-03 Peter Kjellerstedt + + * ChangeLog: + Changelog surgery of my previous commit to add bugzilla reference. + * m4/gst-args.m4: + Add AG_GST_CHECK_PLUGIN and AG_GST_DISABLE_PLUGIN to make it easier + to include and exclude plug-ins without external references, i.e., + plug-ins listed in GST_PLUGINS_SELECTED. (#498222) + +2008-03-03 Sebastian Dröge + + * gst.supp: + Add another glibc suppression. + +2008-02-29 Peter Kjellerstedt + + * m4/gst-feature.m4: + Make the comment before defines generated via AG_GST_CHECK_FEATURE + look nicer. (#498222) + +2008-02-26 Jan Schmidt + + * m4/Makefile.am: + * m4/as-gcc-inline-assembly.m4: + Add Dave Schleef's GCC inline assembly detection macro + for using in gst-plugins-good in the goom 2k4 plugin. + +2008-02-25 Andy Wingo + + * gst-autogen.sh: Instead of only passing certain arguments to + configure, pass anything that we didn't handle. Much friendlier. + Fixes #34412. + +2008-02-23 Jan Schmidt + + * m4/gst-error.m4: + Store the detected compiler flags into ERROR_CFLAGS rather than + ERROR_CXXFLAGS, and use the macro that checks the C compiler, not + the C++ one. + +2008-02-23 Tim-Philipp Müller + + * m4/gst-error.m4: + Reflow checks for additional warning flags so they're not + nested, which fixes the result reporting in the configure + output. + +2008-02-22 Tim-Philipp Müller + + * m4/as-compiler-flag.m4: + Add AS_CXX_COMPILER_FLAG + + * m4/gst-error.m4: + Add AG_GST_SET_ERROR_CXXFLAGS (Forte bits need testing) + +2008-02-22 Tim-Philipp Müller + + * gtk-doc-plugins.mak: + Add 'check-inspected-versions' target; this helps identify + files that should have been removed or where the version + number should (ideally) be updated before a release + (which doesn't happen automatically if the releaser doesn't + build that plugin locally). Not adding at a distcheck hook + yet though, because it's not really that important and would + probably also be a problem on buildbots. + +2008-02-22 Sebastian Dröge + + * gst.supp: + Add even more glibc 2.7 suppressions. + +2008-02-22 Sebastian Dröge + + * gst.supp: + Add another suppression for GLib caching some values after + the first call. + +2008-02-12 Sebastian Dröge + + Patch by: + Tim Mooney + + * m4/gst-error.m4: + Use no%E_MACRO_REDEFINED on Solaris to prevent compiler warnings. + Fixes bug #515905. + +2008-02-11 Sebastian Dröge + + * gst.supp: + Add a few more glibc 2.7 suppressions to make the avisubtitle unit + test valgrind clean. Fixes bug #515703. + +2008-02-08 Stefan Kost + + * ChangeLog: + Changelog surgery for last commit. + +2008-02-08 Stefan Kost + + * m4/gtk-doc.m4: + Conditionally check for SED. Also sync a bit with upstream macro. + +2008-02-08 Stefan Kost + + * gtk-doc-plugins.mak: + * gtk-doc.mak: + Use '$(SED)' instead of 'sed'. Don't use -i for in-place as its gnu + only, move to a temp file instead. + +2008-02-06 Stefan Kost + + * gtk-doc-plugins.mak: + * gtk-doc.mak: + As our docs are versioned, we need to patch the index.sgml file to have + correct paths there, unless we also want to fork gtk-doc's xsl (which + we don't). This hopefully fixes xrefs between modules. + +2008-02-02 Sebastian Dröge + + * m4/gst-feature.m4: + Use printf instead of echo as "echo -e" isn't POSIX and doesn't work + with strict POSIX shells like tcsh or dash and also not every platform + has a /bin/echo that supports it. + +2008-01-24 Stefan Kost + + * ChangeLog: + ChangeLog surgery. + + * gstdoc-scangobj: + Sync the object scanner with gtk-doc fixes. Update args and hierarchy + files. + +2008-01-20 Sebastian Dröge + + * check.mak: + * coverage/lcov.mak: + * gtk-doc-plugins.mak: + * release.mak: + Use $(MAKE) instead of make to fix the build if GNU make is called + something else on the system. + + * m4/as-docbook.m4: + Fix path for docbook.xsl if we have no /etc/xml/catalog and add a + docbook-xsl search path for FreeBSD. + +2008-01-18 Sebastian Dröge + + * gst.supp: + Add a suppression for a glibc bug: + http://valgrind.org/docs/manual/faq.html#faq.exit_errors> + +2008-01-18 Sebastian Dröge + + * gst.supp: + Add some more glibc 2.7 suppressions and make the GLib suppressions + for the home/tmp/etc directory caching a bit more generic. + +2008-01-18 Sebastian Dröge + + * gst.supp: + Add some glibc 2.7 supressions as found on Debian/unstable. + +2008-01-14 Jan Schmidt + + * download-translations: + Apparently I have problems with leaving things commented out when + I edit shell scripts. + +2008-01-12 Jan Schmidt + + * download-translations: + Remove bash-isms + +2008-01-12 Jan Schmidt + + * check-exports: + Restore the cleanup rm of our tmp file which I didn't mean to leave + commented out. + +2008-01-12 Jan Schmidt + + * check-exports: + Fixes to make check-export work on both Solaris and Linux + + * m4/gst-error.m4: + Disable extra warning category (argument mismatch) as an error + on Forte, as it prevents the libcheck fail_if macros from compiling. + + * win32.mak: + Substitute the GStreamer version so things will keep working in 0.11 + +2008-01-11 Tim-Philipp Müller + + Patch by: Peter Kjellerstedt + + * m4/gst-glib2.m4: + * m4/gst-libxml2.m4: + Improve/fix output from configure if either glib-2.0 or + libxml2 are not installed (#498222). + +2008-01-09 Stefan Kost + + * coverage/lcov.mak: + Update coverage make-rules: use them conditionaly, use libtool mode + and use lcov to cleanup. + +2007-12-18 Sebastian Dröge + + * glib-gen.mak: + Also use #include "header" instead of #include
for the + headers that were used to generate the source files for the same + reason as below. + + Remove whitespace before #include. + +2007-12-18 Sebastian Dröge + + * glib-gen.mak: + Use #include "header" instead of #include
for the generated + enum C files as the file will always be in the same directory and + some compilers seem to be a bit strict about that unless . is added + to the include path. + + Include all headers that were used to generate the source files in + the C file as they're used there. + +2007-12-17 Tim-Philipp Müller + + * win32.mak: (win32), (win32defs), (win32crlf): + Make check for CR LF in Visual C++ 6.0 project files + work, based on patch by David Schleef (#496722, #393626). + +2007-12-17 Tim-Philipp Müller + + * Makefile.am: + Don't forget to dist the new win32.mak. + +2007-12-17 Tim-Philipp Müller + + * win32.mak: (win32), (win32defs): + Move common win32 Makefile foo into this new file. + +2007-12-15 Stefan Kost + + * gtk-doc-plugins.mak: + * gtk-doc.mak: + We should have never forked this that much :/. + +2007-12-13 Tim-Philipp Müller + + * check-exports: + Fix build on the ppc64 build bot. + +2007-12-13 Tim-Philipp Müller + + * check-exports: + Suppress more unintentional exports (too much hassle to rename them, + since the win32 project files would need changing too). + +2007-12-12 Tim-Philipp Müller + + * Makefile.am: + check-exports should be disted. + +2007-12-12 Tim-Philipp Müller + + * check-exports: + Add quick'n'dirty script to check the exported symbols of a library + against the symbols in the corresponding .def file (#493983). Based + on script by Ole André Vadla Ravnås. + +2007-11-06 Jan Schmidt + + * gtk-doc-plugins.mak: + Fix distcheck by making sure the types files are treated like the + other gtkdoc-scangobj generated files. + +2007-09-21 Sebastian Dröge + + * m4/gst-args.m4: + Let the AG_GST_ARG_ENABLE_EXPERIMENTAL macro default to disable + building of experimental plugins. Nobody uses it yet and the + --enable--experimental stuff from gst-plugins-good defaults to + disable too. + +2007-09-06 Tim-Philipp Müller + + * gtk-doc-plugins.mak: + Just use the normal 'check' target and avoid a circular + dependency. + +2007-09-06 Tim-Philipp Müller + + * gtk-doc-plugins.mak: + Add rule to error out if .hierarchy file contains tabs. + +2007-08-20 Tim-Philipp Müller + + * download-translations: + * po.mak: + If there are new languages, they need to be added to po/LINGUAS. + +2007-08-20 Tim-Philipp Müller + + * download-translations: + * po.mak: + Fix up 'download-po' a bit, so that we find new translations + for languages that aren't in our po/LINGUAS file yet too. + +2007-07-16 Jan Schmidt + + * gst.supp: + Add a suppression for GLib caching the tmp dir seen on an + Ubuntu Feisty system. + +2007-07-13 Jan Schmidt + + * m4/gst-feature.m4: + If we want to use 'echo -e', call /bin/echo instead of the shell's + since -e is a bash extension, and our /bin/sh might not be being + provided by bash. + +2007-07-01 Thomas Vander Stichele + + * po.mak: + Translation project has moved. Also, no idea how this used to + work given that we weren't downloading a .po file. + +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 + + * m4/gst-feature.m4: + Fix quoting (#449493). + +2007-06-10 Sebastian Dröge + + * m4/gst-parser.m4: + Only generate the parser if bison >= 1.875 _and_ flex >= 2.5.31 is + installed and use pre-generated sources otherwise. Fixes bug #444820. + +2007-05-11 Michael Smith + + * gst.supp: + Suppression variant for our good friend the TLS leak, this time for + Ubuntu Feisty/x86. + +2007-05-09 Tim-Philipp Müller + + * gtk-doc-plugins.mak: + Fix make distcheck again; change some spaces to tabs in makefile. + +2007-04-29 Thomas Vander Stichele + + * gtk-doc-plugins.mak (-module): + Error out when the html build step gives warnings, so they get + fixed properly. + +2007-04-23 Stefan Kost + + * m4/gst-feature.m4: + Add macro AG_GST_PARSE_SUBSYSTEM_DISABLES that checks the defines in + the configuration header and AC_DEFINES the setings. + +2007-04-19 Sebastian Dröge + + Patch by: Vincent Torri + + * m4/gst-parser.m4: + Put the AC_MSG_RESULT output in brackets to get it properly written to + the terminal. + +2007-04-18 Sebastian Dröge + + * m4/gst-parser.m4: + Check for flex >= 2.5.31 and set GENERATE_PARSER if we have at least + that version. Otherwise use pre-generated parser sources as we can't + raise the required flex version. HAVE_MT_SAVE_FLEX is obsolete now + as we use a new enough flex version anyway. First part of #349180 + +2007-04-10 Thomas Vander Stichele + + * m4/gst-check.m4: + Allow pre-setting the GST(PB)_TOOLS/PLUGINS_DIR variables to help + builds against older GStreamer. + +2007-03-25 Sebastian Dröge + + * m4/gst-parser.m4: + Fix the flex version check. It ignored the micro version before. + +2007-03-09 Jan Schmidt + + * check.mak: + Use the same timeout when generating valgrind suppressions as + running the valgrind test. + + * gst.supp: + Add some more suppressions and stuff. + +2007-03-08 Jan Schmidt + + * check.mak: + Make sure GSlice is disabled when building suppressions too. + + * gst.supp: + Add around *850* lines of suppressions for one-time initialisations + inside libasound and gconf/bonobo/ORBit. I feel so dirty. + +2007-03-07 Jan Schmidt + + * gst.supp: + add a suppression for this GConf flup on the FC5 buildbot. + +2007-03-06 Jan Schmidt + + * gst.supp: + Make the suppression a little more generic, to catch the FC5 + backtrace too. + +2007-03-06 Jan Schmidt + + * gst.supp: + Add a suppression for libcdio 0.76. It leaks an internal struct + when the CD-ROM device is not accessible. + +2007-02-28 Thomas Vander Stichele + + * m4/gst-arch.m4: + Move a line that was in the wrong macro + +2007-02-28 Thomas Vander Stichele + + * m4/gst.m4: + Add + * m4/gst-arch.m4: + * m4/gst-args.m4: + * m4/gst-check.m4: + * m4/gst-debuginfo.m4: + * m4/gst-default.m4: + * m4/gst-doc.m4: + * m4/gst-error.m4: + * m4/gst-feature.m4: + * m4/gst-function.m4: + * m4/gst-gettext.m4: + * m4/gst-glib2.m4: + * m4/gst-libxml2.m4: + * m4/gst-parser.m4: + * m4/gst-plugin-docs.m4: + * m4/gst-plugindir.m4: + * m4/gst-valgrind.m4: + * m4/gst-x11.m4: + Convert all macros to use AG_GST style so we can properly warn + when they're missing if configure.ac calls AG_GST_INIT + Will require update in all GStreamer modules. + +2007-02-11 Stefan Kost + + * m4/gst-args.m4: + Remove 'enable' from configure switch description as this leads to + confusing lines like "disable enable builing ...". + * m4/gst-feature.m4: + Fix comment to sound less horrible. + +2007-02-07 Tim-Philipp Müller + + Patch by: Will Newton + + * m4/gst-check.m4: + Use $PKG_CONFIG rather than pkg-config directly, the one in our path + might not be the one we want, like when cross-compiling. Also, other + macros such as PKG_CHECK_MODULES use $PKG_CONFIG, so we should + probably too just for consistency. Fixes #405288. + +2007-01-08 Tim-Philipp Müller + + * m4/gst-parser.m4: + Need to use double square brackets again so m4 doesn't remove them + (fixes #378931). + + * m4/gst-args.m4: + Use double square brackets here as well, for the same reason. + +2007-01-05 Tim-Philipp Müller + + * m4/gst-parser.m4: + Use 'sed' rather than 'tr' to strip trailing letters from version + numbers, since 'tr' might not be available and we know sed is + (#378931). + +2006-10-21 Tim-Philipp Müller + + * check.mak: + Increase default timeout under valgrind, 60 is just too short and + some tests take a bit longer these days and not everyone has a + beefy machine. + +2006-09-29 Michael Smith + + * gst.supp: + More suppressions for edgy. + +2006-09-28 Jan Schmidt + + * m4/gst-glib2.m4: + Use gmodule-no-export-2.0.pc instead of gmodule-2.0.pc - we neither + want nor need --export-dynamic (which ends up making us export a bunch + of unneeded symbols) + +2006-09-14 Tim-Philipp Müller + + * gst.supp: + Some suppressions for the more recent ld.so in ubuntu edgy. + +2006-08-23 Tim-Philipp Müller + + * gst.supp: + Shorten function trail so the suppression works on + my ubuntu dapper system with core cvs as well. + +2006-07-28 Jan Schmidt + + * gst.supp: + Extra suppressions from my Ubuntu x86_64 machine + +2006-07-24 Tim-Philipp Müller + + Patch by: Frederic Peters + + * m4/gst-parser.m4: + Need to double square brackets in .m4 files. Should fix bison + version detection with version numbers like 1.23a (#348354). + +2006-07-24 Jan Schmidt + + * check.mak: + Valgrind fails to find tests written in tests/check/ directly (rather + than a subdir) - because valgrind gets run with a filename that + doesn't contain a relative path, it goes searching /usr/bin instead. + Run with ./.... to make things work either way. + + * gtk-doc-plugins.mak: + Add $(top_builddir)/src as a place to look for plugins + when building too, since that's where gst-template keeps things + +2006-07-23 Stefan Kost + + Patch by: Frederic Peters + + * m4/gst-parser.m4: + Fix bison detection (#348354) + +2006-07-21 Stefan Kost + + * m4/gst-parser.m4: + check for bison and flex + +2006-07-13 Thomas Vander Stichele + + * m4/gst-plugin-docs.m4: + remove the configure argument for enabling plugin doc build; + having gtk-doc enabled and pyxml present is enough of a trigger + +2006-07-03 Thomas Vander Stichele + + * coverage/lcov.mak: + fix up rules to work with gst-python as well + run "make lcov" to test and generate the reports + run "make lcov-reset" to redo it after that + +2006-07-02 Thomas Vander Stichele + + * Makefile.am: + * check.mak: + add an inspect target that inspects every element feature, + so we can have that added for coverage + * coverage/lcov.mak: + add support for lcov + +2006-07-02 Thomas Vander Stichele + + * m4/gst-args.m4: + when building with gcov, reset CFLAGS and friends to O0 + +2006-07-02 Thomas Vander Stichele + + * m4/gst-args.m4: + Find the gcov that matches the gcc version + Only allow gcov if we use gcc + +2006-07-02 Thomas Vander Stichele + + * Makefile.am: + * coverage/coverage-report-entry.pl: + * coverage/coverage-report.pl: + * coverage/coverage-report.xsl: + copy coverage reporting files from dbus + +2006-07-01 Thomas Vander Stichele + + * m4/gst-args.m4: + libtool strips gcov's -f flags, so libgcov does not get + linked in. Setting GCOV_LIBS with -lgcov fixes libtool's + stripping + also show what pkg-config-path we set + +2006-06-22 Tim-Philipp Müller + + Patch by: Peter Kjellerstedt + + * m4/gst-feature.m4: + Show list of plugins without external dependencies that + will not be built as well (#344136). + +2006-06-15 Tim-Philipp Müller + + * m4/gst-plugin-docs.m4: + add GST_PLUGIN_DOCS, which checks for everything needed + to build the plugin docs (namely gtk-doc and pyxml); also + adds a new --enable-plugin-docs configure switch; will + set ENABLE_PLUGIN_DOCS conditional for use in Makefile.am + files (see #344039). + +2006-06-11 Thomas Vander Stichele + + * m4/gst-check.m4: + add GST_PKG_CHECK_MODULES, which in the normal case of checking + for a dependency lib for a plug-in only needs two arguments + to do the right thing. + * m4/gst-feature.m4: + clean up output a little of feature checking; also deal with + non-plug-in feature checks + * m4/Makefile.am: + * m4/gst-gstreamer.m4: + remove this file; it's a useless check + +2006-06-06 Thomas Vander Stichele + + * m4/gst-arch.m4: + add PPC64 so we can have separate structure sizes for it + +2006-06-05 Edward Hervey + + * gtk-doc.mak: + Check for the proper .devhelp2 file to remove. + +2006-05-31 Thomas Vander Stichele + + * gtk-doc.mak: + allow a magic variable to suppress errors from docbuilding + +2006-05-30 Thomas Vander Stichele + + * gtk-doc.mak: + error out if gtkdoc-mktmpl finds unused declarations + +2006-05-28 Edward Hervey + + * gst.supp: + Reverting previous commit. That's good to know, Edward, but why ? + +2006-05-28 Edward Hervey + + * gst.supp: + Added suppresion for memleak in g_option_context_parse on fc5-64 + +2006-05-19 Thomas Vander Stichele + + * m4/gst-check.m4: + set GSTPB_PLUGINS_DIR just like GST_PLUGINS_DIR + +2006-05-18 Tim-Philipp Müller + + * check.mak: + Fix 'make help' in check directories, it should be + 'valgrind.gen-suppressions' not 'valgrind-gen-suppressions' + (not changing target to match help string on purpose to keep + scripts etc. functional). + +2006-05-18 Thomas Vander Stichele + + Patch by: Peter Kjellerstedt + + * m4/gst-arch.m4: + add support for CRIS and CRISv32. + +2006-05-17 Jan Schmidt + + * m4/gst-args.m4: + Fix the macros for command-line supplied package and origin names + so they don't end up being configure as "" (Fixes #341479) + +2006-05-14 Jan Schmidt + + * gtk-doc.mak: + Add uninstall rule to remove .devhelp2 files. + +2006-05-09 Edward Hervey + + * gst.supp: + Add suppression for GSlice version of + g_type_init calloc leak + +2006-04-05 Michael Smith + + * gst.supp: + Delete a bogus suppression for the registry code. + Generalise a suppression for a glib bug (see #337404) + +2006-04-04 Michael Smith + + * gst.supp: + Add a leak suppression: the existing glibc-doesn't-free-TLS one + wasn't triggering here. + +2006-04-04 Michael Smith + + * gst.supp: + Add some minimally-neccesary suppressions for my x86/dapper system. + +2006-04-01 Thomas Vander Stichele + + * plugins.xsl: + Do not display an origin link if origin does not start with http + See #323798 + +2006-04-01 Thomas Vander Stichele + + * m4/gst-args.m4: + * m4/gst-feature.m4: + add more macros + * m4/gst-x11.m4: + X11-related checks + +2006-04-01 Thomas Vander Stichele + + * m4/as-version.m4: + newer version + * m4/gst-args.m4: + * m4/gst-doc.m4: + update and add other macros to be shared across projects + +2006-03-24 Thomas Vander Stichele + + * gst.supp: + add a suppression for g_parse_debug_string + +2006-03-23 Stefan Kost + + * gstdoc-scangobj: + sync fully with gtkdoc-0.15 + +2006-03-23 Stefan Kost + + * gstdoc-scangobj: + * gtk-doc.mak: + sync a little with gtk-doc mainline + +2006-03-17 Wim Taymans + + * gst.supp: + add another clone suppression + change all glibc suppressions to match 2.3.* + +2006-03-09 Thomas Vander Stichele + + * m4/check.m4: + fix test so it actually works when the normal check is used + over debian's/ubuntu's + +2006-03-08 Jan Schmidt + + * check.mak: + Set G_SLICE=always-malloc when valgrinding tests + (closes #333272) + +2006-02-21 Jan Schmidt + + * m4/gst-glib2.m4: + Fix debug output when the GLib version prerequisite is not found + +2006-02-13 Andy Wingo + + * m4/check.m4: Hack around Debian/Ubuntu's broken installation of + the PIC version of check as libcheck_pic.a. Should work with + cross-compilation too. Grr. + +2006-02-06 Thomas Vander Stichele + + * m4/gst-default.m4: + switch to auto* sinks for defaults + +2006-02-02 Wim Taymans + + * check.mak: + add a .valgrind.gen-suppressions target to aid in generating + suppressions + * gst.supp: + add more repressions from my debian glibc as of today + +2006-02-02 Thomas Vander Stichele + + * gtk-doc-plugins.mak: + only add srcdir/gst if it exists + +2006-01-30 Thomas Vander Stichele + + * release.mak: + don't complain about disted enums in win32 + +2006-01-20 Thomas Vander Stichele + + * m4/gst-check.m4: + AC_SUBST CFLAGS and LIBS + do a non-command because something is stripping out our AC_SUBST + +2006-01-20 Thomas Vander Stichele + + * m4/gst-args.m4: + * m4/gst-valgrind.m4: + properly give a "no" result manually when providing a + not-found action to fix configure output + +2006-01-20 Thomas Vander Stichele + + * m4/pkg.m4: + update with a more recent version + +2006-01-07 Thomas Vander Stichele + + * gettext.patch: + make Makefile depend on LINGUAS, so rebuilds work when adding + a language + +2006-01-03 Michael Smith + + * check.mak: + Clarify error message from valgrind test runs. + +2005-12-16 Thomas Vander Stichele + + * m4/gst-arch.m4: + define HOST_CPU + +2005-11-29 Thomas Vander Stichele + + * check.mak: + add a valgrind-forever target for tests + +2005-11-28 Thomas Vander Stichele + + * check.mak: + when a "make test.check" run fails, make it rerun the test with + at least debug level 2 + +2005-11-14 Thomas Vander Stichele + + * m4/Makefile.am: + * m4/gst-check.m4: + fix check for base plugins + * m4/gst-default.m4: + add m4 to set default elements + +2005-10-18 Thomas Vander Stichele + + * m4/gst-check.m4: + check for tools correctly + +2005-10-18 Thomas Vander Stichele + + * gtk-doc.mak: + only enable breaking on new API when make distcheck passes, + not before + +2005-10-18 Thomas Vander Stichele + + * m4/gst-check.m4: + Resurrect Julien's dead body and wipe his mind clean + +2005-10-18 Thomas Vander Stichele + + * m4/gst-check.m4: + Kill Julien + +2005-10-17 Julien MOUTTE + + * m4/gst-check.m4: I know Thomas will kill me but this + ifelse statement seems incorrect as it is always setting + required to "yes". With this one it seems to work. Fixes + build of gst-plugins-base on my setup where gstreamer-check + is definitely not present/required. + +2005-10-18 Stefan Kost + + * gtk-doc.mak: + make build break on new api that has not been added to the + sections file + +2005-10-17 Thomas Vander Stichele + + * m4/gst-glib2.m4: + * m4/Makefile.am: + * m4/gst-check.m4: + add macro for easy checks for GStreamer libs + +2005-10-16 Thomas Vander Stichele + + * m4/gst-glib2.m4: + update, warn in error cases + +2005-10-16 Thomas Vander Stichele + + * m4/gst-error.m4: + add GST_SET_DEFAULT_LEVEL + +2005-10-16 Thomas Vander Stichele + + * m4/Makefile.am: + * m4/gst-gettext.m4: + remove the AM_GNU_GETTEXT* calls, they need to be in configure.ac + * m4/gst-glib2.m4: + clean up and re-use in core soon + * m4/gst-plugindir.m4: + macro to set up PLUGINDIR and plugindir define/var + +2005-10-15 Thomas Vander Stichele + + * m4/Makefile.am: + * m4/gst-gettext.m4: + add macro for setting up gettext + +2005-10-15 Thomas Vander Stichele + + * m4/gst-args.m4: + add some .m4's for argument checking that can be shared among modules + +2005-10-15 Thomas Vander Stichele + + * m4/as-libtool.m4: + set _LT_LDFLAGS + * m4/gst-libxml2.m4: + document + +2005-10-15 Thomas Vander Stichele + + * m4/gst-arch.m4: + indent a little + add AC_REQUIRE + * m4/gst-error.m4: + clean up + +2005-10-12 Thomas Vander Stichele + + * gst-autogen.sh: + update version detection expression to catch stuff like + Libtool (libtool15) 1.5.0 + +2005-10-11 Thomas Vander Stichele + + * gst.supp: + commit 6 new suppressions related to g_module_open; can these + really not be folded into one ? + +2005-10-11 Edward Hervey + + * gst.supp: + made the suppression more generic + Added pthread memleak suppresions + Added nss_parse_* memleak suppresion (used by g_option_context_parse) + +2005-10-11 Thomas Vander Stichele + + * check.mak: + be more strict, more leak resolution + * gst.supp: + clean up the g_type_init suppressions + +2005-10-07 Thomas Vander Stichele + + * m4/Makefile.am: + * m4/gst-valgrind.m4: + put the valgrind detection in an .m4 + +2005-09-29 Thomas Vander Stichele + + * check.mak: + add some more targets, like "help", but also more intensive tests + +2005-09-23 Thomas Vander Stichele + + * gtk-doc.mak: + make certain doc warnings fatal so people maintain docs again + +2005-09-23 Thomas Vander Stichele + + * Makefile.am: + * gtk-doc-plugins.mak: + * scangobj-merge.py: + merge additions from the .signals.new and .args.new file in + the original ones, only updating if necessary + +2005-09-23 Thomas Vander Stichele + + * gst-xmlinspect.py: + * gstdoc-scangobj: + * gtk-doc-plugins.mak: + fix properly for new API; make update in plugins dir now works + +2005-09-20 Thomas Vander Stichele + + * gst-xmlinspect.py: + * gstdoc-scangobj: + some fixes for new API + * gtk-doc-plugins.mak: + set environment properly + +2005-09-17 David Schleef + + * gtk-doc-plugins.mak: Use new environment variables. + +2005-09-16 Michael Smith + + * gstdoc-scangobj: + Make the scanobj code reflect registry/plugin API changes + +2005-09-15 Thomas Vander Stichele + + * gtk-doc-plugins.mak: + split out scanobj step (which will be run by doc maintainer) + from scan step (which will be run on every build) + clean up some of the commands for make distcheck + +2005-09-15 Thomas Vander Stichele + + * gtk-doc-plugins.mak: + * mangle-tmpl.py: + first stab at reorganizing the plugins build so we can maintain + element docs + +2005-09-14 David Schleef + + * as-libtool.mak: Remove + * m4/as-libtool.m4: The libtool bug that this worked around has + been fixed. + * m4/as-version.m4: Don't define GST_RELEASE, since it causes + config.h to be regenerated needlessly, and we don't use it. + +2005-09-14 Thomas Vander Stichele + + * gtk-doc-plugins.mak: + error out on inspect failure + +2005-09-14 Michael Smith + + * glib-gen.mak: + Don't call glib-mkenums with arguments that confuse/break MinGW, + fixes 316155. + +2005-09-03 Thomas Vander Stichele + + * gtk-doc-plugins.mak: + * gtk-doc.mak: + * m4/gst-doc.m4: + separate out gtk-doc and docbook stuff + have two separate --enable configure flags + +2005-08-26 Thomas Vander Stichele + + * check.mak: + add a .gdb target; rebuild registry for each target, otherwise + a code rebuild always triggers a reg rebuild, and it's just too + annoying + * gstdoc-scangobj: + +2005-08-21 Thomas Vander Stichele + + * check.mak: + separate out REGISTRY_ENVIRONMENT; we want to use that from + our valgrind runs, but we also want TESTS_ENVIRONMENT to contain + everything that the first test, gst-register, needs + +2005-08-21 Thomas Vander Stichele + + * check.mak: + parse output of valgrind and check for definitely lost, and error + out; somehow I was led to believe valgrind returns non-zero for + leaks, but I can't make it do that, so let's parse + +2005-08-20 Thomas Vander Stichele + + * check.mak: + for some weird reason valgrind does not report actual memleaks + if GST_PLUGIN_PATH is set to anything but the core gstreamer dir + while valgrind is running. Since the registry is going to go + anyway, I don't want to waste any more time on this; I just run + valgrind without GST_PLUGIN_PATH set. Since the registry loading + doesn't check if GST_PLUGIN_PATH got changed as a reason to rebuild + the registry, that's actually fine. + +2005-08-15 Thomas Vander Stichele + + * mangle-tmpl.py: + keep original Long_Description; only insert an include if it's + not already the first line in there + * plugins.xsl: + output more information for plugins, including an origin hyperlink + +2005-08-15 Thomas Vander Stichele + + * gst-xmlinspect.py: + a first stab at inspecting plugins and outputting an xml description + * gtk-doc-plugins.mak: + a gtk-doc using snippet for plugins documentation + * plugins.xsl: + a stylesheet to convert gst-xmlinspect.py output to docbook output + for inclusion in the gtk-doc stuff + +2005-07-20 Ronald S. Bultje + + * m4/gst-doc.m4: + s/pdf/eps/ in test for whether we output EPS images (#309379). + +2005-07-18 Andy Wingo + + * m4/as-libtool-tags.m4: Ooh, backported from libtool 1.6. Much + better. Thanks, Paolo Bonzini! + + * m4/Makefile.am (EXTRA_DIST): + * m4/as-libtool-tags.m4: New file, tries to disable some CXX and + fortran checks. + +2005-07-08 Thomas Vander Stichele + + * m4/gst-error.m4: + add macro to set ERROR_CFLAGS + +2005-06-30 Jan Schmidt + + * gst-autogen.sh: + Remove the old autoregen.sh if it exists before recreating it, + to prevent confusing any shell process that might be reading it + currently. + +2005-06-29 Thomas Vander Stichele + + * m4/gtk-doc.m4: + added + +2005-06-03 Stefan Kost + + * gst-autogen.sh: create autoregen.sh *before* shifting the options + +2005-05-17 Thomas Vander Stichele + + * gst-autogen.sh: only update autoregen.sh on actual runs + +2005-03-11 Thomas Vander Stichele + + * m4/check.m4: m4 from the check unit test suite + +2004-12-14 David Schleef + + * m4/gst-arch.m4: remove MMX stuff, since it doesn't work and + isn't needed anywhere + +2004-12-08 Thomas Vander Stichele + + * gst-autogen.sh: + allow failure command to be run so we can clean upfrom autopoint + +2004-09-03 Zeeshan Ali Khattak + * m4/gst-feature.m4: Trying to correct the GST_CHECK_CONFIGPROG macro + +2004-07-21 Benjamin Otte + + * m4/.cvsignore: exciting updates for libtool m4 files + +2004-07-12 David Schleef + + * m4/as-objc.m4: Add a macro to test for objective C + +2004-06-12 Thomas Vander Stichele + + * m4/gst-feature.m4: + not all of them support --plugin-libs, so redirect stderr + +2004-06-12 Thomas Vander Stichele + + * m4/as-scrub-include.m4: + sync with upstream to 0.1.4. Fixes #132440 + +2004-06-07 Benjamin Otte + + * m4/gst-feature.m4: + write a big marker into configure output when checking next plugin + to allow easier parsing of why plugins are(n't) built. + +2004-06-01 Thomas Vander Stichele + + * m4/as-compiler-flag.m4: + * m4/as-compiler.m4: + * m4/as-libtool.m4: + * m4/as-version.m4: + sync with upstream, change sticky options to -ko + +2004-05-24 Thomas Vander Stichele + + * m4/as-scrub-include.m4: synced with upstream + +2004-05-03 Thomas Vander Stichele + + * po.mak: + snippet for updating .po files + +2004-03-18 Thomas Vander Stichele + + * Makefile.am: + * m4/Makefile.am: + integrate these with the dist + +2004-03-17 Thomas Vander Stichele + + * release.mak: add a release target + +2004-03-09 Thomas Vander Stichele + + patch by: Stephane Loeuillet + + * m4/ax_create_stdint_h.m4: + use head -n instead of head - (#136500) + +2004-03-05 Thomas Vander Stichele + + * m4/gst-doc.m4: don't build PS without dvips binary + +2004-02-22 Julio M. Merino Vidal + + reviewed by: Benjamin Otte + + * m4/as-docbook.m4: + don't use == operator with test(1) (fixes #135115) + +2004-02-16 Thomas Vander Stichele + + * common/m4/gst-arch.m4: x86_64 is x86 too (clue from Fedora 2 test) + +2004-02-13 Thomas Vander Stichele + + * m4/gst-feature.m4: + remove AM_CONDITIONAL for the subsystem since automake 1.6.x + requires that call be in configure.ac + +2004-02-13 Thomas Vander Stichele + + * m4/gst-libxml2.m4: + take required version as argument, and default to 2.4.9 if not + specified + +2004-02-12 Thomas Vander Stichele + + * m4/gst-feature.m4: + rename and fix up GST_CHECK_DISABLE_SUBSYSTEM + +2004-02-11 Thomas Vander Stichele + + * common/m4/as-ac-expand.m4: + * common/m4/as-auto-alt.m4: + * common/m4/as-compiler-flag.m4: + * common/m4/as-compiler.m4: + * common/m4/as-docbook.m4: + * common/m4/as-libtool.m4: + * common/m4/as-scrub-include.m4: + * common/m4/as-version.m4: + * common/m4/glib-gettext.m4: + * common/m4/gst-arch.m4: + * common/m4/gst-debuginfo.m4: + * common/m4/gst-doc.m4: + * common/m4/gst-feature.m4: + * common/m4/gst-function.m4: + * common/m4/gst-glib2.m4: + * common/m4/gst-gstreamer.m4: + * common/m4/gst-libxml2.m4: + * common/m4/gst-makecontext.m4: + * common/m4/gst-mcsc.m4: + * common/m4/pkg.m4: + fix underquoted macros as reported by automake 1.8.x (#133800) + +2004-02-11 Johan Dahlin + + * gst-autogen.sh: Use A-Z instead of A-z in sed expression to + avoid a warning + +2004-02-05 Thomas Vander Stichele + + * m4/gst-doc.m4: + we use --output-format=xml and --ingnore-files options to + gtkdoc-mkdb, which got added between 0.9 and 1.0 + +2004-02-04 Thomas Vander Stichele + + * m4/as-libtool.m4: remove AM_PROG_LIBTOOL so it can move back + to configure.ac to shut up libtoolize + +2004-02-03 Thomas Vander Stichele + + * glib-gen.mak: added; used to generate enums and marshal code + +2004-01-13 Thomas Vander Stichele + + * gettext.patch: added; used by autogen.sh to make sure + GETTEXT_PACKAGE is understood from po/Makefile.in.in -> po/Makefile.in + diff --git a/common/MAINTAINERS b/common/MAINTAINERS new file mode 100644 index 0000000..558ddff --- /dev/null +++ b/common/MAINTAINERS @@ -0,0 +1,12 @@ +GStreamer is currently maintained by the consensus of a number +of people, including, but not limited to: + + Jan Schmidt + Wim Taymans + David Schleef + Tim-Philipp Müller + Sebastian Dröge + +Maintainer-related issues should be addressed to: + + gstreamer-devel@lists.freedesktop.org diff --git a/common/Makefile.am b/common/Makefile.am new file mode 100644 index 0000000..25966fc --- /dev/null +++ b/common/Makefile.am @@ -0,0 +1,22 @@ +SUBDIRS = m4 + +EXTRA_DIST = \ + ChangeLog \ + gettext.patch \ + glib-gen.mak gtk-doc.mak upload-doc.mak \ + cruft.mak release.mak win32.mak po.mak \ + parallel-subdirs.mak \ + gst-autogen.sh \ + check-exports \ + c-to-xml.py mangle-tmpl.py scangobj-merge.py \ + gtk-doc-plugins.mak \ + plugins.xsl gstdoc-scangobj \ + gst.supp check.mak \ + coverage/lcov.mak \ + coverage/coverage-report.pl \ + coverage/coverage-report.xsl \ + coverage/coverage-report-entry.pl \ + download-translations \ + extract-release-date-from-doap-file \ + gst-indent \ + orc.mak diff --git a/common/README b/common/README new file mode 100644 index 0000000..83a1b88 --- /dev/null +++ b/common/README @@ -0,0 +1,255 @@ +GStreamer @SERIES_VERSION@ + +WHAT IT IS +---------- + +This is GStreamer, a framework for streaming media. + +WHERE TO START +-------------- + +We have a website at +http://gstreamer.freedesktop.org/ + +You should start by going through our FAQ at +http://gstreamer.freedesktop.org/data/doc/gstreamer/head/faq/html/ + +There is more documentation; go to +http://gstreamer.freedesktop.org/documentation + +You can subscribe to our mailing lists; see the website for details. + +We track bugs in GNOME's bugzilla; see the website for details. + +You can join us on IRC - #gstreamer on irc.freenode.org + +GStreamer 1.0 series +-------------------- + +Starring + + GSTREAMER + +The core around which all other modules revolve. Base functionality and +libraries, some essential elements, documentation, and testing. + + BASE + +A well-groomed and well-maintained collection of GStreamer plug-ins and +elements, spanning the range of possible types of elements one would want +to write for GStreamer. + +And introducing, for the first time ever, on the development screen ... + + THE GOOD + + --- "Such ingratitude. After all the times I've saved your life." + +A collection of plug-ins you'd want to have right next to you on the +battlefield. Shooting sharp and making no mistakes, these plug-ins have it +all: good looks, good code, and good licensing. Documented and dressed up +in tests. If you're looking for a role model to base your own plug-in on, +here it is. + +If you find a plot hole or a badly lip-synced line of code in them, +let us know - it is a matter of honour for us to ensure Blondie doesn't look +like he's been walking 100 miles through the desert without water. + + THE UGLY + + --- "When you have to shoot, shoot. Don't talk." + +There are times when the world needs a color between black and white. +Quality code to match the good's, but two-timing, backstabbing and ready to +sell your freedom down the river. These plug-ins might have a patent noose +around their neck, or a lock-up license, or any other problem that makes you +think twice about shipping them. + +We don't call them ugly because we like them less. Does a mother love her +son less because he's not as pretty as the other ones ? No - she commends +him on his great personality. These plug-ins are the life of the party. +And we'll still step in and set them straight if you report any unacceptable +behaviour - because there are two kinds of people in the world, my friend: +those with a rope around their neck and the people who do the cutting. + + THE BAD + + --- "That an accusation?" + +No perfectly groomed moustache or any amount of fine clothing is going to +cover up the truth - these plug-ins are Bad with a capital B. +They look fine on the outside, and might even appear to get the job done, but +at the end of the day they're a black sheep. Without a golden-haired angel +to watch over them, they'll probably land in an unmarked grave at the final +showdown. + +Don't bug us about their quality - exercise your Free Software rights, +patch up the offender and send us the patch on the fastest steed you can +steal from the Confederates. Because you see, in this world, there's two +kinds of people, my friend: those with loaded guns and those who dig. +You dig. + +The Lowdown +----------- + + --- "I've never seen so many plug-ins wasted so badly." + +GStreamer Plug-ins has grown so big that it's hard to separate the wheat from +the chaff. Also, distributors have brought up issues about the legal status +of some of the plug-ins we ship. To remedy this, we've divided the previous +set of available plug-ins into four modules: + +- gst-plugins-base: a small and fixed set of plug-ins, covering a wide range + of possible types of elements; these are continuously kept up-to-date + with any core changes during the development series. + + - We believe distributors can safely ship these plug-ins. + - People writing elements should base their code on these elements. + - These elements come with examples, documentation, and regression tests. + +- gst-plugins-good: a set of plug-ins that we consider to have good quality + code, correct functionality, our preferred license (LGPL for the plug-in + code, LGPL or LGPL-compatible for the supporting library). + + - We believe distributors can safely ship these plug-ins. + - People writing elements should base their code on these elements. + +- gst-plugins-ugly: a set of plug-ins that have good quality and correct + functionality, but distributing them might pose problems. The license + on either the plug-ins or the supporting libraries might not be how we'd + like. The code might be widely known to present patent problems. + + - Distributors should check if they want/can ship these plug-ins. + - People writing elements should base their code on these elements. + +- gst-plugins-bad: a set of plug-ins that aren't up to par compared to the + rest. They might be close to being good quality, but they're missing + something - be it a good code review, some documentation, a set of tests, + a real live maintainer, or some actual wide use. + If the blanks are filled in they might be upgraded to become part of + either gst-plugins-good or gst-plugins-ugly, depending on the other factors. + + - If the plug-ins break, you can't complain - instead, you can fix the + problem and send us a patch, or bribe someone into fixing them for you. + - New contributors can start here for things to work on. + +PLATFORMS +--------- + +- Linux is of course fully supported +- FreeBSD is reported to work; other BSDs should work too +- Solaris is reported to work; a specific sunaudiosink plugin has been written +- MacOSX works, binary 1.x packages can be built using the cerbero build tool +- Windows works; binary 1.x packages can be built using the cerbero build tool + - MSys/MinGW builds + - Microsoft Visual Studio builds are not yet available or supported +- Android works, binary 1.x packages can be built using the cerbero build tool +- iOS works + +INSTALLING FROM PACKAGES +------------------------ + +You should always prefer installing from packages first. GStreamer is +well-maintained for a number of distributions, including Fedora, Debian, +Ubuntu, Mandrake, Gentoo, ... + +Only in cases where you: +- want to hack on GStreamer +- want to verify that a bug has been fixed +- do not have a sane distribution +should you choose to build from source tarballs or git. + +Find more information about the various packages at +http://gstreamer.freedesktop.org/download/ + +COMPILING FROM SOURCE TARBALLS +------------------------------ + +- again, make sure that you really need to install from source ! + If GStreamer is one of your first projects ever that you build from source, + consider taking on an easier project. + +- check output of ./configure --help to see if any options apply to you +- run + ./configure + make + + to build GStreamer. +- if you want to install it (not required, but what you usually want to do), run + make install + +- try out a simple test: + gst-launch -v fakesrc num_buffers=5 ! fakesink + (If you didn't install GStreamer, prefix gst-launch with tools/) + + If it outputs a bunch of messages from fakesrc and fakesink, everything is + ok. + + If it did not work, keep in mind that you might need to adjust the + PATH and/or LD_LIBRARY_PATH environment variables to make the system + find GStreamer in the prefix where you installed (by default that is /usr/local). + +- After this, you're ready to install gst-plugins, which will provide the + functionality you're probably looking for by now, so go on and read + that README. + +COMPILING FROM GIT +------------------ + +When building from git sources, you will need to run autogen.sh to generate +the build system files. + +You will need a set of additional tools typical for building from git, +including: +- autoconf +- automake +- libtool + +autogen.sh will check for recent enough versions and complain if you don't have +them. You can also specify specific versions of automake and autoconf with +--with-automake and --with-autoconf + +Check autogen.sh options by running autogen.sh --help + +autogen.sh can pass on arguments to configure + +When you have done this once, you can use autoregen.sh to re-autogen with +the last passed options as a handy shortcut. Use it. + +After the autogen.sh stage, you can follow the directions listed in +"COMPILING FROM SOURCE" + +You can also run your whole git stack uninstalled in your home directory, +so that you can quickly test changes without affecting your system setup or +interfering with GStreamer installed from packages. Many GStreamer developers +use an uninstalled setup for their work. + +There is a 'create-uninstalled-setup.sh' script in + + http://cgit.freedesktop.org/gstreamer/gstreamer/tree/scripts/ + +to easily create an uninstalled setup from scratch. + + +PLUG-IN DEPENDENCIES AND LICENSES +--------------------------------- + +GStreamer is developed under the terms of the LGPL (see LICENSE file for +details). Some of our plug-ins however rely on libraries which are available +under other licenses. This means that if you are distributing an application +which has a non-GPL compatible license (for instance a closed-source +application) with GStreamer, you have to make sure not to distribute GPL-linked +plug-ins. + +When using GPL-linked plug-ins, GStreamer is for all practical reasons +under the GPL itself. + +HISTORY +------- + +The fundamental design comes from the video pipeline at Oregon Graduate +Institute, as well as some ideas from DirectMedia. It's based on plug-ins that +will provide the various codec and other functionality. The interface +hopefully is generic enough for various companies (ahem, Apple) to release +binary codecs for Linux, until such time as they get a clue and release the +source. diff --git a/common/README.static-linking b/common/README.static-linking new file mode 100644 index 0000000..6d8299b --- /dev/null +++ b/common/README.static-linking @@ -0,0 +1,174 @@ +================================= + GStreamer Static Linking README +================================= + +DRAFT, April 2013 + + + I. INTRODUCTION + +It is possible to link GStreamer libraries, plugins and applications +statically, both in case of free/libre/open-source software applications +and proprietary applications. On some platforms static linking may even +be required. + +However, distributing statically linked binaries using GStreamer usually +requires additional effort to stay compliant with the GNU LGPL v2.1 license. + +The purpose of this document is to draw attention to this fact, and to +summarise in layman's terms what we believe is required from anyone +distributing statically linked GStreamer binaries. Most of this also +applies to dynamically linked GStreamer binaries. + + + II. DISCLAIMER + +This document is not legal advice, nor is it comprehensive. It may use +words in ways that do not match the definition or use in the license +text. It may even be outright wrong. Read the license text for all the +details, it is the only legally binding document in this respect. + +This document is primarily concerned with the implications for the +distribution of binaries based on LGPL-licensed software as imposed by +the LGPL license, but there may be other restrictions to the distribution +of such binaries, such as terms and conditions of distribution channels +(e.g. "app stores"). + + + III. THE SPIRIT OF THE LGPL LICENSE + +The GNU LGPL v2.1 license allows use of such-licensed software by +proprietary applications, but still aims to ensure that at least the +LGPL-licensed software parts remain free under all circumstances. This +means any changes to LGPL-licensed source code must be documented and +be made available on request to those who received binaries of the +software. It also means that it must be possible to make changes to the +LGPL-licensed software parts and make the application use those, as far +as that is possible. And that recipients of an application using +LGPL-licensed software are made aware of their rights according to the +LGPL license. + +In an environment where GStreamer libraries and plugins are used as +dynamically-loaded shared objects (DLL/.so/.dyn files), this is usually +not a big problem, because it is fairly easy to compile a modified version +of the GStreamer libraries or LGPL plugins, and the application will/should +just pick up and use the modified version automatically. All that is needed +is for the original, LGPL-licensed source code and source code modifications +to be made available, and for a way to build the libraries or plugins for +the platform required (usually that will be using the build system scripts +that come with GStreamer, and using the typical build environment on the +system in question, but where that is not the case the needed build scripts +and/or tools would need to be provided as well). + + + IV. THINGS YOU NEED TO DO + + * You must tell users of your application that you are using LGPL-licensed + software, which LGPL-licensed software exactly, and you must provide them + with a copy of the license so they know their rights under the LGPL. + + * You must provide (on request) all the source code and all the changes + or additions you have made to the LGPL-licensed software you are using. + + For GStreamer code we would recommend that the changes be provided either + in form of a branch in a git repository, or as a set of "git format-patch"- + style patches against a GStreamer release or a snapshot of a GStreamer git + repository. The patches should ideally say what was changed and why it + was changed, and there should ideally be separate patches for independent + changes. + + * You must provide a way for users of your application to make changes to + the LGPL-licensed parts of the code, and re-create a full application + binary with the changes (using the standard toolchain and tools of the + target platform; if you are using a custom toolchain or custom tools + you must provide these and document how to use them to create a new + application binary). + + Note that this of course does not mean that the user is allowed to + re-distribute the changed application. Nor does it mean that you have + to provide your proprietary source code - it is sufficient to provide a + ready-made compiled object file that can be relinked into an application + binary with the re-compiled LGPL components. + + + V. THINGS TO LOOK OUT FOR + +While most GStreamer plugins and the libraries they depend on are licensed +under the LGPL or even more permissive licenses, that is not the case for +all plugins and libraries used, esp. those in the gst-plugins-ugly or +some of those in the gst-plugins-bad set of plugins. + +When statically linking proprietary code, care must be taken not to +statically link plugins or libraries that are licensed under less permissive +terms than the LGPL, such as e.g. GPL-licensed libraries. + + + VI. SPECIAL CONSIDERATIONS FOR SPECIFIC USE-CASES + + + 1. Proprietary GStreamer/GLib-based Application On iOS + +Let's assume an individual or a company wants to distribute a proprietary +iOS application that is built on top of GStreamer and GLib through +Apple's App Store. At the time of writing the Apple iPhone developer +agreement didn’t allow the bundling of shared libraries, so distributing +a proprietary iOS application with shared libraries is only possible using +distribution mechanisms outside of the App Store and/or only to jailbroken +devices, a prospect that may not appeal to our individual or company. So the +only alternative then is to link everything statically, which means the +obligations mentioned above come into play. + + + 2. Example: Jabber on iOS + +Tandberg (now Cisco) created a Jabber application for iOS, based on GStreamer. +On request they provided an LGPL compliance bundle in form of a zip file, with +roughly the following contents: + +buildapp.sh +readme.txt +Jabber/Jabber-Info.plist +Jabber/libip.a [236MB binary with proprietary code] +Jabber/main.mm +Jabber/xcconfig/Application.xcconfig +Jabber/xcconfig/Debug.xcconfig +Jabber/xcconfig/Release.xcconfig +Jabber/xcconfig/Shared.xcconfig +Jabber/Resources/*.lproj/Localizable.strings +Jabber/Resources/{Images,Audio,Sounds,IB,Message Styles,Emoticons,Fonts}/* +Jabber/Resources/* +Jabber.xcodeproj/project.pbxproj +Jabber.xcodeproj/project.xcworkspace/contents.xcworkspacedata +opensource/build/config.site +opensource/build/m4/movi.m4 +opensource/build/scripts/clean-deps.sh +opensource/build/scripts/fixup-makefile.sh +opensource/build/scripts/MoviMaker.py +opensource/build.sh +opensource/env.sh +opensource/Makefile +opensource/external/glib/* +opensource/external/gstreamer/{gstreamer,gst-plugins-*}/* +opensource/external/openssl/* +opensource/external/proxy-libintl/* +opensource/toolchain/darwin-x86/bin/{misc autotoools,m4,glib-mkenums,glib-genmarshal,libtool,pkg-config,etc.} +opensource/toolchain/darwin-x86/share/{aclocal,aclocal-1.11,autoconf,automake-1.11,libtool}/* +opensource/toolchain/darwin-x86/share/Config.pm +opensource/toolchain/darwin-x86/share/Config.pm.movi.in +patches/glib/glib.patch +patches/gst-plugins-bad/gst-plugins-bad.patch +patches/gst-plugins-base/gst-plugins-base.patch +patches/gst-plugins-good/gst-plugins-good.patch +patches/gstreamer/gstreamer.patch +patches/openssl/openssl.patch + +readme.txt starts with "This Readme file describes how to build the Cisco +Jabber for iPad application. You need to install Xcode, but the final package +is built by running buildapp.sh." and describes how to build project, +prerequisites, the procedure in detail, and a "How to Include Provisioning +Profile Manually / Alternate Code Signing Instructions" section. + + + 3. Random Links Which May Be Of Interest + +[0] http://multinc.com/2009/08/24/compatibility-between-the-iphone-app-store-and-the-lgpl/ diff --git a/common/autogen.sh.in b/common/autogen.sh.in new file mode 100755 index 0000000..270639f --- /dev/null +++ b/common/autogen.sh.in @@ -0,0 +1,118 @@ +test -n "$srcdir" || srcdir=`dirname "$0"` +test -n "$srcdir" || srcdir=. + +olddir=`pwd` +cd "$srcdir" + +DIE=0 +package=@PACKAGE@ +srcfile=@SRCFILE@ + +# Make sure we have common +if test ! -f common/gst-autogen.sh; +then + echo "+ Setting up common submodule" + git submodule init +fi +git submodule update + +# source helper functions +if test ! -f common/gst-autogen.sh; +then + echo There is something wrong with your source tree. + echo You are missing common/gst-autogen.sh + exit 1 +fi +. common/gst-autogen.sh + +# install pre-commit hook for doing clean commits +if test ! \( -x .git/hooks/pre-commit -a -L .git/hooks/pre-commit \); +then + rm -f .git/hooks/pre-commit + ln -s ../../common/hooks/pre-commit.hook .git/hooks/pre-commit +fi + +# GNU gettext automake support doesn't get along with git. +# https://bugzilla.gnome.org/show_bug.cgi?id=661128 +if test -d po ; then + touch -t 200001010000 po/@PACKAGE@-@API_VERSION@.pot +fi + +CONFIGURE_DEF_OPT='--enable-maintainer-mode --enable-gtk-doc' + +if test "x$package" = "xgstreamer"; then + CONFIGURE_DEF_OPT="$CONFIGURE_DEF_OPT --enable-docbook --enable-failing-tests --enable-poisoning" +fi + +autogen_options $@ + +printf "+ check for build tools" +if test ! -z "$NOCHECK"; then echo ": skipped version checks"; else echo; fi +version_check "autoconf" "$AUTOCONF autoconf autoconf270 autoconf269 autoconf268 " \ + "ftp://ftp.gnu.org/pub/gnu/autoconf/" 2 68 || DIE=1 +version_check "automake" "$AUTOMAKE automake automake-1.11" \ + "ftp://ftp.gnu.org/pub/gnu/automake/" 1 11 || DIE=1 +version_check "autopoint" "autopoint" \ + "ftp://ftp.gnu.org/pub/gnu/gettext/" 0 17 || DIE=1 +version_check "libtoolize" "$LIBTOOLIZE libtoolize glibtoolize" \ + "ftp://ftp.gnu.org/pub/gnu/libtool/" 2 2 6 || DIE=1 +version_check "pkg-config" "" \ + "http://www.freedesktop.org/software/pkgconfig" 0 8 0 || DIE=1 + +die_check $DIE + +aclocal_check || DIE=1 +autoheader_check || DIE=1 + +die_check $DIE + +# if no arguments specified then this will be printed +if test -z "$*" && test -z "$NOCONFIGURE"; then + echo "+ checking for autogen.sh options" + echo " This autogen script will automatically run ./configure as:" + echo " ./configure $CONFIGURE_DEF_OPT" + echo " To pass any additional options, please specify them on the $0" + echo " command line." +fi + +toplevel_check $srcfile + +# autopoint +if test -d po ; then + tool_run "$autopoint" "--force" +fi + +# aclocal +if test -f acinclude.m4; then rm acinclude.m4; fi + +tool_run "$libtoolize" "--copy --force" +tool_run "$aclocal" "-I m4 -I common/m4 $ACLOCAL_FLAGS" +tool_run "$autoheader" + +# touch the stamp-h.in build stamp so we don't re-run autoheader in maintainer mode +echo timestamp > stamp-h.in 2> /dev/null + +tool_run "$autoconf" +debug "automake: $automake" +tool_run "$automake" "--add-missing --copy" + +test -n "$NOCONFIGURE" && { + echo "+ skipping configure stage for package $package, as requested." + echo "+ autogen.sh done." + exit 0 +} + +cd "$olddir" + +echo "+ running configure ... " +test ! -z "$CONFIGURE_DEF_OPT" && echo " default flags: $CONFIGURE_DEF_OPT" +test ! -z "$CONFIGURE_EXT_OPT" && echo " external flags: $CONFIGURE_EXT_OPT" +echo + +echo "$srcdir/configure" $CONFIGURE_DEF_OPT $CONFIGURE_EXT_OPT +"$srcdir/configure" $CONFIGURE_DEF_OPT $CONFIGURE_EXT_OPT || { + echo " configure failed" + exit 1 +} + +echo "Now type 'make' to compile $package." diff --git a/common/c-to-xml.py b/common/c-to-xml.py new file mode 100644 index 0000000..7a7a35b --- /dev/null +++ b/common/c-to-xml.py @@ -0,0 +1,36 @@ +# -*- Mode: Python -*- +# vi:si:et:sw=4:sts=4:ts=4 + +""" +Convert a C program to valid XML to be included in docbook +""" + +from __future__ import print_function, unicode_literals + +import sys +import os +from xml.sax import saxutils + +def main(): + if len(sys.argv) == 1: + sys.stderr.write("Please specify a source file to convert") + sys.exit(1) + source = sys.argv[1] + + if not os.path.exists(source): + sys.stderr.write("%s does not exist.\n" % source) + sys.exit(1) + + content = open(source, "r").read() + + # print header + print ('') + print ('') + print () + print ('') + + # print content + print (saxutils.escape(content)) + print ('') + +main() diff --git a/common/check-exports b/common/check-exports new file mode 100755 index 0000000..ee01ff7 --- /dev/null +++ b/common/check-exports @@ -0,0 +1,54 @@ +#!/bin/sh +# check-exports +# +# quick'n'dirty script that retrieves the list of exported symbols of a given +# library using 'nm', and compares that against the list of symbols-to-export +# of our win32/common/libfoo.def files. + +if [ $# -ne 2 ]; then + echo "Usage: $0 library.def library.so" + exit 1 +fi + +def_path="$1" +def_name="$(basename $def_path)" +lib_path="$2" + +lib_result="`mktemp /tmp/defname.XXXXXX`" + +LC_ALL=C +export LC_ALL + +# On Solaris, add -p to get the correct output format +NMARGS= +if nm -V 2>&1 |grep Solaris > /dev/null; then + NMARGS=-p +fi + +# _end is special cased because for some reason it is reported as an exported +# BSS symbol, unlike on linux where it's a local absolute symbol. +nm $NMARGS $lib_path | awk \ + '{ + if ($3 ~ /^[_]?(gst_|Gst|GST_).*/) + { + if ($2 ~ /^[BSDG]$/) + print "\t" $3 " DATA" + else if ($2 == "T") + print "\t" $3 + } + }' | sort | awk '{ if (NR == 1) print "EXPORTS"; print $0; }' \ + > $lib_result + +diffoutput=`diff -u $def_path $lib_result` +diffresult=$? + +rm $lib_result + +if test "$diffresult" -eq 0; then + exit 0; +else + echo -n "$diffoutput" >&2 + echo >&2 + exit 1; +fi + diff --git a/common/check.mak b/common/check.mak new file mode 100644 index 0000000..611546a --- /dev/null +++ b/common/check.mak @@ -0,0 +1,252 @@ +# keep target around, since it's referenced in the modules' Makefiles +clean-local-check: + @echo + +if HAVE_VALGRIND +# hangs spectacularly on some machines, so let's not do this by default yet +check-valgrind: + $(MAKE) valgrind +else +check-valgrind: + @true +endif + +LOOPS ?= 10 + +# run any given test by running make test.check +# if the test fails, run it again at at least debug level 2 +%.check: % + @$(TESTS_ENVIRONMENT) \ + CK_DEFAULT_TIMEOUT=20 \ + $* || \ + $(TESTS_ENVIRONMENT) \ + GST_DEBUG=$$GST_DEBUG,*:2 \ + CK_DEFAULT_TIMEOUT=20 \ + $* + +# just like 'check', but don't run it again if it fails (useful for debugging) +%.check-norepeat: % + @$(TESTS_ENVIRONMENT) \ + CK_DEFAULT_TIMEOUT=20 \ + $* + +# run any given test in a loop +%.torture: % + @for i in `seq 1 $(LOOPS)`; do \ + $(TESTS_ENVIRONMENT) \ + CK_DEFAULT_TIMEOUT=20 \ + $*; done + +# run any given test in an infinite loop +%.forever: % + @while true; do \ + $(TESTS_ENVIRONMENT) \ + CK_DEFAULT_TIMEOUT=20 \ + $* || break; done + +# valgrind any given test by running make test.valgrind +%.valgrind: % + @$(TESTS_ENVIRONMENT) \ + CK_DEFAULT_TIMEOUT=360 \ + G_SLICE=always-malloc \ + $(LIBTOOL) --mode=execute \ + $(VALGRIND_PATH) -q \ + $(foreach s,$(SUPPRESSIONS),--suppressions=$(s)) \ + --tool=memcheck --leak-check=full --trace-children=yes \ + --show-possibly-lost=no \ + --leak-resolution=high --num-callers=20 \ + ./$* 2>&1 | tee valgrind.log + @if grep "==" valgrind.log > /dev/null 2>&1; then \ + rm valgrind.log; \ + exit 1; \ + fi + @rm valgrind.log + +# valgrind any given test and generate suppressions for it +%.valgrind.gen-suppressions: % + @$(TESTS_ENVIRONMENT) \ + CK_DEFAULT_TIMEOUT=360 \ + G_SLICE=always-malloc \ + $(LIBTOOL) --mode=execute \ + $(VALGRIND_PATH) -q \ + $(foreach s,$(SUPPRESSIONS),--suppressions=$(s)) \ + --tool=memcheck --leak-check=full --trace-children=yes \ + --show-possibly-lost=no \ + --leak-resolution=high --num-callers=20 \ + --gen-suppressions=all \ + ./$* 2>&1 | tee suppressions.log + +# valgrind torture any given test +%.valgrind-torture: % + @for i in `seq 1 $(LOOPS)`; do \ + $(MAKE) $*.valgrind || \ + (echo "Failure after $$i runs"; exit 1) || \ + exit 1; \ + done + @banner="All $(LOOPS) loops passed"; \ + dashes=`echo "$$banner" | sed s/./=/g`; \ + echo $$dashes; echo $$banner; echo $$dashes + +# valgrind any given test until failure by running make test.valgrind-forever +%.valgrind-forever: % + @while $(MAKE) $*.valgrind; do \ + true; done + +# gdb any given test by running make test.gdb +%.gdb: % + @$(TESTS_ENVIRONMENT) \ + CK_FORK=no \ + $(LIBTOOL) --mode=execute \ + gdb $* + +%.lcov-reset: + $(MAKE) $*.lcov-run + $(MAKE) $*.lcov-report + +%.lcov: % + $(MAKE) $*.lcov-reset + +if GST_GCOV_ENABLED +%.lcov-clean: + $(MAKE) -C $(top_builddir) lcov-clean + +%.lcov-run: + $(MAKE) $*.lcov-clean + $(MAKE) $*.check + +%.lcov-report: + $(MAKE) -C $(top_builddir) lcov-report +else +%.lcov-run: + echo "Need to reconfigure with --enable-gcov" + +%.lcov-report: + echo "Need to reconfigure with --enable-gcov" +endif + +# torture tests +torture: $(TESTS) + -rm test-registry.* + @echo "Torturing tests ..." + @for i in `seq 1 $(LOOPS)`; do \ + $(MAKE) check || \ + (echo "Failure after $$i runs"; exit 1) || \ + exit 1; \ + done + @banner="All $(LOOPS) loops passed"; \ + dashes=`echo "$$banner" | sed s/./=/g`; \ + echo $$dashes; echo $$banner; echo $$dashes + +# forever tests +forever: $(TESTS) + -rm test-registry.* + @echo "Forever tests ..." + @while true; do \ + $(MAKE) check || \ + (echo "Failure"; exit 1) || \ + exit 1; \ + done + +# valgrind all tests +valgrind: $(TESTS) + @echo "Valgrinding tests ..." + @failed=0; \ + for t in $(filter-out $(VALGRIND_TESTS_DISABLE),$(TESTS)); do \ + $(MAKE) $$t.valgrind; \ + if test "$$?" -ne 0; then \ + echo "Valgrind error for test $$t"; \ + failed=`expr $$failed + 1`; \ + whicht="$$whicht $$t"; \ + fi; \ + done; \ + if test "$$failed" -ne 0; then \ + echo "$$failed tests had leaks or errors under valgrind:"; \ + echo "$$whicht"; \ + false; \ + fi + +# valgrind all tests until failure +valgrind-forever: $(TESTS) + -rm test-registry.* + @echo "Forever valgrinding tests ..." + @while true; do \ + $(MAKE) valgrind || \ + (echo "Failure"; exit 1) || \ + exit 1; \ + done + +# valgrind torture all tests +valgrind-torture: $(TESTS) + -rm test-registry.* + @echo "Torturing and valgrinding tests ..." + @for i in `seq 1 $(LOOPS)`; do \ + $(MAKE) valgrind || \ + (echo "Failure after $$i runs"; exit 1) || \ + exit 1; \ + done + @banner="All $(LOOPS) loops passed"; \ + dashes=`echo "$$banner" | sed s/./=/g`; \ + echo $$dashes; echo $$banner; echo $$dashes + +# valgrind all tests and generate suppressions +valgrind.gen-suppressions: $(TESTS) + @echo "Valgrinding tests ..." + @failed=0; \ + for t in $(filter-out $(VALGRIND_TESTS_DISABLE),$(TESTS)); do \ + $(MAKE) $$t.valgrind.gen-suppressions; \ + if test "$$?" -ne 0; then \ + echo "Valgrind error for test $$t"; \ + failed=`expr $$failed + 1`; \ + whicht="$$whicht $$t"; \ + fi; \ + done; \ + if test "$$failed" -ne 0; then \ + echo "$$failed tests had leaks or errors under valgrind:"; \ + echo "$$whicht"; \ + false; \ + fi + +# inspect every plugin feature +GST_INSPECT = $(GST_TOOLS_DIR)/gst-inspect-$(GST_API_VERSION) +inspect: + @echo "Inspecting features ..." + @for e in `$(TESTS_ENVIRONMENT) $(GST_INSPECT) | head -n -2 \ + | cut -d: -f2`; \ + do echo Inspecting $$e; \ + $(GST_INSPECT) $$e > /dev/null 2>&1; done + +help: + @echo + @echo "make check -- run all checks" + @echo "make torture -- run all checks $(LOOPS) times" + @echo "make (dir)/(test).check -- run the given check once, repeat with GST_DEBUG=*:2 if it fails" + @echo "make (dir)/(test).check-norepeat -- run the given check once, but don't run it again if it fails" + @echo "make (dir)/(test).forever -- run the given check forever" + @echo "make (dir)/(test).torture -- run the given check $(LOOPS) times" + @echo + @echo "make (dir)/(test).gdb -- start up gdb for the given test" + @echo + @echo "make valgrind -- valgrind all tests" + @echo "make valgrind-forever -- valgrind all tests forever" + @echo "make valgrind-torture -- valgrind all tests $(LOOPS) times" + @echo "make valgrind.gen-suppressions -- generate suppressions for all tests" + @echo " and save to suppressions.log" + @echo "make (dir)/(test).valgrind -- valgrind the given test" + @echo "make (dir)/(test).valgrind-forever -- valgrind the given test forever" + @echo "make (dir)/(test).valgrind-torture -- valgrind the given test $(LOOPS) times" + @echo "make (dir)/(test).valgrind.gen-suppressions -- generate suppressions" + @echo " and save to suppressions.log" + @echo "make inspect -- inspect all plugin features" + @echo + @echo + @echo "Additionally, you can use the GST_CHECKS environment variable to" + @echo "specify which test(s) should be run. This is useful if you are" + @echo "debugging a failure in one particular test, or want to reproduce" + @echo "a race condition in a single test." + @echo + @echo "Examples:" + @echo + @echo " GST_CHECKS=test_this,test_that make element/foobar.check" + @echo " GST_CHECKS=test_many_threads make element/foobar.forever" + @echo + diff --git a/common/coverage/coverage-report-entry.pl b/common/coverage/coverage-report-entry.pl new file mode 100644 index 0000000..d0036b3 --- /dev/null +++ b/common/coverage/coverage-report-entry.pl @@ -0,0 +1,69 @@ +#!/usr/bin/perl +# +# Copyright (C) 2006 Daniel Berrange +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + +print < + +Coverage report for $ARGV[0] + + + +

Coverage report for $ARGV[0]

+ +
+EOF
+
+
+while (<>) {
+    s/&/&/g;
+    s//>/g;
+
+    if (/^\s*function (\S+) called (\d+) returned \d+% blocks executed \d+%/) {
+	my $class = $2 > 0 ? "perfect" : "terrible";
+	$_ = "$_";
+    } elsif (/^\s*branch\s+\d+\s+taken\s+(\d+)%\s+.*$/) {
+	my $class = $1 > 0 ? "perfect" : "terrible";
+	$_ = "$_";
+    } elsif (/^\s*branch\s+\d+\s+never executed.*$/) {
+	my $class = "terrible";
+	$_ = "$_";
+    } elsif (/^\s*call\s+\d+\s+never executed.*$/) {
+	my $class = "terrible";
+	$_ = "$_";
+    } elsif (/^\s*call\s+\d+\s+returned\s+(\d+)%.*$/) {
+	my $class = $1 > 0 ? "perfect" : "terrible";
+	$_ = "$_";
+    }
+
+    print;
+}
+
+print <
+
+
+EOF
diff --git a/common/coverage/coverage-report.pl b/common/coverage/coverage-report.pl
new file mode 100644
index 0000000..18bd6f1
--- /dev/null
+++ b/common/coverage/coverage-report.pl
@@ -0,0 +1,125 @@
+#!/usr/bin/perl
+#
+# Copyright (C) 2006 Daniel Berrange
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# 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., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+use warnings;
+use strict;
+
+my %coverage = ( functions => {}, files => {} );
+
+my %filemap;
+
+my $type;
+my $name;
+
+my @functions;
+
+while (<>) {
+    if (/^Function '(.*)'\s*$/) {
+	$type = "function";
+	$name = $1;
+	$coverage{$type}->{$name} = {};
+	push @functions, $name;
+    } elsif (/^File '(.*?)'\s*$/) {
+	$type = "file";
+	$name = $1;
+	$coverage{$type}->{$name} = {};
+
+	foreach my $func (@functions) {
+	    $coverage{"function"}->{$func}->{file} = $name;
+	}
+	@functions = ();
+    } elsif (/^Lines executed:(.*)%\s*of\s*(\d+)\s*$/) {
+	$coverage{$type}->{$name}->{lines} = $2;
+	$coverage{$type}->{$name}->{linesCoverage} = $1;
+    } elsif (/^Branches executed:(.*)%\s*of\s*(\d+)\s*$/) {
+	$coverage{$type}->{$name}->{branches} = $2;
+	$coverage{$type}->{$name}->{branchesCoverage} = $1;
+    } elsif (/^Taken at least once:(.*)%\s*of\s*(\d+)\s*$/) {
+	$coverage{$type}->{$name}->{conds} = $2;
+	$coverage{$type}->{$name}->{condsCoverage} = $1;
+    } elsif (/^Calls executed:(.*)%\s*of\s*(\d+)\s*$/) {
+	$coverage{$type}->{$name}->{calls} = $2;
+	$coverage{$type}->{$name}->{callsCoverage} = $1;
+    } elsif (/^No branches$/) {
+	$coverage{$type}->{$name}->{branches} = 0;
+	$coverage{$type}->{$name}->{branchesCoverage} = "100.00";
+	$coverage{$type}->{$name}->{conds} = 0;
+	$coverage{$type}->{$name}->{condsCoverage} = "100.00";
+    } elsif (/^No calls$/) {
+	$coverage{$type}->{$name}->{calls} = 0;
+	$coverage{$type}->{$name}->{callsCoverage} = "100.00";
+    } elsif (/^\s*(.*):creating '(.*)'\s*$/) {
+	$filemap{$1} = $2;
+    } elsif (/^\s*$/) {
+	# nada
+    } else {
+	warn "Shit [$_]\n";
+    }
+}
+
+my %summary;
+foreach my $type ("function", "file") {
+    $summary{$type} = {};
+    foreach my $m ("lines", "branches", "conds", "calls") {
+	my $totalGot = 0;
+	my $totalMiss = 0;
+	my $count = 0;
+	foreach my $func (keys %{$coverage{function}}) {
+	    $count++;
+	    my $got = $coverage{function}->{$func}->{$m};
+	    $totalGot += $got;
+	    my $miss = $got * $coverage{function}->{$func}->{$m ."Coverage"} / 100;
+	    $totalMiss += $miss;
+	}
+	$summary{$type}->{$m} = sprintf("%d", $totalGot);
+	$summary{$type}->{$m . "Coverage"} = sprintf("%.2f", $totalMiss / $totalGot * 100);
+    }
+}
+
+
+
+print "\n";
+
+foreach my $type ("function", "file") {
+    printf "<%ss>\n", $type;
+    foreach my $name (sort { $a cmp $b } keys %{$coverage{$type}}) {
+	my $rec = $coverage{$type}->{$name};
+	printf "  \n", $name, ($type eq "file" ? $filemap{$name} : $filemap{$rec->{file}});
+	printf "    \n", $rec->{lines}, $rec->{linesCoverage};
+	if (exists $rec->{branches}) {
+	    printf "    \n", $rec->{branches}, $rec->{branchesCoverage};
+	}
+	if (exists $rec->{conds}) {
+	    printf "    \n", $rec->{conds}, $rec->{condsCoverage};
+	}
+	if (exists $rec->{calls}) {
+	    printf "    \n", $rec->{calls}, $rec->{callsCoverage};
+	}
+	print  "  \n";
+    }
+
+    printf "  \n";
+    printf "    \n", $summary{$type}->{lines}, $summary{$type}->{linesCoverage};
+    printf "    \n", $summary{$type}->{branches}, $summary{$type}->{branchesCoverage};
+    printf "    \n", $summary{$type}->{conds}, $summary{$type}->{condsCoverage};
+    printf "    \n", $summary{$type}->{calls}, $summary{$type}->{callsCoverage};
+    printf  "  \n";
+    printf "\n", $type;
+}
+
+print "\n";
diff --git a/common/coverage/coverage-report.xsl b/common/coverage/coverage-report.xsl
new file mode 100644
index 0000000..3fe124b
--- /dev/null
+++ b/common/coverage/coverage-report.xsl
@@ -0,0 +1,235 @@
+
+
+
+
+  
+
+  
+    
+      
+        Coverage report
+        
+      
+      
+        

Coverage report

+ + + +
+ + +

Function coverage

+ + + +
+ + + +

File coverage

+ + + +
+ + + + + + + + + + + + + + + + + + + + + odd + + + even + + + + + + + + + + + + + + odd + + + even + + + + + + +
NameLinesBranchesConditionsCalls
+
+ + + + + + + + + + + + + + Summary + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + perfect + + + excellant + + + good + + + poor + + + bad + + + terrible + + + + + % of + + +
diff --git a/common/coverage/lcov.mak b/common/coverage/lcov.mak new file mode 100644 index 0000000..b45728a --- /dev/null +++ b/common/coverage/lcov.mak @@ -0,0 +1,47 @@ +## .PHONY so it always rebuilds it +.PHONY: lcov-reset lcov lcov-run lcov-report lcov-upload lcov-clean + +# run lcov from scratch, always +lcov-reset: + $(MAKE) lcov-run + $(MAKE) lcov-report + +# run lcov from scratch if the dir is not there +lcov: + $(MAKE) lcov-reset + +if GST_GCOV_ENABLED +# reset lcov stats +lcov-clean: + @-rm -rf lcov + lcov --directory . --zerocounters + +# reset run coverage tests +lcov-run: + -$(MAKE) lcov-clean + -if test -d tests/check; then $(MAKE) -C tests/check inspect; fi + -$(MAKE) check + +# generate report based on current coverage data +lcov-report: + mkdir lcov + lcov --compat-libtool --directory . --capture --output-file lcov/lcov.info + lcov --list-full-path -l lcov/lcov.info | grep -v "`cd $(top_srcdir) && pwd`" | cut -d\| -f1 > lcov/remove + lcov --list-full-path -l lcov/lcov.info | grep "tests/check/" | cut -d\| -f1 >> lcov/remove + lcov --list-full-path -l lcov/lcov.info | grep "docs/plugins/" | cut -d\| -f1 >> lcov/remove + lcov -r lcov/lcov.info `cat lcov/remove` > lcov/lcov.cleaned.info + rm lcov/remove + mv lcov/lcov.cleaned.info lcov/lcov.info + genhtml -t "$(PACKAGE_STRING)" -o lcov --num-spaces 2 lcov/lcov.info + +lcov-upload: lcov + rsync -rvz -e ssh --delete lcov/* gstreamer.freedesktop.org:/srv/gstreamer.freedesktop.org/www/data/coverage/lcov/$(PACKAGE) + +else +lcov-run: + echo "Need to reconfigure with --enable-gcov" + +lcov-report: + echo "Need to reconfigure with --enable-gcov" +endif + diff --git a/common/cruft.mak b/common/cruft.mak new file mode 100644 index 0000000..53eec24 --- /dev/null +++ b/common/cruft.mak @@ -0,0 +1,56 @@ +# checks for left-over files in the (usually uninstalled) tree, ie. for +# stuff that best be deleted to avoid problems like having old plugin binaries +# lying around. +# +# set CRUFT_FILES and/or CRUFT_DIRS in your Makefile.am when you include this + +check-cruft: + @cruft_files=""; cruft_dirs=""; \ + for f in $(CRUFT_FILES); do \ + if test -e $$f; then \ + cruft_files="$$cruft_files $$f"; \ + fi \ + done; \ + for d in $(CRUFT_DIRS); do \ + if test -e $$d; then \ + cruft_dirs="$$cruft_dirs $$d"; \ + fi \ + done; \ + if test "x$$cruft_files$$cruft_dirs" != x; then \ + echo; \ + echo "**** CRUFT ALERT *****"; \ + echo; \ + echo "The following files and directories may not be needed any "; \ + echo "longer (usually because a plugin has been merged into "; \ + echo "another plugin, moved to a different module, or been "; \ + echo "renamed), and you probably want to clean them up if you "; \ + echo "don't have local changes: "; \ + echo; \ + for f in $$cruft_files; do echo "file $$f"; done; \ + echo; \ + for d in $$cruft_dirs; do echo "directory $$d"; done; \ + echo; \ + echo "'make clean-cruft' will remove these for you."; \ + echo; \ + fi + +clean-cruft-dirs: + @for d in $(CRUFT_DIRS); do \ + if test -e $$d; then \ + rm -r "$$d" && echo "Removed directory $$d"; \ + fi \ + done + +clean-cruft-files: + @for f in $(CRUFT_FILES); do \ + if test -e $$f; then \ + rm "$$f" && echo "Removed file $$f"; \ + fi \ + done + +clean-cruft: clean-cruft-dirs clean-cruft-files + +# also might want to add this to your Makefile.am: +# +# all-local: check-cruft + diff --git a/common/download-translations b/common/download-translations new file mode 100755 index 0000000..aef1d31 --- /dev/null +++ b/common/download-translations @@ -0,0 +1,152 @@ +#!/bin/sh +# Shell script to download the latest translations for a given GStreamer +# package from translationproject.org + + +# DOMAINS based on http://translationproject.org/extra/matrix.html +# We need to check all domains, not only po/LINGUAS, since there might be +# new translations +DOMAINS=\ +"af am ar az be bg pt_BR bs ca zh_CN cs cy da de el eo es et eu fa fi fr "\ +"ga en_GB gl gu he hi zh_HK hr hu id is it ja ko ku ky lg lt lv mk mn ms "\ +"mt nb ne nl nn or pa pl pt rm ro ru rw sk sl sq sr sv ta tq th tk "\ +"tr zh_TW uk ven vi wa xh zu" + +# for testing/debugging: +#DOMAINS="es fr hu sv pl xx" + +# check for 'diff' program +diff --version 2>/dev/null >/dev/null +if [ ! $? ]; then + echo "==== You must have the 'diff' program installed for this script ====" + exit 1 +fi + +# check for 'wget' program +wget --version 2>/dev/null >/dev/null +if [ ! $? ]; then + echo "==== You must have the 'wget' program installed for this script ====" + exit 1 +fi + +# make sure we're in the top-level directory +if [ ! -d ./po ]; then + echo "==== No ./po directory in the current working directory ====" + exit 1 +fi + +# make sure a package argument was passed to us +if [ -z "$1" ]; then + echo "Usage: $0 PACKAGE, e.g. $0 gst-plugins-good" + exit 1 +fi + +if test "$1" != "gstreamer" -a \ + "$1" != "gst-plugins-base" -a \ + "$1" != "gst-plugins-good" -a \ + "$1" != "gst-plugins-ugly" -a \ + "$1" != "gst-plugins-bad"; then + echo "Unexpected package '$1' ?!" + exit 1 +fi + +PACKAGE="$1" + +DOMAINS_TO_ADD="" +DOMAINS_UPDATED="" +DOMAINS_NOT_IN_LINGUAS="" + +echo "Downloading latest translation files for package $PACKAGE ..." +echo + +for d in $DOMAINS +do + PACKAGE_PO_URL_BASE="http://translationproject.org/latest/$PACKAGE" + PO_URL="$PACKAGE_PO_URL_BASE/$d.po" + PO_FILENAME="$PACKAGE.$d.po" + if wget -q -nc -O $PO_FILENAME $PO_URL; then + # we want all .po files in UTF-8 format really, so convert if needed.. + CHARSET=`grep Content-Type $PO_FILENAME | sed -e 's/.*charset=\(.*\)\\\\n.*/\1/'` + if test "x$CHARSET" != "xUTF-8" -a "x$CHARSET" != "xutf-8"; then + # note: things like the bugs address will be added back by make update-po + if msguniq $PO_FILENAME --no-location \ + --output-file=$PO_FILENAME.utf8 \ + --to-code=UTF-8; then + mv $PO_FILENAME.utf8 $PO_FILENAME + else + echo "**** $d: conversion from $CHARSET to UTF-8 failed ****" + fi + fi + if [ -f "po/$d.po" ]; then + # ./po/foo.po exists, so let's check if ours matches the latest from the + # translation project website + REVDATE_NEW=`grep PO-Revision-Date $PO_FILENAME`; + REVDATE_OLD=`grep PO-Revision-Date po/$d.po`; + CHARSET_OLD=`grep Content-Type po/$d.po | sed -e 's/.*charset=\(.*\)\\\\n.*/\1/'` + if test "x$REVDATE_NEW" = "x$REVDATE_OLD" -a "x$CHARSET_OLD" = "xUTF-8"; then + # note: source code line markers will be removed later by make upload-po + echo "$d.po: up-to-date" + rm -f $PO_FILENAME + else + mv $PO_FILENAME "po/$d.po" + if test "x$CHARSET_OLD" != "xUTF-8" -a "x$CHARSET_OLD" != "xutf-8"; then + echo "$d.po: update (and charset converted from $CHARSET_OLD to UTF-8)" + else + echo "$d.po: updated" + fi + DOMAINS_UPDATED="$DOMAINS_UPDATED $d" + fi + # make sure domain is listed in LINGUAS + if ! grep $d "po/LINGUAS" >/dev/null 2>/dev/null; then + DOMAINS_NOT_IN_LINGUAS="$DOMAINS_NOT_IN_LINGUAS $d" + fi + else + # ./po/foo.po doesn't exist, but foo.po exists on the translation project + # website, so it's probably a new translation + echo "$d.po: new language" + mv $PO_FILENAME "po/$d.po" + DOMAINS_UPDATED="$DOMAINS_UPDATED $d" + DOMAINS_TO_ADD="$DOMAINS_TO_ADD $d" + fi + else + rm -f $PO_FILENAME + echo "$d.po: failure (does probably not exist)" + fi +done + +if [ -n "$DOMAINS_UPDATED" ]; then + echo "====================================================================" + echo + echo "Language domains updated :$DOMAINS_UPDATED" + echo "Language domains to git add :$DOMAINS_TO_ADD" + echo + echo "Source: http://translationproject.org/latest/$PACKAGE/" + echo + if [ -n "$DOMAINS_TO_ADD" ]; then + CMD_STRING="git add" + for d in $DOMAINS_TO_ADD; do + CMD_STRING="$CMD_STRING po/$d.po" + done + echo "Please run" + echo + echo " $CMD_STRING" + echo + echo "now and add the following domains to the po/LINGUAS file:" + echo + echo " $DOMAINS_TO_ADD" + echo + echo + fi + echo "====================================================================" +fi + +if [ -n "$DOMAINS_NOT_IN_LINGUAS" ]; then + echo + echo "Existing domains missing from the po/LINGUAS file:" + echo + echo " $DOMAINS_NOT_IN_LINGUAS" + echo + echo +fi + + diff --git a/common/extract-release-date-from-doap-file b/common/extract-release-date-from-doap-file new file mode 100755 index 0000000..f57e307 --- /dev/null +++ b/common/extract-release-date-from-doap-file @@ -0,0 +1,32 @@ +#!/bin/sh +# Shell script to extract the date given a release version and a .doap file + +if test "x$1" = "x" -o "x$2" = "x" -o ! -s "$2"; then + echo "Usage: $0 RELEASE-VERSION-NUMBER DOAP-FILE" >&2; + exit 1 +fi + +if ! grep '/dev/null ; then + echo "$2 does not look lika a .doap file" >&2; + exit 1 +fi + +if ! grep "$1" "$2" >/dev/null ; then + echo "$2 contains no reference to a version $1" >&2; + exit 1 +fi + +awk 'BEGIN {x=0} +{ +if ( $0 ~ // ) {x=1; chunk=""} +if (x==1) { + if ($0 ~ //) { chunk = chunk $0 } + if ($0 ~ //) { chunk = chunk $0 } +} +if ($0 ~ /<\/release>/) {x=0; print chunk} +}' < "$2" | \ +\ +grep ''"$1"'' | \ +\ +sed -e 's/^.*//' -e 's/<\/created>.*$//' + diff --git a/common/gen-changelog.py b/common/gen-changelog.py new file mode 100644 index 0000000..9bddaa0 --- /dev/null +++ b/common/gen-changelog.py @@ -0,0 +1,99 @@ +#!/usr/bin/env python + +import sys +import subprocess +import re + +# Makes a GNU-Style ChangeLog from a git repository +# Handles git-svn repositories also + +# Arguments : same as for git log +release_refs={} + +def process_commit(lines, files): + # DATE NAME + # BLANK LINE + # Subject + # BLANK LINE + # ... + # FILES + fileincommit = False + lines = [x.strip() for x in lines if x.strip() and not x.startswith('git-svn-id')] + files = [x.strip() for x in files if x.strip()] + for l in lines: + if l.startswith('* ') and ':' in l: + fileincommit = True + break + + top_line = lines[0] + print top_line.strip() + print + if not fileincommit: + for f in files: + print '\t* %s:' % f + for l in lines[1:]: + print '\t ', l + print + +def output_commits(): + cmd = ['git', 'log', '--pretty=format:--START-COMMIT--%H%n%ai %an <%ae>%n%n%s%n%b%n--END-COMMIT--', + '--date=short', '--name-only'] + + start_tag = find_start_tag() + + if start_tag is None: + cmd.extend(sys.argv[1:]) + else: + cmd.extend(["%s..HEAD" % (start_tag)]) + + p = subprocess.Popen(args=cmd, shell=False, stdout=subprocess.PIPE) + buf = [] + files = [] + filemode = False + for lin in p.stdout.readlines(): + if lin.startswith("--START-COMMIT--"): + if buf != []: + process_commit(buf, files) + hash = lin[16:].strip() + try: + rel = release_refs[hash] + print "=== release %d.%d.%d ===\n" % (int(rel[0]), int(rel[1]), int(rel[2])) + except: + pass + buf = [] + files = [] + filemode = False + elif lin.startswith("--END-COMMIT--"): + filemode = True + elif filemode == True: + files.append(lin) + else: + buf.append(lin) + if buf != []: + process_commit(buf, files) + +def get_rel_tags(): + # Populate the release_refs dict with the tags for previous releases + reltagre = re.compile("^([a-z0-9]{40}) refs\/tags\/[RELEASE-]*([0-9]+)[-_.]([0-9]+)[-_.]([0-9]+)") + + cmd = ['git', 'show-ref', '--tags', '--dereference'] + p = subprocess.Popen(args=cmd, shell=False, stdout=subprocess.PIPE) + for lin in p.stdout.readlines(): + match = reltagre.search (lin) + if match: + (sha, maj, min, nano) = match.groups() + release_refs[sha] = (maj, min, nano) + +def find_start_tag(): + starttagre = re.compile("^([a-z0-9]{40}) refs\/tags\/CHANGELOG_START") + cmd = ['git', 'show-ref', '--tags'] + p = subprocess.Popen(args=cmd, shell=False, stdout=subprocess.PIPE) + for lin in p.stdout.readlines(): + match = starttagre.search (lin) + if match: + return match.group(1) + return None + +if __name__ == "__main__": + get_rel_tags() + output_commits() diff --git a/common/gettext.patch b/common/gettext.patch new file mode 100644 index 0000000..682b905 --- /dev/null +++ b/common/gettext.patch @@ -0,0 +1,12 @@ +--- po/Makefile.in.in.orig 2006-01-07 12:03:45.000000000 +0100 ++++ po/Makefile.in.in 2006-01-07 12:04:23.000000000 +0100 +@@ -11,6 +11,9 @@ + PACKAGE = @PACKAGE@ + VERSION = @VERSION@ + ++# thomas: add GETTEXT_PACKAGE substitution as used in Makevars ++GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ ++ + SHELL = /bin/sh + @SET_MAKE@ + diff --git a/common/glib-gen.mak b/common/glib-gen.mak new file mode 100644 index 0000000..ef93a5f --- /dev/null +++ b/common/glib-gen.mak @@ -0,0 +1,44 @@ +# these are the variables your Makefile.am should set +# the example is based on the colorbalance interface + +#glib_enum_headers=$(colorbalance_headers) +#glib_enum_define=GST_COLOR_BALANCE +#glib_enum_prefix=gst_color_balance + +enum_headers=$(foreach h,$(glib_enum_headers),\n\#include \"$(h)\") + +# these are all the rules generating the relevant files +%-marshal.h: %-marshal.list + $(AM_V_GEN)glib-genmarshal --header --prefix=$(glib_enum_prefix)_marshal $^ > $*-marshal.h.tmp && \ + mv $*-marshal.h.tmp $*-marshal.h + +%-marshal.c: %-marshal.list + $(AM_V_GEN)echo "#include \"$*-marshal.h\"" >> $*-marshal.c.tmp && \ + glib-genmarshal --body --prefix=$(glib_enum_prefix)_marshal $^ >> $*-marshal.c.tmp && \ + mv $*-marshal.c.tmp $*-marshal.c + +%-enumtypes.h: $(glib_enum_headers) + $(AM_V_GEN)glib-mkenums \ + --fhead "#ifndef __$(glib_enum_define)_ENUM_TYPES_H__\n#define __$(glib_enum_define)_ENUM_TYPES_H__\n\n#include \n\nG_BEGIN_DECLS\n" \ + --fprod "\n/* enumerations from \"@filename@\" */\n" \ + --vhead "GType @enum_name@_get_type (void);\n#define GST_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n" \ + --ftail "G_END_DECLS\n\n#endif /* __$(glib_enum_define)_ENUM_TYPES_H__ */" \ + $^ > $@ + +%-enumtypes.c: $(glib_enum_headers) + @if test "x$(glib_enum_headers)" = "x"; then echo "ERROR: glib_enum_headers is empty, please fix Makefile"; exit 1; fi + $(AM_V_GEN)glib-mkenums \ + --fhead "#include \"$*-enumtypes.h\"\n$(enum_headers)" \ + --fprod "\n/* enumerations from \"@filename@\" */" \ + --vhead "GType\n@enum_name@_get_type (void)\n{\n static volatile gsize g_define_type_id__volatile = 0;\n if (g_once_init_enter (&g_define_type_id__volatile)) {\n static const G@Type@Value values[] = {" \ + --vprod " { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \ + --vtail " { 0, NULL, NULL }\n };\n GType g_define_type_id = g_@type@_register_static (\"@EnumName@\", values);\n g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);\n }\n return g_define_type_id__volatile;\n}\n" \ + $^ > $@ + +# a hack rule to make sure .Plo files exist because they get include'd +# from Makefile's +.deps/%-marshal.Plo: + @touch $@ + +.deps/%-enumtypes.Plo: + @touch $@ diff --git a/common/gst-autogen.sh b/common/gst-autogen.sh new file mode 100644 index 0000000..78cab66 --- /dev/null +++ b/common/gst-autogen.sh @@ -0,0 +1,345 @@ +# a silly hack that generates autoregen.sh but it's handy +# Remove the old autoregen.sh first to create a new file, +# as the current one may be being read by the shell executing +# this script. +if [ -f "autoregen.sh" ]; then + rm autoregen.sh +fi +echo "#!/bin/sh" > autoregen.sh +echo "./autogen.sh $@ \$@" >> autoregen.sh +chmod +x autoregen.sh + +# helper functions for autogen.sh + +debug () +# print out a debug message if DEBUG is a defined variable +{ + if test ! -z "$DEBUG" + then + echo "DEBUG: $1" + fi +} + +version_get () +# based on the command's version output, set variables +# _MAJOR, _MINOR, _MICRO, _VERSION, using the given prefix as variable prefix +# +# arg 1: command binary name +# arg 2: (uppercased) variable name prefix +{ + COMMAND=$1 + VARPREFIX=`echo $2 | tr .,- _` + local ${VARPREFIX}_VERSION + + # strip everything that's not a digit, then use cut to get the first field + pkg_version=`$COMMAND --version|head -n 1|sed 's/^.*)[^0-9]*//'|cut -d' ' -f1` + debug "pkg_version $pkg_version" + # remove any non-digit characters from the version numbers to permit numeric + # comparison + pkg_major=`echo $pkg_version | cut -d. -f1 | sed s/[a-zA-Z\-].*//g` + pkg_minor=`echo $pkg_version | cut -d. -f2 | sed s/[a-zA-Z\-].*//g` + pkg_micro=`echo $pkg_version | cut -d. -f3 | sed s/[a-zA-Z\-].*//g` + test -z "$pkg_major" && pkg_major=0 + test -z "$pkg_minor" && pkg_minor=0 + test -z "$pkg_micro" && pkg_micro=0 + debug "found major $pkg_major minor $pkg_minor micro $pkg_micro" + eval ${VARPREFIX}_MAJOR=$pkg_major + eval ${VARPREFIX}_MINOR=$pkg_minor + eval ${VARPREFIX}_MICRO=$pkg_micro + eval ${VARPREFIX}_VERSION=$pkg_version +} + +version_compare () +# Checks whether the version of VARPREFIX is equal to or +# newer than the requested version +# arg1: VARPREFIX +# arg2: MAJOR +# arg3: MINOR +# arg4: MICRO +{ + VARPREFIX=`echo $1 | tr .,- _` + MAJOR=$2 + MINOR=$3 + MICRO=$4 + + eval pkg_major=\$${VARPREFIX}_MAJOR; + eval pkg_minor=\$${VARPREFIX}_MINOR; + eval pkg_micro=\$${VARPREFIX}_MICRO; + + #start checking the version + debug "version_compare: $VARPREFIX against $MAJOR.$MINOR.$MICRO" + + # reset check + WRONG= + + if [ ! "$pkg_major" -gt "$MAJOR" ]; then + debug "major: $pkg_major <= $MAJOR" + if [ "$pkg_major" -lt "$MAJOR" ]; then + debug "major: $pkg_major < $MAJOR" + WRONG=1 + elif [ ! "$pkg_minor" -gt "$MINOR" ]; then + debug "minor: $pkg_minor <= $MINOR" + if [ "$pkg_minor" -lt "$MINOR" ]; then + debug "minor: $pkg_minor < $MINOR" + WRONG=1 + elif [ "$pkg_micro" -lt "$MICRO" ]; then + debug "micro: $pkg_micro < $MICRO" + WRONG=1 + fi + fi + fi + if test ! -z "$WRONG"; then + debug "version_compare: $VARPREFIX older than $MAJOR.$MINOR.$MICRO" + return 1 + fi + debug "version_compare: $VARPREFIX equal to/newer than $MAJOR.$MINOR.$MICRO" + return 0 +} + + +version_check () +# check the version of a package +# first argument : package name (executable) +# second argument : optional path where to look for it instead +# third argument : source download url +# rest of arguments : major, minor, micro version +# all consecutive ones : suggestions for binaries to use +# (if not specified in second argument) +{ + PACKAGE=$1 + PKG_PATH=$2 + URL=$3 + MAJOR=$4 + MINOR=$5 + MICRO=$6 + + # for backwards compatibility, we let PKG_PATH=PACKAGE when PKG_PATH null + if test -z "$PKG_PATH"; then PKG_PATH=$PACKAGE; fi + debug "major $MAJOR minor $MINOR micro $MICRO" + VERSION=$MAJOR + if test ! -z "$MINOR"; then VERSION=$VERSION.$MINOR; else MINOR=0; fi + if test ! -z "$MICRO"; then VERSION=$VERSION.$MICRO; else MICRO=0; fi + + debug "major $MAJOR minor $MINOR micro $MICRO" + + for SUGGESTION in $PKG_PATH; do + COMMAND="$SUGGESTION" + + # don't check if asked not to + test -z "$NOCHECK" && { + printf " checking for $COMMAND >= $VERSION ... " + } || { + # we set a var with the same name as the package, but stripped of + # unwanted chars + VAR=`echo $PACKAGE | sed 's/-//g'` + debug "setting $VAR" + eval $VAR="$COMMAND" + return 0 + } + + which $COMMAND > /dev/null 2>&1 + if test $? -eq 1; + then + debug "$COMMAND not found" + continue + fi + + VARPREFIX=`echo $COMMAND | sed 's/-//g' | tr [:lower:] [:upper:]` + version_get $COMMAND $VARPREFIX + + version_compare $VARPREFIX $MAJOR $MINOR $MICRO + if test $? -ne 0; then + echo "found $pkg_version, not ok !" + continue + else + echo "found $pkg_version, ok." + # we set a var with the same name as the package, but stripped of + # unwanted chars + VAR=`echo $PACKAGE | sed 's/-//g'` + debug "setting $VAR" + eval $VAR="$COMMAND" + return 0 + fi + done + + echo "$PACKAGE not found !" + echo "You must have $PACKAGE installed to compile $package." + echo "Download the appropriate package for your distribution," + echo "or get the source tarball at $URL" + return 1; +} + +aclocal_check () +{ + # normally aclocal is part of automake + # so we expect it to be in the same place as automake + # so if a different automake is supplied, we need to adapt as well + # so how's about replacing automake with aclocal in the set var, + # and saving that in $aclocal ? + # note, this will fail if the actual automake isn't called automake* + # or if part of the path before it contains it + if [ -z "$automake" ]; then + echo "Error: no automake variable set !" + return 1 + else + aclocal=`echo $automake | sed s/automake/aclocal/` + debug "aclocal: $aclocal" + if [ "$aclocal" != "aclocal" ]; + then + CONFIGURE_DEF_OPT="$CONFIGURE_DEF_OPT --with-aclocal=$aclocal" + fi + if [ ! -x `which $aclocal` ]; then + echo "Error: cannot execute $aclocal !" + return 1 + fi + fi +} + +autoheader_check () +{ + # same here - autoheader is part of autoconf + # use the same voodoo + if [ -z "$autoconf" ]; then + echo "Error: no autoconf variable set !" + return 1 + else + autoheader=`echo $autoconf | sed s/autoconf/autoheader/` + debug "autoheader: $autoheader" + if [ "$autoheader" != "autoheader" ]; + then + CONFIGURE_DEF_OPT="$CONFIGURE_DEF_OPT --with-autoheader=$autoheader" + fi + if [ ! -x `which $autoheader` ]; then + echo "Error: cannot execute $autoheader !" + return 1 + fi + fi + +} + +die_check () +{ + # call with $DIE + # if set to 1, we need to print something helpful then die + DIE=$1 + if test "x$DIE" = "x1"; + then + echo + echo "- Please get the right tools before proceeding." + echo "- Alternatively, if you're sure we're wrong, run with --nocheck." + exit 1 + fi +} + +autogen_options () +{ + if test "x$1" = "x"; then + return 0 + fi + + while test "x$1" != "x" ; do + optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` + case "$1" in + --noconfigure) + NOCONFIGURE=defined + AUTOGEN_EXT_OPT="$AUTOGEN_EXT_OPT --noconfigure" + echo "+ configure run disabled" + shift + ;; + --nocheck) + AUTOGEN_EXT_OPT="$AUTOGEN_EXT_OPT --nocheck" + NOCHECK=defined + echo "+ autotools version check disabled" + shift + ;; + -d|--debug) + DEBUG=defined + AUTOGEN_EXT_OPT="$AUTOGEN_EXT_OPT --debug" + echo "+ debug output enabled" + shift + ;; + -h|--help) + echo "autogen.sh (autogen options) -- (configure options)" + echo "autogen.sh help options: " + echo " --noconfigure don't run the configure script" + echo " --nocheck don't do version checks" + echo " --debug debug the autogen process" + echo + echo " --with-autoconf PATH use autoconf in PATH" + echo " --with-automake PATH use automake in PATH" + echo + echo "Any argument either not in the above list or after a '--' will be " + echo "passed to ./configure." + exit 1 + ;; + --with-automake=*) + AUTOMAKE=$optarg + echo "+ using alternate automake in $optarg" + CONFIGURE_DEF_OPT="$CONFIGURE_DEF_OPT --with-automake=$AUTOMAKE" + shift + ;; + --with-autoconf=*) + AUTOCONF=$optarg + echo "+ using alternate autoconf in $optarg" + CONFIGURE_DEF_OPT="$CONFIGURE_DEF_OPT --with-autoconf=$AUTOCONF" + shift + ;; + --) shift ; break ;; + *) + echo "+ passing argument $1 to configure" + CONFIGURE_EXT_OPT="$CONFIGURE_EXT_OPT $1" + shift + ;; + esac + done + + for arg do CONFIGURE_EXT_OPT="$CONFIGURE_EXT_OPT $arg"; done + if test ! -z "$CONFIGURE_EXT_OPT" + then + echo "+ options passed to configure: $CONFIGURE_EXT_OPT" + fi +} + +toplevel_check () +{ + srcfile=$1 + test -f $srcfile || { + echo "You must run this script in the top-level $package directory" + exit 1 + } +} + +tool_run () +{ + tool=$1 + options=$2 + run_if_fail=$3 + echo "+ running $tool $options..." + $tool $options || { + echo + echo $tool failed + eval $run_if_fail + exit 1 + } +} + +install_git_hooks () +{ + if test -d .git; then + # install pre-commit hook for doing clean commits + for hook in pre-commit; do + if test ! \( -x .git/hooks/$hook -a -L .git/hooks/$hook \); then + echo "+ Installing git $hook hook" + rm -f .git/hooks/$hook + ln -s ../../common/hooks/$hook.hook .git/hooks/$hook || { + # if we couldn't create a symbolic link, try doing a plain cp + if cp common/hooks/pre-commit.hook .git/hooks/pre-commit; then + chmod +x .git/hooks/pre-commit; + else + echo "********** Couldn't install git $hook hook **********"; + fi + } + fi + done + fi +} diff --git a/common/gst-glib-gen.mak b/common/gst-glib-gen.mak new file mode 100644 index 0000000..0b0a5e9 --- /dev/null +++ b/common/gst-glib-gen.mak @@ -0,0 +1,45 @@ +# these are the variables your Makefile.am should set +# the example is based on the colorbalance interface + +#glib_enum_headers=$(colorbalance_headers) +#glib_enum_define=GST_COLOR_BALANCE +#glib_gen_prefix=gst_color_balance +#glib_gen_basename=colorbalance + +enum_headers=$(foreach h,$(glib_enum_headers),\n\#include \"$(h)\") + +# these are all the rules generating the relevant files +$(glib_gen_basename)-marshal.h: $(glib_gen_basename)-marshal.list + $(AM_V_GEN)$(GLIB_GENMARSHAL) --header --prefix=$(glib_gen_prefix)_marshal $^ > $(glib_gen_basename)-marshal.h.tmp && \ + mv $(glib_gen_basename)-marshal.h.tmp $(glib_gen_basename)-marshal.h + +$(glib_gen_basename)-marshal.c: $(glib_gen_basename)-marshal.list + $(AM_V_GEN)echo "#include \"$(glib_gen_basename)-marshal.h\"" >> $(glib_gen_basename)-marshal.c.tmp && \ + $(GLIB_GENMARSHAL) --body --prefix=$(glib_gen_prefix)_marshal $^ >> $(glib_gen_basename)-marshal.c.tmp && \ + mv $(glib_gen_basename)-marshal.c.tmp $(glib_gen_basename)-marshal.c + +$(glib_gen_basename)-enumtypes.h: $(glib_enum_headers) + $(AM_V_GEN)$(GLIB_MKENUMS) \ + --fhead "#ifndef __$(glib_enum_define)_ENUM_TYPES_H__\n#define __$(glib_enum_define)_ENUM_TYPES_H__\n\n#include \n\nG_BEGIN_DECLS\n" \ + --fprod "\n/* enumerations from \"@filename@\" */\n" \ + --vhead "GType @enum_name@_get_type (void);\n#define GST_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n" \ + --ftail "G_END_DECLS\n\n#endif /* __$(glib_enum_define)_ENUM_TYPES_H__ */" \ + $^ > $@ + +$(glib_gen_basename)-enumtypes.c: $(glib_enum_headers) + @if test "x$(glib_enum_headers)" = "x"; then echo "ERROR: glib_enum_headers is empty, please fix Makefile"; exit 1; fi + $(AM_V_GEN)$(GLIB_MKENUMS) \ + --fhead "#include \"$(glib_gen_basename)-enumtypes.h\"\n$(enum_headers)" \ + --fprod "\n/* enumerations from \"@filename@\" */" \ + --vhead "GType\n@enum_name@_get_type (void)\n{\n static volatile gsize g_define_type_id__volatile = 0;\n if (g_once_init_enter (&g_define_type_id__volatile)) {\n static const G@Type@Value values[] = {" \ + --vprod " { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \ + --vtail " { 0, NULL, NULL }\n };\n GType g_define_type_id = g_@type@_register_static (\"@EnumName@\", values);\n g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);\n }\n return g_define_type_id__volatile;\n}\n" \ + $^ > $@ + +# a hack rule to make sure .Plo files exist because they get include'd +# from Makefile's +.deps/%-marshal.Plo: + @touch $@ + +.deps/%-enumtypes.Plo: + @touch $@ diff --git a/common/gst-indent b/common/gst-indent new file mode 100755 index 0000000..732b2ba --- /dev/null +++ b/common/gst-indent @@ -0,0 +1,49 @@ +#!/bin/sh +# +# Check that the code follows a consistant code style +# + +# Check for existence of indent, and error out if not present. +# On some *bsd systems the binary seems to be called gnunindent, +# so check for that first. + +version=`gnuindent --version 2>/dev/null` +if test "x$version" = "x"; then + version=`indent --version 2>/dev/null` + if test "x$version" = "x"; then + echo "GStreamer git pre-commit hook:" + echo "Did not find GNU indent, please install it before continuing." + exit 1 + fi + INDENT=indent +else + INDENT=gnuindent +fi + +case `$INDENT --version` in + GNU*) + ;; + default) + echo "GStreamer git pre-commit hook:" + echo "Did not find GNU indent, please install it before continuing." + echo "(Found $INDENT, but it doesn't seem to be GNU indent)" + exit 1 + ;; +esac + +INDENT_PARAMETERS="--braces-on-if-line \ + --case-brace-indentation0 \ + --case-indentation2 \ + --braces-after-struct-decl-line \ + --line-length80 \ + --no-tabs \ + --cuddle-else \ + --dont-line-up-parentheses \ + --continuation-indentation4 \ + --honour-newlines \ + --tab-size8 \ + --indent-level2 \ + --leave-preprocessor-space" + +$INDENT ${INDENT_PARAMETERS} $@ + diff --git a/common/gst.supp b/common/gst.supp new file mode 100644 index 0000000..2c60392 --- /dev/null +++ b/common/gst.supp @@ -0,0 +1,3967 @@ +### this file contains suppressions for valgrind when running +### the gstreamer unit tests +### it might be useful for wider use as well + +### syscall suppressions + +{ + + Memcheck:Param + clone(parent_tidptr) + fun:clone + fun:clone +} + +{ + + Memcheck:Param + clone(child_tidptr) + fun:clone + fun:clone +} + +{ + + Memcheck:Param + clone(tlsinfo) + fun:clone + fun:clone +} + +### glibc suppressions + +{ + + Memcheck:Cond + obj:/lib/ld-2.*.so + fun:dl_open_worker + obj:/lib/ld-2.*.so + fun:_dl_open + fun:dlopen_doit + obj:/lib/ld-2.*.so + fun:_dlerror_run + fun:dlopen + fun:g_module_open + fun:gst_plugin_load_file +} + +{ + + Memcheck:Cond + fun:strlen + fun:fillin_rpath + fun:_dl_init_paths + fun:dl_main + fun:_dl_sysdep_start + fun:_dl_start + obj:/lib64/ld-2.*.so + obj:* + obj:* +} + +{ + + Memcheck:Cond + fun:_dl_relocate_object + fun:dl_main + fun:_dl_sysdep_start + fun:_dl_start +} + +{ + + Memcheck:Cond + fun:* + fun:dl_open_worker + fun:_dl_catch_error + fun:_dl_open + fun:dlopen_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlopen@@GLIBC_2.2.5 +} + +# glibc does not deallocate thread-local storage + +{ + + Memcheck:Leak + fun:calloc + fun:_dl_allocate_tls + fun:pthread_create@@* +} + +{ + + Memcheck:Leak + fun:calloc + fun:allocate_dtv + fun:_dl_allocate_tls +} + +# I get an extra stack entry on x86/dapper +{ + + Memcheck:Leak + fun:calloc + obj:/lib/ld-2.3.*.so + fun:_dl_allocate_tls + fun:pthread_create@@* +} + + +{ + + Memcheck:Cond + fun:strstr + fun:__pthread_initialize_minimal + obj:/lib/libpthread-*.so + obj:/lib/libpthread-*.so + fun:call_init + fun:_dl_init + obj:/lib/ld-*.so +} + +# a thread-related free problem in glibc from Edgard +{ + __libc_freeres_rw_acess + Memcheck:Addr4 + obj:* + obj:* + obj:* + obj:* + obj:* + fun:__libc_freeres +} + +{ + + Memcheck:Cond + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so +} + +# g_module_open-related problems +{ + + Memcheck:Addr2 + fun:memcpy + fun:_dl_map_object_deps + fun:dl_open_worker + fun:_dl_catch_error + fun:_dl_open + fun:dlopen_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlopen@@GLIBC_2.1 + fun:g_module_open + fun:gst_plugin_load_file + fun:gst_registry_scan_path_level + fun:gst_registry_scan_path_level + fun:gst_registry_scan_path_level + fun:init_post + fun:g_option_context_parse + fun:gst_init_check + fun:gst_init + fun:gst_check_init + fun:main +} + +{ + + Memcheck:Addr4 + fun:memcpy + fun:_dl_map_object_deps + fun:dl_open_worker + fun:_dl_catch_error + fun:_dl_open + fun:dlopen_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlopen@@GLIBC_2.1 + fun:g_module_open + fun:gst_plugin_load_file + fun:gst_registry_scan_path_level + fun:gst_registry_scan_path_level + fun:gst_registry_scan_path_level + fun:init_post + fun:g_option_context_parse + fun:gst_init_check + fun:gst_init + fun:gst_check_init + fun:main +} + +{ + + Memcheck:Cond + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + fun:do_sym + fun:_dl_sym + fun:dlsym_doit + obj:/lib/ld-2.3.*.so + fun:_dlerror_run + fun:dlsym + fun:g_module_symbol + fun:g_module_open + fun:gst_plugin_load_file +} + +{ + + Memcheck:Cond + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + fun:dl_open_worker + obj:/lib/ld-2.3.*.so + fun:_dl_open + fun:dlopen_doit + obj:/lib/ld-2.3.*.so + fun:_dlerror_run + fun:dlopen@@GLIBC_2.1 + fun:g_module_open + fun:gst_plugin_load_file +} +{ + + Memcheck:Cond + obj:/lib/ld-2.3.*.so + fun:dl_open_worker + obj:/lib/ld-2.3.*.so + fun:_dl_open + fun:dlopen_doit + obj:/lib/ld-2.3.*.so + fun:_dlerror_run + fun:dlopen@@GLIBC_2.1 + fun:g_module_open + fun:gst_plugin_load_file + fun:gst_plugin_load_by_name + fun:gst_plugin_feature_load +} + +{ + + Memcheck:Leak + fun:malloc + obj:/lib/ld-2.3.*.so + fun:dl_open_worker + obj:/lib/ld-2.3.*.so + fun:_dl_open + fun:dlopen_doit + obj:/lib/ld-2.3.*.so + fun:_dlerror_run + fun:dlopen@@GLIBC_2.1 + fun:g_module_open + fun:gst_plugin_load_file + fun:gst_plugin_load_by_name +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + fun:dl_open_worker + obj:/lib/ld-2.3.*.so + fun:_dl_open + fun:dlopen_doit + obj:/lib/ld-2.3.*.so +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + fun:dl_open_worker + obj:/lib/ld-2.3.*.so + fun:_dl_open + fun:dlopen_doit + obj:/lib/ld-2.3.*.so + fun:_dlerror_run +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + fun:dl_open_worker + obj:/lib/ld-2.3.*.so + fun:_dl_open + fun:dlopen_doit + obj:/lib/ld-2.3.*.so + fun:_dlerror_run + fun:dlopen@@GLIBC_2.1 + fun:g_module_open +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + fun:dl_open_worker + obj:/lib/ld-2.3.*.so + fun:_dl_open + fun:dlopen_doit + obj:/lib/ld-2.3.*.so + fun:_dlerror_run + fun:dlopen@@GLIBC_2.1 + fun:g_module_open +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + fun:do_sym + fun:_dl_sym + fun:dlsym_doit + obj:/lib/ld-2.3.*.so + fun:_dlerror_run + fun:dlsym + fun:g_module_symbol + fun:g_module_open +} + +{ + + Memcheck:Param + futex(uaddr2) + fun:pthread_once + obj:/lib/libc-2.3.*.so + obj:/lib/libc-2.3.*.so + fun:mbsnrtowcs + fun:vfprintf + fun:vsprintf + fun:sprintf + obj:/lib/libc-2.3.*.so + fun:tmpfile + fun:setup_pipe + fun:setup_messaging_with_key + fun:setup_messaging +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + fun:dlopen + fun:g_module_open +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libc-2.7.so + fun:_dl_sym + obj:/lib/i686/cmov/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + fun:dlsym + fun:g_module_symbol + fun:g_module_open +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + fun:dlopen + fun:g_module_open +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + fun:dlopen + fun:g_module_open +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + fun:dlopen + fun:g_module_open +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libc-2.7.so + obj:/lib/ld-2.7.so + fun:__libc_dlopen_mode +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libc-2.7.so + obj:/lib/ld-2.7.so + fun:__libc_dlopen_mode +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libc-2.7.so + obj:/lib/ld-2.7.so + fun:__libc_dlopen_mode + obj:/lib/i686/cmov/libc-2.7.so + obj:/lib/i686/cmov/libc-2.7.so + obj:/lib/i686/cmov/libc-2.7.so + obj:/lib/i686/cmov/libc-2.7.so + obj:/lib/i686/cmov/libc-2.7.so + fun:iconv_open +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libc-2.7.so + obj:/lib/ld-2.7.so + fun:__libc_dlopen_mode + obj:/lib/i686/cmov/libc-2.7.so + obj:/lib/i686/cmov/libc-2.7.so + obj:/lib/i686/cmov/libc-2.7.so + obj:/lib/i686/cmov/libc-2.7.so + obj:/lib/i686/cmov/libc-2.7.so + fun:iconv_open +} + +{ + + Memcheck:Addr8 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/libc-2.7.so + obj:/lib/ld-2.7.so + fun:__libc_dlopen_mode + obj:/lib/libc-2.7.so + obj:/lib/libc-2.7.so + obj:/lib/libc-2.7.so + obj:/lib/libc-2.7.so + obj:/lib/libc-2.7.so + fun:iconv_open +} + +{ + + Memcheck:Addr8 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/libc-2.7.so + obj:/lib/ld-2.7.so + fun:__libc_dlopen_mode + obj:/lib/libc-2.7.so + obj:/lib/libc-2.7.so + obj:/lib/libc-2.7.so + obj:/lib/libc-2.7.so + obj:/lib/libc-2.7.so + fun:iconv_open +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + fun:dlopen +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + fun:dlopen +} + +{ + + Memcheck:Addr8 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/libc-2.7.so + obj:/lib/ld-2.7.so + fun:__libc_dlopen_mode +} + +{ + + Memcheck:Cond + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + fun:dlopen +} + +{ + + Memcheck:Cond + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + fun:dlopen +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + fun:dlopen +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + fun:dlopen +} + +{ + + Memcheck:Cond + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + fun:dlopen +} + +{ + + Memcheck:Cond + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + fun:dlopen +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + fun:dlopen +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + fun:dlopen +} + +{ + + Memcheck:Cond + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + fun:dlopen +} + +{ + + Memcheck:Cond + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + fun:dlopen +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + fun:dlopen +} + +# suppression for a glibc bug: +# http://valgrind.org/docs/manual/faq.html#faq.exit_errors> +{ + + Memcheck:Free + fun:free + obj:*libc-*.so + fun:__libc_freeres + fun:* + fun:_Exit +} + +# same as above, just so it works for tpm on gutsy/x86-64 +{ + + Memcheck:Free + fun:free + fun:free_mem + fun:__libc_freeres +} + +# valgrind doesn't allow me to specify a suppression for Addr1, Addr2, Addr4 +# as Addr*, so 3 copies for that; and then 2 of each for that pesky memcpy +{ + + Memcheck:Addr1 + fun:_dl_signal_error + fun:_dl_map_object_deps + fun:dl_open_worker + fun:_dl_catch_error + fun:_dl_open + fun:dlopen_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlopen@@GLIBC_2.1 + fun:g_module_open +} + +{ + + Memcheck:Addr2 + fun:_dl_signal_error + fun:_dl_map_object_deps + fun:dl_open_worker + fun:_dl_catch_error + fun:_dl_open + fun:dlopen_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlopen@@GLIBC_2.1 + fun:g_module_open +} +{ + + Memcheck:Addr4 + fun:_dl_signal_error + fun:_dl_map_object_deps + fun:dl_open_worker + fun:_dl_catch_error + fun:_dl_open + fun:dlopen_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlopen@@GLIBC_2.1 + fun:g_module_open +} + +{ + + Memcheck:Addr1 + fun:memcpy + fun:_dl_signal_error + fun:_dl_map_object_deps + fun:dl_open_worker + fun:_dl_catch_error + fun:_dl_open + fun:dlopen_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlopen@@GLIBC_2.1 + fun:g_module_open +} + +{ + + Memcheck:Addr2 + fun:memcpy + fun:_dl_signal_error + fun:_dl_map_object_deps + fun:dl_open_worker + fun:_dl_catch_error + fun:_dl_open + fun:dlopen_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlopen@@GLIBC_2.1 + fun:g_module_open +} +{ + + Memcheck:Addr4 + fun:memcpy + fun:_dl_signal_error + fun:_dl_map_object_deps + fun:dl_open_worker + fun:_dl_catch_error + fun:_dl_open + fun:dlopen_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlopen@@GLIBC_2.1 + fun:g_module_open +} + +{ + + Memcheck:Addr8 + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + obj:/lib/libc-2.3.*.so + obj:/lib/ld-2.3.*.so + fun:_dl_open + obj:/lib/libdl-2.3.*.so + obj:/lib/ld-2.3.*.so +} + +{ + + Memcheck:Cond + obj:/lib/ld-2.3.*.so + obj:/lib/libc-2.3.*.so + obj:/lib/ld-2.3.*.so + fun:_dl_open + obj:/lib/libdl-2.3.*.so + obj:/lib/ld-2.3.*.so + obj:/lib/libdl-2.3.*.so + fun:dlopen + fun:g_module_open + fun:gst_plugin_load_file + fun:gst_plugin_load_by_name + fun:gst_plugin_feature_load +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.3.6.so + obj:/lib/ld-2.3.6.so + obj:/lib/tls/i686/cmov/libc-2.3.6.so + obj:/lib/ld-2.3.6.so + fun:_dl_open + obj:/lib/tls/i686/cmov/libdl-2.3.6.so + obj:/lib/ld-2.3.6.so + obj:/lib/tls/i686/cmov/libdl-2.3.6.so + fun:dlopen +} + +{ + + Memcheck:Cond + obj:/lib/ld-2.3.6.so + obj:/lib/tls/i686/cmov/libc-2.3.6.so + obj:/lib/ld-2.3.6.so + fun:_dl_open + obj:/lib/tls/i686/cmov/libdl-2.3.6.so + obj:/lib/ld-2.3.6.so + obj:/lib/tls/i686/cmov/libdl-2.3.6.so + fun:dlopen +} + +{ + + Memcheck:Cond + obj:/lib/ld-2.3.6.so + obj:/lib/ld-2.3.6.so + obj:/lib/ld-2.3.6.so + obj:/lib/tls/i686/cmov/libc-2.3.6.so + obj:/lib/ld-2.3.6.so + fun:_dl_open + obj:/lib/tls/i686/cmov/libdl-2.3.6.so + obj:/lib/ld-2.3.6.so + obj:/lib/tls/i686/cmov/libdl-2.3.6.so + fun:dlopen +} + +### glib suppressions +{ + + Memcheck:Cond + fun:g_parse_debug_string + obj:/usr/lib*/libglib-2.0.so.* + fun:g_slice_alloc + fun:g_slice_alloc0 +} + +{ + + Memcheck:Leak + fun:*alloc + ... + fun:g_type_init* + fun:init_pre* +} + +{ + + Memcheck:Leak + fun:*alloc + ... + fun:g_type_register_fundamental +} + +{ + + Memcheck:Leak + fun:malloc + fun:realloc + fun:g_realloc + fun:type_node_any_new_W +} + +{ + + Memcheck:Leak + fun:realloc + fun:g_realloc + fun:type_node_any_new_W +} + +{ + + Memcheck:Leak + fun:calloc + fun:g_malloc0 + fun:g_type_class_ref +} + +{ + + Memcheck:Leak + fun:malloc + fun:realloc + fun:g_realloc + fun:type_add_flags_W +} + +{ + + Memcheck:Leak + fun:calloc + fun:g_malloc0 + fun:type_add_flags_W +} + +#pthread memleaks + +{ + Thread creation leak + Memcheck:Leak + fun:calloc + fun:allocate_dtv + fun:_dl_allocate* + fun:_dl_allocate* + fun:__pthread_initialize_minimal +} + +{ + Thread management leak + Memcheck:Leak + fun:calloc + fun:allocate_dtv + fun:_dl_allocate* + fun:_dl_allocate* + fun:__pthread_* +} + +{ + Thread management leak 2 + Memcheck:Leak + fun:memalign + fun:_dl_allocate* + fun:_dl_allocate* + fun:__pthread_* +} + +{ + pthread_create Syscall param write(buf) points to uninitialised byte(s) + Memcheck:Param + write(buf) + fun:pthread_create@@GLIBC_2.2.5 + fun:g_thread_create* + +} + +# nss_parse_* memleak (used by g_option_context_parse) +{ + nss_parse_* memleak + Memcheck:Leak + fun:malloc + fun:nss_parse_service_list + fun:__nss_database_lookup +} + +# liboil suppressions +{ + + Memcheck:Value8 + obj:/usr/lib/liboil-0.3.so.0.1.0 + obj:/usr/lib/liboil-0.3.so.0.1.0 + obj:/usr/lib/liboil-0.3.so.0.1.0 + fun:oil_cpu_fault_check_try + fun:oil_test_check_impl + fun:oil_class_optimize + fun:oil_optimize_all + fun:oil_init +} + +{ + + Memcheck:Addr8 + obj:/lib/ld-2.3.6.so +} + +{ + + Memcheck:Param + futex(uaddr2) + fun:pthread_once + obj:/lib/libc-2.3.6.so + obj:/lib/libc-2.3.6.so + fun:setlocale + fun:init_pre + fun:g_option_context_parse + fun:gst_init_check + fun:gst_init + fun:gst_check_init + fun:main +} + +{ + + Memcheck:Cond + obj:/lib/ld-2.3.6.so + obj:/lib/ld-2.3.6.so + fun:_dl_open + obj:/lib/libdl-2.3.6.so + obj:/lib/ld-2.3.6.so + obj:/lib/libdl-2.3.6.so + fun:dlopen + fun:g_module_open + fun:gst_plugin_load_file +} +# this exists in a bunch of different variations, hence the short tail/trace +{ + + Memcheck:Addr4 + obj:/lib/ld-2.4.so + obj:/lib/ld-2.4.so +} +{ + + Memcheck:Addr8 + obj:/lib/ld-2.4.so + obj:/lib/ld-2.4.so +} + +# More edgy suppressions (Mike) +{ + + Memcheck:Cond + obj:/lib/ld-2.4.so + obj:/lib/ld-2.4.so + obj:/lib/ld-2.4.so + obj:/lib/ld-2.4.so + fun:dlopen_doit + obj:/lib/ld-2.4.so + fun:_dlerror_run + fun:dlopen@@GLIBC_2.1 +} + +{ + + Memcheck:Cond + obj:/lib/ld-2.4.so + obj:/lib/ld-2.4.so + obj:/lib/ld-2.4.so + obj:/lib/ld-2.4.so + obj:/lib/ld-2.4.so + obj:/lib/ld-2.4.so + fun:dlopen_doit + obj:/lib/ld-2.4.so + fun:_dlerror_run + fun:dlopen@@GLIBC_2.1 +} + +{ + + Memcheck:Cond + obj:/lib/ld-2.4.so + obj:/lib/ld-2.4.so + obj:/lib/ld-2.4.so + fun:do_sym + fun:_dl_sym +} + +# This one's overly general, but there's zero other information in the stack +# trace - just these five lines! +{ + + Memcheck:Cond + obj:/lib/ld-2.4.so + obj:/lib/ld-2.4.so + obj:/lib/ld-2.4.so + obj:/lib/ld-2.4.so + obj:/lib/ld-2.4.so +} + +{ + + Memcheck:Leak + fun:calloc + obj:/lib/ld-2.4.so + fun:_dl_allocate_tls + fun:pthread_create@@GLIBC_2.1 +} + +# TLS leaks for feisty/x86 +{ + + Memcheck:Leak + fun:calloc + fun:allocate_dtv + fun:_dl_allocate_tls + fun:pthread_create@@GLIBC_2.1 +} + +{ + + Memcheck:Leak + fun:calloc + obj:/usr/lib/libcdio.so.6.0.1 + fun:cdio_open_am_linux + obj:/usr/lib/libcdio.so.6.0.1 + fun:cdio_open_am +} + +{ + + Memcheck:Addr8 + obj:/lib/ld-2.5.so +} + +{ + + Memcheck:Cond + fun:snd_pcm_direct_shm_create_or_connect + fun:snd_pcm_dsnoop_open + fun:_snd_pcm_dsnoop_open + obj:/*lib/libasound.so.2.0.0 + obj:/*lib/libasound.so.2.0.0 + fun:snd_pcm_open_slave + fun:_snd_pcm_plug_open + obj:/*lib/libasound.so.2.0.0 + fun:snd_pcm_open_slave + fun:_snd_pcm_asym_open + obj:/*lib/libasound.so.2.0.0 + obj:/*lib/libasound.so.2.0.0 +} + +{ + + Memcheck:Cond + fun:snd*_pcm_hw_param_set_near +} + +{ + + Memcheck:Cond + ... + fun:snd*_pcm_hw_param_set_near +} + +{ + + Memcheck:Cond + obj:/*lib/libasound.so.2.0.0 + obj:/*lib/libasound.so.2.0.0 + fun:snd_pcm_close + obj:/*lib/libasound.so.2.0.0 +} +{ + + Memcheck:Cond + fun:snd_pcm_direct_shm_create_or_connect + fun:snd_pcm_dmix_open + fun:_snd_pcm_dmix_open + obj:/*lib/libasound.so.2.0.0 + obj:/*lib/libasound.so.2.0.0 + fun:snd_pcm_open_slave + fun:_snd_pcm_softvol_open + obj:/*lib/libasound.so.2.0.0 + fun:snd_pcm_open_slave + fun:_snd_pcm_plug_open + obj:/*lib/libasound.so.2.0.0 + fun:snd_pcm_open_slave + fun:_snd_pcm_asym_open + obj:/*lib/libasound.so.2.0.0 + obj:/*lib/libasound.so.2.0.0 +} +{ + + Memcheck:Leak + fun:malloc + fun:strdup + fun:snd_dlobj_cache_add + obj:/*lib/libasound.so.2.0.0 + fun:snd_pcm_open_slave + fun:snd_pcm_dsnoop_open + fun:_snd_pcm_dsnoop_open + obj:/*lib/libasound.so.2.0.0 + obj:/*lib/libasound.so.2.0.0 + fun:snd_pcm_open_slave + fun:_snd_pcm_plug_open + obj:/*lib/libasound.so.2.0.0 + fun:snd_pcm_open_slave + fun:_snd_pcm_asym_open + obj:/*lib/libasound.so.2.0.0 + obj:/*lib/libasound.so.2.0.0 +} +# Catch about 15 variations on inserting info into an ALSA +# internal cache +{ + + Memcheck:Leak + fun:malloc + ... + fun:snd*_dlobj_cache_add + obj:/*lib*/libasound.so.2.0.0 +} + +{ + + Memcheck:Leak + fun:*alloc + ... + fun:snd_pcm_open_conf +} + +{ + + Memcheck:Leak + fun:*alloc + obj:/*lib*/libasound.so.2.0.0 + ... + fun:snd_config_hook_load +} + +{ + + Memcheck:Leak + fun:*alloc + obj:/*lib*/libasound.so.2.0.0 + ... + fun:snd_config_update_r + fun:snd_config_update +} +{ + + Memcheck:Leak + fun:*alloc + fun:strdup + ... + fun:snd_config_update_r + fun:snd_config_update +} +{ + + Memcheck:Leak + fun:*alloc + fun:_dl_close_worker + ... + fun:snd_config_searcha_hooks +} + +{ + + Memcheck:Leak + fun:malloc + obj:/lib/libc*.so + fun:__nss_database_lookup + obj:* + obj:* + fun:getgrnam_r + fun:getgrnam + fun:snd_pcm_direct_parse_open_conf +} + +{ + + Memcheck:Leak + fun:calloc + fun:_XCBInitDisplayLock + fun:XOpenDisplay +} + +# GConf internal initialisations related to getting the default client. +{ + + Memcheck:Leak + fun:calloc + fun:g_malloc0 + fun:ORBit_alloc_tcval + obj:/usr/lib/libORBit-2.so.* + fun:ORBit_demarshal_IOR + fun:ORBit_demarshal_object + fun:CORBA_ORB_string_to_object + obj:/usr/lib/libgconf-2.so.* + fun:gconf_get_current_lock_holder + fun:gconf_activate_server + obj:/usr/lib/libgconf-2.so.* + obj:/usr/lib/libgconf-2.so.* + fun:gconf_engine_get_default +} +{ + + Memcheck:Leak + fun:calloc + fun:g_malloc0 + fun:ORBit_alloc_tcval + obj:* + fun:PortableServer_POA_servant_to_reference + fun:* + fun:* + fun:* + fun:gconf_engine_get_default +} +{ + + Memcheck:Leak + fun:calloc + fun:g_malloc0 + fun:ORBit_alloc_tcval + obj:/usr/lib/libORBit-2.so.* + fun:ORBit_demarshal_IOR + fun:ORBit_demarshal_object + fun:CORBA_ORB_string_to_object + obj:/usr/lib/libgconf-2.so.* + fun:gconf_get_current_lock_holder + fun:gconf_activate_server + obj:/usr/lib/libgconf-2.so.* + obj:/usr/lib/libgconf-2.so.* + fun:gconf_engine_get_default +} +{ + + Memcheck:Leak + fun:calloc + fun:g_malloc0 + fun:ORBit_alloc* + fun:* + fun:ORBit_demarshal_IOR + fun:ORBit_demarshal_object + fun:ORBit_demarshal_value + fun:* + fun:ORBit_small_invoke_stub + fun:ConfigServer_get_default_database + fun:* + fun:gconf_engine_get_default +} +{ + + Memcheck:Leak + fun:calloc + fun:g_malloc0 + fun:ORBit_alloc* + fun:* + fun:IOP_generate_profiles + fun:ORBit_marshal_object + fun:ORBit_marshal_value + fun:* + fun:ORBit_small_invoke_stub + fun:ConfigServer_add_client + fun:* + fun:* + fun:gconf_engine_get_default +} +{ + + Memcheck:Leak + fun:calloc + fun:g_malloc0 + fun:ORBit_alloc_by_tc + fun:* + fun:PortableServer_POA_servant_to_reference + fun:* + fun:* + fun:* + fun:gconf_engine_get_default +} +{ + + Memcheck:Leak + fun:calloc + fun:g_malloc0 + fun:ORBit_alloc_by_tc + obj:/usr/lib/libORBit-2.so.* + fun:ORBit_demarshal_IOR + fun:ORBit_demarshal_object + fun:CORBA_ORB_string_to_object + obj:/usr/lib/libgconf-2.so.* + fun:gconf_get_current_lock_holder + fun:gconf_activate_server + obj:/usr/lib/libgconf-2.so.* + obj:/usr/lib/libgconf-2.so.* + fun:gconf_engine_get_default +} + +{ + + Memcheck:Leak + fun:calloc + fun:g_malloc0 + fun:ORBit_alloc* + fun:* + fun:ORBit_demarshal_IOR + fun:ORBit_demarshal_object + fun:* + fun:* + fun:gconf_activate_server +} + +# Some libORBit/bonobo initialisation stuff +{ + + Memcheck:Leak + fun:malloc + fun:g_malloc + fun:ORBit_alloc_string + fun:CORBA_string_dup + fun:Bonobo_ActivationEnvValue_set + fun:bonobo_activation_init_activation_env + fun:bonobo_activation_orb_init + fun:bonobo_activation_init +} +{ + + Memcheck:Leak + fun:calloc + fun:g_malloc0 + fun:ORBit_alloc* + fun:ORBit_small_alloc* + obj:/usr/lib/libORBit-2.so* + fun:PortableServer_POA_servant_to_reference + obj:/usr/lib/libbonobo-2.so* +} +{ + + Memcheck:Leak + fun:calloc + fun:g_malloc0 + fun:ORBit_alloc_tcval + fun:ORBit_small_allocbuf + fun:ORBit_adaptor_setup + obj:/usr/lib/libORBit-2.so* + fun:ORBit_POA_setup_root + fun:ORBit_init_internals + fun:CORBA_ORB_init +} +{ + + Memcheck:Leak + fun:calloc + fun:g_malloc0 + fun:ORBit_alloc_tcval + fun:ORBit_adaptor_setup + fun:* + fun:ORBit_POA_setup_root + fun:ORBit_init_internals + fun:CORBA_ORB_init +} +{ + + Memcheck:Leak + fun:calloc + fun:g_malloc0 + fun:ORBit_alloc* + fun:ORBit_small_allocbuf + fun:bonobo_activation_init_activation_env + fun:bonobo_activation_orb_init + fun:bonobo_activation_init +} + +# More GConf stuff from the FC5 buildbot, mostly variations on the +# above stack traces +{ + + Memcheck:Param + writev(vector[...]) + fun:writev + obj:/usr/lib/libORBit-2.so* + fun:link_connection_writev + fun:giop_send_buffer_write + obj:/usr/lib/libORBit-2.so* + fun:ORBit_small_invoke_stub + fun:ORBit_small_invoke_stub_n + fun:ORBit_c_stub_invoke + fun:ConfigServer_ping + fun:gconf_activate_server + obj:/usr/lib/libgconf-2.so* + obj:/usr/lib/libgconf-2.so* + fun:gconf_engine_get_default +} +{ + + Memcheck:Leak + fun:calloc + fun:g_malloc0 + fun:ORBit_alloc* + fun:ORBit_small_alloc* + obj:/usr/lib/libORBit-2.so* + fun:PortableServer_POA_servant_to_reference + obj:/usr/lib/libgconf-2.so* + obj:/usr/lib/libgconf-2.so* + obj:/usr/lib/libgconf-2.so* + fun:gconf_engine_get_default +} +{ + + Memcheck:Leak + fun:calloc + fun:g_malloc0 + fun:ORBit_alloc* + fun:ORBit_small_alloc + obj:/usr/lib/libORBit-2.so* + fun:ORBit_demarshal_IOR + fun:ORBit_demarshal_object + fun:CORBA_ORB_string_to_object + obj:/usr/lib/libgconf-2.so* + fun:gconf_get_current_lock_holder + fun:gconf_activate_server + obj:/usr/lib/libgconf-2.so* + obj:/usr/lib/libgconf-2.so* + fun:gconf_engine_get_default +} +{ + + Memcheck:Leak + fun:calloc + fun:g_malloc0 + fun:ORBit_alloc* + fun:ORBit_small_alloc* + obj:/usr/lib/libORBit-2.so* + fun:ORBit_demarshal_IOR + fun:ORBit_demarshal_object + fun:CORBA_ORB_string_to_object + obj:/usr/lib/libgconf-2.so* + fun:gconf_get_current_lock_holder + fun:gconf_activate_server + obj:/usr/lib/libgconf-2.so* + obj:/usr/lib/libgconf-2.so* + fun:gconf_engine_get_default +} +{ + + Memcheck:Leak + fun:calloc + fun:g_malloc0 + fun:ORBit_alloc* + fun:ORBit_small_alloc* + obj:/usr/lib/libORBit-2.so* + fun:ORBit_demarshal_IOR + fun:ORBit_demarshal_object + fun:ORBit_demarshal_value + obj:/usr/lib/libORBit-2.so* + fun:ORBit_small_invoke_stub + fun:ORBit_small_invoke_stub_n + fun:ORBit_c_stub_invoke + fun:ConfigServer_get_default_database + obj:/usr/lib/libgconf-2.so* + fun:gconf_engine_get_default +} +{ + + Memcheck:Leak + fun:calloc + fun:g_malloc0 + fun:ORBit_alloc* + fun:ORBit_small_alloc* + obj:/usr/lib/libORBit-2.so* + fun:ORBit_OAObject_object_to_objkey + fun:IOP_generate_profiles + fun:ORBit_marshal_object + fun:ORBit_marshal_value + obj:/usr/lib/libORBit-2.so* + fun:ORBit_small_invoke_stub + fun:ORBit_small_invoke_stub_n + fun:ORBit_c_stub_invoke + fun:ConfigServer_add_client + obj:/usr/lib/libgconf-2.so* + obj:/usr/lib/libgconf-2.so* + fun:gconf_engine_get_default +} +{ + + Memcheck:Leak + fun:malloc + obj:*libc-*.so + fun:__nss_database_lookup + obj:* + obj:* + fun:getpwnam_r + obj:/usr/lib*/libglib-2.0.so.* + fun:g_get_home_dir +} +{ + + Memcheck:Leak + fun:malloc + obj:*libc-*.so + fun:__nss_database_lookup + obj:* + obj:* + fun:getpwnam_r + obj:/usr/lib*/libglib-2.0.so.* + fun:g_get_user_name +} +{ + + Memcheck:Leak + fun:malloc + obj:*libc-*.so + fun:__nss_database_lookup + obj:* + obj:* + fun:getpwnam_r + obj:/usr/lib*/libglib-2.0.so.* + fun:g_get_tmp_dir +} + +{ + + Memcheck:Leak + fun:malloc + obj:*libc-*.so + fun:__nss_database_lookup + obj:* + obj:* + fun:getpwnam_r + obj:/usr/lib*/libglib-2.0.so.0.* + fun:g_get_host_name +} + + +## Some Fontconfig errors. +{ + + Memcheck:Leak + fun:malloc + fun:FcPatternObjectInsertElt + fun:FcPatternObjectAddWithBinding + fun:FcPatternAppend + fun:FcEndElement + obj:/usr/lib/libexpat.so.* + obj:/usr/lib/libexpat.so.* + obj:/usr/lib/libexpat.so.* + obj:/usr/lib/libexpat.so.* + fun:XML_ParseBuffer + fun:FcConfigParseAndLoad + fun:FcConfigParseAndLoad + fun:FcParseInclude + fun:FcEndElement + obj:/usr/lib/libexpat.so.* + obj:/usr/lib/libexpat.so.* + obj:/usr/lib/libexpat.so.* + obj:/usr/lib/libexpat.so.* + fun:XML_ParseBuffer + fun:FcConfigParseAndLoad +} +{ + + Memcheck:Leak + fun:*alloc + ... + fun:FcInitLoadConfig +} + +# Issues with ubuntu Hardy, same crack as for previous ubuntus +{ + + Memcheck:Leak + fun:calloc + obj:* + fun:_dl_allocate_tls + fun:pthread_create@@* + obj:/usr/lib/libgthread* + fun:g_thread_* +} + +# I've made this version generic, so that it covers future modifications +# of library names +{ + + Memcheck:Leak + fun:calloc + obj:* + fun:_dl_allocate_tls + fun:pthread_create@@* + fun:g_thread_* +} + +# series of invalid read of size 4 in g_module_open for ubuntu +# hardy x86/32bit +{ + + Memcheck:Addr4 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/tls/i686/cmov/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/tls/i686/cmov/libdl-2.7.so + fun:dlopen + fun:g_module_open + fun:gst_plugin_load_* +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/tls/i686/cmov/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/tls/i686/cmov/libdl-2.7.so + fun:dlopen + fun:g_module_open + fun:gst_plugin_load_* +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/tls/i686/cmov/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/tls/i686/cmov/libdl-2.7.so + fun:dlopen + fun:g_module_open + fun:gst_plugin_load_* +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/tls/i686/cmov/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/tls/i686/cmov/libdl-2.7.so + fun:dlopen + fun:g_module_open + fun:gst_plugin_load_* +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/tls/i686/cmov/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/tls/i686/cmov/libdl-2.7.so + fun:dlopen + fun:g_module_open + fun:gst_plugin_load* +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/tls/i686/cmov/libc-2.7.so + fun:_dl_sym + obj:/lib/tls/i686/cmov/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/tls/i686/cmov/libdl-2.7.so + fun:dlsym + fun:g_module_symbol + fun:g_module_open + fun:gst_plugin_load_* +} + +# series of invalid read of size 8 in g_module_open for ubuntu +# hardy x86/64bit +{ + + Memcheck:Addr8 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/libdl-2.7.so + fun:dlopen + fun:g_module_open +} + +{ + + Memcheck:Addr8 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/libdl-2.7.so + fun:dlopen + fun:g_module_open +} + +{ + + Memcheck:Addr8 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/libdl-2.7.so + fun:dlopen + fun:g_module_open +} + +{ + + Memcheck:Addr8 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/libdl-2.7.so + fun:dlopen + fun:g_module_open +} + +{ + + Memcheck:Addr8 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/libdl-2.7.so + fun:dlopen + fun:g_module_open +} + +{ + + Memcheck:Addr8 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/libdl-2.7.so + fun:dlopen + fun:g_module_open +} + +{ + + Memcheck:Addr8 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/libc-2.7.so + obj:/lib/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/libdl-2.7.so + fun:dlsym + fun:g_module_symbol + fun:g_module_open +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/tls/i686/cmov/libc-2.7.so + obj:/lib/ld-2.7.so + fun:__libc_dlopen_mode + fun:__nss_lookup_function + obj:/lib/tls/i686/cmov/libc-2.7.so + fun:__nss_passwd_lookup + fun:getpwnam_r +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/tls/i686/cmov/libc-2.7.so + obj:/lib/ld-2.7.so + fun:__libc_dlopen_mode + fun:__nss_lookup_function + obj:/lib/tls/i686/cmov/libc-2.7.so + fun:__nss_passwd_lookup + fun:getpwnam_r +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/tls/i686/cmov/libc-2.7.so + obj:/lib/ld-2.7.so + fun:__libc_dlopen_mode + fun:__nss_lookup_function + obj:/lib/tls/i686/cmov/libnss_compat-2.7.so + fun:_nss_compat_getpwnam_r + fun:getpwnam_r +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/tls/i686/cmov/libc-2.7.so + obj:/lib/ld-2.7.so + fun:__libc_dlopen_mode + fun:__nss_lookup_function + obj:/lib/tls/i686/cmov/libnss_compat-2.7.so + fun:_nss_compat_getpwnam_r + fun:getpwnam_r +} + +{ + + Memcheck:Addr8 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/libc-2.7.so + obj:/lib/ld-2.7.so + fun:__libc_dlopen_mode + fun:__nss_lookup_function + obj:/lib/libc-2.7.so + fun:getpwnam_r +} + +## Leaks in ALSA (variations of leak from snd_config_load1) + +{ + + Memcheck:Leak + fun:calloc + fun:_snd_config_make + fun:_snd_config_make_add + fun:* + fun:* + fun:* + fun:* + fun:snd_config_load1 +} + +{ + + Memcheck:Leak + fun:calloc + fun:_snd_config_make + fun:_snd_config_make_add + fun:* + fun:* + fun:snd_config_load1 +} +{ + + Memcheck:Leak + fun:calloc + fun:_snd_config_make + fun:_snd_config_make_add + fun:* + fun:* + fun:* + fun:snd_config_load1 +} +{ + + Memcheck:Leak + fun:calloc + fun:_snd_config_make + fun:_snd_config_make_add + fun:* + fun:* + fun:* + fun:* + fun:* + fun:snd_config_load1 +} + +{ + + Memcheck:Leak + fun:calloc + fun:_snd_config_make + fun:_snd_config_make_add + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:snd_config_load1 +} + +{ + + Memcheck:Leak + fun:calloc + fun:_snd_config_make + fun:_snd_config_make_add + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:snd_config_load1 +} +{ + + Memcheck:Leak + fun:calloc + fun:_snd_config_make + fun:_snd_config_make_add + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:snd_config_load1 +} + +{ + + Memcheck:Leak + fun:malloc + fun:snd1_dlobj_cache_add + fun:snd_ctl_open_noupdate +} + +{ + + Memcheck:Leak + fun:malloc + fun:* + fun:snd1_dlobj_cache_add + fun:snd_ctl_open_noupdate +} + +{ + + Memcheck:Leak + fun:*alloc + fun:* + fun:* + fun:* + fun:snd_config_load1 +} + +{ + + Memcheck:Leak + fun:*alloc + fun:* + fun:* + fun:* + fun:* + fun:snd_config_load1 +} + +{ + + Memcheck:Leak + fun:*alloc + fun:* + fun:* + fun:* + fun:* + fun:* + fun:snd_config_load1 +} + +{ + + Memcheck:Leak + fun:*alloc + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:snd_config_load1 +} + +{ + + Memcheck:Leak + fun:*alloc + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:snd_config_load1 +} + +{ + + Memcheck:Leak + fun:*alloc + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:snd_config_load1 +} + +{ + + Memcheck:Leak + fun:*alloc + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:snd_config_load1 +} + +{ + + Memcheck:Leak + fun:*alloc + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:snd_config_load1 +} + + +# The following are leaks of caps that need to be created dynamically +# in the type registration of the plugin (used for pad templates). + +{ + + Memcheck:Leak + fun:malloc + fun:g_malloc + fun:g_slice_alloc + fun:gst_caps_new_empty + fun:gst_caps_new_simple + fun:* + fun:g_type_class_ref + fun:gst_element_register +} + +{ + + Memcheck:Leak + fun:malloc + fun:g_malloc + fun:g_slice_alloc + fun:gst_caps_new_empty + fun:* + fun:* + fun:g_type_class_ref + fun:gst_element_register + fun:gst_ogm_parse_plugin_init + fun:plugin_init +} + +{ + + Memcheck:Leak + fun:malloc + fun:g_malloc + fun:g_slice_alloc + fun:gst_caps_new_empty + fun:gst_caps_copy + fun:gst_video_test_src_base_init + fun:g_type_class_ref + fun:gst_element_register +} + +{ + + Memcheck:Leak + fun:malloc + fun:g_malloc + fun:g_slice_alloc + fun:gst_caps_new_empty + fun:gst_caps_copy + fun:gst_video_test_src_getcaps + fun:gst_video_test_src_base_init + fun:g_type_class_ref + fun:gst_element_register +} + +{ + + Memcheck:Leak + fun:malloc + fun:g_malloc + fun:g_slice_alloc + fun:gst_caps_new_empty + fun:gst_ffmpegcsp_codectype_to_caps + fun:gst_ffmpegcolorspace_register + fun:plugin_init +} + +{ + + Memcheck:Leak + fun:malloc + fun:g_malloc + fun:g_slice_alloc + fun:gst_caps_new_empty + fun:gst_caps_copy + fun:gst_ffmpegcolorspace_register + fun:plugin_init +} + +{ + + Memcheck:Leak + fun:malloc + fun:g_malloc + fun:g_slice_alloc + fun:gst_caps_new_empty + fun:gst_caps_new_any + fun:gst_ffmpegdemux_register + fun:plugin_init +} + +{ + + Memcheck:Leak + fun:malloc + fun:g_malloc + fun:g_slice_alloc + fun:gst_caps_new_empty + fun:gst_caps_copy + fun:gst_audio_filter_class_add_pad_templates +} + +{ + + Memcheck:Leak + fun:realloc + fun:g_realloc + fun:g_ptr_array_maybe_expand + fun:g_ptr_array_add + fun:gst_caps_append + fun:gst_audio_filter_class_add_pad_templates +} + +{ + + Memcheck:Leak + fun:malloc + fun:realloc + fun:g_realloc + fun:g_ptr_array_maybe_expand + fun:g_ptr_array_add + fun:gst_caps_append + fun:gst_audio_filter_class_add_pad_templates +} + +{ + + Memcheck:Leak + fun:malloc + fun:realloc + fun:g_realloc + fun:g_ptr_array_maybe_expand + fun:g_ptr_array_add + fun:gst_caps_copy + fun:gst_audio_filter_class_add_pad_templates +} + +{ + + Memcheck:Leak + fun:malloc + fun:g_malloc + fun:g_slice_alloc + fun:g_ptr_array_sized_new + fun:gst_caps_new_empty + fun:gst_caps_copy + fun:gst_audio_filter_class_add_pad_templates +} +{ + + Memcheck:Leak + fun:malloc + fun:realloc + fun:g_realloc + fun:g_array_maybe_expand + fun:g_array_sized_new + fun:* + fun:* + fun:* + fun:gst_value_init_and_copy + fun:gst_structure_copy + fun:gst_caps_copy + fun:gst_audio_filter_class_add_pad_templates +} +{ + + Memcheck:Leak + fun:malloc + fun:realloc + fun:g_realloc + fun:g_array_maybe_expand + fun:g_array_sized_new + fun:* + fun:gst_structure_copy + fun:gst_caps_copy + fun:gst_audio_filter_class_add_pad_templates +} +{ + + Memcheck:Leak + fun:malloc + fun:g_malloc + fun:g_slice_alloc + fun:g_array_sized_new + fun:* + fun:gst_structure_copy + fun:gst_caps_copy + fun:gst_audio_filter_class_add_pad_templates +} + +{ + + Memcheck:Leak + fun:malloc + fun:g_malloc + fun:g_slice_alloc + fun:gst_caps_new_empty + fun:gst_riff_create_*_template_caps +} +{ + + Memcheck:Leak + fun:malloc + fun:realloc + fun:g_realloc + fun:* + fun:* + fun:* + fun:gst_structure_copy + fun:gst_caps_copy + fun:gst_caps_append + fun:gst_riff_create_*_template_caps +} +{ + + Memcheck:Leak + fun:malloc + fun:g_malloc + fun:g_slice_alloc + fun:g_array_sized_new + fun:* + fun:gst_structure_copy + fun:gst_caps_copy + fun:gst_caps_append + fun:gst_riff_create_*_template_caps +} + +## Leaks in pango (bilboed: gentoo unstable amd64) + +{ + + Memcheck:Leak + fun:*alloc + ... + fun:pango_layout_get_pixel_extents +} +{ + + Memcheck:Leak + fun:calloc + fun:g_malloc0 + fun:pango_language_from_string + fun:pango_language_get_default + fun:pango_context_init + fun:g_type_create_instance + fun:g_object_constructor + fun:g_object_newv + fun:g_object_new_valist + fun:g_object_new + fun:pango_font_map_create_context +} + +{ + + Memcheck:Leak + fun:calloc + fun:g_malloc0 + fun:pango_language_from_string +} + + +## Leak of everything allocated by gst-libav plugin init +{ + + Memcheck:Leak + fun:*alloc + ... + fun:gst_ffmpeg_cfg_init +} + +## Leak of GIO module through gnomevfs + +{ + + Memcheck:Leak + fun:malloc + fun:g_malloc + fun:* + fun:* + fun:g_type_create_instance + fun:* + fun:* + fun:* + fun:* + fun:g_io_module_new + fun:g_io_modules_load_all_in_directory + fun:* + fun:get_default_vfs +} + +## Conditional jump in getaddrinfo (bilboed, gentoo ~amd64, Dec 13 2008) +{ + + Memcheck:Cond + fun:gaih_inet + fun:getaddrinfo +} + +## Dynamic pad templates in mxfmux +{ + + Memcheck:Leak + fun:malloc + fun:g_malloc + fun:g_slice_alloc + fun:gst_caps_new_empty + fun:gst_caps_from_string + fun:mxf_*_init + fun:plugin_init +} + +## We don't know if ffmpeg frees this or not and better pass a copy for safety +{ + + Memcheck:Leak + fun:malloc + fun:g_malloc + fun:g_strdup + fun:gst_ffmpeg_cfg_fill_context + fun:gst_ffmpegenc_setcaps + fun:gst_pad_set_caps +} + +## Leak/overreads with glibc-2.10 + +{ + + Memcheck:Value8 + fun:do_sym + fun:dlsym_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlsym +} +{ + + Memcheck:Cond + fun:do_sym + fun:dlsym_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlsym +} + +{ + + Memcheck:Value8 + fun:dl_open_worker + fun:_dl_catch_error + fun:_dl_open + fun:dlopen_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlopen* +} + +{ + + Memcheck:Value8 + fun:_dl_relocate_object + fun:dl_open_worker + fun:_dl_catch_error + fun:_dl_open + fun:dlopen_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlopen* +} + +{ + + Memcheck:Value8 + fun:_dl_check_map_versions + fun:dl_open_worker + fun:_dl_catch_error + fun:_dl_open + fun:dlopen_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlopen* +} + +{ + + Memcheck:Cond + fun:dl_open_worker + fun:_dl_catch_error + fun:_dl_open + fun:dlopen_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlopen* +} + +{ + + Memcheck:Cond + fun:_dl_relocate_object + fun:dl_open_worker + fun:_dl_catch_error + fun:_dl_open + fun:dlopen_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlopen* +} + +{ + + Memcheck:Cond + fun:_dl_check_map_versions + fun:dl_open_worker + fun:_dl_catch_error + fun:_dl_open + fun:dlopen_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlopen* +} + +{ + + Memcheck:Cond + fun:_dl_map_object* + fun:dl_open_worker + fun:_dl_catch_error + fun:_dl_open + fun:dlopen_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlopen* +} + +{ + + Memcheck:Value8 + fun:_dl_map_object* + fun:dl_open_worker + fun:_dl_catch_error + fun:_dl_open + fun:dlopen_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlopen* +} + +{ + + Memcheck:Value8 + fun:_dl_check_caller + fun:dl_open_worker + fun:_dl_catch_error + fun:_dl_open + fun:dlopen_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlopen* +} + +{ + + Memcheck:Cond + fun:_dl_check_caller + fun:dl_open_worker + fun:_dl_catch_error + fun:_dl_open + fun:dlopen_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlopen* +} + +{ + + Memcheck:Value8 + obj:/lib*/libc-2.10.*.so + obj:/lib*/libc-2.10.*.so + fun:_vgnU_freeres +} +{ + + Memcheck:Cond + obj:/lib*/libc-2.10.*.so + obj:/lib*/libc-2.10.*.so + fun:_vgnU_freeres +} +{ + + Memcheck:Free + fun:free + obj:/lib*/libc-2.10.*.so + obj:/lib*/libc-2.10.*.so + fun:_vgnU_freeres +} + +{ + + Memcheck:Value8 + fun:_dl_fini + fun:__run_exit_handlers + fun:exit +} + +{ + + Memcheck:Cond + fun:_dl_fini + fun:__run_exit_handlers + fun:exit +} +{ + + Memcheck:Value8 + fun:_dl_sort_fini + fun:_dl_fini + fun:__run_exit_handlers + fun:exit +} + +{ + + Memcheck:Cond + fun:_dl_sort_fini + fun:_dl_fini + fun:__run_exit_handlers + fun:exit +} + +# glibc-2.10 dl overreads +{ + + Memcheck:Value8 + fun:_dl_fixup + fun:_dl_runtime_resolve +} +{ + + Memcheck:Cond + fun:_dl_fixup + fun:_dl_runtime_resolve +} + +{ + + Memcheck:Value8 + fun:_dl_lookup_symbol_x + fun:_dl_fixup + fun:_dl_runtime_resolve +} +{ + + Memcheck:Cond + fun:_dl_lookup_symbol_x + fun:_dl_fixup + fun:_dl_runtime_resolve +} +{ + + Memcheck:Value8 + fun:call_init + fun:_dl_init +} +{ + + Memcheck:Value8 + fun:_dl_init +} +{ + + Memcheck:Value8 + fun:do_lookup_x + fun:_dl_lookup_symbol_x + fun:_dl_relocate_object + fun:dl_main +} +{ + + Memcheck:Cond + fun:do_lookup_x + fun:_dl_lookup_symbol_x + fun:_dl_relocate_object + fun:dl_main +} +{ + + Memcheck:Value8 + fun:_dl_lookup_symbol_x + fun:_dl_relocate_object + fun:dl_main +} +{ + + Memcheck:Value8 + fun:_dl_relocate_object + fun:dl_main +} +{ + + Memcheck:Value8 + fun:dl_main + fun:_dl_sysdep_start + fun:_dl_start +} +{ + + Memcheck:Cond + fun:dl_main + fun:_dl_sysdep_start + fun:_dl_start +} + +{ + + Memcheck:Cond + fun:* + fun:do_lookup_x + fun:_dl_lookup_symbol_x + fun:_dl_relocate_object + fun:dl_main +} + +{ + + Memcheck:Value8 + fun:* + fun:do_lookup_x + fun:_dl_lookup_symbol_x + fun:_dl_relocate_object + fun:dl_main +} + +{ + + Memcheck:Value8 + fun:_dl_check_map_versions + fun:_dl_check_all_versions + fun:version_check_doit + fun:_dl_receive_error + fun:dl_main +} + +{ + + Memcheck:Cond + fun:_dl_check_map_versions + fun:_dl_check_all_versions + fun:version_check_doit + fun:_dl_receive_error + fun:dl_main +} + +{ + + Memcheck:Value8 + fun:_dl_check_all_versions + fun:version_check_doit + fun:_dl_receive_error + fun:dl_main +} + +{ + + Memcheck:Cond + fun:_dl_check_all_versions + fun:version_check_doit + fun:_dl_receive_error + fun:dl_main +} + +{ + + Memcheck:Value8 + fun:* + fun:_dl_check_map_versions + fun:_dl_check_all_versions + fun:version_check_doit + fun:_dl_receive_error + fun:dl_main +} +{ + + Memcheck:Cond + fun:* + fun:_dl_check_map_versions + fun:_dl_check_all_versions + fun:version_check_doit + fun:_dl_receive_error + fun:dl_main +} + +{ + + Memcheck:Value8 + fun:init_tls + fun:dl_main +} +{ + + Memcheck:Cond + fun:init_tls + fun:dl_main +} + +{ + + Memcheck:Cond + fun:_dl_map_object_deps + fun:dl_main +} +{ + + Memcheck:Value8 + fun:_dl_map_object_deps + fun:dl_main +} + +{ + + Memcheck:Value8 + fun:_dl_protect_relro + fun:_dl_relocate_object + fun:dl_main +} + +{ + + Memcheck:Value8 + fun:* + fun:do_lookup_x + fun:_dl_lookup_symbol_x + fun:_dl_relocate_object + fun:dl_main +} + +{ + + Memcheck:Value8 + fun:_dl_setup_hash + fun:_dl_map_object_from_fd + fun:_dl_map_object +} + +{ + + Memcheck:Value8 + fun:* + fun:_dl_new_object + fun:_dl_map_object_from_fd + fun:_dl_map_object +} + +{ + + Memcheck:Cond + fun:* + fun:_dl_new_object + fun:_dl_map_object_from_fd + fun:_dl_map_object +} + +{ + + Memcheck:Value8 + fun:openaux + fun:_dl_catch_error + fun:_dl_map_object_deps + fun:dl_main +} + +{ + + Memcheck:Value8 + fun:* + fun:_dl_map_object +} + +{ + + Memcheck:Cond + fun:* + fun:_dl_map_object +} + +{ + + Memcheck:Cond + fun:_dl_map_object + fun:openaux + fun:_dl_catch_error + fun:_dl_map_object_deps + fun:dl_main +} + +{ + + Memcheck:Value8 + fun:_dl_map_object + fun:openaux + fun:_dl_catch_error + fun:_dl_map_object_deps + fun:dl_main +} + +{ + + Memcheck:Cond + fun:* + fun:_dl_map_object + fun:openaux + fun:_dl_catch_error + fun:_dl_map_object_deps + fun:dl_main +} + +{ + + Memcheck:Value8 + fun:* + fun:open_path + fun:_dl_map_object + fun:openaux + fun:_dl_catch_error + fun:_dl_map_object_deps + fun:dl_main +} + +{ + + Memcheck:Cond + fun:* + fun:open_path + fun:_dl_map_object + fun:openaux + fun:_dl_catch_error + fun:_dl_map_object_deps + fun:dl_main +} + +{ + + Memcheck:Value8 + fun:_dl_map_object_from_fd + fun:_dl_map_object +} + +{ + + Memcheck:Cond + fun:_dl_map_object_from_fd + fun:_dl_map_object +} + +{ + + Memcheck:Value8 + fun:* + fun:_dl_new_object + fun:_dl_map_object_from_fd + fun:_dl_map_object +} + +{ + + Memcheck:Value8 + fun:_dl_new_object + fun:_dl_map_object_from_fd + fun:_dl_map_object +} + +{ + + Memcheck:Cond + fun:_dl_new_object + fun:_dl_map_object_from_fd + fun:_dl_map_object +} + +{ + + Memcheck:Value8 + fun:* + fun:_dl_name_match_p + fun:_dl_map_object +} + +{ + + Memcheck:Cond + fun:* + fun:* + fun:_dl_map_object +} + +{ + + Memcheck:Value8 + fun:* + fun:_dl_name_match_p + fun:_dl_check_map_versions + fun:_dl_check_all_versions +} + +{ + + Memcheck:Value8 + fun:* + fun:* + fun:do_lookup_x + fun:_dl_lookup_symbol_x +} + +{ + + Memcheck:Cond + fun:do_lookup_x + fun:_dl_lookup_symbol_x +} + +{ + + Memcheck:Value8 + fun:do_lookup_x + fun:_dl_lookup_symbol_x +} + +{ + + Memcheck:Value8 + fun:* + fun:do_lookup_x + fun:_dl_lookup_symbol_x +} +{ + + Memcheck:Cond + fun:* + fun:do_lookup_x + fun:_dl_lookup_symbol_x +} + +{ + + Memcheck:Value8 + fun:_dl_name_match_p + fun:_dl_map_object + fun:dl_open_worker +} +{ + + Memcheck:Cond + fun:_dl_name_match_p + fun:_dl_map_object + fun:dl_open_worker +} + +{ + + Memcheck:Value8 + fun:* + fun:_dl_name_match_p + fun:_dl_map_object + fun:dl_open_worker +} +{ + + Memcheck:Cond + fun:* + fun:_dl_name_match_p + fun:_dl_map_object + fun:dl_open_worker +} + +{ + + Memcheck:Value8 + fun:_dl_lookup_symbol_x + fun:_dl_relocate_object +} +{ + + Memcheck:Cond + fun:_dl_lookup_symbol_x + fun:_dl_relocate_object +} + +{ + + Memcheck:Value8 + fun:* + fun:* + fun:_dl_check_map_versions +} +{ + + Memcheck:Value8 + fun:* + fun:_dl_check_map_versions +} +{ + + Memcheck:Cond + fun:* + fun:* + fun:_dl_check_map_versions +} +{ + + Memcheck:Cond + fun:* + fun:_dl_check_map_versions +} +{ + + Memcheck:Value8 + fun:openaux +} +{ + + Memcheck:Value8 + fun:_dl_name_match_p + fun:_dl_map_object +} + +{ + + Memcheck:Cond + fun:_dl_close_worker + fun:_dl_close + fun:_dl_catch_error + fun:dlerror_run +} +{ + + Memcheck:Value8 + fun:_dl_close_worker + fun:_dl_close + fun:_dl_catch_error + fun:dlerror_run +} +{ + + Memcheck:Cond + fun:* + fun:_dl_close_worker + fun:_dl_close + fun:_dl_catch_error + fun:dlerror_run +} +{ + + Memcheck:Value8 + fun:* + fun:_dl_close_worker + fun:_dl_close + fun:_dl_catch_error + fun:dlerror_run +} + +{ + + Memcheck:Cond + fun:fillin_rpath + fun:_dl_init_paths + fun:dl_main +} +{ + + Memcheck:Value8 + fun:fillin_rpath + fun:_dl_init_paths + fun:dl_main +} +{ + + Memcheck:Cond + fun:* + fun:fillin_rpath + fun:_dl_init_paths + fun:dl_main +} +{ + + Memcheck:Value8 + fun:* + fun:fillin_rpath + fun:_dl_init_paths + fun:dl_main +} + +{ + + Memcheck:Cond + fun:_dl_map_object + fun:map_doit + fun:_dl_catch_error + fun:do_preload + fun:dl_main +} +{ + + Memcheck:Value8 + fun:_dl_map_object + fun:map_doit + fun:_dl_catch_error + fun:do_preload + fun:dl_main +} +{ + + Memcheck:Param + open(filename) + fun:open + fun:open_verify + fun:_dl_map_object + fun:map_doit + fun:_dl_catch_error + fun:do_preload + fun:dl_main +} + +{ + + Memcheck:Param + stat(file_name) + fun:_xstat + fun:open_path + fun:_dl_map_object + fun:openaux + fun:_dl_catch_error + fun:_dl_map_object_deps + fun:dl_main +} + +{ + + Memcheck:Value8 + fun:_dl_catch_error + fun:_dl_map_object_deps + fun:dl_open_worker +} + +{ + + Memcheck:Cond + fun:* + fun:_dl_map_object_deps + fun:dl_main +} +{ + + Memcheck:Value8 + fun:* + fun:_dl_map_object_deps + fun:dl_main +} + +{ + + Memcheck:Value8 + fun:* + fun:* + fun:_dl_map_object_deps + fun:dl_main +} + +# glibc-2.10 tls issues +{ + + Memcheck:Cond + fun:* + fun:init_tls + fun:dl_main +} +{ + + Memcheck:Value8 + fun:* + fun:init_tls + fun:dl_main +} +{ + + Memcheck:Cond + fun:* + fun:* + fun:init_tls + fun:dl_main +} +{ + + Memcheck:Value8 + fun:* + fun:* + fun:init_tls + fun:dl_main +} + +{ + + Memcheck:Cond + fun:_dl_allocate_tls_init + fun:dl_main +} +{ + + Memcheck:Value8 + fun:_dl_allocate_tls_init + fun:dl_main +} +{ + + Memcheck:Cond + fun:* + fun:_dl_allocate_tls_init + fun:dl_main +} +{ + + Memcheck:Value8 + fun:* + fun:_dl_allocate_tls_init + fun:dl_main +} + +{ + + Memcheck:Cond + fun:__tls* + obj:* + obj:* + fun:_vgnU_freeres +} + +{ + + Memcheck:Param + arch_prctl(arg2) + fun:init_tls +} +# GLib caching tmp/home directories (glibc-2.10 variants) +{ + + Memcheck:Cond + fun:* + fun:dl_open_worker + fun:* + fun:* + fun:* + fun:_dl_catch_error + fun:dlerror_run + fun:* + fun:__nss_lookup_function + fun:__nss_lookup + fun:getpwnam* +} +{ + + Memcheck:Value8 + fun:* + fun:dl_open_worker + fun:* + fun:* + fun:* + fun:_dl_catch_error + fun:dlerror_run + fun:* + fun:__nss_lookup_function + fun:__nss_lookup + fun:getpwnam* +} +{ + + Memcheck:Cond + fun:dl_open_worker + fun:* + fun:* + fun:do_dlopen + fun:* + fun:dlerror_run + fun:* + fun:__nss_lookup_function + fun:__nss_lookup + fun:getpwnam* +} +{ + + Memcheck:Value8 + fun:dl_open_worker + fun:* + fun:* + fun:do_dlopen + fun:* + fun:dlerror_run + fun:* + fun:__nss_lookup_function + fun:__nss_lookup + fun:getpwnam* +} + +{ + + Memcheck:Value8 + fun:_dl_add_to_slotinfo + fun:dl_main +} +{ + + Memcheck:Param + open(filename) + fun:open + fun:open_verify + fun:open_path + fun:_dl_map_object +} + + + +# GModule issues with glibc-2.10 +{ + + Memcheck:Value8 + fun:* + fun:* + fun:dlsym + fun:g_module_symbol +} +{ + + Memcheck:Value8 + fun:g_module_* + fun:gst_plugin* +} +{ + + Memcheck:Value8 + fun:* + fun:g_module_* + fun:gst_plugin* +} + +{ + + Memcheck:Value8 + fun:* + fun:* + fun:dlopen* + fun:g_module_open +} +{ + + Memcheck:Value8 + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:dlsym + fun:g_module_symbol +} + +{ + + Memcheck:Value8 + fun:* + fun:* + fun:* + fun:* + fun:* + fun:dlopen* + fun:g_module_open +} + +# Leak in GSlice +{ + + Memcheck:Value8 + fun:g_parse_debug_string + fun:slice_config_init + fun:g_slice_init_nomessage + fun:_g_slice_thread_init_nomessage + fun:g_thread_init_glib +} + +# 2.10 pthread issues +{ + + Memcheck:Value8 + fun:__pthread_initialize_minimal +} + +# glibc 2.11 conditional +{ + + Memcheck:Cond + fun:_dl_relocate_object + fun:dl_main + fun:_dl_sysdep_start + fun:_dl_start + obj:/lib64/ld-2.11.so +} + +# glibc 2.11 Leak + +{ + + Memcheck:Leak + fun:*alloc + fun:dl_open_worker + fun:_dl_catch_error + fun:_dl_open + fun:dlopen_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlopen@@GLIBC_2.2.5 +} + +{ + + Memcheck:Leak + fun:*alloc + fun:_dl_* + fun:dl_open_worker + fun:_dl_catch_error + fun:_dl_open + fun:dlopen_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlopen@@GLIBC_2.2.5 +} + +{ + + Memcheck:Leak + fun:*alloc + fun:_dl_* + fun:_dl_* + fun:_dl_* + fun:dl_open_worker + fun:_dl_catch_error + fun:_dl_open + fun:dlopen_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlopen@@GLIBC_2.2.5 +} + +{ + + Memcheck:Leak + fun:*alloc + fun:* + fun:_dl_* + fun:openaux + fun:_dl_catch_error + fun:_dl_map_object_deps + fun:dl_open_worker + fun:_dl_catch_error + fun:_dl_open + fun:dlopen_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlopen@@GLIBC_2.2.5 +} + +{ + + Memcheck:Leak + fun:*alloc + fun:* + fun:_dl_map_object + fun:dl_open_worker + fun:_dl_catch_error + fun:_dl_open + fun:dlopen_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlopen@@GLIBC_2.2.5 +} + +{ + + Memcheck:Leak + fun:*alloc + fun:_dl_new_object + fun:_dl_map_object_from_fd + fun:_dl_map_object + fun:openaux + fun:_dl_catch_error + fun:_dl_map_object_deps + fun:dl_open_worker + fun:_dl_catch_error + fun:_dl_open + fun:dlopen_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlopen@@GLIBC_2.2.5 +} + +{ + + Memcheck:Leak + fun:*alloc + fun:* + fun:_dl_* + fun:_dl_* + fun:_dl_* + fun:dl_open_worker + fun:_dl_catch_error + fun:_dl_open + fun:dlopen_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlopen@@GLIBC_2.2.5 +} + +# glib type leaks +{ + + Memcheck:Leak + fun:*alloc + ... + fun:g_type_register_static +} + +# new registry system +# all of this will only be created once when loading registry. + +{ + + Memcheck:Leak + fun:*alloc + ... + fun:_priv_gst_registry_chunks_load_plugin +} + +# system-wide tags +# these tags are registered once + +{ + + Memcheck:Leak + fun:*alloc + fun:* + fun:* + fun:gst_tag_register + fun:_gst_tag_initialize +} + +# system-wide type classes that we keep referenced + +{ + + Memcheck:Leak + fun:*alloc + ... + fun:g_type_class_ref +} + +# leaking cached queries which are only initialized once +{ + + Memcheck:Leak + fun:*alloc + ... + fun:_gst_query_initialize + fun:init_post +} + +# macosx (leopard) library loader leak +{ + + Memcheck:Leak + fun:_Znwm + fun:_ZNSs4_Rep9_S_createEmmRKSaIcE + fun:_ZNSs12_S_constructIPKcEEPcT_S3_RKSaIcESt20forward_iterator_tag + fun:_ZNSsC2EPKcRKSaIcE + fun:_Z41__static_initialization_and_destruction_0ii + fun:_ZN16ImageLoaderMachO18doModInitFunctionsERKN11ImageLoader11LinkContextE +} + +# GObject type registration +{ + + Memcheck:Leak + fun:*alloc + ... + fun:_g_atomic_array_copy +} + +{ + + Memcheck:Leak + fun:*alloc + fun:getdelim + obj:*libselinux* +} + +{ + + Memcheck:Leak + fun:*alloc + ... + obj:*/sed +} + +{ + + Memcheck:Addr8 + ... + obj:*/sed +} + +# GLib 2.23 interface vtable +{ + + Memcheck:Leak + fun:*alloc + ... + fun:g_type_add_interface_static +} + +{ + + Memcheck:Leak + fun:*alloc + obj:*/dash +} + +# libtool/gentoo fake leak +# it actually runs bash and valgrind complains +{ + + Memcheck:Leak + fun:*alloc + obj:/bin/bash +} + +{ + + Memcheck:Leak + fun:*alloc + ... + fun:_gst_plugin_loader_client_run + fun:main +} + +{ + + Memcheck:Cond + fun:*strcasecmp* + ... + fun:__dcigettext +} + +{ + + Memcheck:Value8 + fun:*strcasecmp* + ... + fun:__dcigettext +} + +{ + + Memcheck:Leak + fun:malloc + ... + fun:gst_poll_new + fun:gst_poll_new_timer + fun:gst_system_clock_init +} + +{ + + Memcheck:Leak + fun:calloc + ... + fun:gobject_init_ctor +} + +{ + + Memcheck:Leak + fun:malloc + ... + fun:g_quark_from*_string +} diff --git a/common/gstdoc-scangobj b/common/gstdoc-scangobj new file mode 100755 index 0000000..4ad9786 --- /dev/null +++ b/common/gstdoc-scangobj @@ -0,0 +1,1617 @@ +#!/usr/bin/env perl +# -*- cperl -*- +# +# gtk-doc - GTK DocBook documentation generator. +# Copyright (C) 1998 Damon Chaplin +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. +# + +# +# This gets information about object hierarchies and signals +# by compiling a small C program. CFLAGS and LDFLAGS must be +# set appropriately before running this script. +# + +use Getopt::Long; + +my $GTK_DOC_PREFIX=`pkg-config --variable prefix gtk-doc`; +if ($GTK_DOC_PREFIX) { + chomp $GTK_DOC_PREFIX; + #print "Adding $GTK_DOC_PREFIX/share/gtk-doc/data to \@INC\n"; + unshift @INC, "$GTK_DOC_PREFIX/share/gtk-doc/data"; +} else { + unshift @INC, '/usr/share/gtk-doc/data'; +} +require "gtkdoc-common.pl"; + +# Options + +# name of documentation module +my $MODULE; +my $OUTPUT_DIR; +my $INSPECT_DIR; +my $VERBOSE; +my $PRINT_VERSION; +my $PRINT_HELP; +my $TYPE_INIT_FUNC="g_type_init ()"; + +# --nogtkinit is deprecated, as it is the default now anyway. +%optctl = (module => \$MODULE, + source => \$SOURCE, + types => \$TYPES_FILE, + nogtkinit => \$NO_GTK_INIT, + 'type-init-func' => \$TYPE_INIT_FUNC, + 'output-dir' => \$OUTPUT_DIR, + 'inspect-dir' => \$INSPECT_DIR, + 'verbose' => \$VERBOSE, + 'version' => \$PRINT_VERSION, + 'help' => \$PRINT_HELP); + +GetOptions(\%optctl, "module=s", "source=s", "types:s", "output-dir:s", "inspect-dir:s", "nogtkinit", "type-init-func:s", "verbose", "version", "help"); + +if ($NO_GTK_INIT) { + # Do nothing. This just avoids a warning. + # the option is not used anymore +} + +if ($PRINT_VERSION) { + print "1.5\n"; + exit 0; +} + +if (!$MODULE) { + $PRINT_HELP = 1; +} + +if ($PRINT_HELP) { + print <$MODULE-scan.c") || die "Cannot open $MODULE-scan.c: $!\n"; + +my $old_signals_filename = "$OUTPUT_DIR/$MODULE.signals"; +my $new_signals_filename = "$OUTPUT_DIR/$MODULE.signals.new"; +my $old_hierarchy_filename = "$OUTPUT_DIR/$MODULE.hierarchy"; +my $new_hierarchy_filename = "$OUTPUT_DIR/$MODULE.hierarchy.new"; +my $old_interfaces_filename = "$OUTPUT_DIR/$MODULE.interfaces"; +my $new_interfaces_filename = "$OUTPUT_DIR/$MODULE.interfaces.new"; +my $old_prerequisites_filename = "$OUTPUT_DIR/$MODULE.prerequisites"; +my $new_prerequisites_filename = "$OUTPUT_DIR/$MODULE.prerequisites.new"; +my $old_args_filename = "$OUTPUT_DIR/$MODULE.args"; +my $new_args_filename = "$OUTPUT_DIR/$MODULE.args.new"; + +my $debug_log="g_message"; +if (!defined($VERBOSE) or $VERBOSE eq "0") { + $debug_log="//$debug_log"; +} + +# write a C program to scan the types + +$includes = ""; +@types = (); +@impl_types = (); + +for () { + if (/^#include/) { + $includes .= $_; + } elsif (/^%/) { + next; + } elsif (/^\s*$/) { + next; + } elsif (/^type:(.*)$/) { + $t = $1; + chomp $t; + push @impl_types, $t; + } else { + chomp; + push @types, $_; + } +} + +$ntypes = @types + @impl_types + 1; + +print OUTPUT < +#include +#include +#include + +#include +EOT + +if ($includes) { + print OUTPUT $includes; +} else { + for (@types) { + print OUTPUT "extern GType $_ (void);\n"; + } +} + +print OUTPUT < +#endif + +static GType *object_types = NULL; + +static GString *xmlstr = NULL; + +static const gchar* +xmlprint (gint indent, const gchar *tag, const gchar *data) +{ + const gchar indent_str[] = " "; + + /* reset */ + g_string_truncate (xmlstr, 0); + g_string_append_len (xmlstr, indent_str, MIN (indent, strlen (indent_str))); + g_string_append_printf (xmlstr, "<%s>", tag); + + if (data) { + gchar *s; + + s = g_markup_escape_text (data, -1); + g_string_append (xmlstr, s); + g_free (s); + } + + g_string_append_printf (xmlstr, "\\n", tag); + return xmlstr->str; +} + +static gint +gst_feature_sort_compare (gconstpointer a, gconstpointer b) +{ + 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 +static_pad_template_compare (gconstpointer a, gconstpointer b) +{ + GstStaticPadTemplate *spt_a = (GstStaticPadTemplate *) a; + GstStaticPadTemplate *spt_b = (GstStaticPadTemplate *) b; + + /* we want SINK before SRC (enum is UNKNOWN, SRC, SINK) */ + if (spt_a->direction != spt_b->direction) + return spt_b->direction - spt_a->direction; + + /* we want ALWAYS first, SOMETIMES second, REQUEST last + * (enum is ALWAYS, SOMETIMES, REQUEST) */ + if (spt_a->presence != spt_b->presence) + return spt_a->presence - spt_b->presence; + + return strcmp (spt_a->name_template, spt_b->name_template); +} + +static GType * +get_object_types (void) +{ + gpointer g_object_class; + GList *plugins = NULL; + GList *factories = NULL; + GList *l; + GstElementFactory *factory = NULL; + GType type; + gint i = 0; + gboolean reinspect; + + /* get a list of features from plugins in our source module */ + plugins = gst_registry_get_plugin_list (gst_registry_get ()); + + xmlstr = g_string_new (""); + + reinspect = !g_file_test ("scanobj-build.stamp", G_FILE_TEST_EXISTS); + + while (plugins) { + GList *features; + GstPlugin *plugin; + const gchar *source; + FILE *inspect = NULL; + gchar *inspect_name; + + plugin = (GstPlugin *) (plugins->data); + plugins = g_list_next (plugins); + source = gst_plugin_get_source (plugin); + if (!source || strcmp (source, "$SOURCE") != 0) { + continue; + } + + /* skip static coreelements plugin with pipeline and bin element factory */ + if (gst_plugin_get_filename (plugin) == NULL) + continue; + + $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", + 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, + g_strerror (errno)); + } + g_free (inspect_name); + + basename = g_path_get_basename (gst_plugin_get_filename (plugin)); + + /* output plugin data */ + fputs ("\\n",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 (), + gst_plugin_get_name (plugin)); + + /* sort factories by feature->name */ + features = g_list_sort (features, gst_feature_sort_compare); + + while (features) { + GstPluginFeature *feature; + feature = GST_PLUGIN_FEATURE (features->data); + feature = gst_plugin_feature_load (feature); + if (!feature) { + g_warning ("Could not load plugin feature %s", + gst_plugin_feature_get_name (feature)); + } + + if (GST_IS_ELEMENT_FACTORY (feature)) { + const gchar *pad_dir[] = { "unknown","source","sink" }; + const gchar *pad_pres[] = { "always","sometimes","request" }; + GList *pads, *pad; + + $debug_log (" feature: %s", gst_plugin_feature_get_name (feature)); + + factory = GST_ELEMENT_FACTORY (feature); + factories = g_list_prepend (factories, factory); + + if (reinspect) { + /* output element data */ + fputs (" \\n", 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 */ + pads = g_list_copy ((GList *) gst_element_factory_get_static_pad_templates (factory)); + pads = g_list_sort (pads, static_pad_template_compare); + for (pad = pads; pad != NULL; pad = pad->next) { + GstStaticPadTemplate *pt = pad->data; + + fputs (" \\n", inspect); + fputs (xmlprint(10, "name", pt->name_template),inspect); + fputs (xmlprint(10, "direction", pad_dir[pt->direction]),inspect); + fputs (xmlprint(10, "presence", pad_pres[pt->presence]),inspect); + fputs (xmlprint(10, "details", pt->static_caps.string),inspect); + fputs (" \\n", inspect); + } + g_list_free (pads); + fputs (" \\n \\n", inspect); + } + } + features = g_list_next (features); + } + + if (reinspect) { + fputs (" \\n", inspect); + fclose (inspect); + } + } + + g_string_free (xmlstr, TRUE); + + $debug_log ("number of element factories: %d", g_list_length (factories)); + + /* allocate the object_types array to hold them */ + object_types = g_new0 (GType, g_list_length (factories)+$ntypes+1); + + l = factories; + i = 0; + + /* fill it */ + while (l) { + 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_metadata (factory, GST_ELEMENT_METADATA_LONGNAME)); + object_types[i++] = type; + } else { + g_message ("type info for factory %s not found", + gst_element_factory_get_metadata (factory, GST_ELEMENT_METADATA_LONGNAME)); + } + l = g_list_next (l); + } + +EOT + +# get_type functions: +for (@types) { +print OUTPUT < uppercase with '_' + * GFileMonitor -> file_monitor + * GIOExtensionPoint -> extension_point + * GtkTreeView -> tree_view + * if 2nd char is upper case too + * search for first lower case and go back one char + * else + * search for next upper case + */ + if (!strncmp (object_name, "Gtk", 3)) + object_arg = object_name + 3; + else if (!strncmp (object_name, "Gnome", 5)) + object_arg = object_name + 5; + else + object_arg = object_name; + + object_arg_lower = g_ascii_strdown (object_arg, -1); + sprintf (pos, "*%s\\n", object_arg_lower); + pos += strlen (pos); + if (!strncmp (object_arg_lower, "widget", 6)) + widget_num = 2; + g_free(object_arg_lower); + + /* Convert signal name to use underscores rather than dashes '-'. */ + strncpy (signal_name, query_info.signal_name, 127); + signal_name[127] = '\\0'; + for (i = 0; signal_name[i]; i++) + { + if (signal_name[i] == '-') + signal_name[i] = '_'; + } + + /* Output the signal parameters. */ + for (param = 0; param < query_info.n_params; param++) + { + type_name = get_type_name (query_info.param_types[param] & ~G_SIGNAL_TYPE_STATIC_SCOPE, &is_pointer); + + /* Most arguments to the callback are called "arg1", "arg2", etc. + GtkWidgets are called "widget", "widget2", ... + GtkCallbacks are called "callback", "callback2", ... */ + if (!strcmp (type_name, "GtkWidget")) + { + arg_name = "widget"; + arg_num = &widget_num; + } + else if (!strcmp (type_name, "GtkCallback") + || !strcmp (type_name, "GtkCCallback")) + { + arg_name = "callback"; + arg_num = &callback_num; + } + else + { + arg_name = "arg"; + arg_num = ¶m_num; + } + sprintf (pos, "%s ", type_name); + pos += strlen (pos); + + if (!arg_num || *arg_num == 0) + sprintf (pos, "%s%s\\n", is_pointer ? "*" : " ", arg_name); + else + sprintf (pos, "%s%s%i\\n", is_pointer ? "*" : " ", arg_name, + *arg_num); + pos += strlen (pos); + + if (arg_num) + { + if (*arg_num == 0) + *arg_num = 2; + else + *arg_num += 1; + } + } + + pos = flags; + /* We use one-character flags for simplicity. */ + if (query_info.signal_flags & G_SIGNAL_RUN_FIRST) + *pos++ = 'f'; + if (query_info.signal_flags & G_SIGNAL_RUN_LAST) + *pos++ = 'l'; + if (query_info.signal_flags & G_SIGNAL_RUN_CLEANUP) + *pos++ = 'c'; + if (query_info.signal_flags & G_SIGNAL_NO_RECURSE) + *pos++ = 'r'; + if (query_info.signal_flags & G_SIGNAL_DETAILED) + *pos++ = 'd'; + if (query_info.signal_flags & G_SIGNAL_ACTION) + *pos++ = 'a'; + if (query_info.signal_flags & G_SIGNAL_NO_HOOKS) + *pos++ = 'h'; + *pos = 0; + + /* Output the return type and function name. */ + ret_type = get_type_name (query_info.return_type & ~G_SIGNAL_TYPE_STATIC_SCOPE, &is_pointer); + + fprintf (fp, + "\\n%s::%s\\n%s%s\\n%s\\n%s\\n\\n", + object_name, query_info.signal_name, ret_type, is_pointer ? "*" : "", flags, buffer); +} + + +/* Returns the type name to use for a signal argument or return value, given + the GtkType from the signal info. It also sets is_pointer to TRUE if the + argument needs a '*' since it is a pointer. */ +static const gchar * +get_type_name (GType type, gboolean * is_pointer) +{ + const gchar *type_name; + + *is_pointer = FALSE; + type_name = g_type_name (type); + + switch (type) { + case G_TYPE_NONE: + case G_TYPE_CHAR: + case G_TYPE_UCHAR: + case G_TYPE_BOOLEAN: + case G_TYPE_INT: + case G_TYPE_UINT: + case G_TYPE_LONG: + case G_TYPE_ULONG: + case G_TYPE_FLOAT: + case G_TYPE_DOUBLE: + case G_TYPE_POINTER: + /* These all have normal C type names so they are OK. */ + return type_name; + + case G_TYPE_STRING: + /* A GtkString is really a gchar*. */ + *is_pointer = TRUE; + return "gchar"; + + case G_TYPE_ENUM: + case G_TYPE_FLAGS: + /* We use a gint for both of these. Hopefully a subtype with a decent + name will be registered and used instead, as GTK+ does itself. */ + return "gint"; + + case G_TYPE_BOXED: + /* The boxed type shouldn't be used itself, only subtypes. Though we + return 'gpointer' just in case. */ + return "gpointer"; + + case G_TYPE_PARAM: + /* A GParam is really a GParamSpec*. */ + *is_pointer = TRUE; + return "GParamSpec"; + +#if GLIB_CHECK_VERSION (2, 25, 9) + case G_TYPE_VARIANT: + *is_pointer = TRUE; + return "GVariant"; +#endif + +default: + break; + } + + /* For all GObject subclasses we can use the class name with a "*", + e.g. 'GtkWidget *'. */ + if (g_type_is_a (type, G_TYPE_OBJECT)) + *is_pointer = TRUE; + + /* Also catch non GObject root types */ + if (G_TYPE_IS_CLASSED (type)) + *is_pointer = TRUE; + + /* All boxed subtypes will be pointers as well. */ + /* Exception: GStrv */ + if (g_type_is_a (type, G_TYPE_BOXED) && + !g_type_is_a (type, G_TYPE_STRV)) + *is_pointer = TRUE; + + /* All pointer subtypes will be pointers as well. */ + if (g_type_is_a (type, G_TYPE_POINTER)) + *is_pointer = TRUE; + + /* But enums are not */ + if (g_type_is_a (type, G_TYPE_ENUM) || + g_type_is_a (type, G_TYPE_FLAGS)) + *is_pointer = FALSE; + + return type_name; +} + + +/* This outputs the hierarchy of all objects which have been initialized, + i.e. by calling their XXX_get_type() initialization function. */ +static void +output_object_hierarchy (void) +{ + FILE *fp; + gint i,j; + GType root, type; + GType root_types[$ntypes] = { G_TYPE_INVALID, }; + + fp = fopen (hierarchy_filename, "w"); + if (fp == NULL) + { + g_warning ("Couldn't open output file: %s : %s", hierarchy_filename, g_strerror(errno)); + return; + } + output_hierarchy (fp, G_TYPE_OBJECT, 0); + output_hierarchy (fp, G_TYPE_INTERFACE, 0); + + for (i=0; object_types[i]; i++) { + root = object_types[i]; + while ((type = g_type_parent (root))) { + root = type; + } + if ((root != G_TYPE_OBJECT) && (root != G_TYPE_INTERFACE)) { + for (j=0; root_types[j]; j++) { + if (root == root_types[j]) { + root = G_TYPE_INVALID; break; + } + } + if(root) { + root_types[j] = root; + output_hierarchy (fp, root, 0); + } + } + } + + 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, + GType type, + guint level) +{ + guint i; + GType *children; + guint n_children; + + if (!type) + return; + + for (i = 0; i < level; i++) + fprintf (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); + + g_free (children); +} + +static void output_object_interfaces (void) +{ + guint i; + FILE *fp; + + fp = fopen (interfaces_filename, "w"); + if (fp == NULL) + { + g_warning ("Couldn't open output file: %s : %s", interfaces_filename, g_strerror(errno)); + return; + } + output_interfaces (fp, G_TYPE_OBJECT); + + for (i = 0; object_types[i]; i++) + { + if (!g_type_parent (object_types[i]) && + (object_types[i] != G_TYPE_OBJECT) && + G_TYPE_IS_INSTANTIATABLE (object_types[i])) + { + output_interfaces (fp, object_types[i]); + } + } + fclose (fp); +} + +static void +output_interfaces (FILE *fp, + GType type) +{ + guint i; + GType *children, *interfaces; + guint n_children, n_interfaces; + + if (!type) + return; + + interfaces = g_type_interfaces (type, &n_interfaces); + + if (n_interfaces > 0) + { + fprintf (fp, "%s", g_type_name (type)); + for (i=0; i < n_interfaces; i++) + fprintf (fp, " %s", g_type_name (interfaces[i])); + fprintf (fp, "\\n"); + } + g_free (interfaces); + + children = g_type_children (type, &n_children); + + for (i=0; i < n_children; i++) + output_interfaces (fp, children[i]); + + g_free (children); +} + +static void output_interface_prerequisites (void) +{ + FILE *fp; + + fp = fopen (prerequisites_filename, "w"); + if (fp == NULL) + { + g_warning ("Couldn't open output file: %s : %s", prerequisites_filename, g_strerror(errno)); + return; + } + output_prerequisites (fp, G_TYPE_INTERFACE); + fclose (fp); +} + +static void +output_prerequisites (FILE *fp, + GType type) +{ +#if GLIB_CHECK_VERSION(2,1,0) + guint i; + GType *children, *prerequisites; + guint n_children, n_prerequisites; + + if (!type) + return; + + prerequisites = g_type_interface_prerequisites (type, &n_prerequisites); + + if (n_prerequisites > 0) + { + fprintf (fp, "%s", g_type_name (type)); + for (i=0; i < n_prerequisites; i++) + fprintf (fp, " %s", g_type_name (prerequisites[i])); + fprintf (fp, "\\n"); + } + g_free (prerequisites); + + children = g_type_children (type, &n_children); + + for (i=0; i < n_children; i++) + output_prerequisites (fp, children[i]); + + g_free (children); +#endif +} + +static void +output_args (void) +{ + FILE *fp; + gint i; + + fp = fopen (args_filename, "w"); + if (fp == NULL) + { + g_warning ("Couldn't open output file: %s : %s", args_filename, g_strerror(errno)); + return; + } + + for (i = 0; object_types[i]; i++) { + output_object_args (fp, object_types[i]); + } + + fclose (fp); +} + +static gint +compare_param_specs (const void *a, const void *b) +{ + GParamSpec *spec_a = *(GParamSpec **)a; + GParamSpec *spec_b = *(GParamSpec **)b; + + return strcmp (g_param_spec_get_name (spec_a), g_param_spec_get_name (spec_b)); +} + +/* Its common to have unsigned properties restricted + * to the signed range. Therefore we make this look + * a bit nicer by spelling out the max constants. + */ + +/* Don't use "==" with floats, it might trigger a gcc warning. */ +#define GTKDOC_COMPARE_FLOAT(x, y) (x <= y && x >= y) + +static gchar* +describe_double_constant (gdouble value) +{ + gchar *desc; + + if (GTKDOC_COMPARE_FLOAT (value, G_MAXDOUBLE)) + desc = g_strdup ("G_MAXDOUBLE"); + else if (GTKDOC_COMPARE_FLOAT (value, G_MINDOUBLE)) + desc = g_strdup ("G_MINDOUBLE"); + else if (GTKDOC_COMPARE_FLOAT (value, -G_MAXDOUBLE)) + desc = g_strdup ("-G_MAXDOUBLE"); + else if (GTKDOC_COMPARE_FLOAT (value, G_MAXFLOAT)) + desc = g_strdup ("G_MAXFLOAT"); + else if (GTKDOC_COMPARE_FLOAT (value, G_MINFLOAT)) + desc = g_strdup ("G_MINFLOAT"); + else if (GTKDOC_COMPARE_FLOAT (value, -G_MAXFLOAT)) + desc = g_strdup ("-G_MAXFLOAT"); + else{ + /* make sure floats are output with a decimal dot irrespective of + * current locale. Use formatd since we want human-readable numbers + * and do not need the exact same bit representation when deserialising */ + desc = g_malloc0 (G_ASCII_DTOSTR_BUF_SIZE); + g_ascii_formatd (desc, G_ASCII_DTOSTR_BUF_SIZE, "%g", value); + } + + return desc; +} + +static gchar* +describe_signed_constant (gsize size, gint64 value) +{ + gchar *desc = NULL; + + switch (size) { + case 8: + if (value == G_MAXINT64) + desc = g_strdup ("G_MAXINT64"); + else if (value == G_MININT64) + desc = g_strdup ("G_MININT64"); + /* fall through */ + case 4: + if (sizeof (int) == 4) { + if (value == G_MAXINT) + desc = g_strdup ("G_MAXINT"); + else if (value == G_MININT) + desc = g_strdup ("G_MININT"); + else if (value == (gint64)G_MAXUINT) + desc = g_strdup ("G_MAXUINT"); + } + if (value == G_MAXLONG) + desc = g_strdup ("G_MAXLONG"); + else if (value == G_MINLONG) + desc = g_strdup ("G_MINLONG"); + else if (value == (gint64)G_MAXULONG) + desc = g_strdup ("G_MAXULONG"); + /* fall through */ + case 2: + if (sizeof (int) == 2) { + if (value == G_MAXINT) + desc = g_strdup ("G_MAXINT"); + else if (value == G_MININT) + desc = g_strdup ("G_MININT"); + else if (value == (gint64)G_MAXUINT) + desc = g_strdup ("G_MAXUINT"); + } + break; + default: + break; + } + if (!desc) + desc = g_strdup_printf ("%" G_GINT64_FORMAT, value); + + return desc; +} + +static gchar* +describe_unsigned_constant (gsize size, guint64 value) +{ + gchar *desc = NULL; + + switch (size) { + case 8: + if (value == G_MAXINT64) + desc = g_strdup ("G_MAXINT64"); + else if (value == G_MAXUINT64) + desc = g_strdup ("G_MAXUINT64"); + /* fall through */ + case 4: + if (sizeof (int) == 4) { + if (value == (guint64)G_MAXINT) + desc = g_strdup ("G_MAXINT"); + else if (value == G_MAXUINT) + desc = g_strdup ("G_MAXUINT"); + } + if (value == (guint64)G_MAXLONG) + desc = g_strdup ("G_MAXLONG"); + else if (value == G_MAXULONG) + desc = g_strdup ("G_MAXULONG"); + /* fall through */ + case 2: + if (sizeof (int) == 2) { + if (value == (guint64)G_MAXINT) + desc = g_strdup ("G_MAXINT"); + else if (value == G_MAXUINT) + desc = g_strdup ("G_MAXUINT"); + } + break; + default: + break; + } + if (!desc) + desc = g_strdup_printf ("%" G_GUINT64_FORMAT, value); + + return desc; +} + +static gchar* +describe_type (GParamSpec *spec) +{ + gchar *desc; + gchar *lower; + gchar *upper; + + if (G_IS_PARAM_SPEC_CHAR (spec)) + { + GParamSpecChar *pspec = G_PARAM_SPEC_CHAR (spec); + + lower = describe_signed_constant (sizeof(gchar), pspec->minimum); + upper = describe_signed_constant (sizeof(gchar), pspec->maximum); + if (pspec->minimum == G_MININT8 && pspec->maximum == G_MAXINT8) + desc = g_strdup (""); + else if (pspec->minimum == G_MININT8) + desc = g_strdup_printf ("<= %s", upper); + else if (pspec->maximum == G_MAXINT8) + desc = g_strdup_printf (">= %s", lower); + else + desc = g_strdup_printf ("[%s,%s]", lower, upper); + g_free (lower); + g_free (upper); + } + else if (G_IS_PARAM_SPEC_UCHAR (spec)) + { + GParamSpecUChar *pspec = G_PARAM_SPEC_UCHAR (spec); + + lower = describe_unsigned_constant (sizeof(guchar), pspec->minimum); + upper = describe_unsigned_constant (sizeof(guchar), pspec->maximum); + if (pspec->minimum == 0 && pspec->maximum == G_MAXUINT8) + desc = g_strdup (""); + else if (pspec->minimum == 0) + desc = g_strdup_printf ("<= %s", upper); + else if (pspec->maximum == G_MAXUINT8) + desc = g_strdup_printf (">= %s", lower); + else + desc = g_strdup_printf ("[%s,%s]", lower, upper); + g_free (lower); + g_free (upper); + } + else if (G_IS_PARAM_SPEC_INT (spec)) + { + GParamSpecInt *pspec = G_PARAM_SPEC_INT (spec); + + lower = describe_signed_constant (sizeof(gint), pspec->minimum); + upper = describe_signed_constant (sizeof(gint), pspec->maximum); + if (pspec->minimum == G_MININT && pspec->maximum == G_MAXINT) + desc = g_strdup (""); + else if (pspec->minimum == G_MININT) + desc = g_strdup_printf ("<= %s", upper); + else if (pspec->maximum == G_MAXINT) + desc = g_strdup_printf (">= %s", lower); + else + desc = g_strdup_printf ("[%s,%s]", lower, upper); + g_free (lower); + g_free (upper); + } + else if (G_IS_PARAM_SPEC_UINT (spec)) + { + GParamSpecUInt *pspec = G_PARAM_SPEC_UINT (spec); + + lower = describe_unsigned_constant (sizeof(guint), pspec->minimum); + upper = describe_unsigned_constant (sizeof(guint), pspec->maximum); + if (pspec->minimum == 0 && pspec->maximum == G_MAXUINT) + desc = g_strdup (""); + else if (pspec->minimum == 0) + desc = g_strdup_printf ("<= %s", upper); + else if (pspec->maximum == G_MAXUINT) + desc = g_strdup_printf (">= %s", lower); + else + desc = g_strdup_printf ("[%s,%s]", lower, upper); + g_free (lower); + g_free (upper); + } + else if (G_IS_PARAM_SPEC_LONG (spec)) + { + GParamSpecLong *pspec = G_PARAM_SPEC_LONG (spec); + + lower = describe_signed_constant (sizeof(glong), pspec->minimum); + upper = describe_signed_constant (sizeof(glong), pspec->maximum); + if (pspec->minimum == G_MINLONG && pspec->maximum == G_MAXLONG) + desc = g_strdup (""); + else if (pspec->minimum == G_MINLONG) + desc = g_strdup_printf ("<= %s", upper); + else if (pspec->maximum == G_MAXLONG) + desc = g_strdup_printf (">= %s", lower); + else + desc = g_strdup_printf ("[%s,%s]", lower, upper); + g_free (lower); + g_free (upper); + } + else if (G_IS_PARAM_SPEC_ULONG (spec)) + { + GParamSpecULong *pspec = G_PARAM_SPEC_ULONG (spec); + + lower = describe_unsigned_constant (sizeof(gulong), pspec->minimum); + upper = describe_unsigned_constant (sizeof(gulong), pspec->maximum); + if (pspec->minimum == 0 && pspec->maximum == G_MAXULONG) + desc = g_strdup (""); + else if (pspec->minimum == 0) + desc = g_strdup_printf ("<= %s", upper); + else if (pspec->maximum == G_MAXULONG) + desc = g_strdup_printf (">= %s", lower); + else + desc = g_strdup_printf ("[%s,%s]", lower, upper); + g_free (lower); + g_free (upper); + } + else if (G_IS_PARAM_SPEC_INT64 (spec)) + { + GParamSpecInt64 *pspec = G_PARAM_SPEC_INT64 (spec); + + lower = describe_signed_constant (sizeof(gint64), pspec->minimum); + upper = describe_signed_constant (sizeof(gint64), pspec->maximum); + if (pspec->minimum == G_MININT64 && pspec->maximum == G_MAXINT64) + desc = g_strdup (""); + else if (pspec->minimum == G_MININT64) + desc = g_strdup_printf ("<= %s", upper); + else if (pspec->maximum == G_MAXINT64) + desc = g_strdup_printf (">= %s", lower); + else + desc = g_strdup_printf ("[%s,%s]", lower, upper); + g_free (lower); + g_free (upper); + } + else if (G_IS_PARAM_SPEC_UINT64 (spec)) + { + GParamSpecUInt64 *pspec = G_PARAM_SPEC_UINT64 (spec); + + lower = describe_unsigned_constant (sizeof(guint64), pspec->minimum); + upper = describe_unsigned_constant (sizeof(guint64), pspec->maximum); + if (pspec->minimum == 0 && pspec->maximum == G_MAXUINT64) + desc = g_strdup (""); + else if (pspec->minimum == 0) + desc = g_strdup_printf ("<= %s", upper); + else if (pspec->maximum == G_MAXUINT64) + desc = g_strdup_printf (">= %s", lower); + else + desc = g_strdup_printf ("[%s,%s]", lower, upper); + g_free (lower); + g_free (upper); + } + else if (G_IS_PARAM_SPEC_FLOAT (spec)) + { + GParamSpecFloat *pspec = G_PARAM_SPEC_FLOAT (spec); + + lower = describe_double_constant (pspec->minimum); + upper = describe_double_constant (pspec->maximum); + if (GTKDOC_COMPARE_FLOAT (pspec->minimum, -G_MAXFLOAT)) + { + if (GTKDOC_COMPARE_FLOAT (pspec->maximum, G_MAXFLOAT)) + desc = g_strdup (""); + else + desc = g_strdup_printf ("<= %s", upper); + } + else if (GTKDOC_COMPARE_FLOAT (pspec->maximum, G_MAXFLOAT)) + desc = g_strdup_printf (">= %s", lower); + else + desc = g_strdup_printf ("[%s,%s]", lower, upper); + g_free (lower); + g_free (upper); + } + else if (G_IS_PARAM_SPEC_DOUBLE (spec)) + { + GParamSpecDouble *pspec = G_PARAM_SPEC_DOUBLE (spec); + + lower = describe_double_constant (pspec->minimum); + upper = describe_double_constant (pspec->maximum); + if (GTKDOC_COMPARE_FLOAT (pspec->minimum, -G_MAXDOUBLE)) + { + if (GTKDOC_COMPARE_FLOAT (pspec->maximum, G_MAXDOUBLE)) + desc = g_strdup (""); + else + desc = g_strdup_printf ("<= %s", upper); + } + else if (GTKDOC_COMPARE_FLOAT (pspec->maximum, G_MAXDOUBLE)) + desc = g_strdup_printf (">= %s", lower); + else + desc = g_strdup_printf ("[%s,%s]", lower, upper); + g_free (lower); + g_free (upper); + } +#if GLIB_CHECK_VERSION (2, 12, 0) + else if (G_IS_PARAM_SPEC_GTYPE (spec)) + { + GParamSpecGType *pspec = G_PARAM_SPEC_GTYPE (spec); + gboolean is_pointer; + + desc = g_strdup (get_type_name (pspec->is_a_type, &is_pointer)); + } +#endif +#if GLIB_CHECK_VERSION (2, 25, 9) + else if (G_IS_PARAM_SPEC_VARIANT (spec)) + { + GParamSpecVariant *pspec = G_PARAM_SPEC_VARIANT (spec); + gchar *variant_type; + + variant_type = g_variant_type_dup_string (pspec->type); + desc = g_strdup_printf ("GVariant<%s>", variant_type); + g_free (variant_type); + } +#endif + else + { + desc = g_strdup (""); + } + + return desc; +} + +static gchar* +describe_default (GParamSpec *spec) +{ + gchar *desc; + + if (G_IS_PARAM_SPEC_CHAR (spec)) + { + GParamSpecChar *pspec = G_PARAM_SPEC_CHAR (spec); + + desc = g_strdup_printf ("%d", pspec->default_value); + } + else if (G_IS_PARAM_SPEC_UCHAR (spec)) + { + GParamSpecUChar *pspec = G_PARAM_SPEC_UCHAR (spec); + + desc = g_strdup_printf ("%u", pspec->default_value); + } + else if (G_IS_PARAM_SPEC_BOOLEAN (spec)) + { + GParamSpecBoolean *pspec = G_PARAM_SPEC_BOOLEAN (spec); + + desc = g_strdup_printf ("%s", pspec->default_value ? "TRUE" : "FALSE"); + } + else if (G_IS_PARAM_SPEC_INT (spec)) + { + GParamSpecInt *pspec = G_PARAM_SPEC_INT (spec); + + desc = g_strdup_printf ("%d", pspec->default_value); + } + else if (G_IS_PARAM_SPEC_UINT (spec)) + { + GParamSpecUInt *pspec = G_PARAM_SPEC_UINT (spec); + + desc = g_strdup_printf ("%u", pspec->default_value); + } + else if (G_IS_PARAM_SPEC_LONG (spec)) + { + GParamSpecLong *pspec = G_PARAM_SPEC_LONG (spec); + + desc = g_strdup_printf ("%ld", pspec->default_value); + } + else if (G_IS_PARAM_SPEC_LONG (spec)) + { + GParamSpecULong *pspec = G_PARAM_SPEC_ULONG (spec); + + desc = g_strdup_printf ("%lu", pspec->default_value); + } + else if (G_IS_PARAM_SPEC_INT64 (spec)) + { + GParamSpecInt64 *pspec = G_PARAM_SPEC_INT64 (spec); + + desc = g_strdup_printf ("%" G_GINT64_FORMAT, pspec->default_value); + } + else if (G_IS_PARAM_SPEC_UINT64 (spec)) + { + GParamSpecUInt64 *pspec = G_PARAM_SPEC_UINT64 (spec); + + desc = g_strdup_printf ("%" G_GUINT64_FORMAT, pspec->default_value); + } + else if (G_IS_PARAM_SPEC_UNICHAR (spec)) + { + GParamSpecUnichar *pspec = G_PARAM_SPEC_UNICHAR (spec); + + if (g_unichar_isprint (pspec->default_value)) + desc = g_strdup_printf ("'%c'", pspec->default_value); + else + desc = g_strdup_printf ("%u", pspec->default_value); + } + else if (G_IS_PARAM_SPEC_ENUM (spec)) + { + GParamSpecEnum *pspec = G_PARAM_SPEC_ENUM (spec); + + GEnumValue *value = g_enum_get_value (pspec->enum_class, pspec->default_value); + if (value) + desc = g_strdup_printf ("%s", value->value_name); + else + desc = g_strdup_printf ("%d", pspec->default_value); + } + else if (G_IS_PARAM_SPEC_FLAGS (spec)) + { + GParamSpecFlags *pspec = G_PARAM_SPEC_FLAGS (spec); + guint default_value; + GString *acc; + + default_value = pspec->default_value; + acc = g_string_new (""); + + while (default_value) + { + GFlagsValue *value = g_flags_get_first_value (pspec->flags_class, default_value); + + if (!value) + break; + + if (acc->len > 0) + g_string_append (acc, "|"); + g_string_append (acc, value->value_name); + + default_value &= ~value->value; + } + + if (default_value == 0) + desc = g_string_free (acc, FALSE); + else + { + desc = g_strdup_printf ("%d", pspec->default_value); + g_string_free (acc, TRUE); + } + } + else if (G_IS_PARAM_SPEC_FLOAT (spec)) + { + GParamSpecFloat *pspec = G_PARAM_SPEC_FLOAT (spec); + + /* make sure floats are output with a decimal dot irrespective of + * current locale. Use formatd since we want human-readable numbers + * and do not need the exact same bit representation when deserialising */ + desc = g_malloc0 (G_ASCII_DTOSTR_BUF_SIZE); + g_ascii_formatd (desc, G_ASCII_DTOSTR_BUF_SIZE, "%g", + pspec->default_value); + } + else if (G_IS_PARAM_SPEC_DOUBLE (spec)) + { + GParamSpecDouble *pspec = G_PARAM_SPEC_DOUBLE (spec); + + /* make sure floats are output with a decimal dot irrespective of + * current locale. Use formatd since we want human-readable numbers + * and do not need the exact same bit representation when deserialising */ + desc = g_malloc0 (G_ASCII_DTOSTR_BUF_SIZE); + g_ascii_formatd (desc, G_ASCII_DTOSTR_BUF_SIZE, "%g", + pspec->default_value); + } + else if (G_IS_PARAM_SPEC_STRING (spec)) + { + GParamSpecString *pspec = G_PARAM_SPEC_STRING (spec); + + if (pspec->default_value) + { + gchar *esc = g_strescape (pspec->default_value, NULL); + + desc = g_strdup_printf ("\\"%s\\"", esc); + + g_free (esc); + } + else + desc = g_strdup_printf ("NULL"); + } + else + { + desc = g_strdup (""); + } + + return desc; +} + + +static void +output_object_args (FILE *fp, GType object_type) +{ + gpointer class; + const gchar *object_class_name; + guint arg; + gchar flags[16], *pos; + GParamSpec **properties; + guint n_properties; + gboolean child_prop; + gboolean style_prop; + gboolean is_pointer; + const gchar *type_name; + gchar *type_desc; + gchar *default_value; + + if (G_TYPE_IS_OBJECT (object_type)) + { + class = g_type_class_peek (object_type); + if (!class) + return; + + properties = g_object_class_list_properties (class, &n_properties); + } +#if GLIB_MAJOR_VERSION > 2 || (GLIB_MAJOR_VERSION == 2 && GLIB_MINOR_VERSION >= 3) + else if (G_TYPE_IS_INTERFACE (object_type)) + { + class = g_type_default_interface_ref (object_type); + + if (!class) + return; + + properties = g_object_interface_list_properties (class, &n_properties); + } +#endif + else + return; + + object_class_name = g_type_name (object_type); + + child_prop = FALSE; + style_prop = FALSE; + + while (TRUE) { + qsort (properties, n_properties, sizeof (GParamSpec *), compare_param_specs); + for (arg = 0; arg < n_properties; arg++) + { + GParamSpec *spec = properties[arg]; + const gchar *nick, *blurb, *dot; + + if (spec->owner_type != object_type) + continue; + + pos = flags; + /* We use one-character flags for simplicity. */ + if (child_prop && !style_prop) + *pos++ = 'c'; + if (style_prop) + *pos++ = 's'; + if (spec->flags & G_PARAM_READABLE) + *pos++ = 'r'; + if (spec->flags & G_PARAM_WRITABLE) + *pos++ = 'w'; + if (spec->flags & G_PARAM_CONSTRUCT) + *pos++ = 'x'; + if (spec->flags & G_PARAM_CONSTRUCT_ONLY) + *pos++ = 'X'; + *pos = 0; + + nick = g_param_spec_get_nick (spec); + blurb = g_param_spec_get_blurb (spec); + + dot = ""; + if (blurb) { + int str_len = strlen (blurb); + if (str_len > 0 && blurb[str_len - 1] != '.') + dot = "."; + } + + type_desc = describe_type (spec); + default_value = describe_default (spec); + type_name = get_type_name (spec->value_type, &is_pointer); + fprintf (fp, "\\n%s::%s\\n%s%s\\n%s\\n%s\\n%s\\n%s%s\\n%s\\n\\n\\n", + object_class_name, g_param_spec_get_name (spec), type_name, is_pointer ? "*" : "", type_desc, flags, nick ? nick : "(null)", blurb ? blurb : "(null)", dot, default_value); + g_free (type_desc); + g_free (default_value); + } + + g_free (properties); + +#ifdef GTK_IS_CONTAINER_CLASS + if (!child_prop && GTK_IS_CONTAINER_CLASS (class)) { + properties = gtk_container_class_list_child_properties (class, &n_properties); + child_prop = TRUE; + continue; + } +#endif + +#ifdef GTK_IS_CELL_AREA_CLASS + if (!child_prop && GTK_IS_CELL_AREA_CLASS (class)) { + properties = gtk_cell_area_class_list_cell_properties (class, &n_properties); + child_prop = TRUE; + continue; + } +#endif + +#ifdef GTK_IS_WIDGET_CLASS +#if GTK_CHECK_VERSION(2,1,0) + if (!style_prop && GTK_IS_WIDGET_CLASS (class)) { + properties = gtk_widget_class_list_style_properties (GTK_WIDGET_CLASS (class), &n_properties); + style_prop = TRUE; + continue; + } +#endif +#endif + + break; + } +} +EOT + +close OUTPUT; + +# Compile and run our file + +$CC = $ENV{CC} ? $ENV{CC} : "gcc"; +$LD = $ENV{LD} ? $ENV{LD} : $CC; +$CFLAGS = $ENV{CFLAGS} ? "$ENV{CFLAGS}" : ""; +$LDFLAGS = $ENV{LDFLAGS} ? $ENV{LDFLAGS} : ""; + +my $o_file; +if ($CC =~ /libtool/) { + $o_file = "$MODULE-scan.lo" +} else { + $o_file = "$MODULE-scan.o" +} + +my $stdout=""; +if (!defined($VERBOSE) or $VERBOSE eq "0") { + $stdout=">/dev/null"; +} + +# Compiling scanner +$command = "$CC $stdout $CFLAGS -c -o $o_file $MODULE-scan.c"; +system("($command)") == 0 or die "Compilation of scanner failed: $!\n"; + +# Linking scanner +$command = "$LD $stdout -o $MODULE-scan $o_file $LDFLAGS"; +system($command) == 0 or die "Linking of scanner failed: $!\n"; + +# Running scanner $MODULE-scan "; +system("sh -c ./$MODULE-scan") == 0 or die "Scan failed: $!\n"; + +if (!defined($ENV{"GTK_DOC_KEEP_INTERMEDIATE"})) { + unlink "./$MODULE-scan.c", "./$MODULE-scan.o", "./$MODULE-scan.lo", "./$MODULE-scan"; +} + +&UpdateFileIfChanged ($old_hierarchy_filename, $new_hierarchy_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); + diff --git a/common/gtk-doc-plugins.mak b/common/gtk-doc-plugins.mak new file mode 100644 index 0000000..f19e7d7 --- /dev/null +++ b/common/gtk-doc-plugins.mak @@ -0,0 +1,382 @@ +# This is an include file specifically tuned for building documentation +# for GStreamer plug-ins + +help: + @echo + @echo "If you are a doc maintainer, run 'make update' to update" + @echo "the documentation files maintained in git" + @echo + @echo Other useful make targets: + @echo + @echo check-inspected-versions: make sure the inspected plugin info + @echo is up to date before a release + @echo + +# update the stuff maintained by doc maintainers +update: scanobj-update + $(MAKE) check-outdated-docs + +# We set GPATH here; this gives us semantics for GNU make +# which are more like other make's VPATH, when it comes to +# whether a source that is a target of one rule is then +# searched for in VPATH/GPATH. +# +GPATH = $(srcdir) + +# thomas: make docs parallel installable +TARGET_DIR=$(HTML_DIR)/$(DOC_MODULE)-@GST_API_VERSION@ + +MAINTAINER_DOC_STAMPS = \ + scanobj-build.stamp + +EXTRA_DIST = \ + $(MAINTAINER_DOC_STAMPS) \ + $(srcdir)/inspect/*.xml \ + $(SCANOBJ_FILES) \ + $(content_files) \ + $(extra_files) \ + $(HTML_IMAGES) \ + $(DOC_MAIN_SGML_FILE) \ + $(DOC_OVERRIDES) \ + $(DOC_MODULE)-sections.txt + +# we don't add scanobj-build.stamp here since they are built manually by docs +# maintainers and result is commited to git +DOC_STAMPS = \ + scan-build.stamp \ + tmpl-build.stamp \ + sgml-build.stamp \ + html-build.stamp \ + scan.stamp \ + tmpl.stamp \ + sgml.stamp \ + html.stamp + +# files generated/updated by gtkdoc-scangobj +SCANOBJ_FILES = \ + $(DOC_MODULE).args \ + $(DOC_MODULE).hierarchy \ + $(DOC_MODULE).interfaces \ + $(DOC_MODULE).prerequisites \ + $(DOC_MODULE).signals \ + $(DOC_MODULE).types + +SCANOBJ_FILES_O = \ + .libs/$(DOC_MODULE)-scan.o + +# files generated/updated by gtkdoc-scan +SCAN_FILES = \ + $(DOC_MODULE)-sections.txt \ + $(DOC_MODULE)-overrides.txt \ + $(DOC_MODULE)-decl.txt \ + $(DOC_MODULE)-decl-list.txt + + +REPORT_FILES = \ + $(DOC_MODULE)-undocumented.txt \ + $(DOC_MODULE)-undeclared.txt \ + $(DOC_MODULE)-unused.txt + +CLEANFILES = \ + $(SCANOBJ_FILES_O) \ + $(REPORT_FILES) \ + $(DOC_STAMPS) \ + inspect-registry.xml + +INSPECT_DIR = inspect + +if ENABLE_GTK_DOC +all-local: html-build.stamp + +### inspect GStreamer plug-ins; done by documentation maintainer ### + +# only look at the plugins in this module when building inspect .xml stuff +INSPECT_REGISTRY=$(top_builddir)/docs/plugins/inspect-registry.xml +INSPECT_ENVIRONMENT=\ + LC_ALL=C \ + GST_PLUGIN_SYSTEM_PATH_1_0= \ + GST_PLUGIN_PATH_1_0=$(top_builddir)/gst:$(top_builddir)/sys:$(top_builddir)/ext:$(top_builddir)/plugins:$(top_builddir)/src:$(top_builddir)/gnl \ + GST_REGISTRY_1_0=$(INSPECT_REGISTRY) \ + PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" \ + $(INSPECT_EXTRA_ENVIRONMENT) + +#### scan gobjects; done by documentation maintainer #### +scanobj-update: + -rm scanobj-build.stamp + $(MAKE) scanobj-build.stamp + +# gstdoc-scanobj produces 5 output files (.new) +# scangobj-merge.py merges them into the file which we commit later +# TODO: also merge the hierarchy +scanobj-build.stamp: $(SCANOBJ_DEPS) $(basefiles) + @echo " DOC Introspecting gobjects" + @if test x"$(srcdir)" != x. ; then \ + for f in $(SCANOBJ_FILES) $(SCAN_FILES); \ + do \ + if test -e $(srcdir)/$$f; then cp -u $(srcdir)/$$f . ; fi; \ + done; \ + fi; \ + mkdir -p $(INSPECT_DIR); \ + scanobj_options=""; \ + if test "x$(V)" = "x1"; then \ + scanobj_options="--verbose"; \ + fi; \ + $(INSPECT_ENVIRONMENT) \ + CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" \ + CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS) $(WARNING_CFLAGS)" \ + LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" \ + $(GST_DOC_SCANOBJ) $$scanobj_options --type-init-func="gst_init(NULL,NULL)" \ + --module=$(DOC_MODULE) --source=$(PACKAGE) --inspect-dir=$(INSPECT_DIR) && \ + echo " DOC Merging introspection data" && \ + $(PYTHON) \ + $(top_srcdir)/common/scangobj-merge.py $(DOC_MODULE) || exit 1; \ + if test x"$(srcdir)" != x. ; then \ + for f in $(SCANOBJ_FILES); \ + do \ + cmp -s ./$$f $(srcdir)/$$f || cp ./$$f $(srcdir)/ ; \ + done; \ + fi; \ + touch scanobj-build.stamp + +$(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(SCANOBJ_FILES_O): scan-build.stamp + @true + +### scan headers; done on every build ### +scan-build.stamp: $(HFILE_GLOB) $(EXTRA_HFILES) $(basefiles) scanobj-build.stamp + @echo ' DOC Scanning header files' + @if test x"$(srcdir)" != x. ; then \ + for f in $(SCANOBJ_FILES) $(SCAN_FILES); \ + do \ + if test -e $(srcdir)/$$f; then cp -u $(srcdir)/$$f . ; fi; \ + done; \ + fi + @_source_dir='' ; \ + for i in $(DOC_SOURCE_DIR) ; do \ + _source_dir="$${_source_dir} --source-dir=$$i" ; \ + done ; \ + gtkdoc-scan \ + $(SCAN_OPTIONS) $(EXTRA_HFILES) \ + --module=$(DOC_MODULE) \ + $${_source_dir} \ + --ignore-headers="$(IGNORE_HFILES)"; \ + touch scan-build.stamp + +#### update templates; done on every build #### + +# in a non-srcdir build, we need to copy files from the previous step +# and the files from previous runs of this step +tmpl-build.stamp: $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_OVERRIDES) + @echo ' DOC Rebuilding template files' + @if test x"$(srcdir)" != x. ; then \ + for f in $(SCANOBJ_FILES) $(SCAN_FILES); \ + do \ + if test -e $(srcdir)/$$f; then cp -u $(srcdir)/$$f . ; fi; \ + done; \ + fi + @gtkdoc-mktmpl --module=$(DOC_MODULE) + @$(PYTHON) \ + $(top_srcdir)/common/mangle-tmpl.py $(srcdir)/$(INSPECT_DIR) tmpl + @touch tmpl-build.stamp + +tmpl.stamp: tmpl-build.stamp + @true + +#### xml #### + +sgml-build.stamp: tmpl.stamp scan-build.stamp $(CFILE_GLOB) $(top_srcdir)/common/plugins.xsl $(expand_content_files) + @echo ' DOC Building XML' + @-mkdir -p xml + @for a in $(srcdir)/$(INSPECT_DIR)/*.xml; do \ + xsltproc --stringparam module $(MODULE) \ + $(top_srcdir)/common/plugins.xsl $$a > xml/`basename $$a`; done + @for f in $(EXAMPLE_CFILES); do \ + $(PYTHON) $(top_srcdir)/common/c-to-xml.py $$f > xml/element-`basename $$f .c`.xml; done + @gtkdoc-mkdb \ + --module=$(DOC_MODULE) \ + --source-dir=$(DOC_SOURCE_DIR) \ + --expand-content-files="$(expand_content_files)" \ + --main-sgml-file=$(srcdir)/$(DOC_MAIN_SGML_FILE) \ + --output-format=xml \ + --ignore-files="$(IGNORE_HFILES) $(IGNORE_CFILES)" \ + $(MKDB_OPTIONS) + @cp ../version.entities xml + @touch sgml-build.stamp + +sgml.stamp: sgml-build.stamp + @true + +#### html #### + +html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) + @echo ' DOC Building HTML' + @rm -rf html + @mkdir html + @cp $(srcdir)/$(DOC_MAIN_SGML_FILE) html + @for f in $(content_files); do cp $(srcdir)/$$f html; done + @cp -pr xml html + @cp ../version.entities html + @mkhtml_options=""; \ + gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-verbose"; \ + if test "$(?)" = "0"; then \ + if test "x$(V)" = "x1"; then \ + mkhtml_options="$$mkhtml_options --verbose"; \ + fi; \ + fi; \ + cd html && gtkdoc-mkhtml $$mkhtml_options $(DOC_MODULE)-@GST_API_VERSION@ $(DOC_MAIN_SGML_FILE) + @rm -f html/$(DOC_MAIN_SGML_FILE) + @rm -rf html/xml + @rm -f html/version.entities + @test "x$(HTML_IMAGES)" = "x" || for i in "" $(HTML_IMAGES) ; do \ + if test "$$i" != ""; then cp $(srcdir)/$$i html ; fi; done + @echo ' DOC Fixing cross-references' + @gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS) + @touch html-build.stamp + +clean-local-gtkdoc: + @rm -rf xml tmpl html +# clean files copied for nonsrcdir templates build + @if test x"$(srcdir)" != x. ; then \ + rm -rf $(SCANOBJ_FILES) $(SCAN_FILES) $(REPORT_FILES) \ + $(MAINTAINER_DOC_STAMPS); \ + fi +else +all-local: +clean-local-gtkdoc: +endif + +clean-local: clean-local-gtkdoc + @rm -f *~ *.bak + @rm -rf .libs + +distclean-local: + @rm -f $(REPORT_FILES) \ + $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt + @rm -rf tmpl/*.sgml.bak + @rm -f $(DOC_MODULE).hierarchy + @rm -f *.stamp || true + @if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ + rm -f $(DOC_MODULE)-docs.sgml ; \ + rm -f $(DOC_MODULE).types ; \ + rm -f $(DOC_MODULE).interfaces ; \ + rm -f $(DOC_MODULE)-overrides.txt ; \ + rm -f $(DOC_MODULE).prerequisites ; \ + rm -f $(DOC_MODULE)-sections.txt ; \ + rm -rf tmpl/*.sgml ; \ + rm -rf $(INSPECT_DIR); \ + fi + @rm -rf *.o + +MAINTAINERCLEANFILES = $(MAINTAINER_DOC_STAMPS) + +# thomas: make docs parallel installable; devhelp requires majorminor too +install-data-local: + (installfiles=`echo $(builddir)/html/*.sgml $(builddir)/html/*.html $(builddir)/html/*.png $(builddir)/html/*.css`; \ + if test "$$installfiles" = '$(builddir)/html/*.sgml $(builddir)/html/*.html $(builddir)/html/*.png $(builddir)/html/*.css'; \ + then echo '-- Nothing to install' ; \ + else \ + $(mkinstalldirs) $(DESTDIR)$(TARGET_DIR); \ + for i in $$installfiles; do \ + echo '-- Installing '$$i ; \ + $(INSTALL_DATA) $$i $(DESTDIR)$(TARGET_DIR); \ + done; \ + pngfiles=`echo ./html/*.png`; \ + if test "$$pngfiles" != './html/*.png'; then \ + for i in $$pngfiles; do \ + echo '-- Installing '$$i ; \ + $(INSTALL_DATA) $$i $(DESTDIR)$(TARGET_DIR); \ + done; \ + fi; \ + echo '-- Installing $(builddir)/html/$(DOC_MODULE)-@GST_API_VERSION@.devhelp2' ; \ + if test -e $(builddir)/html/$(DOC_MODULE)-@GST_API_VERSION@.devhelp2; then \ + $(INSTALL_DATA) $(builddir)/html/$(DOC_MODULE)-@GST_API_VERSION@.devhelp2 \ + $(DESTDIR)$(TARGET_DIR)/$(DOC_MODULE)-@GST_API_VERSION@.devhelp2; \ + fi; \ + $(GTKDOC_REBASE) --relative --dest-dir=$(DESTDIR) --html-dir=$(DESTDIR)$(TARGET_DIR) || true ; \ + fi) +uninstall-local: + if test -d $(DESTDIR)$(TARGET_DIR); then \ + rm -rf $(DESTDIR)$(TARGET_DIR)/*; \ + rmdir -p $(DESTDIR)$(TARGET_DIR) 2>/dev/null || true; \ + else \ + echo '-- Nothing to uninstall' ; \ + fi; + +# +# Checks +# +if ENABLE_GTK_DOC +check-hierarchy: $(DOC_MODULE).hierarchy + @if grep ' ' $(DOC_MODULE).hierarchy; then \ + echo "$(DOC_MODULE).hierarchy contains tabs, please fix"; \ + /bin/false; \ + fi + +check: check-hierarchy +endif + +# wildcard is apparently not portable to other makes, hence the use of find +inspect_files = $(shell find $(srcdir)/$(INSPECT_DIR) -name '*.xml') + +check-inspected-versions: + @echo Checking plugin versions of inspected plugin data ...; \ + fail=0 ; \ + for each in $(inspect_files) ; do \ + if (grep -H '' $$each | grep -v '$(VERSION)'); then \ + echo $$each should be fixed to say version $(VERSION) or be removed ; \ + echo "sed -i -e 's//$(VERSION)<\/version>/'" $$each; \ + echo ; \ + fail=1; \ + fi ; \ + done ; \ + exit $$fail + +check-outdated-docs: + $(AM_V_GEN)echo Checking for outdated plugin inspect data ...; \ + fail=0 ; \ + if [ -d $(top_srcdir)/.git/ ]; then \ + files=`find $(srcdir)/inspect/ -name '*xml'`; \ + for f in $$files; do \ + ver=`grep '$(PACKAGE_VERSION)' $$f`; \ + if test "x$$ver" = "x"; then \ + plugin=`echo $$f | sed -e 's/^.*plugin-//' -e 's/.xml//'`; \ + # echo "Checking $$plugin $$f"; \ + pushd "$(top_srcdir)" >/dev/null; \ + pinit=`git grep -A3 GST_PLUGIN_DEFINE -- ext/ gst/ sys/ | grep "\"$$plugin\""`; \ + popd >/dev/null; \ + # echo "[$$pinit]"; \ + if test "x$$pinit" = "x"; then \ + printf " **** outdated docs for plugin %-15s: %s\n" $$plugin $$f; \ + fail=1; \ + fi; \ + fi; \ + done; \ + fi ; \ + exit $$fail + +# +# Require gtk-doc when making dist +# +if ENABLE_GTK_DOC +dist-check-gtkdoc: +else +dist-check-gtkdoc: + @echo "*** gtk-doc must be installed and enabled in order to make dist" + @false +endif + +# FIXME: decide whether we want to dist generated html or not +# also this only works, if the project has been build before +# we could dist html only if its there, but that might lead to missing html in +# tarballs +dist-hook: dist-check-gtkdoc dist-hook-local + mkdir $(distdir)/html + cp html/* $(distdir)/html + -cp $(srcdir)/$(DOC_MODULE).types $(distdir)/ + -cp $(srcdir)/$(DOC_MODULE)-sections.txt $(distdir)/ + cd $(distdir) && rm -f $(DISTCLEANFILES) + -gtkdoc-rebase --online --relative --html-dir=$(distdir)/html + +.PHONY : dist-hook-local docs check-outdated-docs inspect + +# avoid spurious build errors when distchecking with -jN +.NOTPARALLEL: diff --git a/common/gtk-doc.mak b/common/gtk-doc.mak new file mode 100644 index 0000000..9d76889 --- /dev/null +++ b/common/gtk-doc.mak @@ -0,0 +1,227 @@ +########################################################################### +# Everything below here is generic and you shouldn't need to change it. +########################################################################### +# thomas: except of course that we did + +# thomas: copied from glib-2 +# We set GPATH here; this gives us semantics for GNU make +# which are more like other make's VPATH, when it comes to +# whether a source that is a target of one rule is then +# searched for in VPATH/GPATH. +# +GPATH = $(srcdir) + +# thomas: make docs parallel installable +TARGET_DIR=$(HTML_DIR)/$(DOC_MODULE)-@GST_API_VERSION@ + +EXTRA_DIST = \ + $(content_files) \ + $(extra_files) \ + $(HTML_IMAGES) \ + $(DOC_MAIN_SGML_FILE) \ + $(DOC_MODULE).types \ + $(DOC_OVERRIDES) \ + $(DOC_MODULE)-sections.txt + +DOC_STAMPS = \ + setup-build.stamp \ + scan-build.stamp \ + sgml-build.stamp \ + html-build.stamp \ + sgml.stamp \ + html.stamp + +SCANOBJ_FILES = \ + $(DOC_MODULE).args \ + $(DOC_MODULE).hierarchy \ + $(DOC_MODULE).interfaces \ + $(DOC_MODULE).prerequisites \ + $(DOC_MODULE).signals \ + .libs/$(DOC_MODULE)-scan.o + +REPORT_FILES = \ + $(DOC_MODULE)-undocumented.txt \ + $(DOC_MODULE)-undeclared.txt \ + $(DOC_MODULE)-unused.txt + +CLEANFILES = $(SCANOBJ_FILES) $(REPORT_FILES) $(DOC_STAMPS) doc-registry.xml + +if ENABLE_GTK_DOC +all-local: html-build.stamp + +#### setup #### + +setup-build.stamp: $(content_files) + -@if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ + echo ' DOC Preparing build'; \ + files=`echo $(DOC_MAIN_SGML_FILE) $(DOC_OVERRIDES) $(DOC_MODULE)-sections.txt $(DOC_MODULE).types $(content_files)`; \ + if test "x$$files" != "x" ; then \ + for file in $$files ; do \ + test -f $(abs_srcdir)/$$file && \ + cp -pu $(abs_srcdir)/$$file $(abs_builddir)/ || true; \ + done; \ + fi; \ + fi + @touch setup-build.stamp + +#### scan #### + +# in the case of non-srcdir builds, the built gst directory gets added +# to gtk-doc scanning; but only then, to avoid duplicates +scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB) + @echo ' DOC Scanning header files' + @_source_dir='' ; \ + for i in $(DOC_SOURCE_DIR) ; do \ + _source_dir="$${_source_dir} --source-dir=$$i" ; \ + done ; \ + gtkdoc-scan \ + $(SCAN_OPTIONS) $(EXTRA_HFILES) \ + --module=$(DOC_MODULE) \ + $${_source_dir} \ + --ignore-headers="$(IGNORE_HFILES)" + @if grep -l '^..*$$' $(DOC_MODULE).types > /dev/null; then \ + echo " DOC Introspecting gobjects"; \ + GST_PLUGIN_SYSTEM_PATH_1_0=`cd $(top_builddir) && pwd` \ + GST_PLUGIN_PATH_1_0= \ + GST_REGISTRY_1_0=doc-registry.xml \ + $(GTKDOC_EXTRA_ENVIRONMENT) \ + CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" \ + CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" \ + LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" \ + gtkdoc-scangobj --type-init-func="gst_init(NULL,NULL)" \ + --module=$(DOC_MODULE) ; \ + else \ + for i in $(SCANOBJ_FILES) ; do \ + test -f $$i || touch $$i ; \ + done \ + fi + @touch scan-build.stamp + +$(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt: scan-build.stamp + @true + +#### xml #### + +sgml-build.stamp: setup-build.stamp $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(expand_content_files) + @echo ' DOC Building XML' + @gtkdoc-mkdb --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) --output-format=xml $(MKDB_OPTIONS) + @cp ../version.entities xml + @touch sgml-build.stamp + +sgml.stamp: sgml-build.stamp + @true + +#### html #### + +html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) + @echo ' DOC Building HTML' + @rm -rf html + @mkdir html + @cp -pr xml html + @cp ../version.entities ./ + @mkhtml_options=""; \ + gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-verbose"; \ + if test "$(?)" = "0"; then \ + if test "x$(V)" = "x1"; then \ + mkhtml_options="$$mkhtml_options --verbose"; \ + fi; \ + fi; \ + @gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-path"; \ + if test "$(?)" = "0"; then \ + mkhtml_options=--path="$(abs_srcdir)"; \ + fi; \ + cd html && gtkdoc-mkhtml $$mkhtml_options $(MKHTML_OPTIONS) $(DOC_MODULE)-@GST_API_VERSION@ ../$(DOC_MAIN_SGML_FILE) + @rm -rf html/xml + @rm -f version.entities + @test "x$(HTML_IMAGES)" = "x" || ( cd $(srcdir) && cp $(HTML_IMAGES) $(abs_builddir)/html ) + @echo ' DOC Fixing cross-references' + @gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS) + @touch html-build.stamp + +clean-local-gtkdoc: + @rm -rf xml tmpl html +# clean files copied for nonsrcdir templates build + @if test x"$(srcdir)" != x. ; then \ + rm -rf $(DOC_MODULE).types; \ + fi +else +all-local: +clean-local-gtkdoc: +endif + +clean-local: clean-local-gtkdoc + @rm -f *~ *.bak + @rm -rf .libs + +distclean-local: + @rm -f $(REPORT_FILES) \ + $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt + @rm -rf tmpl/*.sgml.bak + @rm -f $(DOC_MODULE).hierarchy + @rm -f *.stamp || true + @if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ + rm -f $(DOC_MAIN_SGML_FILE) ; \ + rm -f $(DOC_OVERRIDES) ; \ + rm -f $(DOC_MODULE).types ; \ + rm -f $(DOC_MODULE).interfaces ; \ + rm -f $(DOC_MODULE).prerequisites ; \ + rm -f $(DOC_MODULE)-sections.txt ; \ + rm -f $(content_files) ; \ + rm -rf tmpl/*.sgml ; \ + fi + @rm -rf *.o + +maintainer-clean-local: clean + @cd $(srcdir) && rm -rf html \ + xml $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt + +# thomas: make docs parallel installable; devhelp requires majorminor too +install-data-local: + (installfiles=`echo $(builddir)/html/*.sgml $(builddir)/html/*.html $(builddir)/html/*.png $(builddir)/html/*.css`; \ + if test "$$installfiles" = '$(builddir)/html/*.sgml $(builddir)/html/*.html $(builddir)/html/*.png $(builddir)/html/*.css'; \ + then echo '-- Nothing to install' ; \ + else \ + $(mkinstalldirs) $(DESTDIR)$(TARGET_DIR); \ + for i in $$installfiles; do \ + echo '-- Installing '$$i ; \ + $(INSTALL_DATA) $$i $(DESTDIR)$(TARGET_DIR); \ + done; \ + echo '-- Installing $(builddir)/html/$(DOC_MODULE)-@GST_API_VERSION@.devhelp2' ; \ + if test -e $(builddir)/html/$(DOC_MODULE)-@GST_API_VERSION@.devhelp2; then \ + $(INSTALL_DATA) $(builddir)/html/$(DOC_MODULE)-@GST_API_VERSION@.devhelp2 \ + $(DESTDIR)$(TARGET_DIR)/$(DOC_MODULE)-@GST_API_VERSION@.devhelp2; \ + fi; \ + $(GTKDOC_REBASE) --relative --dest-dir=$(DESTDIR) --html-dir=$(DESTDIR)$(TARGET_DIR) || true ; \ + fi) +uninstall-local: + if test -d $(DESTDIR)$(TARGET_DIR); then \ + rm -rf $(DESTDIR)$(TARGET_DIR)/*; \ + rmdir -p $(DESTDIR)$(TARGET_DIR) 2>/dev/null || true; \ + else \ + echo '-- Nothing to uninstall' ; \ + fi; + + +# +# Require gtk-doc when making dist +# +if ENABLE_GTK_DOC +dist-check-gtkdoc: +else +dist-check-gtkdoc: + @echo "*** gtk-doc must be installed and enabled in order to make dist" + @false +endif + +dist-hook: dist-check-gtkdoc dist-hook-local + mkdir $(distdir)/html + cp html/* $(distdir)/html + -cp $(srcdir)/$(DOC_MODULE).types $(distdir)/ + -cp $(srcdir)/$(DOC_MODULE)-sections.txt $(distdir)/ + cd $(distdir) && rm -f $(DISTCLEANFILES) + -gtkdoc-rebase --online --relative --html-dir=$(distdir)/html + +.PHONY : dist-hook-local docs + +# avoid spurious build errors when distchecking with -jN +.NOTPARALLEL: diff --git a/common/hooks/install-hooks b/common/hooks/install-hooks new file mode 100755 index 0000000..38840ec --- /dev/null +++ b/common/hooks/install-hooks @@ -0,0 +1,97 @@ +#!/bin/bash +# +# install-hooks +# +# install hooks on git server +# +# usage: install-hooks [GIT_REPOSITORY_DIR] + +set -e + +HOOKS="update post-receive" + +# if directory where git repositories are is specified, change into that +if ! test -z $1 ; then + cd $1; +fi + +# save it +gitrepodir=`pwd` + +# make backup of previous hooks +timestamp=`date +%F-%H%M%S` +for hook in $HOOKS; do + if [ -e $hook ]; then + cp $hook $hook.backup-$timestamp + fi +done + +# now check out the common module with the latest hooks +tmpdir=`mktemp -d` +if test -z $tmpdir; then + echo "Failed to create temp dir" + exit 1; +fi + +pushd $tmpdir >/dev/null +git clone --branch=master $gitrepodir/common + +# copy over latest hooks into directory with git repositories +for hook in $HOOKS; do + cp -v common/hooks/$hook.hook $gitrepodir/$hook +done + +# now switch back to directory where the git repositories are +popd >/dev/null + +# clean up temp checkout of common dir +rm -rf $tmpdir + +# remove backup again if it is identical to the new one +for hook in $HOOKS; do + if cmp $hook $hook.backup-$timestamp; then + rm $hook.backup-$timestamp + fi +done + +# sanity check if there are any git repositories in here +if ! ls *.git */*.git 2>/dev/null >&2 ; then + echo "No git repositories in $(pwd) ?!" + exit; +fi + +echo "git repository base dir: $gitrepodir" + +for repo in *.git */*.git ; do + if test "$repo" = "sdk/glib.git"; then + echo "Skipping $repo" + continue + fi + echo "Updating hooks in $repo" + for hook in $HOOKS; do + # make sure target hook script actually exists + if ! test -e $hook ; then + echo "Hook '$hook' does not exist in $gitrepodir. Aborting."; + exit 1; + fi + # create new hook + rm -f $repo/hooks/$hook.new + pushd $repo/hooks >/dev/null + if [ -e "../../$hook" ] ; then + ln -s "../../$hook" $hook.new + elif [ -e "../../../$hook" ] ; then + ln -s "../../../$hook" $hook.new + else + echo "could not find hook script in parent directories ?!" + exit 1 + fi + # put new hook in place atomically + #echo "installing $repo/hooks/$hook" + mv $hook.new $hook + # test it to make sure all is good + cat $hook >/dev/null + popd >/dev/null + done +done + +echo "Done" diff --git a/common/hooks/post-receive.hook b/common/hooks/post-receive.hook new file mode 100755 index 0000000..0951bda --- /dev/null +++ b/common/hooks/post-receive.hook @@ -0,0 +1,293 @@ +#!/usr/bin/perl -w +# +# Copyright 2005 Alexandre Julliard +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. + +use strict; +use open ':utf8'; +use Encode 'encode'; +use Cwd 'realpath'; + +binmode STDIN, ':utf8'; +binmode STDOUT, ':utf8'; + +sub git_config($); +sub get_repos_name(); + +# some parameters you may want to change + +# set this to something that takes "-s" +my $mailer = "/usr/bin/mail"; + +# debug mode +my $debug = 0; + +# configuration parameters + +my $project_name = 'gstreamer'; + +# base URL of the gitweb repository browser +my $gitweb_url = "http://cgit.freedesktop.org/$project_name"; + + +# default repository name +my $repos_name = get_repos_name(); + +# max size of diffs in bytes +my $max_diff_size = 10000; + +# address for mail notices +my $commitlist_address = 'gstreamer-commits@lists.freedesktop.org'; +#my $commitlist_address = 'tpm'; + +# max number of individual notices before falling back to a single global notice +my $max_individual_notices = 100; + +# format an integer date + timezone as string +# algorithm taken from git's date.c +sub format_date($$) +{ + my ($time,$tz) = @_; + + if ($tz < 0) + { + my $minutes = (-$tz / 100) * 60 + (-$tz % 100); + $time -= $minutes * 60; + } + else + { + my $minutes = ($tz / 100) * 60 + ($tz % 100); + $time += $minutes * 60; + } + return gmtime($time) . sprintf " %+05d", $tz; +} + +# fetch a parameter from the git config file +sub git_config($) +{ + my ($param) = @_; + + open CONFIG, "-|" or exec "git", "config", $param; + my $ret = ; + chomp $ret if $ret; + close CONFIG or $ret = undef; + return $ret; +} + +# send an email notification +sub mail_notification($$$@) +{ + my ($name, $subject, $content_type, @text) = @_; + $subject = encode("MIME-Q",$subject); + if ($debug) + { + print "---------------------\n"; + print "To: $name\n"; + print "Subject: $subject\n"; + print "Content-Type: $content_type\n"; + print "\n", join("\n", @text), "\n"; + } + else + { + my $pid = open MAIL, "|-"; + return unless defined $pid; + if (!$pid) + { + exec $mailer, "-s", $subject, $name, or die "Cannot exec $mailer"; + } + print MAIL join("\n", @text), "\n"; + close MAIL; + } +} + +# get the default repository name (includes subdirectory, if any) +sub get_repos_name() +{ + my $dir = `git rev-parse --git-dir`; + chomp $dir; + my $repos = realpath($dir); + $repos =~ s/(.*?)((\.git\/)?\.git)$/$1/; + $repos =~ s%(.*\/$project_name)/([^/]+/?[^/]*)/?$%$2%; + return $repos; +} + +# extract the information from a commit or tag object and return a hash containing the various fields +sub get_object_info($) +{ + my $obj = shift; + my %info = (); + my @log = (); + my $do_log = 0; + + open TYPE, "-|" or exec "git", "cat-file", "-t", $obj or die "cannot run git-cat-file"; + my $type = ; + chomp $type; + close TYPE; + + open OBJ, "-|" or exec "git", "cat-file", $type, $obj or die "cannot run git-cat-file"; + while () + { + chomp; + if ($do_log) + { + last if /^-----BEGIN PGP SIGNATURE-----/; + push @log, $_; + } + elsif (/^(author|committer|tagger) ((.*)(<.*>)) (\d+) ([+-]\d+)$/) + { + $info{$1} = $2; + $info{$1 . "_name"} = $3; + $info{$1 . "_email"} = $4; + $info{$1 . "_date"} = $5; + $info{$1 . "_tz"} = $6; + } + elsif (/^tag (.*)$/) + { + $info{"tag"} = $1; + } + elsif (/^$/) { $do_log = 1; } + } + close OBJ; + + $info{"type"} = $type; + $info{"log"} = \@log; + return %info; +} + +# send a commit notice to a mailing list +sub send_commit_notice($$) +{ + my ($ref,$obj) = @_; + my %info = get_object_info($obj); + my @notice = (); + my $subject; + + printf "sending e-mail for $obj\n"; + + # TODO normal tags are not identified + if ($info{"type"} eq "tag") + { + push @notice, + "Module: $repos_name", + "Branch: $ref", + "Tag: $obj", + $gitweb_url ? "URL: $gitweb_url/tag/?id=$obj\n" : "", + "Tagger: " . $info{"tagger"}, + "Date: " . format_date($info{"tagger_date"},$info{"tagger_tz"}), + "", + join "\n", @{$info{"log"}}; + $subject = "Tag " . $info{"tag"} . ": " . ${$info{"log"}}[0]; + } + else + { + push @notice, + "Module: $repos_name", + "Branch: $ref", + "Commit: $obj", + $gitweb_url ? "URL: $gitweb_url/commit/?id=$obj\n" : "", + "Author: " . $info{"author"}, + "Date: " . format_date($info{"author_date"},$info{"author_tz"}), + "", + join "\n", @{$info{"log"}}, + "", + "---", + ""; + + open STAT, "-|" or exec "git", "diff-tree", "--stat", "-M", "--no-commit-id", $obj or die "cannot exec git-diff-tree"; + push @notice, join("", ); + close STAT; + + open DIFF, "-|" or exec "git", "diff-tree", "-p", "-M", "--no-commit-id", $obj or die "cannot exec git-diff-tree"; + my $diff = join( "", ); + close DIFF; + + if (($max_diff_size == -1) || (length($diff) < $max_diff_size)) + { + push @notice, $diff; + } + else + { + push @notice, "Diff: $gitweb_url/diff/?id=$obj" if $gitweb_url; + } + + if ($ref eq 'master') + { + $subject = $repos_name . ": " . ${$info{"log"}}[0]; + } + else + { + $subject = "[$ref] " . $repos_name . ": " . ${$info{"log"}}[0]; + } + } + + mail_notification($commitlist_address, $subject, "text/plain; charset=UTF-8", @notice); +} + +# send a global commit notice when there are too many commits for individual mails +sub send_global_notice($$$) +{ + my ($ref, $old_sha1, $new_sha1) = @_; + my @notice = (); + + open LIST, "-|" or exec "git", "rev-list", "--pretty", "^$old_sha1", "$new_sha1" or die "cannot exec git-rev-list"; + while () + { + chomp; + s/^commit /URL: $gitweb_url\/commit\/?id=/ if $gitweb_url; + push @notice, $_; + } + close LIST; + + mail_notification($commitlist_address, "New commits on branch $ref", "text/plain; charset=UTF-8", @notice); +} + +# send all the notices +sub send_all_notices($$$) +{ + my ($old_sha1, $new_sha1, $ref) = @_; + + $ref =~ s/^refs\/heads\///; + + if ($old_sha1 eq '0' x 40) # new ref + { + send_commit_notice( $ref, $new_sha1 ) if $commitlist_address; + return; + } + + my @commits = (); + + open LIST, "-|" or exec "git", "rev-list", "--topo-order", "^$old_sha1", "$new_sha1" or die "cannot exec git-rev-list"; + while () + { + chomp; + die "invalid commit $_" unless /^[0-9a-f]{40}$/; + unshift @commits, $_; + } + close LIST; + + if (@commits > $max_individual_notices) + { + send_global_notice( $ref, $old_sha1, $new_sha1 ) if $commitlist_address; + return; + } + + foreach my $commit (@commits) + { + send_commit_notice( $ref, $commit ) if $commitlist_address; + } +} + +# append repository path to URL +$gitweb_url .= "/$repos_name" if $gitweb_url; + +while (<>) +{ + chomp; + if (/^([0-9a-f]{40}) ([0-9a-f]{40}) (.*)$/) { send_all_notices( $1, $2, $3 ); } +} + +exit 0; diff --git a/common/hooks/pre-commit.hook b/common/hooks/pre-commit.hook new file mode 100755 index 0000000..aef1ce1 --- /dev/null +++ b/common/hooks/pre-commit.hook @@ -0,0 +1,77 @@ +#!/bin/sh +# +# Check that the code follows a consistant code style +# + +# Check for existence of indent, and error out if not present. +# On some *bsd systems the binary seems to be called gnunindent, +# so check for that first. + +version=`gnuindent --version 2>/dev/null` +if test "x$version" = "x"; then + version=`indent --version 2>/dev/null` + if test "x$version" = "x"; then + echo "GStreamer git pre-commit hook:" + echo "Did not find GNU indent, please install it before continuing." + exit 1 + fi + INDENT=indent +else + INDENT=gnuindent +fi + +case `$INDENT --version` in + GNU*) + ;; + default) + echo "GStreamer git pre-commit hook:" + echo "Did not find GNU indent, please install it before continuing." + echo "(Found $INDENT, but it doesn't seem to be GNU indent)" + exit 1 + ;; +esac + +INDENT_PARAMETERS="--braces-on-if-line \ + --case-brace-indentation0 \ + --case-indentation2 \ + --braces-after-struct-decl-line \ + --line-length80 \ + --no-tabs \ + --cuddle-else \ + --dont-line-up-parentheses \ + --continuation-indentation4 \ + --honour-newlines \ + --tab-size8 \ + --indent-level2 \ + --leave-preprocessor-space" + +echo "--Checking style--" +for file in `git diff-index --cached --name-only HEAD --diff-filter=ACMR| grep "\.c$"` ; do + # nf is the temporary checkout. This makes sure we check against the + # revision in the index (and not the checked out version). + nf=`git checkout-index --temp ${file} | cut -f 1` + newfile=`mktemp /tmp/${nf}.XXXXXX` || exit 1 + $INDENT ${INDENT_PARAMETERS} \ + $nf -o $newfile 2>> /dev/null + # FIXME: Call indent twice as it tends to do line-breaks + # different for every second call. + $INDENT ${INDENT_PARAMETERS} \ + $newfile 2>> /dev/null + diff -u -p "${nf}" "${newfile}" + r=$? + rm "${newfile}" + rm "${nf}" + if [ $r != 0 ] ; then +echo "=================================================================================================" +echo " Code style error in: $file " +echo " " +echo " Please fix before committing. Don't forget to run git add before trying to commit again. " +echo " If the whole file is to be committed, this should work (run from the top-level directory): " +echo " " +echo " gst-indent $file; git add $file; git commit" +echo " " +echo "=================================================================================================" + exit 1 + fi +done +echo "--Checking style pass--" diff --git a/common/hooks/pre-receive.hook b/common/hooks/pre-receive.hook new file mode 100755 index 0000000..c0bde0a --- /dev/null +++ b/common/hooks/pre-receive.hook @@ -0,0 +1,190 @@ +#!/usr/bin/env python +import sys +import os +import subprocess + +# This server-side pre-receive hook is to be put and activated in all modules +# that depend on the common submodule. +# +# It will check whether any modifications to the common 'submodule file' has a +# a valid commit SHA1 that exists in the common module. + +def commit_exists(sha1, gitdir): + """Returns True if the sha1 is a valid commit in the given + git directory""" + # FIXME: We're using 'git show' for the time being, but there's a small + # risk that there might be a valid SHA1 for a non-commit object. + env = os.environ.copy() + env["GIT_DIR"] = gitdir + sub = subprocess.Popen(["git", "show", sha1], env=env, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE) + while True: + res = sub.poll() + if res != None: + return res == 0 + +# location of the common git module +COMMON_GIT_DIR = "/git/gstreamer/common.git" + +# checks whether the push contains a change to the common submodule, +# and if so checks that it is changing it to a valid *EXISTING* common +# commit +def has_valid_common_change(old, new, ref): + # 1. Get the latest change to common (if there was any changes) + sub = subprocess.Popen(["git", "diff", "%s..%s" % (old, new, ), "--", "common"], + stdout=subprocess.PIPE) + stdout, stderr = sub.communicate() + + print "=> Checking for integrity of common submodule changes" + + if stdout != "": + # Format of submodule special files + # Subproject commit + + # we get a diff, therefore only grab the last line + lastline = stdout.strip().rsplit('\n',1)[-1] + if not lastline.startswith("+Subproject commit"): + # this is bad, it means the diff has changed to something completely + # different + return False + subsha1 = lastline.rsplit(' ', 1)[-1] + print " Pack wants common to point to", subsha1 + if not commit_exists(subsha1, COMMON_GIT_DIR): + print + print " /!\\ Commit does not exist in common git module /!\\" + print " /!\\ for ref", ref + print + print " Attempting to push commits containing modifications to common" + print " that have not been commited to the actuall common module." + print + print " First push your changes to common/ before pushing the changes" + print " to the module using it." + print + return False + + print " [OK]" + print + return True + +def commit_in_valid_branch(sha): + sub = subprocess.Popen(["git", "branch", "--contains", sha], + stdout=subprocess.PIPE) + stdout, stderr = sub.communicate() + r = stdout.strip() + return r != "" + +# checks whether the push contains merge commits and if so, makes sure that +# the merge is only between branches present on the repository. +def contains_valid_merge(old, new, ref): + sub = subprocess.Popen(["git", "rev-list", "--parents", "%s..%s" % (old, new, )], + stdout=subprocess.PIPE) + stdout, stderr = sub.communicate() + + res = True + + print "=> Checking for merge commits" + + for line in stdout.split('\n'): + if res == False: + break + splits = line.strip().split() + if len(splits) > 2: + # the commit has more than one parent => it's a merge + commit = splits[0] + for parent in splits[1:]: + if not commit_in_valid_branch(parent): + print + print " /!\\ Commit %s" % commit + print " /!\\ is a merge commit from/to a branch not" + print " /!\\ present on this repository" + print + print " Make sure you are not attempting to push a merge" + print " from a 3rd party repository" + print + print " Make sure you have properly rebased your commits against" + print " the current official branches" + print + res = False + break + + if res: + print " [OK]" + print + return res + +# checks whether the first line of any commit message contains a marker +# that indicates that it's work-in-progress that shouldn't be pushed +def contains_wip_commits(old, new): + # Get the commit message header + sub = subprocess.Popen(["git", "log", "--format=%s", "%s..%s" % (old, new, )], stdout=subprocess.PIPE) + stdout, stderr = sub.communicate() + if stdout != "": + for line in stdout.strip().rsplit('\n',1): + if line.startswith("!"): + return True + if line.startswith("WIP:") or line.startswith("wip:"): + return True + return False + +pushvalid = True +error_badcommon = False +error_badcommit = False + +openbranches = ["1.2", "1.0", "master"] + +def branch_closed(ref): + # We only care about branches + if not ref.startswith("refs/heads/"): + return False + + # Check if it's in the allowed branches + brname = ref.rsplit("/", 1)[-1].strip() + if brname in openbranches: + return False + + # Else it's not allowed + return True + +for line in sys.stdin.readlines(): + # ref is the ref to be modified + # old is the old commit it was pointing to + # new is the new commit it was pointing to + old, new, ref = line.split(' ', 2) + + pushvalid = has_valid_common_change(old, new, ref) + if pushvalid == False: + break + if branch_closed(ref): + print ">>>> Attempting to push to", ref + print ">>>> BRANCH READ-ONLY OR FORBIDDEN" + print ">>>> PUSH DENIED" + print + pushvalid = False + break + pushvalid = contains_valid_merge(old, new, ref) + if pushvalid == False: + break + if contains_wip_commits(old, new): + error_badcommit = True + pushvalid = False + break + +if pushvalid: + print " Incoming packet valid, proceeding to actual commit" + print + sys.exit(0) +else: + if error_badcommit: + print " Attempting to push commits with commit messages that start" + print " with '!' or 'WIP:'. Such commit messages are reserved for" + print " private branches and work in progress to prevent the commits" + print " from accidentally being pushed to the main repository." + if error_badcommon: + print " Attempting to push commits containing modifications to common" + print " that have not been commited to the actuall common module." + print + print " First push your changes to common/ before pushing the changes" + print " to the module using it." + sys.exit(-1) + diff --git a/common/hooks/update.hook b/common/hooks/update.hook new file mode 100755 index 0000000..d5a3331 --- /dev/null +++ b/common/hooks/update.hook @@ -0,0 +1,128 @@ +#!/bin/sh +# +# An example hook script to blocks unannotated tags from entering. +# Called by "git receive-pack" with arguments: refname sha1-old sha1-new +# +# To enable this hook, rename this file to "update". +# +# Config +# ------ +# hooks.allowunannotated +# This boolean sets whether unannotated tags will be allowed into the +# repository. By default they won't be. +# hooks.allowdeletetag +# This boolean sets whether deleting tags will be allowed in the +# repository. By default they won't be. +# hooks.allowmodifytag +# This boolean sets whether a tag may be modified after creation. By default +# it won't be. +# hooks.allowdeletebranch +# This boolean sets whether deleting branches will be allowed in the +# repository. By default they won't be. +# hooks.denycreatebranch +# This boolean sets whether remotely creating branches will be denied +# in the repository. By default this is allowed. +# + +# --- Command line +refname="$1" +oldrev="$2" +newrev="$3" + +# --- Safety check +if [ -z "$GIT_DIR" ]; then + echo "Don't run this script from the command line." >&2 + echo " (if you want, you could supply GIT_DIR then run" >&2 + echo " $0 )" >&2 + exit 1 +fi + +if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then + echo "Usage: $0 " >&2 + exit 1 +fi + +# --- Config +allowunannotated=false #$(git config --bool hooks.allowunannotated) +allowdeletebranch=false #$(git config --bool hooks.allowdeletebranch) +denycreatebranch=false #$(git config --bool hooks.denycreatebranch) +allowdeletetag=false #$(git config --bool hooks.allowdeletetag) +allowmodifytag=true #$(git config --bool hooks.allowmodifytag) + +# check for no description +projectdesc=$(sed -e '1q' "$GIT_DIR/description") +case "$projectdesc" in +"Unnamed repository"* | "") + echo "*** Project description file hasn't been set" >&2 + exit 1 + ;; +esac + +# --- Check types +# if $newrev is 0000...0000, it's a commit to delete a ref. +zero="0000000000000000000000000000000000000000" +if [ "$newrev" = "$zero" ]; then + newrev_type=delete +else + newrev_type=$(git cat-file -t $newrev) +fi + +case "$refname","$newrev_type" in + refs/tags/*,commit) + # un-annotated tag + short_refname=${refname##refs/tags/} + if [ "$allowunannotated" != "true" ]; then + echo "*** The un-annotated tag, $short_refname, is not allowed in this repository" >&2 + echo "*** Use 'git tag [ -a | -s ]' for tags you want to propagate." >&2 + exit 1 + fi + ;; + refs/tags/*,delete) + # delete tag + if [ "$allowdeletetag" != "true" ]; then + echo "*** Deleting a tag is not allowed in this repository" >&2 + exit 1 + fi + ;; + refs/tags/*,tag) + # annotated tag + if [ "$allowmodifytag" != "true" ] && git rev-parse $refname > /dev/null 2>&1 + then + echo "*** Tag '$refname' already exists." >&2 + echo "*** Modifying a tag is not allowed in this repository." >&2 + exit 1 + fi + ;; + refs/heads/*,commit) + # branch + if [ "$oldrev" = "$zero" -a "$denycreatebranch" = "true" ]; then + echo "*** Creating a branch is not allowed in this repository" >&2 + exit 1 + fi + ;; + refs/heads/*,delete) + # delete branch + if [ "$allowdeletebranch" != "true" ]; then + echo "*** Deleting a branch is not allowed in this repository" >&2 + exit 1 + fi + ;; + refs/remotes/*,commit) + # tracking branch + ;; + refs/remotes/*,delete) + # delete tracking branch + if [ "$allowdeletebranch" != "true" ]; then + echo "*** Deleting a tracking branch is not allowed in this repository" >&2 + exit 1 + fi + ;; + *) + # Anything else (is there anything else?) + echo "*** Update hook: unknown type of update to ref $refname of type $newrev_type" >&2 + exit 1 + ;; +esac + +# --- Finished +exit 0 diff --git a/common/m4/.gitignore b/common/m4/.gitignore new file mode 100644 index 0000000..b36621e --- /dev/null +++ b/common/m4/.gitignore @@ -0,0 +1,23 @@ +codeset.m4 +gettext.m4 +glibc21.m4 +iconv.m4 +intdiv0.m4 +inttypes-pri.m4 +inttypes.m4 +inttypes_h.m4 +isc-posix.m4 +lcmessage.m4 +lib-ld.m4 +lib-link.m4 +lib-prefix.m4 +progtest.m4 +stdint_h.m4 +uintmax_t.m4 +ulonglong.m4 + +libtool.m4 +ltoptions.m4 +ltsugar.m4 +ltversion.m4 + diff --git a/common/m4/Makefile.am b/common/m4/Makefile.am new file mode 100644 index 0000000..3d387ee --- /dev/null +++ b/common/m4/Makefile.am @@ -0,0 +1,40 @@ +EXTRA_DIST = \ + README \ + as-ac-expand.m4 \ + as-auto-alt.m4 \ + as-compiler-flag.m4 \ + as-compiler.m4 \ + as-docbook.m4 \ + as-gcc-inline-assembly.m4 \ + as-libtool.m4 \ + as-libtool-tags.m4 \ + as-python.m4 \ + as-version.m4 \ + ax_create_stdint_h.m4 \ + glib-gettext.m4 \ + gst-arch.m4 \ + gst-args.m4 \ + gst-check.m4 \ + gst-debuginfo.m4 \ + gst-default.m4 \ + gst-doc.m4 \ + gst-dowhile.m4 \ + gst-error.m4 \ + gst-feature.m4 \ + gst-function.m4 \ + gst-gettext.m4 \ + gst-glib2.m4 \ + gst-libxml2.m4 \ + gst-parser.m4 \ + gst-package-release-datetime.m4 \ + gst-platform.m4 \ + gst-plugindir.m4 \ + gst-plugin-docs.m4 \ + gst-valgrind.m4 \ + gst-x11.m4 \ + gst.m4 \ + gtk-doc.m4 \ + introspection.m4 \ + pkg.m4 \ + check.m4 \ + orc.m4 diff --git a/common/m4/README b/common/m4/README new file mode 100644 index 0000000..867a344 --- /dev/null +++ b/common/m4/README @@ -0,0 +1,3 @@ +All aclocal .m4 files we need are put here and cat'd to acinclude.m4 in +the source root. Official ones (taken from the relevant devel packages) +are named as-is, unofficial ones (or changed ones) get a gst-prefix. diff --git a/common/m4/as-ac-expand.m4 b/common/m4/as-ac-expand.m4 new file mode 100644 index 0000000..d6c9e33 --- /dev/null +++ b/common/m4/as-ac-expand.m4 @@ -0,0 +1,43 @@ +dnl as-ac-expand.m4 0.2.0 +dnl autostars m4 macro for expanding directories using configure's prefix +dnl thomas@apestaart.org + +dnl AS_AC_EXPAND(VAR, CONFIGURE_VAR) +dnl example +dnl AS_AC_EXPAND(SYSCONFDIR, $sysconfdir) +dnl will set SYSCONFDIR to /usr/local/etc if prefix=/usr/local + +AC_DEFUN([AS_AC_EXPAND], +[ + EXP_VAR=[$1] + FROM_VAR=[$2] + + dnl first expand prefix and exec_prefix if necessary + prefix_save=$prefix + exec_prefix_save=$exec_prefix + + dnl if no prefix given, then use /usr/local, the default prefix + if test "x$prefix" = "xNONE"; then + prefix="$ac_default_prefix" + fi + dnl if no exec_prefix given, then use prefix + if test "x$exec_prefix" = "xNONE"; then + exec_prefix=$prefix + fi + + full_var="$FROM_VAR" + dnl loop until it doesn't change anymore + while true; do + new_full_var="`eval echo $full_var`" + if test "x$new_full_var" = "x$full_var"; then break; fi + full_var=$new_full_var + done + + dnl clean up + full_var=$new_full_var + AC_SUBST([$1], "$full_var") + + dnl restore prefix and exec_prefix + prefix=$prefix_save + exec_prefix=$exec_prefix_save +]) diff --git a/common/m4/as-auto-alt.m4 b/common/m4/as-auto-alt.m4 new file mode 100644 index 0000000..3f7920d --- /dev/null +++ b/common/m4/as-auto-alt.m4 @@ -0,0 +1,50 @@ +dnl as-auto-alt.m4 0.0.2 +dnl autostars m4 macro for supplying alternate autotools versions to configure +dnl thomas@apestaart.org +dnl +dnl AS_AUTOTOOLS_ALTERNATE() +dnl +dnl supplies --with arguments for autoconf, autoheader, automake, aclocal + +AC_DEFUN([AS_AUTOTOOLS_ALTERNATE], +[ + dnl allow for different autoconf version + AC_ARG_WITH(autoconf, + AC_HELP_STRING([--with-autoconf], + [use a different autoconf for regeneration of Makefiles]), + [ + unset AUTOCONF + AM_MISSING_PROG(AUTOCONF, ${withval}) + AC_MSG_NOTICE([Using $AUTOCONF as autoconf]) + ]) + + dnl allow for different autoheader version + AC_ARG_WITH(autoheader, + AC_HELP_STRING([--with-autoheader], + [use a different autoheader for regeneration of Makefiles]), + [ + unset AUTOHEADER + AM_MISSING_PROG(AUTOHEADER, ${withval}) + AC_MSG_NOTICE([Using $AUTOHEADER as autoheader]) + ]) + + dnl allow for different automake version + AC_ARG_WITH(automake, + AC_HELP_STRING([--with-automake], + [use a different automake for regeneration of Makefiles]), + [ + unset AUTOMAKE + AM_MISSING_PROG(AUTOMAKE, ${withval}) + AC_MSG_NOTICE([Using $AUTOMAKE as automake]) + ]) + + dnl allow for different aclocal version + AC_ARG_WITH(aclocal, + AC_HELP_STRING([--with-aclocal], + [use a different aclocal for regeneration of Makefiles]), + [ + unset ACLOCAL + AM_MISSING_PROG(ACLOCAL, ${withval}) + AC_MSG_NOTICE([Using $ACLOCAL as aclocal]) + ]) +]) diff --git a/common/m4/as-compiler-flag.m4 b/common/m4/as-compiler-flag.m4 new file mode 100644 index 0000000..8bb853a --- /dev/null +++ b/common/m4/as-compiler-flag.m4 @@ -0,0 +1,96 @@ +dnl as-compiler-flag.m4 0.1.0 + +dnl autostars m4 macro for detection of compiler flags + +dnl David Schleef +dnl Tim-Philipp Müller + +dnl AS_COMPILER_FLAG(CFLAGS, ACTION-IF-ACCEPTED, [ACTION-IF-NOT-ACCEPTED]) +dnl Tries to compile with the given CFLAGS. +dnl Runs ACTION-IF-ACCEPTED if the compiler can compile with the flags, +dnl and ACTION-IF-NOT-ACCEPTED otherwise. + +AC_DEFUN([AS_COMPILER_FLAG], +[ + AC_MSG_CHECKING([to see if compiler understands $1]) + + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $1" + + AC_TRY_COMPILE([ ], [], [flag_ok=yes], [flag_ok=no]) + CFLAGS="$save_CFLAGS" + + if test "X$flag_ok" = Xyes ; then + $2 + true + else + $3 + true + fi + AC_MSG_RESULT([$flag_ok]) +]) + +dnl AS_CXX_COMPILER_FLAG(CPPFLAGS, ACTION-IF-ACCEPTED, [ACTION-IF-NOT-ACCEPTED]) +dnl Tries to compile with the given CPPFLAGS. +dnl Runs ACTION-IF-ACCEPTED if the compiler can compile with the flags, +dnl and ACTION-IF-NOT-ACCEPTED otherwise. + +AC_DEFUN([AS_CXX_COMPILER_FLAG], +[ + AC_REQUIRE([AC_PROG_CXX]) + + AC_MSG_CHECKING([to see if c++ compiler understands $1]) + + save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $1" + + AC_LANG_PUSH(C++) + + AC_TRY_COMPILE([ ], [], [flag_ok=yes], [flag_ok=no]) + CPPFLAGS="$save_CPPFLAGS" + + if test "X$flag_ok" = Xyes ; then + $2 + true + else + $3 + true + fi + + AC_LANG_POP(C++) + + AC_MSG_RESULT([$flag_ok]) +]) + +dnl AS_OBJC_COMPILER_FLAG(CPPFLAGS, ACTION-IF-ACCEPTED, [ACTION-IF-NOT-ACCEPTED]) +dnl Tries to compile with the given CPPFLAGS. +dnl Runs ACTION-IF-ACCEPTED if the compiler can compile with the flags, +dnl and ACTION-IF-NOT-ACCEPTED otherwise. + +AC_DEFUN([AS_OBJC_COMPILER_FLAG], +[ + AC_REQUIRE([AC_PROG_OBJC]) + + AC_MSG_CHECKING([to see if Objective C compiler understands $1]) + + save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $1" + + AC_LANG_PUSH([Objective C]) + + AC_TRY_COMPILE([ ], [], [flag_ok=yes], [flag_ok=no]) + CPPFLAGS="$save_CPPFLAGS" + + if test "X$flag_ok" = Xyes ; then + $2 + true + else + $3 + true + fi + + AC_LANG_POP([Objective C]) + + AC_MSG_RESULT([$flag_ok]) +]) + diff --git a/common/m4/as-compiler.m4 b/common/m4/as-compiler.m4 new file mode 100644 index 0000000..309a060 --- /dev/null +++ b/common/m4/as-compiler.m4 @@ -0,0 +1,44 @@ +dnl as-compiler.m4 0.1.0 + +dnl autostars m4 macro for detection of compiler flavor + +dnl Thomas Vander Stichele + +dnl $Id: as-compiler.m4,v 1.4 2004/06/01 09:44:19 thomasvs Exp $ + +dnl AS_COMPILER(COMPILER) +dnl will set variable COMPILER to +dnl - gcc +dnl - forte +dnl - (empty) if no guess could be made + +AC_DEFUN([AS_COMPILER], +[ + as_compiler= + AC_MSG_CHECKING(for compiler flavour) + + dnl is it gcc ? + if test "x$GCC" = "xyes"; then + as_compiler="gcc" + fi + + dnl is it forte ? + AC_TRY_RUN([ +int main +(int argc, char *argv[]) +{ +#ifdef __sun + return 0; +#else + return 1; +#endif +} + ], as_compiler="forte", ,) + + if test "x$as_compiler" = "x"; then + AC_MSG_RESULT([unknown !]) + else + AC_MSG_RESULT($as_compiler) + fi + [$1]=$as_compiler +]) diff --git a/common/m4/as-docbook.m4 b/common/m4/as-docbook.m4 new file mode 100644 index 0000000..2e27050 --- /dev/null +++ b/common/m4/as-docbook.m4 @@ -0,0 +1,78 @@ +dnl AS_DOCBOOK([, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) +dnl checks if xsltproc can build docbook documentation +dnl (which is possible if the catalog is set up properly +dnl I also tried checking for a specific version and type of docbook +dnl but xsltproc seemed to happily run anyway, so we can't check for that +dnl and version +dnl this macro takes inspiration from +dnl http://www.movement.uklinux.net/docs/docbook-autotools/configure.html +AC_DEFUN([AS_DOCBOOK], +[ + XSLTPROC_FLAGS=--nonet + DOCBOOK_ROOT= + TYPE_LC=xml + TYPE_UC=XML + DOCBOOK_VERSION=4.1.2 + + if test -n "$XML_CATALOG_FILES"; then + oldIFS=$IFS + IFS=' ' + for xml_catalog_file in $XML_CATALOG_FILES; do + if test -f $xml_catalog_file; then + XML_CATALOG=$xml_catalog_file + CAT_ENTRY_START='' + break + fi + done + IFS=$oldIFS + elif test ! -f /etc/xml/catalog; then + for i in /usr/share/sgml/docbook/stylesheet/xsl/nwalsh /usr/share/sgml/docbook/xsl-stylesheets/ /usr/local/share/xsl/docbook ; + do + if test -d "$i"; then + DOCBOOK_ROOT=$i + fi + done + else + XML_CATALOG=/etc/xml/catalog + CAT_ENTRY_START='' + fi + + dnl We need xsltproc to process the test + AC_CHECK_PROG(XSLTPROC,xsltproc,xsltproc,) + XSLTPROC_WORKS=no + if test -n "$XSLTPROC"; then + AC_MSG_CHECKING([whether xsltproc docbook processing works]) + + if test -n "$XML_CATALOG"; then + DB_FILE="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl" + else + DB_FILE="$DOCBOOK_ROOT/xhtml/docbook.xsl" + fi + $XSLTPROC $XSLTPROC_FLAGS $DB_FILE >/dev/null 2>&1 << END + + + + +END + if test "$?" = 0; then + XSLTPROC_WORKS=yes + fi + AC_MSG_RESULT($XSLTPROC_WORKS) + fi + + if test "x$XSLTPROC_WORKS" = "xyes"; then + dnl execute ACTION-IF-FOUND + ifelse([$1], , :, [$1]) + else + dnl execute ACTION-IF-NOT-FOUND + ifelse([$2], , :, [$2]) + fi + + AC_SUBST(XML_CATALOG) + AC_SUBST(XSLTPROC_FLAGS) + AC_SUBST(DOCBOOK_ROOT) + AC_SUBST(CAT_ENTRY_START) + AC_SUBST(CAT_ENTRY_END) +]) diff --git a/common/m4/as-gcc-inline-assembly.m4 b/common/m4/as-gcc-inline-assembly.m4 new file mode 100644 index 0000000..af32104 --- /dev/null +++ b/common/m4/as-gcc-inline-assembly.m4 @@ -0,0 +1,52 @@ +dnl as-gcc-inline-assembly.m4 0.1.0 + +dnl autostars m4 macro for detection of gcc inline assembly + +dnl David Schleef + +dnl $Id$ + +dnl AS_COMPILER_FLAG(ACTION-IF-ACCEPTED, [ACTION-IF-NOT-ACCEPTED]) +dnl Tries to compile with the given CFLAGS. +dnl Runs ACTION-IF-ACCEPTED if the compiler can compile with the flags, +dnl and ACTION-IF-NOT-ACCEPTED otherwise. + +AC_DEFUN([AS_GCC_INLINE_ASSEMBLY], +[ + AC_MSG_CHECKING([if compiler supports gcc-style inline assembly]) + + AC_TRY_COMPILE([], [ +#ifdef __GNUC_MINOR__ +#if (__GNUC__ * 1000 + __GNUC_MINOR__) < 3004 +#error GCC before 3.4 has critical bugs compiling inline assembly +#endif +#endif +__asm__ (""::) ], [flag_ok=yes], [flag_ok=no]) + + if test "X$flag_ok" = Xyes ; then + $1 + true + else + $2 + true + fi + AC_MSG_RESULT([$flag_ok]) +]) + + +AC_DEFUN([AS_GCC_ASM_POWERPC_FPU], +[ + AC_MSG_CHECKING([if compiler supports FPU instructions on PowerPC]) + + AC_TRY_COMPILE([], [__asm__ ("fadd 0,0,0"::) ], [flag_ok=yes], [flag_ok=no]) + + if test "X$flag_ok" = Xyes ; then + $1 + true + else + $2 + true + fi + AC_MSG_RESULT([$flag_ok]) +]) + diff --git a/common/m4/as-libtool-tags.m4 b/common/m4/as-libtool-tags.m4 new file mode 100644 index 0000000..06f0ae4 --- /dev/null +++ b/common/m4/as-libtool-tags.m4 @@ -0,0 +1,83 @@ +dnl as-libtool-tags.m4 0.1.4 + +dnl autostars m4 macro for selecting libtool "tags" (languages) + +dnl Andy Wingo does not claim credit for this macro +dnl backported from libtool 1.6 by Paolo Bonzini +dnl see http://lists.gnu.org/archive/html/libtool/2003-12/msg00007.html + +dnl $Id$ + +dnl AS_LIBTOOL_TAGS([tags...]) + +dnl example +dnl AS_LIBTOOL_TAGS([]) for only C (no fortran, etc) + +dnl When AC_LIBTOOL_TAGS is used, I redefine _LT_AC_TAGCONFIG +dnl to be more similar to the libtool 1.6 implementation, which +dnl uses an m4 loop and m4 case instead of a shell loop. This +dnl way the CXX/GCJ/F77/RC tests are not always expanded. + +dnl AS_LIBTOOL_TAGS +dnl --------------- +dnl tags to enable +AC_DEFUN([AS_LIBTOOL_TAGS], +[m4_define([_LT_TAGS],[$1]) +m4_define([_LT_AC_TAGCONFIG], [ + # redefined LT AC TAGCONFIG + if test -f "$ltmain"; then + if test ! -f "${ofile}"; then + AC_MSG_WARN([output file `$ofile' does not exist]) + fi + + if test -z "$LTCC"; then + eval "`$SHELL ${ofile} --config | grep '^LTCC='`" + if test -z "$LTCC"; then + AC_MSG_WARN([output file `$ofile' does not look like a libtool script]) + else + AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile']) + fi + fi + + AC_FOREACH([_LT_TAG], _LT_TAGS, + echo THOMAS: tag _LT_TAG + [m4_case(_LT_TAG, + [CXX], [ + if test -n "$CXX" && test "X$CXX" != "Xno"; then + echo "THOMAS: YAY CXX" + AC_LIBTOOL_LANG_CXX_CONFIG + available_tags="$available_tags _LT_TAG" + fi], + [F77], [ + if test -n "$F77" && test "X$F77" != "Xno"; then + AC_LIBTOOL_LANG_F77_CONFIG + available_tags="$available_tags _LT_TAG" + fi], + [GCJ], [ + if test -n "$GCJ" && test "X$GCJ" != "Xno"; then + AC_LIBTOOL_LANG_GCJ_CONFIG + available_tags="$available_tags _LT_TAG" + fi], + [RC], [ + if test -n "$RC" && test "X$RC" != "Xno"; then + AC_LIBTOOL_LANG_RC_CONFIG + available_tags="$available_tags _LT_TAG" + fi], + [m4_errprintn(m4_location[: error: invalid tag name: ]"_LT_TAG") + m4_exit(1)]) + ]) + echo THOMAS: available tags: $available_tags + fi + # Now substitute the updated list of available tags. + if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then + mv "${ofile}T" "$ofile" + chmod +x "$ofile" + AC_MSG_NOTICE([updated available libtool tags with $available_tags.]) + else + rm -f "${ofile}T" + AC_MSG_ERROR([unable to update list of available tagged configurations.]) + + fi + +])dnl _LT_AC_TAG_CONFIG +]) diff --git a/common/m4/as-libtool.m4 b/common/m4/as-libtool.m4 new file mode 100644 index 0000000..3b16095 --- /dev/null +++ b/common/m4/as-libtool.m4 @@ -0,0 +1,46 @@ +dnl as-libtool.m4 0.1.4 + +dnl autostars m4 macro for libtool versioning + +dnl Thomas Vander Stichele + +dnl $Id: as-libtool.m4,v 1.10 2005/10/15 13:44:23 thomasvs Exp $ + +dnl AS_LIBTOOL(PREFIX, CURRENT, REVISION, AGE, [RELEASE]) + +dnl example +dnl AS_LIBTOOL(GST, 2, 0, 0) + +dnl this macro +dnl - defines [$PREFIX]_CURRENT, REVISION and AGE +dnl - defines [$PREFIX]_LIBVERSION +dnl - defines [$PREFIX]_LT_LDFLAGS to set versioning +dnl - AC_SUBST's them all + +dnl if RELEASE is given, then add a -release option to the LDFLAGS +dnl with the given release version +dnl then use [$PREFIX]_LT_LDFLAGS in the relevant Makefile.am's + +dnl call AM_PROG_LIBTOOL after this call + +AC_DEFUN([AS_LIBTOOL], +[ + [$1]_CURRENT=[$2] + [$1]_REVISION=[$3] + [$1]_AGE=[$4] + [$1]_LIBVERSION=[$2]:[$3]:[$4] + AC_SUBST([$1]_CURRENT) + AC_SUBST([$1]_REVISION) + AC_SUBST([$1]_AGE) + AC_SUBST([$1]_LIBVERSION) + + [$1]_LT_LDFLAGS="$[$1]_LT_LDFLAGS -version-info $[$1]_LIBVERSION" + if test ! -z "[$5]" + then + [$1]_LT_LDFLAGS="$[$1]_LT_LDFLAGS -release [$5]" + fi + AC_SUBST([$1]_LT_LDFLAGS) + + LT_PREREQ([2.2.6]) + LT_INIT([dlopen win32-dll disable-static]) +]) diff --git a/common/m4/as-python.m4 b/common/m4/as-python.m4 new file mode 100644 index 0000000..eb9b175 --- /dev/null +++ b/common/m4/as-python.m4 @@ -0,0 +1,152 @@ +## ------------------------ +## Python file handling +## From Andrew Dalke +## Updated by James Henstridge +## Updated by Andy Wingo to loop through possible pythons +## ------------------------ + +# AS_PATH_PYTHON([MINIMUM-VERSION]) + +# Adds support for distributing Python modules and packages. To +# install modules, copy them to $(pythondir), using the python_PYTHON +# automake variable. To install a package with the same name as the +# automake package, install to $(pkgpythondir), or use the +# pkgpython_PYTHON automake variable. + +# The variables $(pyexecdir) and $(pkgpyexecdir) are provided as +# locations to install python extension modules (shared libraries). +# Another macro is required to find the appropriate flags to compile +# extension modules. + +# If your package is configured with a different prefix to python, +# users will have to add the install directory to the PYTHONPATH +# environment variable, or create a .pth file (see the python +# documentation for details). + +# If the MINIMUM-VERSION argument is passed, AS_PATH_PYTHON will +# cause an error if the version of python installed on the system +# doesn't meet the requirement. MINIMUM-VERSION should consist of +# numbers and dots only. + +# Updated to loop over all possible python binaries by Andy Wingo +# +# Updated to only warn and unset PYTHON if no good one is found + +AC_DEFUN([AS_PATH_PYTHON], + [ + dnl Find a version of Python. I could check for python versions 1.4 + dnl or earlier, but the default installation locations changed from + dnl $prefix/lib/site-python in 1.4 to $prefix/lib/python1.5/site-packages + dnl in 1.5, and I don't want to maintain that logic. + + dnl should we do the version check? + PYTHON_CANDIDATES="python python2.2 python2.1 python2.0 python2 \ + python1.6 python1.5" + ifelse([$1],[], + [AC_PATH_PROG(PYTHON, $PYTHON_CANDIDATES)], + [ + AC_MSG_NOTICE(Looking for Python version >= $1) + changequote(<<, >>)dnl + prog=" +import sys, string +minver = '$1' +# split string by '.' and convert to numeric +minver_info = map(string.atoi, string.split(minver, '.')) +# we can now do comparisons on the two lists: +if sys.version_info >= tuple(minver_info): + sys.exit(0) +else: + sys.exit(1)" + changequote([, ])dnl + + python_good=false + for python_candidate in $PYTHON_CANDIDATES; do + unset PYTHON + AC_PATH_PROG(PYTHON, $python_candidate) 1> /dev/null 2> /dev/null + + if test "x$PYTHON" = "x"; then continue; fi + + if $PYTHON -c "$prog" 1>&AC_FD_CC 2>&AC_FD_CC; then + AC_MSG_CHECKING(["$PYTHON":]) + AC_MSG_RESULT([okay]) + python_good=true + break; + else + dnl clear the cache val + unset ac_cv_path_PYTHON + fi + done + ]) + + if test "$python_good" != "true"; then + AC_MSG_WARN([No suitable version of python found]) + PYTHON= + else + + AC_MSG_CHECKING([local Python configuration]) + + dnl Query Python for its version number. Getting [:3] seems to be + dnl the best way to do this; it's what "site.py" does in the standard + dnl library. Need to change quote character because of [:3] + + AC_SUBST(PYTHON_VERSION) + changequote(<<, >>)dnl + PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[:3]"` + changequote([, ])dnl + + + dnl Use the values of $prefix and $exec_prefix for the corresponding + dnl values of PYTHON_PREFIX and PYTHON_EXEC_PREFIX. These are made + dnl distinct variables so they can be overridden if need be. However, + dnl general consensus is that you shouldn't need this ability. + + AC_SUBST(PYTHON_PREFIX) + PYTHON_PREFIX='${prefix}' + + AC_SUBST(PYTHON_EXEC_PREFIX) + PYTHON_EXEC_PREFIX='${exec_prefix}' + + dnl At times (like when building shared libraries) you may want + dnl to know which OS platform Python thinks this is. + + AC_SUBST(PYTHON_PLATFORM) + PYTHON_PLATFORM=`$PYTHON -c "import sys; print sys.platform"` + + + dnl Set up 4 directories: + + dnl pythondir -- where to install python scripts. This is the + dnl site-packages directory, not the python standard library + dnl directory like in previous automake betas. This behaviour + dnl is more consistent with lispdir.m4 for example. + dnl + dnl Also, if the package prefix isn't the same as python's prefix, + dnl then the old $(pythondir) was pretty useless. + + AC_SUBST(pythondir) + pythondir=$PYTHON_PREFIX"/lib/python"$PYTHON_VERSION/site-packages + + dnl pkgpythondir -- $PACKAGE directory under pythondir. Was + dnl PYTHON_SITE_PACKAGE in previous betas, but this naming is + dnl more consistent with the rest of automake. + dnl Maybe this should be put in python.am? + + AC_SUBST(pkgpythondir) + pkgpythondir=\${pythondir}/$PACKAGE + + dnl pyexecdir -- directory for installing python extension modules + dnl (shared libraries) Was PYTHON_SITE_EXEC in previous betas. + + AC_SUBST(pyexecdir) + pyexecdir=$PYTHON_EXEC_PREFIX"/lib/python"$PYTHON_VERSION/site-packages + + dnl pkgpyexecdir -- $(pyexecdir)/$(PACKAGE) + dnl Maybe this should be put in python.am? + + AC_SUBST(pkgpyexecdir) + pkgpyexecdir=\${pyexecdir}/$PACKAGE + + AC_MSG_RESULT([looks good]) + + fi +]) diff --git a/common/m4/as-version.m4 b/common/m4/as-version.m4 new file mode 100644 index 0000000..22ff774 --- /dev/null +++ b/common/m4/as-version.m4 @@ -0,0 +1,75 @@ +dnl as-version.m4 0.2.0 + +dnl autostars m4 macro for versioning + +dnl Thomas Vander Stichele + +dnl $Id: as-version.m4,v 1.15 2006/04/01 09:40:24 thomasvs Exp $ + +dnl AS_VERSION + +dnl example +dnl AS_VERSION + +dnl this macro +dnl - AC_SUBST's PACKAGE_VERSION_MAJOR, _MINOR, _MICRO +dnl - AC_SUBST's PACKAGE_VERSION_RELEASE, +dnl which can be used for rpm release fields +dnl - doesn't call AM_INIT_AUTOMAKE anymore because it prevents +dnl maintainer mode from running correctly +dnl +dnl don't forget to put #undef PACKAGE_VERSION_RELEASE in acconfig.h +dnl if you use acconfig.h + +AC_DEFUN([AS_VERSION], +[ + PACKAGE_VERSION_MAJOR=$(echo AC_PACKAGE_VERSION | cut -d'.' -f1) + PACKAGE_VERSION_MINOR=$(echo AC_PACKAGE_VERSION | cut -d'.' -f2) + PACKAGE_VERSION_MICRO=$(echo AC_PACKAGE_VERSION | cut -d'.' -f3) + + AC_SUBST(PACKAGE_VERSION_MAJOR) + AC_SUBST(PACKAGE_VERSION_MINOR) + AC_SUBST(PACKAGE_VERSION_MICRO) +]) + +dnl AS_NANO(ACTION-IF-NANO-NON-NULL, [ACTION-IF-NANO-NULL]) + +dnl requires AC_INIT to be called before +dnl For projects using a fourth or nano number in your versioning to indicate +dnl development or prerelease snapshots, this macro allows the build to be +dnl set up differently accordingly. + +dnl this macro: +dnl - parses AC_PACKAGE_VERSION, set by AC_INIT, and extracts the nano number +dnl - sets the variable PACKAGE_VERSION_NANO +dnl - sets the variable PACKAGE_VERSION_RELEASE, which can be used +dnl for rpm release fields +dnl - executes ACTION-IF-NANO-NON-NULL or ACTION-IF-NANO-NULL + +dnl example: +dnl AS_NANO(RELEASE="yes", RELEASE="no") + +AC_DEFUN([AS_NANO], +[ + AC_MSG_CHECKING(nano version) + + NANO=$(echo AC_PACKAGE_VERSION | cut -d'.' -f4) + + if test x"$NANO" = x || test "x$NANO" = "x0" ; then + AC_MSG_RESULT([0 (release)]) + NANO=0 + PACKAGE_VERSION_RELEASE=1 + ifelse([$1], , :, [$1]) + else + AC_MSG_RESULT($NANO) + PACKAGE_VERSION_RELEASE=0.`date +%Y%m%d.%H%M%S` + if test "x$NANO" != "x1" ; then + ifelse([$1], , :, [$1]) + else + ifelse([$2], , :, [$2]) + fi + fi + PACKAGE_VERSION_NANO=$NANO + AC_SUBST(PACKAGE_VERSION_NANO) + AC_SUBST(PACKAGE_VERSION_RELEASE) +]) diff --git a/common/m4/ax_create_stdint_h.m4 b/common/m4/ax_create_stdint_h.m4 new file mode 100644 index 0000000..13bf699 --- /dev/null +++ b/common/m4/ax_create_stdint_h.m4 @@ -0,0 +1,734 @@ +##### http://autoconf-archive.cryp.to/ax_create_stdint_h.html +# +# SYNOPSIS +# +# AX_CREATE_STDINT_H [( HEADER-TO-GENERATE [, HEDERS-TO-CHECK])] +# +# DESCRIPTION +# +# the "ISO C9X: 7.18 Integer types " section requires the +# existence of an include file that defines a set of +# typedefs, especially uint8_t,int32_t,uintptr_t. Many older +# installations will not provide this file, but some will have the +# very same definitions in . In other enviroments we can +# use the inet-types in which would define the typedefs +# int8_t and u_int8_t respectivly. +# +# This macros will create a local "_stdint.h" or the headerfile given +# as an argument. In many cases that file will just "#include +# " or "#include ", while in other environments +# it will provide the set of basic 'stdint's definitions/typedefs: +# +# int8_t,uint8_t,int16_t,uint16_t,int32_t,uint32_t,intptr_t,uintptr_t +# int_least32_t.. int_fast32_t.. intmax_t +# +# which may or may not rely on the definitions of other files, or +# using the AC_CHECK_SIZEOF macro to determine the actual sizeof each +# type. +# +# if your header files require the stdint-types you will want to +# create an installable file mylib-int.h that all your other +# installable header may include. So if you have a library package +# named "mylib", just use +# +# AX_CREATE_STDINT_H(mylib-int.h) +# +# in configure.ac and go to install that very header file in +# Makefile.am along with the other headers (mylib.h) - and the +# mylib-specific headers can simply use "#include " to +# obtain the stdint-types. +# +# Remember, if the system already had a valid , the +# generated file will include it directly. No need for fuzzy +# HAVE_STDINT_H things... (oops, GCC 4.2.x has deliberatly disabled +# its stdint.h for non-c99 compilation and the c99-mode is not the +# default. Therefore this macro will not use the compiler's stdint.h +# - please complain to the GCC developers). +# +# LAST MODIFICATION +# +# 2007-06-27 +# +# COPYLEFT +# +# Copyright (c) 2007 Guido U. Draheim +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# 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. +# +# As a special exception, the respective Autoconf Macro's copyright +# owner gives unlimited permission to copy, distribute and modify the +# configure scripts that are the output of Autoconf when processing +# the Macro. You need not follow the terms of the GNU General Public +# License when using or distributing such scripts, even though +# portions of the text of the Macro appear in them. The GNU General +# Public License (GPL) does govern all other use of the material that +# constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the +# Autoconf Macro released by the Autoconf Macro Archive. When you +# make and distribute a modified version of the Autoconf Macro, you +# may extend this special exception to the GPL to apply to your +# modified version as well. + +AC_DEFUN([AX_CHECK_DATA_MODEL],[ + AC_CHECK_SIZEOF(char) + AC_CHECK_SIZEOF(short) + AC_CHECK_SIZEOF(int) + AC_CHECK_SIZEOF(long) + AC_CHECK_SIZEOF(void*) + ac_cv_char_data_model="" + ac_cv_char_data_model="$ac_cv_char_data_model$ac_cv_sizeof_char" + ac_cv_char_data_model="$ac_cv_char_data_model$ac_cv_sizeof_short" + ac_cv_char_data_model="$ac_cv_char_data_model$ac_cv_sizeof_int" + ac_cv_long_data_model="" + ac_cv_long_data_model="$ac_cv_long_data_model$ac_cv_sizeof_int" + ac_cv_long_data_model="$ac_cv_long_data_model$ac_cv_sizeof_long" + ac_cv_long_data_model="$ac_cv_long_data_model$ac_cv_sizeof_voidp" + AC_MSG_CHECKING([data model]) + case "$ac_cv_char_data_model/$ac_cv_long_data_model" in + 122/242) ac_cv_data_model="IP16" ; n="standard 16bit machine" ;; + 122/244) ac_cv_data_model="LP32" ; n="standard 32bit machine" ;; + 122/*) ac_cv_data_model="i16" ; n="unusual int16 model" ;; + 124/444) ac_cv_data_model="ILP32" ; n="standard 32bit unixish" ;; + 124/488) ac_cv_data_model="LP64" ; n="standard 64bit unixish" ;; + 124/448) ac_cv_data_model="LLP64" ; n="unusual 64bit unixish" ;; + 124/*) ac_cv_data_model="i32" ; n="unusual int32 model" ;; + 128/888) ac_cv_data_model="ILP64" ; n="unusual 64bit numeric" ;; + 128/*) ac_cv_data_model="i64" ; n="unusual int64 model" ;; + 222/*2) ac_cv_data_model="DSP16" ; n="strict 16bit dsptype" ;; + 333/*3) ac_cv_data_model="DSP24" ; n="strict 24bit dsptype" ;; + 444/*4) ac_cv_data_model="DSP32" ; n="strict 32bit dsptype" ;; + 666/*6) ac_cv_data_model="DSP48" ; n="strict 48bit dsptype" ;; + 888/*8) ac_cv_data_model="DSP64" ; n="strict 64bit dsptype" ;; + 222/*|333/*|444/*|666/*|888/*) : + ac_cv_data_model="iDSP" ; n="unusual dsptype" ;; + *) ac_cv_data_model="none" ; n="very unusual model" ;; + esac + AC_MSG_RESULT([$ac_cv_data_model ($ac_cv_long_data_model, $n)]) +]) + +dnl AX_CHECK_HEADER_STDINT_X([HEADERLIST][,ACTION-IF]) +AC_DEFUN([AX_CHECK_HEADER_STDINT_X],[ +AC_CACHE_CHECK([for stdint uintptr_t], [ac_cv_header_stdint_x],[ + ac_cv_header_stdint_x="" # the 1997 typedefs (inttypes.h) + AC_MSG_RESULT([(..)]) + for i in m4_ifval([$1],[$1],[stdint.h inttypes.h sys/inttypes.h sys/types.h]) + do + unset ac_cv_type_uintptr_t + unset ac_cv_type_uint64_t + AC_CHECK_TYPE(uintptr_t,[ac_cv_header_stdint_x=$i],continue,[#include <$i>]) + AC_CHECK_TYPE(uint64_t,[and64="/uint64_t"],[and64=""],[#include<$i>]) + m4_ifvaln([$2],[$2]) break + done + AC_MSG_CHECKING([for stdint uintptr_t]) + ]) +]) + +AC_DEFUN([AX_CHECK_HEADER_STDINT_O],[ +AC_CACHE_CHECK([for stdint uint32_t], [ac_cv_header_stdint_o],[ + ac_cv_header_stdint_o="" # the 1995 typedefs (sys/inttypes.h) + AC_MSG_RESULT([(..)]) + for i in m4_ifval([$1],[$1],[inttypes.h sys/inttypes.h sys/types.h stdint.h]) + do + unset ac_cv_type_uint32_t + unset ac_cv_type_uint64_t + AC_CHECK_TYPE(uint32_t,[ac_cv_header_stdint_o=$i],continue,[#include <$i>]) + AC_CHECK_TYPE(uint64_t,[and64="/uint64_t"],[and64=""],[#include<$i>]) + m4_ifvaln([$2],[$2]) break + break; + done + AC_MSG_CHECKING([for stdint uint32_t]) + ]) +]) + +AC_DEFUN([AX_CHECK_HEADER_STDINT_U],[ +AC_CACHE_CHECK([for stdint u_int32_t], [ac_cv_header_stdint_u],[ + ac_cv_header_stdint_u="" # the BSD typedefs (sys/types.h) + AC_MSG_RESULT([(..)]) + for i in m4_ifval([$1],[$1],[sys/types.h inttypes.h sys/inttypes.h]) ; do + unset ac_cv_type_u_int32_t + unset ac_cv_type_u_int64_t + AC_CHECK_TYPE(u_int32_t,[ac_cv_header_stdint_u=$i],continue,[#include <$i>]) + AC_CHECK_TYPE(u_int64_t,[and64="/u_int64_t"],[and64=""],[#include<$i>]) + m4_ifvaln([$2],[$2]) break + break; + done + AC_MSG_CHECKING([for stdint u_int32_t]) + ]) +]) + +AC_DEFUN([AX_CREATE_STDINT_H], +[# ------ AX CREATE STDINT H ------------------------------------- +AC_MSG_CHECKING([for stdint types]) +ac_stdint_h=`echo ifelse($1, , _stdint.h, $1)` +# try to shortcircuit - if the default include path of the compiler +# can find a "stdint.h" header then we assume that all compilers can. +AC_CACHE_VAL([ac_cv_header_stdint_t],[ +old_CXXFLAGS="$CXXFLAGS" ; CXXFLAGS="" +old_CPPFLAGS="$CPPFLAGS" ; CPPFLAGS="" +old_CFLAGS="$CFLAGS" ; CFLAGS="" +AC_TRY_COMPILE([#include ],[int_least32_t v = 0;], +[ac_cv_stdint_result="(assuming C99 compatible system)" + ac_cv_header_stdint_t="stdint.h"; ], +[ac_cv_header_stdint_t=""]) +if test "$GCC" = "yes" && test ".$ac_cv_header_stdint_t" = "."; then +CFLAGS="-std=c99" +AC_TRY_COMPILE([#include ],[int_least32_t v = 0;], +[AC_MSG_WARN(your GCC compiler has a defunct stdint.h for its default-mode)]) +fi +CXXFLAGS="$old_CXXFLAGS" +CPPFLAGS="$old_CPPFLAGS" +CFLAGS="$old_CFLAGS" ]) + +v="... $ac_cv_header_stdint_h" +if test "$ac_stdint_h" = "stdint.h" ; then + AC_MSG_RESULT([(are you sure you want them in ./stdint.h?)]) +elif test "$ac_stdint_h" = "inttypes.h" ; then + AC_MSG_RESULT([(are you sure you want them in ./inttypes.h?)]) +elif test "_$ac_cv_header_stdint_t" = "_" ; then + AC_MSG_RESULT([(putting them into $ac_stdint_h)$v]) +else + ac_cv_header_stdint="$ac_cv_header_stdint_t" + AC_MSG_RESULT([$ac_cv_header_stdint (shortcircuit)]) +fi + +if test "_$ac_cv_header_stdint_t" = "_" ; then # can not shortcircuit.. + +dnl .....intro message done, now do a few system checks..... +dnl btw, all old CHECK_TYPE macros do automatically "DEFINE" a type, +dnl therefore we use the autoconf implementation detail CHECK_TYPE_NEW +dnl instead that is triggered with 3 or more arguments (see types.m4) + +inttype_headers=`echo $2 | sed -e 's/,/ /g'` + +ac_cv_stdint_result="(no helpful system typedefs seen)" +AX_CHECK_HEADER_STDINT_X(dnl + stdint.h inttypes.h sys/inttypes.h $inttype_headers, + ac_cv_stdint_result="(seen uintptr_t$and64 in $i)") + +if test "_$ac_cv_header_stdint_x" = "_" ; then +AX_CHECK_HEADER_STDINT_O(dnl, + inttypes.h sys/inttypes.h stdint.h $inttype_headers, + ac_cv_stdint_result="(seen uint32_t$and64 in $i)") +fi + +if test "_$ac_cv_header_stdint_x" = "_" ; then +if test "_$ac_cv_header_stdint_o" = "_" ; then +AX_CHECK_HEADER_STDINT_U(dnl, + sys/types.h inttypes.h sys/inttypes.h $inttype_headers, + ac_cv_stdint_result="(seen u_int32_t$and64 in $i)") +fi fi + +dnl if there was no good C99 header file, do some typedef checks... +if test "_$ac_cv_header_stdint_x" = "_" ; then + AC_MSG_CHECKING([for stdint datatype model]) + AC_MSG_RESULT([(..)]) + AX_CHECK_DATA_MODEL +fi + +if test "_$ac_cv_header_stdint_x" != "_" ; then + ac_cv_header_stdint="$ac_cv_header_stdint_x" +elif test "_$ac_cv_header_stdint_o" != "_" ; then + ac_cv_header_stdint="$ac_cv_header_stdint_o" +elif test "_$ac_cv_header_stdint_u" != "_" ; then + ac_cv_header_stdint="$ac_cv_header_stdint_u" +else + ac_cv_header_stdint="stddef.h" +fi + +AC_MSG_CHECKING([for extra inttypes in chosen header]) +AC_MSG_RESULT([($ac_cv_header_stdint)]) +dnl see if int_least and int_fast types are present in _this_ header. +unset ac_cv_type_int_least32_t +unset ac_cv_type_int_fast32_t +AC_CHECK_TYPE(int_least32_t,,,[#include <$ac_cv_header_stdint>]) +AC_CHECK_TYPE(int_fast32_t,,,[#include<$ac_cv_header_stdint>]) +AC_CHECK_TYPE(intmax_t,,,[#include <$ac_cv_header_stdint>]) + +fi # shortcircut to system "stdint.h" +# ------------------ PREPARE VARIABLES ------------------------------ +if test "$GCC" = "yes" ; then +ac_cv_stdint_message="using gnu compiler "`$CC --version | head -1` +else +ac_cv_stdint_message="using $CC" +fi + +AC_MSG_RESULT([make use of $ac_cv_header_stdint in $ac_stdint_h dnl +$ac_cv_stdint_result]) + +dnl ----------------------------------------------------------------- +# ----------------- DONE inttypes.h checks START header ------------- +AC_CONFIG_COMMANDS([$ac_stdint_h],[ +AC_MSG_NOTICE(creating $ac_stdint_h : $_ac_stdint_h) +ac_stdint=$tmp/_stdint.h + +echo "#ifndef" $_ac_stdint_h >$ac_stdint +echo "#define" $_ac_stdint_h "1" >>$ac_stdint +echo "#ifndef" _GENERATED_STDINT_H >>$ac_stdint +echo "#define" _GENERATED_STDINT_H '"'$PACKAGE $VERSION'"' >>$ac_stdint +echo "/* generated $ac_cv_stdint_message */" >>$ac_stdint +if test "_$ac_cv_header_stdint_t" != "_" ; then +echo "#define _STDINT_HAVE_STDINT_H" "1" >>$ac_stdint +echo "#include " >>$ac_stdint +echo "#endif" >>$ac_stdint +echo "#endif" >>$ac_stdint +else + +cat >>$ac_stdint < +#else +#include + +/* .................... configured part ............................ */ + +STDINT_EOF + +echo "/* whether we have a C99 compatible stdint header file */" >>$ac_stdint +if test "_$ac_cv_header_stdint_x" != "_" ; then + ac_header="$ac_cv_header_stdint_x" + echo "#define _STDINT_HEADER_INTPTR" '"'"$ac_header"'"' >>$ac_stdint +else + echo "/* #undef _STDINT_HEADER_INTPTR */" >>$ac_stdint +fi + +echo "/* whether we have a C96 compatible inttypes header file */" >>$ac_stdint +if test "_$ac_cv_header_stdint_o" != "_" ; then + ac_header="$ac_cv_header_stdint_o" + echo "#define _STDINT_HEADER_UINT32" '"'"$ac_header"'"' >>$ac_stdint +else + echo "/* #undef _STDINT_HEADER_UINT32 */" >>$ac_stdint +fi + +echo "/* whether we have a BSD compatible inet types header */" >>$ac_stdint +if test "_$ac_cv_header_stdint_u" != "_" ; then + ac_header="$ac_cv_header_stdint_u" + echo "#define _STDINT_HEADER_U_INT32" '"'"$ac_header"'"' >>$ac_stdint +else + echo "/* #undef _STDINT_HEADER_U_INT32 */" >>$ac_stdint +fi + +echo "" >>$ac_stdint + +if test "_$ac_header" != "_" ; then if test "$ac_header" != "stddef.h" ; then + echo "#include <$ac_header>" >>$ac_stdint + echo "" >>$ac_stdint +fi fi + +echo "/* which 64bit typedef has been found */" >>$ac_stdint +if test "$ac_cv_type_uint64_t" = "yes" ; then +echo "#define _STDINT_HAVE_UINT64_T" "1" >>$ac_stdint +else +echo "/* #undef _STDINT_HAVE_UINT64_T */" >>$ac_stdint +fi +if test "$ac_cv_type_u_int64_t" = "yes" ; then +echo "#define _STDINT_HAVE_U_INT64_T" "1" >>$ac_stdint +else +echo "/* #undef _STDINT_HAVE_U_INT64_T */" >>$ac_stdint +fi +echo "" >>$ac_stdint + +echo "/* which type model has been detected */" >>$ac_stdint +if test "_$ac_cv_char_data_model" != "_" ; then +echo "#define _STDINT_CHAR_MODEL" "$ac_cv_char_data_model" >>$ac_stdint +echo "#define _STDINT_LONG_MODEL" "$ac_cv_long_data_model" >>$ac_stdint +else +echo "/* #undef _STDINT_CHAR_MODEL // skipped */" >>$ac_stdint +echo "/* #undef _STDINT_LONG_MODEL // skipped */" >>$ac_stdint +fi +echo "" >>$ac_stdint + +echo "/* whether int_least types were detected */" >>$ac_stdint +if test "$ac_cv_type_int_least32_t" = "yes"; then +echo "#define _STDINT_HAVE_INT_LEAST32_T" "1" >>$ac_stdint +else +echo "/* #undef _STDINT_HAVE_INT_LEAST32_T */" >>$ac_stdint +fi +echo "/* whether int_fast types were detected */" >>$ac_stdint +if test "$ac_cv_type_int_fast32_t" = "yes"; then +echo "#define _STDINT_HAVE_INT_FAST32_T" "1" >>$ac_stdint +else +echo "/* #undef _STDINT_HAVE_INT_FAST32_T */" >>$ac_stdint +fi +echo "/* whether intmax_t type was detected */" >>$ac_stdint +if test "$ac_cv_type_intmax_t" = "yes"; then +echo "#define _STDINT_HAVE_INTMAX_T" "1" >>$ac_stdint +else +echo "/* #undef _STDINT_HAVE_INTMAX_T */" >>$ac_stdint +fi +echo "" >>$ac_stdint + + cat >>$ac_stdint <= 199901L +#define _HAVE_UINT64_T +#define _HAVE_LONGLONG_UINT64_T +typedef long long int64_t; +typedef unsigned long long uint64_t; + +#elif !defined __STRICT_ANSI__ +#if defined _MSC_VER || defined __WATCOMC__ || defined __BORLANDC__ +#define _HAVE_UINT64_T +typedef __int64 int64_t; +typedef unsigned __int64 uint64_t; + +#elif defined __GNUC__ || defined __MWERKS__ || defined __ELF__ +/* note: all ELF-systems seem to have loff-support which needs 64-bit */ +#if !defined _NO_LONGLONG +#define _HAVE_UINT64_T +#define _HAVE_LONGLONG_UINT64_T +typedef long long int64_t; +typedef unsigned long long uint64_t; +#endif + +#elif defined __alpha || (defined __mips && defined _ABIN32) +#if !defined _NO_LONGLONG +typedef long int64_t; +typedef unsigned long uint64_t; +#endif + /* compiler/cpu type to define int64_t */ +#endif +#endif +#endif + +#if defined _STDINT_HAVE_U_INT_TYPES +/* int8_t int16_t int32_t defined by inet code, redeclare the u_intXX types */ +typedef u_int8_t uint8_t; +typedef u_int16_t uint16_t; +typedef u_int32_t uint32_t; + +/* glibc compatibility */ +#ifndef __int8_t_defined +#define __int8_t_defined +#endif +#endif + +#ifdef _STDINT_NEED_INT_MODEL_T +/* we must guess all the basic types. Apart from byte-adressable system, */ +/* there a few 32-bit-only dsp-systems that we guard with BYTE_MODEL 8-} */ +/* (btw, those nibble-addressable systems are way off, or so we assume) */ + +dnl /* have a look at "64bit and data size neutrality" at */ +dnl /* http://unix.org/version2/whatsnew/login_64bit.html */ +dnl /* (the shorthand "ILP" types always have a "P" part) */ + +#if defined _STDINT_BYTE_MODEL +#if _STDINT_LONG_MODEL+0 == 242 +/* 2:4:2 = IP16 = a normal 16-bit system */ +typedef unsigned char uint8_t; +typedef unsigned short uint16_t; +typedef unsigned long uint32_t; +#ifndef __int8_t_defined +#define __int8_t_defined +typedef char int8_t; +typedef short int16_t; +typedef long int32_t; +#endif +#elif _STDINT_LONG_MODEL+0 == 244 || _STDINT_LONG_MODEL == 444 +/* 2:4:4 = LP32 = a 32-bit system derived from a 16-bit */ +/* 4:4:4 = ILP32 = a normal 32-bit system */ +typedef unsigned char uint8_t; +typedef unsigned short uint16_t; +typedef unsigned int uint32_t; +#ifndef __int8_t_defined +#define __int8_t_defined +typedef char int8_t; +typedef short int16_t; +typedef int int32_t; +#endif +#elif _STDINT_LONG_MODEL+0 == 484 || _STDINT_LONG_MODEL+0 == 488 +/* 4:8:4 = IP32 = a 32-bit system prepared for 64-bit */ +/* 4:8:8 = LP64 = a normal 64-bit system */ +typedef unsigned char uint8_t; +typedef unsigned short uint16_t; +typedef unsigned int uint32_t; +#ifndef __int8_t_defined +#define __int8_t_defined +typedef char int8_t; +typedef short int16_t; +typedef int int32_t; +#endif +/* this system has a "long" of 64bit */ +#ifndef _HAVE_UINT64_T +#define _HAVE_UINT64_T +typedef unsigned long uint64_t; +typedef long int64_t; +#endif +#elif _STDINT_LONG_MODEL+0 == 448 +/* LLP64 a 64-bit system derived from a 32-bit system */ +typedef unsigned char uint8_t; +typedef unsigned short uint16_t; +typedef unsigned int uint32_t; +#ifndef __int8_t_defined +#define __int8_t_defined +typedef char int8_t; +typedef short int16_t; +typedef int int32_t; +#endif +/* assuming the system has a "long long" */ +#ifndef _HAVE_UINT64_T +#define _HAVE_UINT64_T +#define _HAVE_LONGLONG_UINT64_T +typedef unsigned long long uint64_t; +typedef long long int64_t; +#endif +#else +#define _STDINT_NO_INT32_T +#endif +#else +#define _STDINT_NO_INT8_T +#define _STDINT_NO_INT32_T +#endif +#endif + +/* + * quote from SunOS-5.8 sys/inttypes.h: + * Use at your own risk. As of February 1996, the committee is squarely + * behind the fixed sized types; the "least" and "fast" types are still being + * discussed. The probability that the "fast" types may be removed before + * the standard is finalized is high enough that they are not currently + * implemented. + */ + +#if defined _STDINT_NEED_INT_LEAST_T +typedef int8_t int_least8_t; +typedef int16_t int_least16_t; +typedef int32_t int_least32_t; +#ifdef _HAVE_UINT64_T +typedef int64_t int_least64_t; +#endif + +typedef uint8_t uint_least8_t; +typedef uint16_t uint_least16_t; +typedef uint32_t uint_least32_t; +#ifdef _HAVE_UINT64_T +typedef uint64_t uint_least64_t; +#endif + /* least types */ +#endif + +#if defined _STDINT_NEED_INT_FAST_T +typedef int8_t int_fast8_t; +typedef int int_fast16_t; +typedef int32_t int_fast32_t; +#ifdef _HAVE_UINT64_T +typedef int64_t int_fast64_t; +#endif + +typedef uint8_t uint_fast8_t; +typedef unsigned uint_fast16_t; +typedef uint32_t uint_fast32_t; +#ifdef _HAVE_UINT64_T +typedef uint64_t uint_fast64_t; +#endif + /* fast types */ +#endif + +#ifdef _STDINT_NEED_INTMAX_T +#ifdef _HAVE_UINT64_T +typedef int64_t intmax_t; +typedef uint64_t uintmax_t; +#else +typedef long intmax_t; +typedef unsigned long uintmax_t; +#endif +#endif + +#ifdef _STDINT_NEED_INTPTR_T +#ifndef __intptr_t_defined +#define __intptr_t_defined +/* we encourage using "long" to store pointer values, never use "int" ! */ +#if _STDINT_LONG_MODEL+0 == 242 || _STDINT_LONG_MODEL+0 == 484 +typedef unsigned int uintptr_t; +typedef int intptr_t; +#elif _STDINT_LONG_MODEL+0 == 244 || _STDINT_LONG_MODEL+0 == 444 +typedef unsigned long uintptr_t; +typedef long intptr_t; +#elif _STDINT_LONG_MODEL+0 == 448 && defined _HAVE_UINT64_T +typedef uint64_t uintptr_t; +typedef int64_t intptr_t; +#else /* matches typical system types ILP32 and LP64 - but not IP16 or LLP64 */ +typedef unsigned long uintptr_t; +typedef long intptr_t; +#endif +#endif +#endif + +/* The ISO C99 standard specifies that in C++ implementations these + should only be defined if explicitly requested. */ +#if !defined __cplusplus || defined __STDC_CONSTANT_MACROS +#ifndef UINT32_C + +/* Signed. */ +# define INT8_C(c) c +# define INT16_C(c) c +# define INT32_C(c) c +# ifdef _HAVE_LONGLONG_UINT64_T +# define INT64_C(c) c ## L +# else +# define INT64_C(c) c ## LL +# endif + +/* Unsigned. */ +# define UINT8_C(c) c ## U +# define UINT16_C(c) c ## U +# define UINT32_C(c) c ## U +# ifdef _HAVE_LONGLONG_UINT64_T +# define UINT64_C(c) c ## UL +# else +# define UINT64_C(c) c ## ULL +# endif + +/* Maximal type. */ +# ifdef _HAVE_LONGLONG_UINT64_T +# define INTMAX_C(c) c ## L +# define UINTMAX_C(c) c ## UL +# else +# define INTMAX_C(c) c ## LL +# define UINTMAX_C(c) c ## ULL +# endif + + /* literalnumbers */ +#endif +#endif + +/* These limits are merily those of a two complement byte-oriented system */ + +/* Minimum of signed integral types. */ +# define INT8_MIN (-128) +# define INT16_MIN (-32767-1) +# define INT32_MIN (-2147483647-1) +# define INT64_MIN (-__INT64_C(9223372036854775807)-1) +/* Maximum of signed integral types. */ +# define INT8_MAX (127) +# define INT16_MAX (32767) +# define INT32_MAX (2147483647) +# define INT64_MAX (__INT64_C(9223372036854775807)) + +/* Maximum of unsigned integral types. */ +# define UINT8_MAX (255) +# define UINT16_MAX (65535) +# define UINT32_MAX (4294967295U) +# define UINT64_MAX (__UINT64_C(18446744073709551615)) + +/* Minimum of signed integral types having a minimum size. */ +# define INT_LEAST8_MIN INT8_MIN +# define INT_LEAST16_MIN INT16_MIN +# define INT_LEAST32_MIN INT32_MIN +# define INT_LEAST64_MIN INT64_MIN +/* Maximum of signed integral types having a minimum size. */ +# define INT_LEAST8_MAX INT8_MAX +# define INT_LEAST16_MAX INT16_MAX +# define INT_LEAST32_MAX INT32_MAX +# define INT_LEAST64_MAX INT64_MAX + +/* Maximum of unsigned integral types having a minimum size. */ +# define UINT_LEAST8_MAX UINT8_MAX +# define UINT_LEAST16_MAX UINT16_MAX +# define UINT_LEAST32_MAX UINT32_MAX +# define UINT_LEAST64_MAX UINT64_MAX + + /* shortcircuit*/ +#endif + /* once */ +#endif +#endif +STDINT_EOF +fi + if cmp -s $ac_stdint_h $ac_stdint 2>/dev/null; then + AC_MSG_NOTICE([$ac_stdint_h is unchanged]) + else + ac_dir=`AS_DIRNAME(["$ac_stdint_h"])` + AS_MKDIR_P(["$ac_dir"]) + rm -f $ac_stdint_h + mv $ac_stdint $ac_stdint_h + fi +],[# variables for create stdint.h replacement +PACKAGE="$PACKAGE" +VERSION="$VERSION" +ac_stdint_h="$ac_stdint_h" +_ac_stdint_h=AS_TR_CPP(_$PACKAGE-$ac_stdint_h) +ac_cv_stdint_message="$ac_cv_stdint_message" +ac_cv_header_stdint_t="$ac_cv_header_stdint_t" +ac_cv_header_stdint_x="$ac_cv_header_stdint_x" +ac_cv_header_stdint_o="$ac_cv_header_stdint_o" +ac_cv_header_stdint_u="$ac_cv_header_stdint_u" +ac_cv_type_uint64_t="$ac_cv_type_uint64_t" +ac_cv_type_u_int64_t="$ac_cv_type_u_int64_t" +ac_cv_char_data_model="$ac_cv_char_data_model" +ac_cv_long_data_model="$ac_cv_long_data_model" +ac_cv_type_int_least32_t="$ac_cv_type_int_least32_t" +ac_cv_type_int_fast32_t="$ac_cv_type_int_fast32_t" +ac_cv_type_intmax_t="$ac_cv_type_intmax_t" +]) +]) diff --git a/common/m4/check.m4 b/common/m4/check.m4 new file mode 100644 index 0000000..afd26eb --- /dev/null +++ b/common/m4/check.m4 @@ -0,0 +1,181 @@ +dnl _AM_TRY_CHECK(MINIMUM-VERSION, EXTRA-CFLAGS, EXTRA-LIBS, CHECK-LIB-NAME +dnl [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) +dnl Test for check, and define CHECK_CFLAGS and CHECK_LIBS +dnl Done this way because of the brokenness that is +dnl https://launchpad.net/distros/ubuntu/+source/check/+bug/5840 +dnl + +AC_DEFUN([_AM_TRY_CHECK], +[ + min_check_version=$1 + extra_cflags=$2 + extra_libs=$3 + check_lib_name=$4 + + CHECK_CFLAGS="$extra_cflags" + CHECK_LIBS="$extra_libs -l$check_lib_name" + + ac_save_CFLAGS="$CFLAGS" + ac_save_LIBS="$LIBS" + + CFLAGS="$CFLAGS $CHECK_CFLAGS" + LIBS="$CHECK_LIBS $LIBS" + + AC_MSG_CHECKING(for check named $check_lib_name - version >= $min_check_version) + + rm -f conf.check-test + dnl unset no_check, since in our second run it would have been set to yes + dnl before + no_check= + AC_TRY_RUN([ +#include +#include + +#include + +int main () +{ + int major, minor, micro; + char *tmp_version; + + system ("touch conf.check-test"); + + /* HP/UX 9 (%@#!) writes to sscanf strings */ + tmp_version = strdup("$min_check_version"); + if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { + printf("%s, bad version string\n", "$min_check_version"); + return 1; + } + + if ((CHECK_MAJOR_VERSION != check_major_version) || + (CHECK_MINOR_VERSION != check_minor_version) || + (CHECK_MICRO_VERSION != check_micro_version)) + { + printf("\n*** The check header file (version %d.%d.%d) does not match\n", + CHECK_MAJOR_VERSION, CHECK_MINOR_VERSION, CHECK_MICRO_VERSION); + printf("*** the check library (version %d.%d.%d).\n", + check_major_version, check_minor_version, check_micro_version); + return 1; + } + + if ((check_major_version > major) || + ((check_major_version == major) && (check_minor_version > minor)) || + ((check_major_version == major) && (check_minor_version == minor) && (check_micro_version >= micro))) + { + return 0; + } + else + { + printf("\n*** An old version of check (%d.%d.%d) was found.\n", + check_major_version, check_minor_version, check_micro_version); + printf("*** You need a version of check being at least %d.%d.%d.\n", major, minor, micro); + printf("***\n"); + printf("*** If you have already installed a sufficiently new version, this error\n"); + printf("*** probably means that the wrong copy of the check library and header\n"); + printf("*** file is being found. Rerun configure with the --with-check=PATH option\n"); + printf("*** to specify the prefix where the correct version was installed.\n"); + } + + return 1; +} +],, no_check=yes, [echo $ac_n "cross compiling; assumed OK... $ac_c"]) + + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + + if test "x$no_check" = x ; then + AC_MSG_RESULT(yes) + ifelse([$5], , :, [$5]) + else + AC_MSG_RESULT(no) + if test -f conf.check-test ; then + : + else + echo "*** Could not run check test program, checking why..." + CFLAGS="$CFLAGS $CHECK_CFLAGS" + LIBS="$CHECK_LIBS $LIBS" + AC_TRY_LINK([ +#include +#include + +#include +], , [ echo "*** The test program compiled, but did not run. This usually means" + echo "*** that the run-time linker is not finding check. You'll need to set your" + echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" + echo "*** to the installed location Also, make sure you have run ldconfig if that" + echo "*** is required on your system" + echo "***" + echo "*** If you have an old version installed, it is best to remove it, although" + echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"], + [ echo "*** The test program failed to compile or link. See the file config.log for" + echo "*** the exact error that occured." ]) + + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + + CHECK_CFLAGS="" + CHECK_LIBS="" + + rm -f conf.check-test + ifelse([$6], , AC_MSG_ERROR([check not found]), [$6]) + fi +]) + + +dnl AM_PATH_CHECK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) +dnl Test for check, and define CHECK_CFLAGS and CHECK_LIBS +dnl + +AC_DEFUN([AM_PATH_CHECK], +[ + AC_ARG_WITH(check, + [ --with-check=PATH prefix where check is installed [default=auto]]) + + AC_ARG_WITH(checklibname, + AC_HELP_STRING([--with-check-lib-name=NAME], + [name of the PIC check library (default=check)])) + + min_check_version=ifelse([$1], ,0.8.2,$1) + + if test x$with_check = xno; then + AC_MSG_RESULT(disabled) + ifelse([$3], , AC_MSG_ERROR([disabling check is not supported]), [$3]) + else + if test "x$with_check" != x; then + CHECK_EXTRA_CFLAGS="-I$with_check/include" + CHECK_EXTRA_LIBS="-L$with_check/lib" + else + CHECK_EXTRA_CFLAGS="" + CHECK_EXTRA_LIBS="" + fi + + if test x$with_checklibname = x; then + _AM_TRY_CHECK($min_check_version, $CHECK_EXTRA_CFLAGS, $CHECK_EXTRA_LIBS, + check_pic, [have_check=true], [have_check=false]) + if test x$have_check = xtrue; then + ifelse([$2], , :, [$2]) + else + _AM_TRY_CHECK($min_check_version, $CHECK_EXTRA_CFLAGS, $CHECK_EXTRA_LIBS, + check, [have_check=true], [have_check=false]) + if test x$have_check = xtrue; then + ifelse([$2], , :, [$2]) + else + ifelse([$3], , AC_MSG_ERROR([check not found]), [$3]) + fi + fi + else + _AM_TRY_CHECK($min_check_version, $CHECK_EXTRA_CFLAGS, $CHECK_EXTRA_LIBS, + $with_checklibname, [have_check=true], [have_check=false]) + if test x$have_check = xtrue; then + ifelse([$2], , :, [$2]) + else + ifelse([$3], , AC_MSG_ERROR([check not found]), [$3]) + fi + fi + + AC_SUBST(CHECK_CFLAGS) + AC_SUBST(CHECK_LIBS) + rm -f conf.check-test + fi +]) diff --git a/common/m4/glib-gettext.m4 b/common/m4/glib-gettext.m4 new file mode 100644 index 0000000..f8d442f --- /dev/null +++ b/common/m4/glib-gettext.m4 @@ -0,0 +1,432 @@ +# Copyright (C) 1995-2002 Free Software Foundation, Inc. +# Copyright (C) 2001-2003,2004 Red Hat, Inc. +# +# This file is free software, distributed under the terms of the GNU +# General Public License. As a special exception to the GNU General +# Public License, this file may be distributed as part of a program +# that contains a configuration script generated by Autoconf, under +# the same distribution terms as the rest of that program. +# +# This file can be copied and used freely without restrictions. It can +# be used in projects which are not available under the GNU Public License +# but which still want to provide support for the GNU gettext functionality. +# +# Macro to add for using GNU gettext. +# Ulrich Drepper , 1995, 1996 +# +# Modified to never use included libintl. +# Owen Taylor , 12/15/1998 +# +# Major rework to remove unused code +# Owen Taylor , 12/11/2002 +# +# Added better handling of ALL_LINGUAS from GNU gettext version +# written by Bruno Haible, Owen Taylor 5/30/3002 +# +# Modified to require ngettext +# Matthias Clasen 08/06/2004 +# +# We need this here as well, since someone might use autoconf-2.5x +# to configure GLib then an older version to configure a package +# using AM_GLIB_GNU_GETTEXT +AC_PREREQ(2.53) + +dnl +dnl We go to great lengths to make sure that aclocal won't +dnl try to pull in the installed version of these macros +dnl when running aclocal in the glib directory. +dnl +m4_copy([AC_DEFUN],[glib_DEFUN]) +m4_copy([AC_REQUIRE],[glib_REQUIRE]) +dnl +dnl At the end, if we're not within glib, we'll define the public +dnl definitions in terms of our private definitions. +dnl + +# GLIB_LC_MESSAGES +#-------------------- +glib_DEFUN([GLIB_LC_MESSAGES], + [AC_CHECK_HEADERS([locale.h]) + if test $ac_cv_header_locale_h = yes; then + AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES, + [AC_TRY_LINK([#include ], [return LC_MESSAGES], + am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)]) + if test $am_cv_val_LC_MESSAGES = yes; then + AC_DEFINE(HAVE_LC_MESSAGES, 1, + [Define if your file defines LC_MESSAGES.]) + fi + fi]) + +# GLIB_PATH_PROG_WITH_TEST +#---------------------------- +dnl GLIB_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR, +dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]]) +glib_DEFUN([GLIB_PATH_PROG_WITH_TEST], +[# Extract the first word of "$2", so it can be a program name with args. +set dummy $2; ac_word=[$]2 +AC_MSG_CHECKING([for $ac_word]) +AC_CACHE_VAL(ac_cv_path_$1, +[case "[$]$1" in + /*) + ac_cv_path_$1="[$]$1" # Let the user override the test with a path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in ifelse([$5], , $PATH, [$5]); do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if [$3]; then + ac_cv_path_$1="$ac_dir/$ac_word" + break + fi + fi + done + IFS="$ac_save_ifs" +dnl If no 4th arg is given, leave the cache variable unset, +dnl so AC_PATH_PROGS will keep looking. +ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4" +])dnl + ;; +esac])dnl +$1="$ac_cv_path_$1" +if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then + AC_MSG_RESULT([$]$1) +else + AC_MSG_RESULT(no) +fi +AC_SUBST($1)dnl +]) + +# GLIB_WITH_NLS +#----------------- +glib_DEFUN([GLIB_WITH_NLS], + dnl NLS is obligatory + [USE_NLS=yes + AC_SUBST(USE_NLS) + + gt_cv_have_gettext=no + + CATOBJEXT=NONE + XGETTEXT=: + INTLLIBS= + + AC_CHECK_HEADER(libintl.h, + [gt_cv_func_dgettext_libintl="no" + libintl_extra_libs="" + + # + # First check in libc + # + AC_CACHE_CHECK([for ngettext in libc], gt_cv_func_ngettext_libc, + [AC_TRY_LINK([ +#include +], + [return !ngettext ("","", 1)], + gt_cv_func_ngettext_libc=yes, + gt_cv_func_ngettext_libc=no) + ]) + + if test "$gt_cv_func_ngettext_libc" = "yes" ; then + AC_CACHE_CHECK([for dgettext in libc], gt_cv_func_dgettext_libc, + [AC_TRY_LINK([ +#include +], + [return !dgettext ("","")], + gt_cv_func_dgettext_libc=yes, + gt_cv_func_dgettext_libc=no) + ]) + fi + + if test "$gt_cv_func_ngettext_libc" = "yes" ; then + AC_CHECK_FUNCS(bind_textdomain_codeset) + fi + + # + # If we don't have everything we want, check in libintl + # + if test "$gt_cv_func_dgettext_libc" != "yes" \ + || test "$gt_cv_func_ngettext_libc" != "yes" \ + || test "$ac_cv_func_bind_textdomain_codeset" != "yes" ; then + + AC_CHECK_LIB(intl, bindtextdomain, + [AC_CHECK_LIB(intl, ngettext, + [AC_CHECK_LIB(intl, dgettext, + gt_cv_func_dgettext_libintl=yes)])]) + + if test "$gt_cv_func_dgettext_libintl" != "yes" ; then + AC_MSG_CHECKING([if -liconv is needed to use gettext]) + AC_MSG_RESULT([]) + AC_CHECK_LIB(intl, ngettext, + [AC_CHECK_LIB(intl, dcgettext, + [gt_cv_func_dgettext_libintl=yes + libintl_extra_libs=-liconv], + :,-liconv)], + :,-liconv) + fi + + # + # If we found libintl, then check in it for bind_textdomain_codeset(); + # we'll prefer libc if neither have bind_textdomain_codeset(), + # and both have dgettext and ngettext + # + if test "$gt_cv_func_dgettext_libintl" = "yes" ; then + glib_save_LIBS="$LIBS" + LIBS="$LIBS -lintl $libintl_extra_libs" + unset ac_cv_func_bind_textdomain_codeset + AC_CHECK_FUNCS(bind_textdomain_codeset) + LIBS="$glib_save_LIBS" + + if test "$ac_cv_func_bind_textdomain_codeset" = "yes" ; then + gt_cv_func_dgettext_libc=no + else + if test "$gt_cv_func_dgettext_libc" = "yes" \ + && test "$gt_cv_func_ngettext_libc" = "yes"; then + gt_cv_func_dgettext_libintl=no + fi + fi + fi + fi + + if test "$gt_cv_func_dgettext_libc" = "yes" \ + || test "$gt_cv_func_dgettext_libintl" = "yes"; then + gt_cv_have_gettext=yes + fi + + if test "$gt_cv_func_dgettext_libintl" = "yes"; then + INTLLIBS="-lintl $libintl_extra_libs" + fi + + if test "$gt_cv_have_gettext" = "yes"; then + AC_DEFINE(HAVE_GETTEXT,1, + [Define if the GNU gettext() function is already present or preinstalled.]) + GLIB_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, + [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl + if test "$MSGFMT" != "no"; then + glib_save_LIBS="$LIBS" + LIBS="$LIBS $INTLLIBS" + AC_CHECK_FUNCS(dcgettext) + MSGFMT_OPTS= + AC_MSG_CHECKING([if msgfmt accepts -c]) + GLIB_RUN_PROG([$MSGFMT -c -o /dev/null],[ +msgid "" +msgstr "" +"Content-Type: text/plain; charset=UTF-8\n" +"Project-Id-Version: test 1.0\n" +"PO-Revision-Date: 2007-02-15 12:01+0100\n" +"Last-Translator: test \n" +"Language-Team: C \n" +"MIME-Version: 1.0\n" +"Content-Transfer-Encoding: 8bit\n" +], [MSGFMT_OPTS=-c; AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])]) + AC_SUBST(MSGFMT_OPTS) + AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) + GLIB_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, + [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :) + AC_TRY_LINK(, [extern int _nl_msg_cat_cntr; + return _nl_msg_cat_cntr], + [CATOBJEXT=.gmo + DATADIRNAME=share], + [case $host in + *-*-solaris*) + dnl On Solaris, if bind_textdomain_codeset is in libc, + dnl GNU format message catalog is always supported, + dnl since both are added to the libc all together. + dnl Hence, we'd like to go with DATADIRNAME=share and + dnl and CATOBJEXT=.gmo in this case. + AC_CHECK_FUNC(bind_textdomain_codeset, + [CATOBJEXT=.gmo + DATADIRNAME=share], + [CATOBJEXT=.mo + DATADIRNAME=lib]) + ;; + *) + CATOBJEXT=.mo + DATADIRNAME=lib + ;; + esac]) + LIBS="$glib_save_LIBS" + INSTOBJEXT=.mo + else + gt_cv_have_gettext=no + fi + fi + ]) + + if test "$gt_cv_have_gettext" = "yes" ; then + AC_DEFINE(ENABLE_NLS, 1, + [always defined to indicate that i18n is enabled]) + fi + + dnl Test whether we really found GNU xgettext. + if test "$XGETTEXT" != ":"; then + dnl If it is not GNU xgettext we define it as : so that the + dnl Makefiles still can work. + if $XGETTEXT --omit-header /dev/null 2> /dev/null; then + : ; + else + AC_MSG_RESULT( + [found xgettext program is not GNU xgettext; ignore it]) + XGETTEXT=":" + fi + fi + + # We need to process the po/ directory. + POSUB=po + + AC_OUTPUT_COMMANDS( + [case "$CONFIG_FILES" in *po/Makefile.in*) + sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile + esac]) + + dnl These rules are solely for the distribution goal. While doing this + dnl we only have to keep exactly one list of the available catalogs + dnl in configure.in. + for lang in $ALL_LINGUAS; do + GMOFILES="$GMOFILES $lang.gmo" + POFILES="$POFILES $lang.po" + done + + dnl Make all variables we use known to autoconf. + AC_SUBST(CATALOGS) + AC_SUBST(CATOBJEXT) + AC_SUBST(DATADIRNAME) + AC_SUBST(GMOFILES) + AC_SUBST(INSTOBJEXT) + AC_SUBST(INTLLIBS) + AC_SUBST(PO_IN_DATADIR_TRUE) + AC_SUBST(PO_IN_DATADIR_FALSE) + AC_SUBST(POFILES) + AC_SUBST(POSUB) + ]) + +# AM_GLIB_GNU_GETTEXT +# ------------------- +# Do checks necessary for use of gettext. If a suitable implementation +# of gettext is found in either in libintl or in the C library, +# it will set INTLLIBS to the libraries needed for use of gettext +# and AC_DEFINE() HAVE_GETTEXT and ENABLE_NLS. (The shell variable +# gt_cv_have_gettext will be set to "yes".) It will also call AC_SUBST() +# on various variables needed by the Makefile.in.in installed by +# glib-gettextize. +dnl +glib_DEFUN([GLIB_GNU_GETTEXT], + [AC_REQUIRE([AC_PROG_CC])dnl + AC_REQUIRE([AC_HEADER_STDC])dnl + + GLIB_LC_MESSAGES + GLIB_WITH_NLS + + if test "$gt_cv_have_gettext" = "yes"; then + if test "x$ALL_LINGUAS" = "x"; then + LINGUAS= + else + AC_MSG_CHECKING(for catalogs to be installed) + NEW_LINGUAS= + for presentlang in $ALL_LINGUAS; do + useit=no + if test "%UNSET%" != "${LINGUAS-%UNSET%}"; then + desiredlanguages="$LINGUAS" + else + desiredlanguages="$ALL_LINGUAS" + fi + for desiredlang in $desiredlanguages; do + # Use the presentlang catalog if desiredlang is + # a. equal to presentlang, or + # b. a variant of presentlang (because in this case, + # presentlang can be used as a fallback for messages + # which are not translated in the desiredlang catalog). + case "$desiredlang" in + "$presentlang"*) useit=yes;; + esac + done + if test $useit = yes; then + NEW_LINGUAS="$NEW_LINGUAS $presentlang" + fi + done + LINGUAS=$NEW_LINGUAS + AC_MSG_RESULT($LINGUAS) + fi + + dnl Construct list of names of catalog files to be constructed. + if test -n "$LINGUAS"; then + for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done + fi + fi + + dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly + dnl find the mkinstalldirs script in another subdir but ($top_srcdir). + dnl Try to locate is. + MKINSTALLDIRS= + if test -n "$ac_aux_dir"; then + MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" + fi + if test -z "$MKINSTALLDIRS"; then + MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" + fi + AC_SUBST(MKINSTALLDIRS) + + dnl Generate list of files to be processed by xgettext which will + dnl be included in po/Makefile. + test -d po || mkdir po + if test "x$srcdir" != "x."; then + if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then + posrcprefix="$srcdir/" + else + posrcprefix="../$srcdir/" + fi + else + posrcprefix="../" + fi + rm -f po/POTFILES + sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \ + < $srcdir/po/POTFILES.in > po/POTFILES + ]) + +# AM_GLIB_DEFINE_LOCALEDIR(VARIABLE) +# ------------------------------- +# Define VARIABLE to the location where catalog files will +# be installed by po/Makefile. +glib_DEFUN([GLIB_DEFINE_LOCALEDIR], +[glib_REQUIRE([GLIB_GNU_GETTEXT])dnl +glib_save_prefix="$prefix" +glib_save_exec_prefix="$exec_prefix" +glib_save_datarootdir="$datarootdir" +test "x$prefix" = xNONE && prefix=$ac_default_prefix +test "x$exec_prefix" = xNONE && exec_prefix=$prefix +datarootdir=`eval echo "${datarootdir}"` +if test "x$CATOBJEXT" = "x.mo" ; then + localedir=`eval echo "${libdir}/locale"` +else + localedir=`eval echo "${datadir}/locale"` +fi +prefix="$glib_save_prefix" +exec_prefix="$glib_save_exec_prefix" +datarootdir="$glib_save_datarootdir" +AC_DEFINE_UNQUOTED($1, "$localedir", + [Define the location where the catalogs will be installed]) +]) + +dnl +dnl Now the definitions that aclocal will find +dnl +ifdef(glib_configure_in,[],[ +AC_DEFUN([AM_GLIB_GNU_GETTEXT],[GLIB_GNU_GETTEXT($@)]) +AC_DEFUN([AM_GLIB_DEFINE_LOCALEDIR],[GLIB_DEFINE_LOCALEDIR($@)]) +])dnl + +# GLIB_RUN_PROG(PROGRAM, TEST-FILE, [ACTION-IF-PASS], [ACTION-IF-FAIL]) +# +# Create a temporary file with TEST-FILE as its contents and pass the +# file name to PROGRAM. Perform ACTION-IF-PASS if PROGRAM exits with +# 0 and perform ACTION-IF-FAIL for any other exit status. +AC_DEFUN([GLIB_RUN_PROG], +[cat >conftest.foo <<_ACEOF +$2 +_ACEOF +if AC_RUN_LOG([$1 conftest.foo]); then + m4_ifval([$3], [$3], [:]) +m4_ifvaln([$4], [else $4])dnl +echo "$as_me: failed input was:" >&AS_MESSAGE_LOG_FD +sed 's/^/| /' conftest.foo >&AS_MESSAGE_LOG_FD +fi]) + diff --git a/common/m4/gst-arch.m4 b/common/m4/gst-arch.m4 new file mode 100644 index 0000000..077a20b --- /dev/null +++ b/common/m4/gst-arch.m4 @@ -0,0 +1,140 @@ +dnl AG_GST_ARCH +dnl sets up defines and automake conditionals for host architecture +dnl checks endianness +dnl defines HOST_CPU + +AC_DEFUN([AG_GST_ARCH], +[ + dnl Determine CPU + case "x${target_cpu}" in + xi?86 | xk? | xi?86_64) + case $target_os in + solaris*) + AC_CHECK_DECL([__i386], [I386_ABI="yes"], [I386_ABI="no"]) + AC_CHECK_DECL([__amd64], [AMD64_ABI="yes"], [AMD64_ABI="no"]) + + if test "x$I386_ABI" = "xyes" ; then + HAVE_CPU_I386=yes + AC_DEFINE(HAVE_CPU_I386, 1, [Define if the target CPU is an x86]) + fi + if test "x$AMD64_ABI" = "xyes" ; then + HAVE_CPU_X86_64=yes + AC_DEFINE(HAVE_CPU_X86_64, 1, [Define if the target CPU is a x86_64]) + fi + ;; + *) + HAVE_CPU_I386=yes + AC_DEFINE(HAVE_CPU_I386, 1, [Define if the target CPU is an x86]) + + dnl FIXME could use some better detection + dnl (ie CPUID) + case "x${target_cpu}" in + xi386 | xi486) ;; + *) + AC_DEFINE(HAVE_RDTSC, 1, [Define if RDTSC is available]) ;; + esac + ;; + esac + ;; + xpowerpc) + HAVE_CPU_PPC=yes + AC_DEFINE(HAVE_CPU_PPC, 1, [Define if the target CPU is a PowerPC]) ;; + xpowerpc64) + HAVE_CPU_PPC64=yes + AC_DEFINE(HAVE_CPU_PPC64, 1, [Define if the target CPU is a 64 bit PowerPC]) ;; + xalpha*) + HAVE_CPU_ALPHA=yes + AC_DEFINE(HAVE_CPU_ALPHA, 1, [Define if the target CPU is an Alpha]) ;; + xarm*) + HAVE_CPU_ARM=yes + AC_DEFINE(HAVE_CPU_ARM, 1, [Define if the target CPU is an ARM]) ;; + xsparc*) + HAVE_CPU_SPARC=yes + AC_DEFINE(HAVE_CPU_SPARC, 1, [Define if the target CPU is a SPARC]) ;; + xmips*) + HAVE_CPU_MIPS=yes + AC_DEFINE(HAVE_CPU_MIPS, 1, [Define if the target CPU is a MIPS]) ;; + xhppa*) + HAVE_CPU_HPPA=yes + AC_DEFINE(HAVE_CPU_HPPA, 1, [Define if the target CPU is a HPPA]) ;; + xs390*) + HAVE_CPU_S390=yes + AC_DEFINE(HAVE_CPU_S390, 1, [Define if the target CPU is a S390]) ;; + xia64*) + HAVE_CPU_IA64=yes + AC_DEFINE(HAVE_CPU_IA64, 1, [Define if the target CPU is a IA64]) ;; + xm68k*) + HAVE_CPU_M68K=yes + AC_DEFINE(HAVE_CPU_M68K, 1, [Define if the target CPU is a M68K]) ;; + xx86_64) + HAVE_CPU_X86_64=yes + AC_DEFINE(HAVE_CPU_X86_64, 1, [Define if the target CPU is a x86_64]) ;; + xcris) + HAVE_CPU_CRIS=yes + AC_DEFINE(HAVE_CPU_CRIS, 1, [Define if the target CPU is a CRIS]) ;; + xcrisv32) + HAVE_CPU_CRISV32=yes + AC_DEFINE(HAVE_CPU_CRISV32, 1, [Define if the target CPU is a CRISv32]) ;; + esac + + dnl Determine endianness + AC_C_BIGENDIAN + + AM_CONDITIONAL(HAVE_CPU_I386, test "x$HAVE_CPU_I386" = "xyes") + AM_CONDITIONAL(HAVE_CPU_PPC, test "x$HAVE_CPU_PPC" = "xyes") + AM_CONDITIONAL(HAVE_CPU_PPC64, test "x$HAVE_CPU_PPC64" = "xyes") + AM_CONDITIONAL(HAVE_CPU_ALPHA, test "x$HAVE_CPU_ALPHA" = "xyes") + AM_CONDITIONAL(HAVE_CPU_ARM, test "x$HAVE_CPU_ARM" = "xyes") + AM_CONDITIONAL(HAVE_CPU_SPARC, test "x$HAVE_CPU_SPARC" = "xyes") + AM_CONDITIONAL(HAVE_CPU_HPPA, test "x$HAVE_CPU_HPPA" = "xyes") + AM_CONDITIONAL(HAVE_CPU_MIPS, test "x$HAVE_CPU_MIPS" = "xyes") + AM_CONDITIONAL(HAVE_CPU_S390, test "x$HAVE_CPU_S390" = "xyes") + AM_CONDITIONAL(HAVE_CPU_IA64, test "x$HAVE_CPU_IA64" = "xyes") + AM_CONDITIONAL(HAVE_CPU_M68K, test "x$HAVE_CPU_M68K" = "xyes") + AM_CONDITIONAL(HAVE_CPU_X86_64, test "x$HAVE_CPU_X86_64" = "xyes") + AM_CONDITIONAL(HAVE_CPU_CRIS, test "x$HAVE_CPU_CRIS" = "xyes") + AM_CONDITIONAL(HAVE_CPU_CRISV32, test "x$HAVE_CPU_CRISV32" = "xyes") + + AC_DEFINE_UNQUOTED(HOST_CPU, "$host_cpu", [the host CPU]) + AC_DEFINE_UNQUOTED(TARGET_CPU, "$target_cpu", [the target CPU]) +]) + +dnl check if unaligned memory access works correctly +AC_DEFUN([AG_GST_UNALIGNED_ACCESS], [ + AC_MSG_CHECKING([if unaligned memory access works correctly]) + if test x"$as_cv_unaligned_access" = x ; then + case $host in + alpha*|arm*|hp*|mips*|sh*|sparc*|ia64*) + _AS_ECHO_N([(blacklisted) ]) + as_cv_unaligned_access=no + ;; + i?86*|x86_64*|amd64*|powerpc*|m68k*|cris*) + _AS_ECHO_N([(whitelisted) ]) + as_cv_unaligned_access=yes + ;; + esac + else + _AS_ECHO_N([(cached) ]) + fi + if test x"$as_cv_unaligned_access" = x ; then + AC_TRY_RUN([ +int main(int argc, char **argv) +{ + char array[] = "ABCDEFGH"; + unsigned int iarray[2]; + memcpy(iarray,array,8); +#define GET(x) (*(unsigned int *)((char *)iarray + (x))) + if(GET(0) != 0x41424344 && GET(0) != 0x44434241) return 1; + if(GET(1) != 0x42434445 && GET(1) != 0x45444342) return 1; + if(GET(2) != 0x43444546 && GET(2) != 0x46454443) return 1; + if(GET(3) != 0x44454647 && GET(3) != 0x47464544) return 1; + return 0; +} + ], as_cv_unaligned_access="yes", as_cv_unaligned_access="no") + fi + AC_MSG_RESULT($as_cv_unaligned_access) + if test "$as_cv_unaligned_access" = "yes"; then + AC_DEFINE_UNQUOTED(HAVE_UNALIGNED_ACCESS, 1, + [defined if unaligned memory access works correctly]) + fi +]) diff --git a/common/m4/gst-args.m4 b/common/m4/gst-args.m4 new file mode 100644 index 0000000..b478c82 --- /dev/null +++ b/common/m4/gst-args.m4 @@ -0,0 +1,360 @@ +dnl configure-time options shared among gstreamer modules + +dnl AG_GST_ARG_DEBUG +dnl AG_GST_ARG_PROFILING +dnl AG_GST_ARG_VALGRIND +dnl AG_GST_ARG_GCOV + +dnl AG_GST_ARG_EXAMPLES + +dnl AG_GST_ARG_WITH_PKG_CONFIG_PATH +dnl AG_GST_ARG_WITH_PACKAGE_NAME +dnl AG_GST_ARG_WITH_PACKAGE_ORIGIN + +dnl AG_GST_ARG_WITH_PLUGINS +dnl AG_GST_CHECK_PLUGIN +dnl AG_GST_DISABLE_PLUGIN + +dnl AG_GST_ARG_ENABLE_EXTERNAL +dnl AG_GST_ARG_ENABLE_EXPERIMENTAL +dnl AG_GST_ARG_ENABLE_BROKEN + +dnl AG_GST_ARG_DISABLE_FATAL_WARNINGS +AC_DEFUN([AG_GST_ARG_DEBUG], +[ + dnl debugging stuff + AC_ARG_ENABLE(debug, + AC_HELP_STRING([--disable-debug],[disable addition of -g debugging info]), + [ + case "${enableval}" in + yes) USE_DEBUG=yes ;; + no) USE_DEBUG=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;; + esac + ], + [USE_DEBUG=yes]) dnl Default value +]) + +AC_DEFUN([AG_GST_ARG_PROFILING], +[ + AC_ARG_ENABLE(profiling, + AC_HELP_STRING([--enable-profiling], + [adds -pg to compiler commandline, for profiling]), + [ + case "${enableval}" in + yes) USE_PROFILING=yes ;; + no) USE_PROFILING=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-profiling) ;; + esac + ], + [USE_PROFILING=no]) dnl Default value +]) + +AC_DEFUN([AG_GST_ARG_VALGRIND], +[ + dnl valgrind inclusion + AC_ARG_ENABLE(valgrind, + AC_HELP_STRING([--disable-valgrind],[disable run-time valgrind detection]), + [ + case "${enableval}" in + yes) USE_VALGRIND="$USE_DEBUG" ;; + no) USE_VALGRIND=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-valgrind) ;; + esac + ], + [USE_VALGRIND="$USE_DEBUG"]) dnl Default value + VALGRIND_REQ="3.0" + if test "x$USE_VALGRIND" = xyes; then + PKG_CHECK_MODULES(VALGRIND, valgrind >= $VALGRIND_REQ, + USE_VALGRIND="yes", + USE_VALGRIND="no") + fi + if test "x$USE_VALGRIND" = xyes; then + AC_DEFINE(HAVE_VALGRIND, 1, [Define if valgrind should be used]) + AC_MSG_NOTICE(Using extra code paths for valgrind) + fi +]) + +AC_DEFUN([AG_GST_ARG_GCOV], +[ + AC_ARG_ENABLE(gcov, + AC_HELP_STRING([--enable-gcov], + [compile with coverage profiling instrumentation (gcc only)]), + enable_gcov=$enableval, + enable_gcov=no) + if test x$enable_gcov = xyes ; then + if test "x$GCC" != "xyes" + then + AC_MSG_ERROR([gcov only works if gcc is used]) + fi + + AS_COMPILER_FLAG(["-fprofile-arcs"], + [GCOV_CFLAGS="$GCOV_CFLAGS -fprofile-arcs"], + true) + AS_COMPILER_FLAG(["-ftest-coverage"], + [GCOV_CFLAGS="$GCOV_CFLAGS -ftest-coverage"], + true) + dnl remove any -O flags - FIXME: is this needed ? + GCOV_CFLAGS=`echo "$GCOV_CFLAGS" | sed -e 's/-O[[0-9]]*//g'` + dnl libtool 1.5.22 and lower strip -fprofile-arcs from the flags + dnl passed to the linker, which is a bug; -fprofile-arcs implicitly + dnl links in -lgcov, so we do it explicitly here for the same effect + GCOV_LIBS=-lgcov + AC_SUBST(GCOV_CFLAGS) + AC_SUBST(GCOV_LIBS) + GCOV=`echo $CC | sed s/gcc/gcov/g` + AC_SUBST(GCOV) + + GST_GCOV_ENABLED=yes + AC_DEFINE_UNQUOTED(GST_GCOV_ENABLED, 1, + [Defined if gcov is enabled to force a rebuild due to config.h changing]) + dnl if gcov is used, we do not want default -O2 CFLAGS + if test "x$GST_GCOV_ENABLED" = "xyes" + then + CFLAGS="$CFLAGS -O0" + AC_SUBST(CFLAGS) + CXXFLAGS="$CXXFLAGS -O0" + AC_SUBST(CXXFLAGS) + FFLAGS="$FFLAGS -O0" + AC_SUBST(FFLAGS) + CCASFLAGS="$CCASFLAGS -O0" + AC_SUBST(CCASFLAGS) + AC_MSG_NOTICE([gcov enabled, setting CFLAGS and friends to $CFLAGS]) + fi + fi + AM_CONDITIONAL(GST_GCOV_ENABLED, test x$enable_gcov = xyes) +]) + +AC_DEFUN([AG_GST_ARG_EXAMPLES], +[ + AC_ARG_ENABLE(examples, + AC_HELP_STRING([--disable-examples], [disable building examples]), + [ + case "${enableval}" in + yes) BUILD_EXAMPLES=yes ;; + no) BUILD_EXAMPLES=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for --disable-examples) ;; + esac + ], + [BUILD_EXAMPLES=yes]) dnl Default value + AM_CONDITIONAL(BUILD_EXAMPLES, test "x$BUILD_EXAMPLES" = "xyes") +]) + +AC_DEFUN([AG_GST_ARG_WITH_PKG_CONFIG_PATH], +[ + dnl possibly modify pkg-config path + AC_ARG_WITH(pkg-config-path, + AC_HELP_STRING([--with-pkg-config-path], + [colon-separated list of pkg-config(1) dirs]), + [ + export PKG_CONFIG_PATH=${withval} + AC_MSG_NOTICE(Set PKG_CONFIG_PATH to $PKG_CONFIG_PATH) + ]) +]) + + +dnl This macro requires that GST_GIT or GST_CVS is set to yes or no (release) +AC_DEFUN([AG_GST_ARG_WITH_PACKAGE_NAME], +[ + dnl package name in plugins + AC_ARG_WITH(package-name, + AC_HELP_STRING([--with-package-name], + [specify package name to use in plugins]), + [ + case "${withval}" in + yes) AC_MSG_ERROR(bad value ${withval} for --with-package-name) ;; + no) AC_MSG_ERROR(bad value ${withval} for --with-package-name) ;; + *) GST_PACKAGE_NAME="${withval}" ;; + esac + ], + [ + P=$1 + if test "x$P" = "x" + then + P=$PACKAGE_NAME + fi + + if test "x$PACKAGE_VERSION_NANO" = "x0" + then + GST_PACKAGE_NAME="$P source release" + else + if test "x$PACKAGE_VERSION_NANO" = "x1" + then + GST_PACKAGE_NAME="$P git" + else + GST_PACKAGE_NAME="$P prerelease" + fi + fi + ] + ) + AC_MSG_NOTICE(Using $GST_PACKAGE_NAME as package name) + AC_DEFINE_UNQUOTED(GST_PACKAGE_NAME, "$GST_PACKAGE_NAME", + [package name in plugins]) + AC_SUBST(GST_PACKAGE_NAME) +]) + +AC_DEFUN([AG_GST_ARG_WITH_PACKAGE_ORIGIN], +[ + dnl package origin URL + AC_ARG_WITH(package-origin, + AC_HELP_STRING([--with-package-origin], + [specify package origin URL to use in plugins]), + [ + case "${withval}" in + yes) AC_MSG_ERROR(bad value ${withval} for --with-package-origin) ;; + no) AC_MSG_ERROR(bad value ${withval} for --with-package-origin) ;; + *) GST_PACKAGE_ORIGIN="${withval}" ;; + esac + ], + [GST_PACKAGE_ORIGIN="[Unknown package origin]"] dnl Default value + ) + AC_MSG_NOTICE(Using $GST_PACKAGE_ORIGIN as package origin) + AC_DEFINE_UNQUOTED(GST_PACKAGE_ORIGIN, "$GST_PACKAGE_ORIGIN", + [package origin]) + AC_SUBST(GST_PACKAGE_ORIGIN) +]) + +dnl sets WITH_PLUGINS to the list of plug-ins given as an argument +dnl also clears GST_PLUGINS_ALL and GST_PLUGINS_SELECTED +AC_DEFUN([AG_GST_ARG_WITH_PLUGINS], +[ + AC_ARG_WITH(plugins, + AC_HELP_STRING([--with-plugins], + [comma-separated list of dependencyless plug-ins to compile]), + [WITH_PLUGINS=$withval], + [WITH_PLUGINS=]) + + GST_PLUGINS_ALL="" + GST_PLUGINS_SELECTED="" + GST_PLUGINS_NONPORTED="" + + AC_SUBST(GST_PLUGINS_ALL) + AC_SUBST(GST_PLUGINS_SELECTED) + AC_SUBST(GST_PLUGINS_NONPORTED) +]) + +dnl AG_GST_CHECK_PLUGIN(PLUGIN-NAME) +dnl +dnl This macro adds the plug-in to GST_PLUGINS_ALL. Then it +dnl checks if WITH_PLUGINS is empty or the plugin is present in WITH_PLUGINS, +dnl and if so adds it to GST_PLUGINS_SELECTED. Then it checks if the plugin +dnl is present in WITHOUT_PLUGINS (ie. was disabled specifically) and if so +dnl removes it from GST_PLUGINS_SELECTED. +dnl +dnl The macro will call AM_CONDITIONAL(USE_PLUGIN_, ...) to allow +dnl control of what is built in Makefile.ams. +AC_DEFUN([AG_GST_CHECK_PLUGIN], +[ + GST_PLUGINS_ALL="$GST_PLUGINS_ALL [$1]" + + define([pname_def],translit([$1], -a-z, _a-z)) + + AC_ARG_ENABLE([$1], + AC_HELP_STRING([--disable-[$1]], [disable dependency-less $1 plugin]), + [ + case "${enableval}" in + yes) [gst_use_]pname_def=yes ;; + no) [gst_use_]pname_def=no ;; + *) AC_MSG_ERROR([bad value ${enableval} for --enable-$1]) ;; + esac + ], + [[gst_use_]pname_def=yes]) dnl Default value + + if test x$[gst_use_]pname_def = xno; then + AC_MSG_NOTICE(disabling dependency-less plugin $1) + WITHOUT_PLUGINS="$WITHOUT_PLUGINS [$1]" + fi + undefine([pname_def]) + + dnl First check inclusion + if [[ -z "$WITH_PLUGINS" ]] || echo " [$WITH_PLUGINS] " | tr , ' ' | grep -i " [$1] " > /dev/null; then + GST_PLUGINS_SELECTED="$GST_PLUGINS_SELECTED [$1]" + fi + dnl Then check exclusion + if echo " [$WITHOUT_PLUGINS] " | tr , ' ' | grep -i " [$1] " > /dev/null; then + GST_PLUGINS_SELECTED=`echo " $GST_PLUGINS_SELECTED " | $SED -e 's/ [$1] / /'` + fi + dnl Finally check if the plugin is ported or not + if echo " [$GST_PLUGINS_NONPORTED] " | tr , ' ' | grep -i " [$1] " > /dev/null; then + GST_PLUGINS_SELECTED=`echo " $GST_PLUGINS_SELECTED " | $SED -e 's/ [$1] / /'` + fi + AM_CONDITIONAL([USE_PLUGIN_]translit([$1], a-z, A-Z), echo " $GST_PLUGINS_SELECTED " | grep -i " [$1] " > /dev/null) +]) + +dnl AG_GST_DISABLE_PLUGIN(PLUGIN-NAME) +dnl +dnl This macro disables the plug-in by removing it from +dnl GST_PLUGINS_SELECTED. +AC_DEFUN([AG_GST_DISABLE_PLUGIN], +[ + GST_PLUGINS_SELECTED=`echo " $GST_PLUGINS_SELECTED " | $SED -e 's/ [$1] / /'` + AM_CONDITIONAL([USE_PLUGIN_]translit([$1], a-z, A-Z), false) +]) + +AC_DEFUN([AG_GST_ARG_ENABLE_EXTERNAL], +[ + AG_GST_CHECK_FEATURE(EXTERNAL, [building of plug-ins with external deps],, + HAVE_EXTERNAL=yes, enabled, + [ + AC_MSG_NOTICE(building external plug-ins) + BUILD_EXTERNAL="yes" + ],[ + AC_MSG_WARN(all plug-ins with external dependencies will not be built) + BUILD_EXTERNAL="no" + ]) + # make BUILD_EXTERNAL available to Makefile.am + AM_CONDITIONAL(BUILD_EXTERNAL, test "x$BUILD_EXTERNAL" = "xyes") +]) + +dnl experimental plug-ins; stuff that hasn't had the dust settle yet +dnl read 'builds, but might not work' +AC_DEFUN([AG_GST_ARG_ENABLE_EXPERIMENTAL], +[ + AG_GST_CHECK_FEATURE(EXPERIMENTAL, [building of experimental plug-ins],, + HAVE_EXPERIMENTAL=yes, disabled, + [ + AC_MSG_WARN(building experimental plug-ins) + BUILD_EXPERIMENTAL="yes" + ],[ + AC_MSG_NOTICE(not building experimental plug-ins) + BUILD_EXPERIMENTAL="no" + ]) + # make BUILD_EXPERIMENTAL available to Makefile.am + AM_CONDITIONAL(BUILD_EXPERIMENTAL, test "x$BUILD_EXPERIMENTAL" = "xyes") +]) + +dnl broken plug-ins; stuff that doesn't seem to build at the moment +AC_DEFUN([AG_GST_ARG_ENABLE_BROKEN], +[ + AG_GST_CHECK_FEATURE(BROKEN, [building of broken plug-ins],, + HAVE_BROKEN=yes, disabled, + [ + AC_MSG_WARN([building broken plug-ins -- no bug reports on these, only patches ...]) + ],[ + AC_MSG_NOTICE([not building broken plug-ins]) + ]) +]) + +dnl allow people (or build tools) to override default behaviour +dnl for fatal compiler warnings +dnl Enable fatal warnings by default only for development versions +AC_DEFUN([AG_GST_ARG_DISABLE_FATAL_WARNINGS], +[ + AC_ARG_ENABLE(fatal-warnings, + AC_HELP_STRING([--disable-fatal-warnings], + [Don't turn compiler warnings into fatal errors]), + [ + case "${enableval}" in + yes) FATAL_WARNINGS=yes ;; + no) FATAL_WARNINGS=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for --disable-fatal-warnings) ;; + esac + ], + [ + if test "x`expr $PACKAGE_VERSION_MINOR % 2`" = "x1" -a "x`expr $PACKAGE_VERSION_MICRO '<' 90`" = "x1"; then + FATAL_WARNINGS=yes + else + FATAL_WARNINGS=no + fi + ]) +]) diff --git a/common/m4/gst-check.m4 b/common/m4/gst-check.m4 new file mode 100644 index 0000000..4277053 --- /dev/null +++ b/common/m4/gst-check.m4 @@ -0,0 +1,294 @@ +dnl pkg-config-based checks for GStreamer modules and dependency modules + +dnl generic: +dnl AG_GST_PKG_CHECK_MODULES([PREFIX], [WHICH], [REQUIRED]) +dnl sets HAVE_[$PREFIX], [$PREFIX]_* +dnl AG_GST_CHECK_MODULES([PREFIX], [MODULE], [MINVER], [NAME], [REQUIRED]) +dnl sets HAVE_[$PREFIX], [$PREFIX]_* + +dnl specific: +dnl AG_GST_CHECK_GST([MAJMIN], [MINVER], [REQUIRED]) +dnl also sets/ACSUBSTs GST_TOOLS_DIR and GST_PLUGINS_DIR +dnl AG_GST_CHECK_GST_BASE([MAJMIN], [MINVER], [REQUIRED]) +dnl AG_GST_CHECK_GST_CONTROLLER([MAJMIN], [MINVER], [REQUIRED]) +dnl AG_GST_CHECK_GST_NET([MAJMIN], [MINVER], [REQUIRED]) +dnl AG_GST_CHECK_GST_CHECK([MAJMIN], [MINVER], [REQUIRED]) +dnl AG_GST_CHECK_GST_PLUGINS_BASE([MAJMIN], [MINVER], [REQUIRED]) +dnl also sets/ACSUBSTs GSTPB_PLUGINS_DIR + +AC_DEFUN([AG_GST_PKG_CHECK_MODULES], +[ + which="[$2]" + dnl not required by default, since we use this mostly for plugin deps + required=ifelse([$3], , "no", [$3]) + + PKG_CHECK_MODULES([$1], $which, + [ + HAVE_[$1]="yes" + ], + [ + HAVE_[$1]="no" + if test "x$required" = "xyes"; then + AC_MSG_ERROR($[$1]_PKG_ERRORS) + else + AC_MSG_NOTICE($[$1]_PKG_ERRORS) + fi + ]) + + dnl AC_SUBST of CFLAGS and LIBS was not done before automake 1.7 + dnl It gets done automatically in automake >= 1.7, which we now require +])) + +AC_DEFUN([AG_GST_CHECK_MODULES], +[ + module=[$2] + minver=[$3] + name="[$4]" + required=ifelse([$5], , "yes", [$5]) dnl required by default + + PKG_CHECK_MODULES([$1], $module >= $minver, + [ + HAVE_[$1]="yes" + ], + [ + HAVE_[$1]="no" + AC_MSG_NOTICE($[$1]_PKG_ERRORS) + if test "x$required" = "xyes"; then + AC_MSG_ERROR([no $module >= $minver ($name) found]) + else + AC_MSG_NOTICE([no $module >= $minver ($name) found]) + fi + ]) + + dnl AC_SUBST of CFLAGS and LIBS was not done before automake 1.7 + dnl It gets done automatically in automake >= 1.7, which we now require +])) + +AC_DEFUN([AG_GST_CHECK_GST], +[ + AG_GST_CHECK_MODULES(GST, gstreamer-[$1], [$2], [GStreamer], [$3]) + dnl allow setting before calling this macro to override + if test -z $GST_TOOLS_DIR; then + GST_TOOLS_DIR=`$PKG_CONFIG --variable=toolsdir gstreamer-[$1]` + if test -z $GST_TOOLS_DIR; then + AC_MSG_ERROR( + [no tools dir set in GStreamer pkg-config file, core upgrade needed.]) + fi + fi + AC_MSG_NOTICE([using GStreamer tools in $GST_TOOLS_DIR]) + AC_SUBST(GST_TOOLS_DIR) + + dnl check for where core plug-ins got installed + dnl this is used for unit tests + dnl allow setting before calling this macro to override + if test -z $GST_PLUGINS_DIR; then + GST_PLUGINS_DIR=`$PKG_CONFIG --variable=pluginsdir gstreamer-[$1]` + if test -z $GST_PLUGINS_DIR; then + AC_MSG_ERROR( + [no pluginsdir set in GStreamer pkg-config file, core upgrade needed.]) + fi + fi + AC_MSG_NOTICE([using GStreamer plug-ins in $GST_PLUGINS_DIR]) + AC_SUBST(GST_PLUGINS_DIR) +]) + +AC_DEFUN([AG_GST_CHECK_GST_BASE], +[ + AG_GST_CHECK_MODULES(GST_BASE, gstreamer-base-[$1], [$2], + [GStreamer Base Libraries], [$3]) +]) + +AC_DEFUN([AG_GST_CHECK_GST_CONTROLLER], +[ + AG_GST_CHECK_MODULES(GST_CONTROLLER, gstreamer-controller-[$1], [$2], + [GStreamer Controller Library], [$3]) +]) + +AC_DEFUN([AG_GST_CHECK_GST_NET], +[ + AG_GST_CHECK_MODULES(GST_NET, gstreamer-net-[$1], [$2], + [GStreamer Network Library], [$3]) +]) + +AC_DEFUN([AG_GST_CHECK_GST_CHECK], +[ + AG_GST_CHECK_MODULES(GST_CHECK, gstreamer-check-[$1], [$2], + [GStreamer Check unittest Library], [$3]) +]) + +dnl =========================================================================== +dnl AG_GST_CHECK_UNINSTALLED_SETUP([ACTION-IF-UNINSTALLED], [ACTION-IF-NOT]) +dnl +dnl ACTION-IF-UNINSTALLED (optional) extra actions to perform if the setup +dnl is an uninstalled setup +dnl ACTION-IF-NOT (optional) extra actions to perform if the setup +dnl is not an uninstalled setup +dnl =========================================================================== +AC_DEFUN([AG_GST_CHECK_UNINSTALLED_SETUP], +[ + AC_MSG_CHECKING([whether this is an uninstalled GStreamer setup]) + AC_CACHE_VAL(gst_cv_is_uninstalled_setup,[ + gst_cv_is_uninstalled_setup=no + if (set -u; : $GST_PLUGIN_SYSTEM_PATH) 2>/dev/null ; then + if test -z "$GST_PLUGIN_SYSTEM_PATH" \ + -a -n "$GST_PLUGIN_SCANNER" \ + -a -n "$GST_PLUGIN_PATH" \ + -a -n "$GST_REGISTRY" \ + -a -n "$DYLD_LIBRARY_PATH" \ + -a -n "$LD_LIBRARY_PATH"; then + gst_cv_is_uninstalled_setup=yes; + fi + fi + ]) + AC_MSG_RESULT($gst_cv_is_uninstalled_setup) + if test "x$gst_cv_is_uninstalled_setup" = "xyes"; then + ifelse([$1], , :, [$1]) + else + ifelse([$2], , :, [$2]) + fi +]) + +dnl =========================================================================== +dnl AG_GST_CHECK_GST_PLUGINS_BASE([GST-API_VERSION], [MIN-VERSION], [REQUIRED]) +dnl +dnl Sets GST_PLUGINS_BASE_CFLAGS and GST_PLUGINS_BASE_LIBS. +dnl +dnl Also sets GSTPB_PLUGINS_DIR (and for consistency also GST_PLUGINS_BASE_DIR) +dnl for use in Makefile.am. This is only really needed/useful in uninstalled +dnl setups, since in an installed setup all plugins will be found in +dnl GST_PLUGINS_DIR anyway. +dnl =========================================================================== +AC_DEFUN([AG_GST_CHECK_GST_PLUGINS_BASE], +[ + AG_GST_CHECK_MODULES(GST_PLUGINS_BASE, gstreamer-plugins-base-[$1], [$2], + [GStreamer Base Plugins], [$3]) + + if test "x$HAVE_GST_PLUGINS_BASE" = "xyes"; then + dnl check for where base plugins got installed + dnl this is used for unit tests + dnl allow setting before calling this macro to override + if test -z $GSTPB_PLUGINS_DIR; then + GSTPB_PLUGINS_DIR=`$PKG_CONFIG --variable=pluginsdir gstreamer-plugins-base-[$1]` + if test -z $GSTPB_PLUGINS_DIR; then + AC_MSG_ERROR( + [no pluginsdir set in GStreamer Base Plugins pkg-config file]) + fi + fi + AC_MSG_NOTICE([using GStreamer Base Plugins in $GSTPB_PLUGINS_DIR]) + GST_PLUGINS_BASE_DIR="$GSTPB_PLUGINS_DIR/gst:$GSTPB_PLUGINS_DIR/sys:$GSTPB_PLUGINS_DIR/ext" + AC_SUBST(GST_PLUGINS_BASE_DIR) + AC_SUBST(GSTPB_PLUGINS_DIR) + fi +]) + +dnl =========================================================================== +dnl AG_GST_CHECK_GST_PLUGINS_GOOD([GST-API_VERSION], [MIN-VERSION]) +dnl +dnl Will set GST_PLUGINS_GOOD_DIR for use in Makefile.am. Note that this will +dnl only be set in an uninstalled setup, since -good ships no .pc file and in +dnl an installed setup all plugins will be found in GST_PLUGINS_DIR anyway. +dnl =========================================================================== +AC_DEFUN([AG_GST_CHECK_GST_PLUGINS_GOOD], +[ + AG_GST_CHECK_MODULES(GST_PLUGINS_GOOD, gstreamer-plugins-good-[$1], [$2], + [GStreamer Good Plugins], [no]) + + if test "x$HAVE_GST_PLUGINS_GOOD" = "xyes"; then + dnl check for where good plugins got installed + dnl this is used for unit tests + dnl allow setting before calling this macro to override + if test -z $GST_PLUGINS_GOOD_DIR; then + GST_PLUGINS_GOOD_DIR=`$PKG_CONFIG --variable=pluginsdir gstreamer-plugins-good-[$1]` + if test -z $GST_PLUGINS_GOOD_DIR; then + AC_MSG_ERROR([no pluginsdir set in GStreamer Good Plugins pkg-config file]) + fi + fi + AC_MSG_NOTICE([using GStreamer Good Plugins in $GST_PLUGINS_GOOD_DIR]) + GST_PLUGINS_GOOD_DIR="$GST_PLUGINS_GOOD_DIR/gst:$GST_PLUGINS_GOOD_DIR/sys:$GST_PLUGINS_GOOD_DIR/ext" + AC_SUBST(GST_PLUGINS_GOOD_DIR) + fi +]) + +dnl =========================================================================== +dnl AG_GST_CHECK_GST_PLUGINS_UGLY([GST-API_VERSION], [MIN-VERSION]) +dnl +dnl Will set GST_PLUGINS_UGLY_DIR for use in Makefile.am. Note that this will +dnl only be set in an uninstalled setup, since -bad ships no .pc file and in +dnl an installed setup all plugins will be found in GST_PLUGINS_DIR anyway. +dnl =========================================================================== +AC_DEFUN([AG_GST_CHECK_GST_PLUGINS_UGLY], +[ + AG_GST_CHECK_MODULES(GST_PLUGINS_UGLY, gstreamer-plugins-ugly-[$1], [$2], + [GStreamer Ugly Plugins], [no]) + + if test "x$HAVE_GST_PLUGINS_UGLY" = "xyes"; then + dnl check for where ugly plugins got installed + dnl this is used for unit tests + dnl allow setting before calling this macro to override + if test -z $GST_PLUGINS_UGLY_DIR; then + GST_PLUGINS_UGLY_DIR=`$PKG_CONFIG --variable=pluginsdir gstreamer-plugins-ugly-[$1]` + if test -z $GST_PLUGINS_UGLY_DIR; then + AC_MSG_ERROR([no pluginsdir set in GStreamer Ugly Plugins pkg-config file]) + fi + fi + AC_MSG_NOTICE([using GStreamer Ugly Plugins in $GST_PLUGINS_UGLY_DIR]) + GST_PLUGINS_UGLY_DIR="$GST_PLUGINS_UGLY_DIR/gst:$GST_PLUGINS_UGLY_DIR/sys:$GST_PLUGINS_UGLY_DIR/ext" + AC_SUBST(GST_PLUGINS_UGLY_DIR) + fi +]) + +dnl =========================================================================== +dnl AG_GST_CHECK_GST_PLUGINS_BAD([GST-API_VERSION], [MIN-VERSION]) +dnl +dnl Will set GST_PLUGINS_BAD_DIR for use in Makefile.am. Note that this will +dnl only be set in an uninstalled setup, since -ugly ships no .pc file and in +dnl an installed setup all plugins will be found in GST_PLUGINS_DIR anyway. +dnl =========================================================================== +AC_DEFUN([AG_GST_CHECK_GST_PLUGINS_BAD], +[ + AG_GST_CHECK_MODULES(GST_PLUGINS_BAD, gstreamer-plugins-bad-[$1], [$2], + [GStreamer Bad Plugins], [no]) + + if test "x$HAVE_GST_PLUGINS_BAD" = "xyes"; then + dnl check for where bad plugins got installed + dnl this is used for unit tests + dnl allow setting before calling this macro to override + if test -z $GST_PLUGINS_BAD_DIR; then + GST_PLUGINS_BAD_DIR=`$PKG_CONFIG --variable=pluginsdir gstreamer-plugins-bad-[$1]` + if test -z $GST_PLUGINS_BAD_DIR; then + AC_MSG_ERROR([no pluginsdir set in GStreamer Bad Plugins pkg-config file]) + fi + fi + AC_MSG_NOTICE([using GStreamer Bad Plugins in $GST_PLUGINS_BAD_DIR]) + GST_PLUGINS_BAD_DIR="$GST_PLUGINS_BAD_DIR/gst:$GST_PLUGINS_BAD_DIR/sys:$GST_PLUGINS_BAD_DIR/ext" + AC_SUBST(GST_PLUGINS_BAD_DIR) + fi +]) + +dnl =========================================================================== +dnl AG_GST_CHECK_GST_PLUGINS_LIBAV([GST-API_VERSION], [MIN-VERSION]) +dnl +dnl Will set GST_PLUGINS_LIBAV_DIR for use in Makefile.am. Note that this will +dnl only be set in an uninstalled setup, since -libav ships no .pc file and in +dnl an installed setup all plugins will be found in GST_PLUGINS_DIR anyway. +dnl =========================================================================== +AC_DEFUN([AG_GST_CHECK_GST_PLUGINS_LIBAV], +[ + AG_GST_CHECK_MODULES(GST_PLUGINS_LIBAV, gstreamer-plugins-libav-[$1], [$2], + [GStreamer Libav Plugins], [no]) + + if test "x$HAVE_GST_PLUGINS_LIBAV" = "xyes"; then + dnl check for where libav plugins got installed + dnl this is used for unit tests + dnl allow setting before calling this macro to override + if test -z $GST_PLUGINS_LIBAV_DIR; then + GST_PLUGINS_LIBAV_DIR=`$PKG_CONFIG --variable=pluginsdir gstreamer-plugins-libav-[$1]` + if test -z $GST_PLUGINS_LIBAV_DIR; then + AC_MSG_ERROR([no pluginsdir set in GStreamer Libav Plugins pkg-config file]) + fi + fi + GST_PLUGINS_LIBAV_DIR="$GST_PLUGINS_LIBAV_DIR/ext/libav" + AC_MSG_NOTICE([using GStreamer Libav Plugins in $GST_PLUGINS_LIBAV_DIR]) + AC_SUBST(GST_PLUGINS_LIBAV_DIR) + fi +]) diff --git a/common/m4/gst-debuginfo.m4 b/common/m4/gst-debuginfo.m4 new file mode 100644 index 0000000..b48854d --- /dev/null +++ b/common/m4/gst-debuginfo.m4 @@ -0,0 +1,46 @@ +AC_DEFUN([AG_GST_DEBUGINFO], [ +AC_ARG_ENABLE(debug, +AC_HELP_STRING([--disable-debug],[disable addition of -g debugging info]), +[case "${enableval}" in + yes) USE_DEBUG=yes ;; + no) USE_DEBUG=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;; +esac], +[USE_DEBUG=yes]) dnl Default value + +AC_ARG_ENABLE(DEBUG, +AC_HELP_STRING([--disable-DEBUG],[disables compilation of debugging messages]), +[case "${enableval}" in + yes) ENABLE_DEBUG=yes ;; + no) ENABLE_DEBUG=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-DEBUG) ;; +esac], +[ENABLE_DEBUG=yes]) dnl Default value +if test x$ENABLE_DEBUG = xyes; then + AC_DEFINE(GST_DEBUG_ENABLED, 1, [Define if DEBUG statements should be compiled in]) +fi + +AC_ARG_ENABLE(INFO, +AC_HELP_STRING([--disable-INFO],[disables compilation of informational messages]), +[case "${enableval}" in + yes) ENABLE_INFO=yes ;; + no) ENABLE_INFO=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-INFO) ;; +esac], +[ENABLE_INFO=yes]) dnl Default value +if test x$ENABLE_INFO = xyes; then + AC_DEFINE(GST_INFO_ENABLED, 1, [Define if INFO statements should be compiled in]) +fi + +AC_ARG_ENABLE(debug-color, +AC_HELP_STRING([--disable-debug-color],[disables color output of DEBUG and INFO output]), +[case "${enableval}" in + yes) ENABLE_DEBUG_COLOR=yes ;; + no) ENABLE_DEBUG_COLOR=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug-color) ;; +esac], +[ENABLE_DEBUG_COLOR=yes]) dnl Default value +if test "x$ENABLE_DEBUG_COLOR" = xyes; then + AC_DEFINE(GST_DEBUG_COLOR, 1, [Define if debugging messages should be colorized]) +fi +]) diff --git a/common/m4/gst-default.m4 b/common/m4/gst-default.m4 new file mode 100644 index 0000000..8de9756 --- /dev/null +++ b/common/m4/gst-default.m4 @@ -0,0 +1,120 @@ +dnl default elements used for tests and such + +dnl AG_GST_DEFAULT_ELEMENTS + +AC_DEFUN([AG_GST_DEFAULT_ELEMENTS], +[ + dnl decide on default elements + dnl FIXME: describe where exactly this gets used + dnl FIXME: decide if it's a problem that this could point to sinks from + dnl depending plugin modules + dnl FIXME: when can we just use autoaudiosrc and autovideosrc? + DEFAULT_AUDIOSINK="autoaudiosink" + DEFAULT_VIDEOSINK="autovideosink" + DEFAULT_AUDIOSRC="alsasrc" + DEFAULT_VIDEOSRC="v4l2src" + DEFAULT_VISUALIZER="goom" + case "$host" in + *-sun-* | *pc-solaris* ) + DEFAULT_AUDIOSRC="sunaudiosrc" + ;; + *-darwin* ) + DEFAULT_AUDIOSRC="osxaudiosrc" + ;; + esac + + dnl Default audio sink + AC_ARG_WITH(default-audiosink, + AC_HELP_STRING([--with-default-audiosink], [specify default audio sink]), + [ + case "${withval}" in + yes) AC_MSG_ERROR(bad value ${withval} for --with-default-audiosink) ;; + no) AC_MSG_ERROR(bad value ${withval} for --with-default-audiosink) ;; + *) DEFAULT_AUDIOSINK="${withval}" ;; + esac + ], + [ + DEFAULT_AUDIOSINK="$DEFAULT_AUDIOSINK" + ] dnl Default value as determined above + ) + AC_MSG_NOTICE(Using $DEFAULT_AUDIOSINK as default audio sink) + AC_SUBST(DEFAULT_AUDIOSINK) + AC_DEFINE_UNQUOTED(DEFAULT_AUDIOSINK, "$DEFAULT_AUDIOSINK", + [Default audio sink]) + + dnl Default audio source + AC_ARG_WITH(default-audiosrc, + AC_HELP_STRING([--with-default-audiosrc], [specify default audio source]), + [ + case "${withval}" in + yes) AC_MSG_ERROR(bad value ${withval} for --with-default-audiosrc) ;; + no) AC_MSG_ERROR(bad value ${withval} for --with-default-audiosrc) ;; + *) DEFAULT_AUDIOSRC="${withval}" ;; + esac + ], + [ + DEFAULT_AUDIOSRC="$DEFAULT_AUDIOSRC" + ] dnl Default value as determined above + ) + AC_MSG_NOTICE(Using $DEFAULT_AUDIOSRC as default audio source) + AC_SUBST(DEFAULT_AUDIOSRC) + AC_DEFINE_UNQUOTED(DEFAULT_AUDIOSRC, "$DEFAULT_AUDIOSRC", + [Default audio source]) + + dnl Default video sink + AC_ARG_WITH(default-videosink, + AC_HELP_STRING([--with-default-videosink], [specify default video sink]), + [ + case "${withval}" in + yes) AC_MSG_ERROR(bad value ${withval} for --with-default-videosink) ;; + no) AC_MSG_ERROR(bad value ${withval} for --with-default-videosink) ;; + *) DEFAULT_VIDEOSINK="${withval}" ;; + esac + ], + [ + DEFAULT_VIDEOSINK="$DEFAULT_VIDEOSINK" + ] dnl Default value as determined above + ) + AC_MSG_NOTICE(Using $DEFAULT_VIDEOSINK as default video sink) + AC_SUBST(DEFAULT_VIDEOSINK) + AC_DEFINE_UNQUOTED(DEFAULT_VIDEOSINK, "$DEFAULT_VIDEOSINK", + [Default video sink]) + + dnl Default video source + AC_ARG_WITH(default-videosrc, + AC_HELP_STRING([--with-default-videosrc], [specify default video source]), + [ + case "${withval}" in + yes) AC_MSG_ERROR(bad value ${withval} for --with-default-videosrc) ;; + no) AC_MSG_ERROR(bad value ${withval} for --with-default-videosrc) ;; + *) DEFAULT_VIDEOSRC="${withval}" ;; + esac + ], + [ + DEFAULT_VIDEOSRC="$DEFAULT_VIDEOSRC" + ] dnl Default value as determined above + ) + AC_MSG_NOTICE(Using $DEFAULT_VIDEOSRC as default video source) + AC_SUBST(DEFAULT_VIDEOSRC) + AC_DEFINE_UNQUOTED(DEFAULT_VIDEOSRC, "$DEFAULT_VIDEOSRC", + [Default video source]) + + dnl Default visualizer + AC_ARG_WITH(default-visualizer, + AC_HELP_STRING([--with-default-visualizer], [specify default visualizer]), + [ + case "${withval}" in + yes) AC_MSG_ERROR(bad value ${withval} for --with-default-visualizer) ;; + no) AC_MSG_ERROR(bad value ${withval} for --with-default-visualizer) ;; + *) DEFAULT_VISUALIZER="${withval}" ;; + esac + ], + [ + DEFAULT_VISUALIZER="$DEFAULT_VISUALIZER" + ] dnl Default value as determined above + ) + AC_MSG_NOTICE(Using $DEFAULT_VISUALIZER as default visualizer) + AC_SUBST(DEFAULT_VISUALIZER) + AC_DEFINE_UNQUOTED(DEFAULT_VISUALIZER, "$DEFAULT_VISUALIZER", + [Default visualizer]) +]) diff --git a/common/m4/gst-doc.m4 b/common/m4/gst-doc.m4 new file mode 100644 index 0000000..5d3f0fd --- /dev/null +++ b/common/m4/gst-doc.m4 @@ -0,0 +1,92 @@ +AC_DEFUN([AG_GST_DOCBOOK_CHECK], +[ + dnl choose a location to install docbook docs in + if test "x$PACKAGE_TARNAME" = "x" + then + AC_MSG_ERROR([Internal error - PACKAGE_TARNAME not set]) + fi + docdir="\$(datadir)/doc/$PACKAGE_TARNAME-$GST_API_VERSION" + + dnl enable/disable docbook documentation building + AC_ARG_ENABLE(docbook, + AC_HELP_STRING([--enable-docbook], + [use docbook to build documentation [default=no]]),, + enable_docbook=no) + + have_docbook=no + + if test x$enable_docbook = xyes; then + dnl check if we actually have everything we need + + dnl check for docbook tools + AC_CHECK_PROG(HAVE_DOCBOOK2PS, docbook2ps, yes, no) + AC_CHECK_PROG(HAVE_XSLTPROC, xsltproc, yes, no) + AC_CHECK_PROG(HAVE_JADETEX, jadetex, yes, no) + AC_CHECK_PROG(HAVE_PS2PDF, ps2pdf, yes, no) + + dnl check if we can process docbook stuff + AS_DOCBOOK(have_docbook=yes, have_docbook=no) + + dnl check for extra tools + AC_CHECK_PROG(HAVE_DVIPS, dvips, yes, no) + AC_CHECK_PROG(HAVE_XMLLINT, xmllint, yes, no) + + AC_CHECK_PROG(HAVE_PNGTOPNM, pngtopnm, yes, no) + AC_CHECK_PROG(HAVE_PNMTOPS, pnmtops, yes, no) + AC_CHECK_PROG(HAVE_EPSTOPDF, epstopdf, yes, no) + + dnl check if we can generate HTML + if test "x$HAVE_XSLTPROC" = "xyes" && \ + test "x$enable_docbook" = "xyes" && \ + test "x$HAVE_XMLLINT" = "xyes"; then + DOC_HTML=yes + AC_MSG_NOTICE(Will output HTML documentation) + else + DOC_HTML=no + AC_MSG_NOTICE(Will not output HTML documentation) + fi + + dnl check if we can generate PS + if test "x$HAVE_DOCBOOK2PS" = "xyes" && \ + test "x$enable_docbook" = "xyes" && \ + test "x$HAVE_XMLLINT" = "xyes" && \ + test "x$HAVE_JADETEX" = "xyes" && \ + test "x$HAVE_DVIPS" = "xyes" && \ + test "x$HAVE_PNGTOPNM" = "xyes" && \ + test "x$HAVE_PNMTOPS" = "xyes"; then + DOC_PS=yes + AC_MSG_NOTICE(Will output PS documentation) + else + DOC_PS=no + AC_MSG_NOTICE(Will not output PS documentation) + fi + + dnl check if we can generate PDF - using only ps2pdf + if test "x$DOC_PS" = "xyes" && \ + test "x$enable_docbook" = "xyes" && \ + test "x$HAVE_XMLLINT" = "xyes" && \ + test "x$HAVE_PS2PDF" = "xyes"; then + DOC_PDF=yes + AC_MSG_NOTICE(Will output PDF documentation) + else + DOC_PDF=no + AC_MSG_NOTICE(Will not output PDF documentation) + fi + + dnl if we don't have everything, we should disable + if test "x$have_docbook" != "xyes"; then + enable_docbook=no + fi + fi + + dnl if we're going to install documentation, tell us where + if test "x$have_docbook" = "xyes"; then + AC_MSG_NOTICE(Installing documentation in $docdir) + AC_SUBST(docdir) + fi + + AM_CONDITIONAL(ENABLE_DOCBOOK, test x$enable_docbook = xyes) + AM_CONDITIONAL(DOC_HTML, test x$DOC_HTML = xyes) + AM_CONDITIONAL(DOC_PDF, test x$DOC_PDF = xyes) + AM_CONDITIONAL(DOC_PS, test x$DOC_PS = xyes) +]) diff --git a/common/m4/gst-dowhile.m4 b/common/m4/gst-dowhile.m4 new file mode 100644 index 0000000..069808d --- /dev/null +++ b/common/m4/gst-dowhile.m4 @@ -0,0 +1,24 @@ +dnl +dnl Check for working do while(0) macros. This is used by G_STMT_START +dnl and G_STMT_END in glib/gmacros.h. Without having this defined we +dnl get "ambigious if-else" compiler warnings when compling C++ code. +dnl +dnl Copied from GLib's configure.in +dnl +AC_DEFUN([AG_GST_CHECK_DOWHILE_MACROS],[ + +dnl *** check for working do while(0) macros *** +AC_CACHE_CHECK([for working do while(0) macros], _cv_g_support_dowhile_macros, [ + AC_TRY_COMPILE([],[ + #define STMT_START do + #define STMT_END while(0) + #define STMT_TEST STMT_START { i = 0; } STMT_END + int main(void) { int i = 1; STMT_TEST; return i; }], + [_cv_g_support_dowhile_macros=yes], + [_cv_g_support_dowhile_macros=no], + [_cv_g_support_dowhile_macros=yes]) +]) +if test x$_cv_g_support_dowhile_macros = xyes; then + AC_DEFINE(HAVE_DOWHILE_MACROS, 1, [define for working do while(0) macros]) +fi +]) diff --git a/common/m4/gst-error.m4 b/common/m4/gst-error.m4 new file mode 100644 index 0000000..d6487cc --- /dev/null +++ b/common/m4/gst-error.m4 @@ -0,0 +1,290 @@ +dnl handle various error-related things + +dnl Thomas Vander Stichele +dnl Tim-Philipp Müller + +dnl Last modification: 2008-02-18 + +dnl AG_GST_SET_ERROR_CFLAGS([ADD-WERROR], [MORE_FLAGS]) +dnl AG_GST_SET_ERROR_CXXFLAGS([ADD-WERROR], [MORE_FLAGS]) +dnl AG_GST_SET_LEVEL_DEFAULT([IS-GIT-VERSION]) + + +dnl Sets WARNING_CFLAGS and ERROR_CFLAGS to something the compiler +dnl will accept and AC_SUBST them so they are available in Makefile +dnl +dnl WARNING_CFLAGS will contain flags to make the compiler emit more +dnl warnings. +dnl ERROR_CFLAGS will contain flags to make those warnings fatal, +dnl unless ADD-WERROR is set to "no" +dnl +dnl If MORE_FLAGS is set, tries to add each of the given flags +dnl to WARNING_CFLAGS if the compiler supports them. Each flag is +dnl tested separately. +dnl +dnl These flags can be overridden at make time: +dnl make ERROR_CFLAGS= +AC_DEFUN([AG_GST_SET_ERROR_CFLAGS], +[ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AS_COMPILER_FLAG]) + + WARNING_CFLAGS="" + ERROR_CFLAGS="" + + dnl if we support -Wall, set it unconditionally + AS_COMPILER_FLAG(-Wall, + WARNING_CFLAGS="$WARNING_CFLAGS -Wall") + + dnl Warn if declarations after statements are used (C99 extension) + AS_COMPILER_FLAG(-Wdeclaration-after-statement, + WARNING_CFLAGS="$WARNING_CFLAGS -Wdeclaration-after-statement") + + dnl Warn if variable length arrays are used (C99 extension) + AS_COMPILER_FLAG(-Wvla, + WARNING_CFLAGS="$WARNING_CFLAGS -Wvla") + + dnl Warn for invalid pointer arithmetic + AS_COMPILER_FLAG(-Wpointer-arith, + WARNING_CFLAGS="$WARNING_CFLAGS -Wpointer-arith") + + dnl if asked for, add -Werror if supported + if test "x$1" != "xno" + then + AS_COMPILER_FLAG(-Werror, ERROR_CFLAGS="$ERROR_CFLAGS -Werror") + + dnl if -Werror isn't suported, try -errwarn=%all (Sun Forte case) + if test "x$ERROR_CFLAGS" = "x" + then + AS_COMPILER_FLAG([-errwarn=%all], [ + ERROR_CFLAGS="-errwarn=%all" + dnl try -errwarn=%all,no%E_EMPTY_DECLARATION, + dnl no%E_STATEMENT_NOT_REACHED,no%E_ARGUEMENT_MISMATCH, + dnl no%E_MACRO_REDEFINED (Sun Forte case) + dnl For Forte we need disable "empty declaration" warning produced by un-needed semicolon + dnl "statement not reached" disabled because there is g_assert_not_reached () in some places + dnl "macro redefined" because of gst/gettext.h + dnl FIXME: is it really supposed to be 'ARGUEMENT' and not 'ARGUMENT'? + for f in 'no%E_EMPTY_DECLARATION' \ + 'no%E_STATEMENT_NOT_REACHED' \ + 'no%E_ARGUEMENT_MISMATCH' \ + 'no%E_MACRO_REDEFINED' \ + 'no%E_LOOP_NOT_ENTERED_AT_TOP' + do + AS_COMPILER_FLAG([-errwarn=%all,$f], [ + ERROR_CFLAGS="$ERROR_CFLAGS,$f" + ]) + done + ]) + fi + fi + + if test "x$2" != "x" + then + UNSUPPORTED="" + list="$2" + for each in $list + do + AS_COMPILER_FLAG($each, + WARNING_CFLAGS="$WARNING_CFLAGS $each", + UNSUPPORTED="$UNSUPPORTED $each") + done + if test "X$UNSUPPORTED" != X ; then + AC_MSG_NOTICE([unsupported compiler flags: $UNSUPPORTED]) + fi + fi + + AC_SUBST(WARNING_CFLAGS) + AC_SUBST(ERROR_CFLAGS) + AC_MSG_NOTICE([set WARNING_CFLAGS to $WARNING_CFLAGS]) + AC_MSG_NOTICE([set ERROR_CFLAGS to $ERROR_CFLAGS]) +]) + +dnl Sets WARNING_CXXFLAGS and ERROR_CXXFLAGS to something the compiler +dnl will accept and AC_SUBST them so they are available in Makefile +dnl +dnl WARNING_CXXFLAGS will contain flags to make the compiler emit more +dnl warnings. +dnl ERROR_CXXFLAGS will contain flags to make those warnings fatal, +dnl unless ADD-WERROR is set to "no" +dnl +dnl If MORE_FLAGS is set, tries to add each of the given flags +dnl to WARNING_CFLAGS if the compiler supports them. Each flag is +dnl tested separately. +dnl +dnl These flags can be overridden at make time: +dnl make ERROR_CXXFLAGS= +AC_DEFUN([AG_GST_SET_ERROR_CXXFLAGS], +[ + AC_REQUIRE([AC_PROG_CXX]) + AC_REQUIRE([AS_CXX_COMPILER_FLAG]) + + ERROR_CXXFLAGS="" + WARNING_CXXFLAGS="" + + dnl if we support -Wall, set it unconditionally + AS_CXX_COMPILER_FLAG(-Wall, WARNING_CXXFLAGS="$WARNING_CXXFLAGS -Wall") + + dnl if asked for, add -Werror if supported + if test "x$1" != "xno" + then + AS_CXX_COMPILER_FLAG(-Werror, ERROR_CXXFLAGS="$ERROR_CXXFLAGS -Werror") + + if test "x$ERROR_CXXFLAGS" != "x" + then + dnl add exceptions + AS_CXX_COMPILER_FLAG([-Wno-non-virtual-dtor], ERROR_CXXFLAGS="$ERROR_CXXFLAGS -Wno-non-virtual-dtor") + + dnl Add -fno-strict-aliasing for GLib versions before 2.19.8 + dnl as before G_LOCK and friends caused strict aliasing compiler + dnl warnings. + PKG_CHECK_EXISTS([glib-2.0 < 2.19.8], [ + AS_CXX_COMPILER_FLAG([-fno-strict-aliasing], + ERROR_CXXFLAGS="$ERROR_CXXFLAGS -fno-strict-aliasing") + ]) + else + dnl if -Werror isn't suported, try -errwarn=%all + AS_CXX_COMPILER_FLAG([-errwarn=%all], ERROR_CXXFLAGS="$ERROR_CXXFLAGS -errwarn=%all") + if test "x$ERROR_CXXFLAGS" != "x"; then + dnl try -errwarn=%all,no%E_EMPTY_DECLARATION, + dnl no%E_STATEMENT_NOT_REACHED,no%E_ARGUEMENT_MISMATCH, + dnl no%E_MACRO_REDEFINED (Sun Forte case) + dnl For Forte we need disable "empty declaration" warning produced by un-needed semicolon + dnl "statement not reached" disabled because there is g_assert_not_reached () in some places + dnl "macro redefined" because of gst/gettext.h + dnl FIXME: is it really supposed to be 'ARGUEMENT' and not 'ARGUMENT'? + dnl FIXME: do any of these work with the c++ compiler? if not, why + dnl do we check at all? + for f in 'no%E_EMPTY_DECLARATION' \ + 'no%E_STATEMENT_NOT_REACHED' \ + 'no%E_ARGUEMENT_MISMATCH' \ + 'no%E_MACRO_REDEFINED' \ + 'no%E_LOOP_NOT_ENTERED_AT_TOP' + do + AS_CXX_COMPILER_FLAG([-errwarn=%all,$f], [ERROR_CXXFLAGS="$ERROR_CXXFLAGS,$f"]) + done + fi + fi + fi + + if test "x$2" != "x" + then + UNSUPPORTED="" + list="$2" + for each in $list + do + AS_CXX_COMPILER_FLAG($each, + WARNING_CXXFLAGS="$WARNING_CXXFLAGS $each", + UNSUPPORTED="$UNSUPPORTED $each") + done + if test "X$UNSUPPORTED" != X ; then + AC_MSG_NOTICE([unsupported compiler flags: $UNSUPPORTED]) + fi + fi + + AC_SUBST(WARNING_CXXFLAGS) + AC_SUBST(ERROR_CXXFLAGS) + AC_MSG_NOTICE([set WARNING_CXXFLAGS to $WARNING_CXXFLAGS]) + AC_MSG_NOTICE([set ERROR_CXXFLAGS to $ERROR_CXXFLAGS]) +]) + +dnl Sets WARNING_OBJCFLAGS and ERROR_OBJCFLAGS to something the compiler +dnl will accept and AC_SUBST them so they are available in Makefile +dnl +dnl WARNING_OBJCFLAGS will contain flags to make the compiler emit more +dnl warnings. +dnl ERROR_OBJCFLAGS will contain flags to make those warnings fatal, +dnl unless ADD-WERROR is set to "no" +dnl +dnl If MORE_FLAGS is set, tries to add each of the given flags +dnl to WARNING_CFLAGS if the compiler supports them. Each flag is +dnl tested separately. +dnl +dnl These flags can be overridden at make time: +dnl make ERROR_OBJCFLAGS= +AC_DEFUN([AG_GST_SET_ERROR_OBJCFLAGS], +[ + AC_REQUIRE([AC_PROG_OBJC]) + AC_REQUIRE([AS_OBJC_COMPILER_FLAG]) + + ERROR_OBJCFLAGS="" + WARNING_OBJCFLAGS="" + + dnl if we support -Wall, set it unconditionally + AS_OBJC_COMPILER_FLAG(-Wall, WARNING_OBJCFLAGS="$WARNING_OBJCFLAGS -Wall") + + dnl if asked for, add -Werror if supported + if test "x$1" != "xno" + then + AS_OBJC_COMPILER_FLAG(-Werror, ERROR_OBJCFLAGS="$ERROR_OBJCFLAGS -Werror") + + if test "x$ERROR_OBJCFLAGS" != "x" + then + dnl Add -fno-strict-aliasing for GLib versions before 2.19.8 + dnl as before G_LOCK and friends caused strict aliasing compiler + dnl warnings. + PKG_CHECK_EXISTS([glib-2.0 < 2.19.8], [ + AS_OBJC_COMPILER_FLAG([-fno-strict-aliasing], + ERROR_OBJCFLAGS="$ERROR_OBJCFLAGS -fno-strict-aliasing") + ]) + else + dnl if -Werror isn't suported, try -errwarn=%all + AS_OBJC_COMPILER_FLAG([-errwarn=%all], ERROR_OBJCFLAGS="$ERROR_OBJCFLAGS -errwarn=%all") + if test "x$ERROR_OBJCFLAGS" != "x"; then + dnl try -errwarn=%all,no%E_EMPTY_DECLARATION, + dnl no%E_STATEMENT_NOT_REACHED,no%E_ARGUEMENT_MISMATCH, + dnl no%E_MACRO_REDEFINED (Sun Forte case) + dnl For Forte we need disable "empty declaration" warning produced by un-needed semicolon + dnl "statement not reached" disabled because there is g_assert_not_reached () in some places + dnl "macro redefined" because of gst/gettext.h + dnl FIXME: is it really supposed to be 'ARGUEMENT' and not 'ARGUMENT'? + dnl FIXME: do any of these work with the c++ compiler? if not, why + dnl do we check at all? + for f in 'no%E_EMPTY_DECLARATION' \ + 'no%E_STATEMENT_NOT_REACHED' \ + 'no%E_ARGUEMENT_MISMATCH' \ + 'no%E_MACRO_REDEFINED' \ + 'no%E_LOOP_NOT_ENTERED_AT_TOP' + do + AS_OBJC_COMPILER_FLAG([-errwarn=%all,$f], [ERROR_OBJCFLAGS="$ERROR_OBJCFLAGS,$f"]) + done + fi + fi + fi + + if test "x$2" != "x" + then + UNSUPPORTED="" + list="$2" + for each in $list + do + AS_OBJC_COMPILER_FLAG($each, + WARNING_OBJCFLAGS="$WARNING_OBJCFLAGS $each", + UNSUPPORTED="$UNSUPPORTED $each") + done + if test "X$UNSUPPORTED" != X ; then + AC_MSG_NOTICE([unsupported compiler flags: $UNSUPPORTED]) + fi + fi + + AC_SUBST(WARNING_OBJCFLAGS) + AC_SUBST(ERROR_OBJCFLAGS) + AC_MSG_NOTICE([set WARNING_OBJCFLAGS to $WARNING_OBJCFLAGS]) + AC_MSG_NOTICE([set ERROR_OBJCFLAGS to $ERROR_OBJCFLAGS]) +]) + +dnl Sets the default error level for debugging messages +AC_DEFUN([AG_GST_SET_LEVEL_DEFAULT], +[ + dnl define correct errorlevel for debugging messages. We want to have + dnl GST_ERROR messages printed when running cvs builds + if test "x[$1]" = "xyes"; then + GST_LEVEL_DEFAULT=GST_LEVEL_ERROR + else + GST_LEVEL_DEFAULT=GST_LEVEL_NONE + fi + AC_DEFINE_UNQUOTED(GST_LEVEL_DEFAULT, $GST_LEVEL_DEFAULT, + [Default errorlevel to use]) + dnl AC_SUBST so we can use it for win32/common/config.h + AC_SUBST(GST_LEVEL_DEFAULT) +]) diff --git a/common/m4/gst-feature.m4 b/common/m4/gst-feature.m4 new file mode 100644 index 0000000..876215e --- /dev/null +++ b/common/m4/gst-feature.m4 @@ -0,0 +1,297 @@ +dnl Perform a check for a feature for GStreamer +dnl Richard Boulton +dnl Thomas Vander Stichele added useful stuff +dnl Last modification: 25/06/2001 +dnl +dnl AG_GST_CHECK_FEATURE(FEATURE-NAME, FEATURE-DESCRIPTION, +dnl DEPENDENT-PLUGINS, TEST-FOR-FEATURE, +dnl DISABLE-BY-DEFAULT, ACTION-IF-USE, ACTION-IF-NOTUSE) +dnl +dnl This macro adds a command line argument to allow the user to enable +dnl or disable a feature, and if the feature is enabled, performs a supplied +dnl test to check if the feature is available. +dnl +dnl The test should define HAVE_ to "yes" or "no" depending +dnl on whether the feature is available. +dnl +dnl The macro will set USE_ to "yes" or "no" depending on +dnl whether the feature is to be used. +dnl Thomas changed this, so that when USE_ was already set +dnl to no, then it stays that way. +dnl +dnl The macro will call AM_CONDITIONAL(USE_, ...) to allow +dnl the feature to control what is built in Makefile.ams. If you want +dnl additional actions resulting from the test, you can add them with the +dnl ACTION-IF-USE and ACTION-IF-NOTUSE parameters. +dnl +dnl FEATURE-NAME is the name of the feature, and should be in +dnl purely upper case characters. +dnl FEATURE-DESCRIPTION is used to describe the feature in help text for +dnl the command line argument. +dnl DEPENDENT-PLUGINS lists any plug-ins which depend on this feature. +dnl TEST-FOR-FEATURE is a test which sets HAVE_ to "yes" +dnl or "no" depending on whether the feature is +dnl available. +dnl DISABLE-BY-DEFAULT if "disabled", the feature is disabled by default, +dnl if any other value, the feature is enabled by default. +dnl ACTION-IF-USE any extra actions to perform if the feature is to be +dnl used. +dnl ACTION-IF-NOTUSE any extra actions to perform if the feature is not to +dnl be used. +dnl +dnl +dnl thomas : +dnl we also added a history. +dnl GST_PLUGINS_YES will contain all plugins to be built +dnl that were checked through AG_GST_CHECK_FEATURE +dnl GST_PLUGINS_NO will contain those that won't be built + +AC_DEFUN([AG_GST_CHECK_FEATURE], +[echo +AC_MSG_NOTICE(*** checking feature: [$2] ***) +if test "x[$3]" != "x" +then + AC_MSG_NOTICE(*** for plug-ins: [$3] ***) +fi +dnl +builtin(define, [gst_endisable], ifelse($5, [disabled], [enable], [disable]))dnl +dnl if it is set to NO, then don't even consider it for building +NOUSE= +if test "x$USE_[$1]" = "xno"; then + NOUSE="yes" +fi +AC_ARG_ENABLE(translit([$1], A-Z, a-z), + [ ]builtin(format, --%-26s gst_endisable %s, gst_endisable-translit([$1], A-Z, a-z), [$2]ifelse([$3],,,: [$3])), + [ case "${enableval}" in + yes) USE_[$1]=yes;; + no) USE_[$1]=no;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-translit([$1], A-Z, a-z)) ;; + esac], + [ USE_$1=]ifelse($5, [disabled], [no], [yes])) dnl DEFAULT + +dnl *** set it back to no if it was preset to no +if test "x$NOUSE" = "xyes"; then + USE_[$1]="no" + AC_MSG_WARN(*** $3 pre-configured not to be built) +fi +NOUSE= + +dnl *** Check if it is ported or not +if echo " [$GST_PLUGINS_NONPORTED] " | tr , ' ' | grep -i " [$1] " > /dev/null; then + USE_[$1]="no" + AC_MSG_WARN(*** $3 not ported) +fi + +dnl *** If it's enabled + +if test x$USE_[$1] = xyes; then + dnl save compile variables before the test + + gst_check_save_LIBS=$LIBS + gst_check_save_LDFLAGS=$LDFLAGS + gst_check_save_CFLAGS=$CFLAGS + gst_check_save_CPPFLAGS=$CPPFLAGS + gst_check_save_CXXFLAGS=$CXXFLAGS + + HAVE_[$1]=no + dnl TEST_FOR_FEATURE + $4 + + LIBS=$gst_check_save_LIBS + LDFLAGS=$gst_check_save_LDFLAGS + CFLAGS=$gst_check_save_CFLAGS + CPPFLAGS=$gst_check_save_CPPFLAGS + CXXFLAGS=$gst_check_save_CXXFLAGS + + dnl If it isn't found, unset USE_[$1] + if test x$HAVE_[$1] = xno; then + USE_[$1]=no + else + ifelse([$3], , :, [AC_MSG_NOTICE(*** These plugins will be built: [$3])]) + fi +fi +dnl *** Warn if it's disabled or not found +if test x$USE_[$1] = xyes; then + ifelse([$6], , :, [$6]) + if test "x$3" != "x"; then + GST_PLUGINS_YES="\t[$3]\n$GST_PLUGINS_YES" + fi + AC_DEFINE(HAVE_[$1], , [Define to enable $2]ifelse($3,,, [ (used by $3)]).) +else + ifelse([$3], , :, [AC_MSG_NOTICE(*** These plugins will not be built: [$3])]) + if test "x$3" != "x"; then + GST_PLUGINS_NO="\t[$3]\n$GST_PLUGINS_NO" + fi + ifelse([$7], , :, [$7]) +fi +dnl *** Define the conditional as appropriate +AM_CONDITIONAL(USE_[$1], test x$USE_[$1] = xyes) +]) + +dnl Use AC_CHECK_LIB and AC_CHECK_HEADER to do both tests at once +dnl sets HAVE_module if we have it +dnl Richard Boulton +dnl Last modification: 26/06/2001 +dnl AG_GST_CHECK_LIBHEADER(FEATURE-NAME, LIB NAME, LIB FUNCTION, EXTRA LD FLAGS, +dnl HEADER NAME, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND) +dnl +dnl This check was written for GStreamer: it should be renamed and checked +dnl for portability if you decide to use it elsewhere. +dnl +AC_DEFUN([AG_GST_CHECK_LIBHEADER], +[ + AC_CHECK_LIB([$2], [$3], HAVE_[$1]=yes, HAVE_[$1]=no,[$4]) + if test "x$HAVE_[$1]" = "xyes"; then + AC_CHECK_HEADER([$5], :, HAVE_[$1]=no) + if test "x$HAVE_[$1]" = "xyes"; then + dnl execute what needs to be + ifelse([$6], , :, [$6]) + else + ifelse([$7], , :, [$7]) + fi + else + ifelse([$7], , :, [$7]) + fi + AC_SUBST(HAVE_[$1]) +] +) + +dnl 2004-02-14 Thomas - changed to get set properly and use proper output +dnl 2003-06-27 Benjamin Otte - changed to make this work with gstconfig.h +dnl +dnl Add a subsystem --disable flag and all the necessary symbols and substitions +dnl +dnl AG_GST_CHECK_SUBSYSTEM_DISABLE(SYSNAME, [subsystem name]) +dnl +AC_DEFUN([AG_GST_CHECK_SUBSYSTEM_DISABLE], +[ + dnl this define will replace each literal subsys_def occurrence with + dnl the lowercase hyphen-separated subsystem + dnl e.g. if $1 is GST_DEBUG then subsys_def will be a macro with gst-debug + define([subsys_def],translit([$1], _A-Z, -a-z)) + + AC_ARG_ENABLE(subsys_def, + AC_HELP_STRING(--disable-subsys_def, [disable $2]), + [ + case "${enableval}" in + yes) GST_DISABLE_[$1]=no ;; + no) GST_DISABLE_[$1]=yes ;; + *) AC_MSG_ERROR([bad value ${enableval} for --enable-subsys_def]) ;; + esac + ], + [GST_DISABLE_[$1]=no]) dnl Default value + + if test x$GST_DISABLE_[$1] = xyes; then + AC_MSG_NOTICE([disabled subsystem [$2]]) + GST_DISABLE_[$1]_DEFINE="#define GST_DISABLE_$1 1" + else + GST_DISABLE_[$1]_DEFINE="/* #undef GST_DISABLE_$1 */" + fi + AC_SUBST(GST_DISABLE_[$1]_DEFINE) + undefine([subsys_def]) +]) + + +dnl Parse gstconfig.h for feature and defines add the symbols and substitions +dnl +dnl AG_GST_PARSE_SUBSYSTEM_DISABLE(GST_CONFIGPATH, FEATURE) +dnl +AC_DEFUN([AG_GST_PARSE_SUBSYSTEM_DISABLE], +[ + grep >/dev/null "#undef GST_DISABLE_$2" $1 + if test $? = 0; then + GST_DISABLE_[$2]=0 + else + GST_DISABLE_[$2]=1 + fi + AC_SUBST(GST_DISABLE_[$2]) +]) + +dnl Parse gstconfig.h and defines add the symbols and substitions +dnl +dnl GST_CONFIGPATH=`$PKG_CONFIG --variable=includedir gstreamer-1.0`"/gst/gstconfig.h" +dnl AG_GST_PARSE_SUBSYSTEM_DISABLES(GST_CONFIGPATH) +dnl +AC_DEFUN([AG_GST_PARSE_SUBSYSTEM_DISABLES], +[ + AG_GST_PARSE_SUBSYSTEM_DISABLE($1,GST_DEBUG) + AG_GST_PARSE_SUBSYSTEM_DISABLE($1,LOADSAVE) + AG_GST_PARSE_SUBSYSTEM_DISABLE($1,PARSE) + AG_GST_PARSE_SUBSYSTEM_DISABLE($1,TRACE) + AG_GST_PARSE_SUBSYSTEM_DISABLE($1,ALLOC_TRACE) + AG_GST_PARSE_SUBSYSTEM_DISABLE($1,REGISTRY) + AG_GST_PARSE_SUBSYSTEM_DISABLE($1,PLUGIN) + AG_GST_PARSE_SUBSYSTEM_DISABLE($1,XML) +]) + +dnl AG_GST_CHECK_GST_DEBUG_DISABLED(ACTION-IF-DISABLED, ACTION-IF-NOT-DISABLED) +dnl +dnl Checks if the GStreamer debugging system is disabled in the core version +dnl we are compiling against (by checking gstconfig.h) +dnl +AC_DEFUN([AG_GST_CHECK_GST_DEBUG_DISABLED], +[ + AC_REQUIRE([AG_GST_CHECK_GST]) + + AC_MSG_CHECKING([whether the GStreamer debugging system is enabled]) + AC_LANG_PUSH([C]) + save_CFLAGS="$CFLAGS" + CFLAGS="$GST_CFLAGS $CFLAGS" + AC_COMPILE_IFELSE([ + AC_LANG_SOURCE([[ + #include + #ifdef GST_DISABLE_GST_DEBUG + #error "debugging disabled, make compiler fail" + #endif]])], [ debug_system_enabled=yes], [debug_system_enabled=no]) + CFLAGS="$save_CFLAGS" + AC_LANG_POP([C]) + + AC_MSG_RESULT([$debug_system_enabled]) + + if test "x$debug_system_enabled" = "xyes" ; then + $2 + true + else + $1 + true + fi +]) + +dnl relies on GST_PLUGINS_ALL, GST_PLUGINS_SELECTED, GST_PLUGINS_YES, +dnl GST_PLUGINS_NO, and BUILD_EXTERNAL +AC_DEFUN([AG_GST_OUTPUT_PLUGINS], [ + +printf "configure: *** Plug-ins without external dependencies that will be built:\n" +( for i in $GST_PLUGINS_SELECTED; do printf '\t'$i'\n'; done ) | sort +printf "\n" + +printf "configure: *** Plug-ins without external dependencies that will NOT be built:\n" +( for i in $GST_PLUGINS_ALL; do + case " $GST_PLUGINS_SELECTED " in + *\ $i\ *) + ;; + *) + printf '\t'$i'\n' + ;; + esac + done ) | sort +printf "\n" + +printf "configure: *** Plug-ins that have NOT been ported:\n" +( for i in $GST_PLUGINS_NONPORTED; do + printf '\t'$i'\n' + done ) | sort +printf "\n" + +if test "x$BUILD_EXTERNAL" = "xno"; then + printf "configure: *** No plug-ins with external dependencies will be built\n" +else + printf "configure: *** Plug-ins with dependencies that will be built:" + printf "$GST_PLUGINS_YES\n" | sort + printf "\n" + printf "configure: *** Plug-ins with dependencies that will NOT be built:" + printf "$GST_PLUGINS_NO\n" | sort + printf "\n" +fi +]) + diff --git a/common/m4/gst-function.m4 b/common/m4/gst-function.m4 new file mode 100644 index 0000000..61adfd3 --- /dev/null +++ b/common/m4/gst-function.m4 @@ -0,0 +1,63 @@ +dnl +dnl Check for compiler mechanism to show functions in debugging +dnl copied from an Ali patch floating on the internet +dnl +AC_DEFUN([AG_GST_CHECK_FUNCTION],[ + dnl #1: __PRETTY_FUNCTION__ + AC_MSG_CHECKING(whether $CC implements __PRETTY_FUNCTION__) + AC_CACHE_VAL(gst_cv_have_pretty_function,[ + AC_TRY_LINK([#include ], + [printf("%s", __PRETTY_FUNCTION__);], + gst_cv_have_pretty_function=yes, + gst_cv_have_pretty_function=no) + ]) + AC_MSG_RESULT($gst_cv_have_pretty_function) + if test "$gst_cv_have_pretty_function" = yes; then + AC_DEFINE(HAVE_PRETTY_FUNCTION, 1, + [defined if the compiler implements __PRETTY_FUNCTION__]) + fi + +dnl #2: __FUNCTION__ + AC_MSG_CHECKING(whether $CC implements __FUNCTION__) + AC_CACHE_VAL(gst_cv_have_function,[ + AC_TRY_LINK([#include ], + [printf("%s", __FUNCTION__);], + gst_cv_have_function=yes, + gst_cv_have_function=no) + ]) + AC_MSG_RESULT($gst_cv_have_function) + if test "$gst_cv_have_function" = yes; then + AC_DEFINE(HAVE_FUNCTION, 1, + [defined if the compiler implements __FUNCTION__]) + fi + +dnl #3: __func__ + AC_MSG_CHECKING(whether $CC implements __func__) + AC_CACHE_VAL(gst_cv_have_func,[ + AC_TRY_LINK([#include ], + [printf("%s", __func__);], + gst_cv_have_func=yes, + gst_cv_have_func=no) + ]) + AC_MSG_RESULT($gst_cv_have_func) + if test "$gst_cv_have_func" = yes; then + AC_DEFINE(HAVE_FUNC, 1, + [defined if the compiler implements __func__]) + fi + +dnl now define FUNCTION to whatever works, and fallback to "" + if test "$gst_cv_have_pretty_function" = yes; then + function=__PRETTY_FUNCTION__ + else + if test "$gst_cv_have_function" = yes; then + function=__FUNCTION__ + else + if test "$gst_cv_have_func" = yes; then + function=__func__ + else + function=\"\" + fi + fi + fi + AC_DEFINE_UNQUOTED(GST_FUNCTION, $function, [macro to use to show function name]) +]) diff --git a/common/m4/gst-gettext.m4 b/common/m4/gst-gettext.m4 new file mode 100644 index 0000000..df817eb --- /dev/null +++ b/common/m4/gst-gettext.m4 @@ -0,0 +1,28 @@ +dnl gettext setup + +dnl AG_GST_GETTEXT([gettext-package]) +dnl defines GETTEXT_PACKAGE and LOCALEDIR + +AC_DEFUN([AG_GST_GETTEXT], +[ + if test "$USE_NLS" = "yes"; then + GETTEXT_PACKAGE=[$1] + else + GETTEXT_PACKAGE=[NULL] + fi + AC_SUBST(GETTEXT_PACKAGE) + AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], "$GETTEXT_PACKAGE", + [gettext package name]) + + dnl make sure po/Makevars is kept in sync with GETTEXT_PACKAGE + if test -e "${srcdir}/po/Makevars"; then + if ! grep -e "$1" "${srcdir}/po/Makevars"; then + AC_MSG_ERROR([DOMAIN in po/Makevars does not match GETTEXT_PACKAGE $1]) + fi + fi + + dnl define LOCALEDIR in config.h + AS_AC_EXPAND(LOCALEDIR, $datadir/locale) + AC_DEFINE_UNQUOTED([LOCALEDIR], "$LOCALEDIR", + [gettext locale dir]) +]) diff --git a/common/m4/gst-glib2.m4 b/common/m4/gst-glib2.m4 new file mode 100644 index 0000000..63f0f46 --- /dev/null +++ b/common/m4/gst-glib2.m4 @@ -0,0 +1,126 @@ +dnl check for a minimum version of GLib + +dnl AG_GST_GLIB_CHECK([minimum-version-required]) + +AC_DEFUN([AG_GST_GLIB_CHECK], +[ + AC_REQUIRE([AS_NANO]) + + dnl Minimum required version of GLib + GLIB_REQ=[$1] + if test "x$GLIB_REQ" = "x" + then + AC_MSG_ERROR([Please specify a required version for GLib 2.0]) + fi + AC_SUBST(GLIB_REQ) + + dnl Check for glib with everything + AG_GST_PKG_CHECK_MODULES(GLIB, + glib-2.0 >= $GLIB_REQ gobject-2.0 gmodule-no-export-2.0) + + if test "x$HAVE_GLIB" = "xno"; then + AC_MSG_ERROR([This package requires GLib >= $GLIB_REQ to compile.]) + fi + + dnl Add define to tell GLib that threading is always enabled within GStreamer + dnl code (optimisation, bypasses checks if the threading system is enabled + dnl when using threading primitives) + GLIB_EXTRA_CFLAGS="$GLIB_EXTRA_CFLAGS -DG_THREADS_MANDATORY" + + dnl Define G_DISABLE_DEPRECATED for development versions + if test "x`expr $PACKAGE_VERSION_MINOR % 2`" = "x1" -a "x`expr $PACKAGE_VERSION_MICRO '<' 90`" = "x1"; then + GLIB_EXTRA_CFLAGS="$GLIB_EXTRA_CFLAGS -DG_DISABLE_DEPRECATED" + fi + + AC_ARG_ENABLE(gobject-cast-checks, + AS_HELP_STRING([--enable-gobject-cast-checks[=@<:@no/auto/yes@:>@]], + [Enable GObject cast checks]),[enable_gobject_cast_checks=$enableval], + [enable_gobject_cast_checks=auto]) + + if test "x$enable_gobject_cast_checks" = "xauto"; then + dnl Turn on cast checks only for development versions + if test "x`expr $PACKAGE_VERSION_MINOR % 2`" = "x1" -a "x`expr $PACKAGE_VERSION_MICRO '<' 90`" = "x1"; then + enable_gobject_cast_checks=yes + else + enable_gobject_cast_checks=no + fi + fi + + if test "x$enable_gobject_cast_checks" = "xno"; then + GLIB_EXTRA_CFLAGS="$GLIB_EXTRA_CFLAGS -DG_DISABLE_CAST_CHECKS" + fi + + AC_ARG_ENABLE(glib-asserts, + AS_HELP_STRING([--enable-glib-asserts[=@<:@no/auto/yes@:>@]], + [Enable GLib assertion]),[enable_glib_assertions=$enableval], + [enable_glib_assertions=auto]) + + if test "x$enable_glib_assertions" = "xauto"; then + dnl Enable assertions only for development versions + if test "x`expr $PACKAGE_VERSION_MINOR % 2`" = "x1" -a "x`expr $PACKAGE_VERSION_MICRO '<' 90`" = "x1"; then + enable_glib_assertions=yes + else + enable_glib_assertions=no + fi + fi + + if test "x$enable_glib_assertions" = "xno"; then + GLIB_EXTRA_CFLAGS="$GLIB_EXTRA_CFLAGS -DG_DISABLE_ASSERT" + fi + + dnl Find location of glib utils. People may want to or have to override these, + dnl e.g. in a cross-compile situation where PATH is a bit messed up. We need + dnl for these tools to work on the host, so can't just use the one from the + dnl GLib installation that pkg-config picks up, as that might be for a + dnl different target architecture. + dnl + dnl glib-genmarshal: + AC_MSG_CHECKING(for glib-genmarshal) + if test "x$GLIB_GENMARSHAL" != "x"; then + AC_MSG_RESULT([$GLIB_GENMARSHAL (from environment)]) + else + GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0` + if $GLIB_GENMARSHAL --version 2>/dev/null >/dev/null; then + AC_MSG_RESULT([$GLIB_GENMARSHAL (from pkg-config path)]) + else + AC_PATH_PROG(GLIB_GENMARSHAL, [glib-genmarshal], [glib-genmarshal]) + AC_MSG_RESULT([$GLIB_GENMARSHAL]) + fi + fi + if ! $GLIB_GENMARSHAL --version 2>/dev/null >/dev/null; then + AC_MSG_WARN([$GLIB_GENMARSHAL does not seem to work!]) + fi + AC_SUBST(GLIB_GENMARSHAL) + + dnl glib-mkenums: + AC_MSG_CHECKING(for glib-mkenums) + if test "x$GLIB_MKENUMS" != "x"; then + AC_MSG_RESULT([$GLIB_MKENUMS (from environment)]) + else + dnl glib-mkenums is written in perl so should always work really + GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0` + AC_MSG_RESULT([$GLIB_MKENUMS]) + fi + if ! $GLIB_MKENUMS --version 2>/dev/null >/dev/null; then + AC_MSG_WARN([$GLIB_MKENUMS does not seem to work!]) + fi + AC_SUBST(GLIB_MKENUMS) + + AC_SUBST(GLIB_EXTRA_CFLAGS) + + dnl Now check for GIO + PKG_CHECK_MODULES(GIO, gio-2.0 >= $GLIB_REQ) + if test "x$HAVE_GIO" = "xno"; then + AC_MSG_ERROR([This package requires GIO >= $GLIB_REQ to compile.]) + fi + + GIO_MODULE_DIR="`$PKG_CONFIG --variable=giomoduledir gio-2.0`" + AC_DEFINE_UNQUOTED(GIO_MODULE_DIR, "$GIO_MODULE_DIR", + [The GIO modules directory.]) + GIO_LIBDIR="`$PKG_CONFIG --variable=libdir gio-2.0`" + AC_DEFINE_UNQUOTED(GIO_LIBDIR, "$GIO_LIBDIR", + [The GIO library directory.]) + AC_SUBST(GIO_CFLAGS) + AC_SUBST(GIO_LIBS) + AC_SUBST(GIO_LDFLAGS) +]) diff --git a/common/m4/gst-libxml2.m4 b/common/m4/gst-libxml2.m4 new file mode 100644 index 0000000..4a843f0 --- /dev/null +++ b/common/m4/gst-libxml2.m4 @@ -0,0 +1,52 @@ +dnl call this macro with the minimum required version as an argument +dnl this macro sets and AC_SUBSTs XML_CFLAGS and XML_LIBS +dnl it also sets LIBXML_PKG, used for the pkg-config file + +AC_DEFUN([AG_GST_LIBXML2_CHECK], +[ + dnl Minimum required version of libxml2 + dnl default to 2.4.9 if not specified + LIBXML2_REQ=ifelse([$1],,2.4.9,[$1]) + AC_SUBST(LIBXML2_REQ) + + dnl check for libxml2 + PKG_CHECK_MODULES(XML, libxml-2.0 >= $LIBXML2_REQ, + HAVE_LIBXML2=yes, [ + AC_MSG_RESULT(no) + HAVE_LIBXML2=no + ]) + if test "x$HAVE_LIBXML2" = "xyes"; then + AC_DEFINE(HAVE_LIBXML2, 1, [Define if libxml2 is available]) + else + AC_MSG_ERROR([ + Need libxml2 and development headers/files to build GStreamer. + + You can do without libxml2 if you pass --disable-loadsave to + configure, but that breaks ABI, so don't do that unless you + are building for an embedded setup and know what you are doing. + ]) + fi + dnl this is for the .pc file + LIBXML_PKG=', libxml-2.0' + AC_SUBST(LIBXML_PKG) + AC_SUBST(XML_LIBS) + AC_SUBST(XML_CFLAGS) + + dnl XML_LIBS might pull in -lz without zlib actually being on the system, so + dnl try linking with these LIBS and CFLAGS + ac_save_CFLAGS=$CFLAGS + ac_save_LIBS=$LIBS + CFLAGS="$CFLAGS $XML_CFLAGS" + LIBS="$LIBS $XML_LIBS" + AC_TRY_LINK([ +#include +#include +],[ +/* function body */ +], + AC_MSG_NOTICE([Test xml2 program linked]), + AC_MSG_ERROR([Could not link libxml2 test program. Check if you have the necessary dependencies.]) + ) + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" +]) diff --git a/common/m4/gst-package-release-datetime.m4 b/common/m4/gst-package-release-datetime.m4 new file mode 100644 index 0000000..bc885e3 --- /dev/null +++ b/common/m4/gst-package-release-datetime.m4 @@ -0,0 +1,89 @@ +dnl macros to set GST_PACKAGE_RELEASE_DATETIME + +dnl =========================================================================== +dnl AG_GST_SET_PACKAGE_RELEASE_DATETIME +dnl +dnl Usage: +dnl +dnl AG_GST_SET_PACKAGE_RELEASE_DATETIME() +dnl AG_GST_SET_PACKAGE_RELEASE_DATETIME([no]...) +dnl sets the release datetime to the current date +dnl (no = this is not a release, but git or prerelease) +dnl +dnl AG_GST_SET_PACKAGE_RELEASE_DATETIME([YYYY-MM-DD]) +dnl AG_GST_SET_PACKAGE_RELEASE_DATETIME([yes], [YYYY-MM-DD]) +dnl sets the release datetime to the specified date (and time, if given) +dnl (yes = this is a release, not git or prerelease) +dnl +dnl AG_GST_SET_PACKAGE_RELEASE_DATETIME([yes], [DOAP-FILE], [RELEASE-VERSION]) +dnl sets the release date to the release date associated with version +dnl RELEASE-VERSION in the .doap file DOAP-FILE +dnl (yes = this is a release, not git or prerelease) +dnl +dnl We need to treat pre-releases like git because there won't be an entry +dnl in the .doap file for pre-releases yet, and we don't want to use the +dnl date of the last release either. +dnl =========================================================================== +AC_DEFUN([AG_GST_SET_PACKAGE_RELEASE_DATETIME], +[ + dnl AG_GST_SET_PACKAGE_RELEASE_DATETIME() + dnl AG_GST_SET_PACKAGE_RELEASE_DATETIME([yes]...) + if test "x$1" = "xno" -o "x$1" = "x"; then + GST_PACKAGE_RELEASE_DATETIME=`date -u "+%Y-%m-%dT%H:%MZ"` + elif test "x$1" = "xyes"; then + dnl AG_GST_SET_PACKAGE_RELEASE_DATETIME([no], ["YYYY-MM-DD"]) + dnl AG_GST_SET_PACKAGE_RELEASE_DATETIME([no], [DOAP-FILE], [RELEASE-VERSION]) + if ( echo $1 | grep '^20[1-9][0-9]-[0-1][0-9]-[0-3][0-9]' >/dev/null ) ; then + GST_PACKAGE_RELEASE_DATETIME=$1 + else + dnl we assume the .doap file contains the date as YYYY-MM-DD + YYYY_MM_DD=`sh "${srcdir}/common/extract-release-date-from-doap-file" $3 $2`; + if test "x$YYYY_MM_DD" != "x"; then + GST_PACKAGE_RELEASE_DATETIME=$YYYY_MM_DD + else + AC_MSG_ERROR([SET_PACKAGE_RELEASE_DATETIME: could not extract + release date for release version $3 from $2]) + GST_PACKAGE_RELEASE_DATETIME="" + fi + fi + dnl AG_GST_SET_PACKAGE_RELEASE_DATETIME([YYYY-MM-DD]) + elif ( echo $1 | grep '^20[1-9][0-9]-[0-1][0-9]-[0-3][0-9]' >/dev/null ) ; then + GST_PACKAGE_RELEASE_DATETIME=$1 + else + AC_MSG_WARN([SET_PACKAGE_RELEASE_DATETIME: invalid first argument]) + GST_PACKAGE_RELEASE_DATETIME="" + fi + + if test "x$GST_PACKAGE_RELEASE_DATETIME" = "x"; then + AC_MSG_WARN([Invalid package release date time: $GST_PACKAGE_RELEASE_DATETIME]) + else + AC_MSG_NOTICE([Setting GST_PACKAGE_RELEASE_DATETIME to $GST_PACKAGE_RELEASE_DATETIME]) + + AC_DEFINE_UNQUOTED([GST_PACKAGE_RELEASE_DATETIME], + ["$GST_PACKAGE_RELEASE_DATETIME"], + [GStreamer package release date/time for plugins as YYYY-MM-DD]) + fi +]) + +dnl =========================================================================== +dnl AG_GST_SET_PACKAGE_RELEASE_DATETIME_WITH_NANO +dnl +dnl Usage: +dnl +dnl AG_GST_SET_PACKAGE_RELEASE_DATETIME([NANO-VERSION], [DOAP-FILE], [RELEASE-VERSION]) +dnl if NANO-VERSION is 0, sets the release date to the release date associated +dnl with version RELEASE-VERSION in the .doap file DOAP-FILE, otherwise sets +dnl the release date and time to the current date/time. +dnl +dnl We need to treat pre-releases like git because there won't be an entry +dnl in the .doap file for pre-releases yet, and we don't want to use the +dnl date of the last release either. +dnl =========================================================================== +AC_DEFUN([AG_GST_SET_PACKAGE_RELEASE_DATETIME_WITH_NANO], +[ + if test "x$1" = "x0"; then + AG_GST_SET_PACKAGE_RELEASE_DATETIME([yes], [ $2 ], [ $3 ]) + else + AG_GST_SET_PACKAGE_RELEASE_DATETIME([no]) + fi +]) diff --git a/common/m4/gst-parser.m4 b/common/m4/gst-parser.m4 new file mode 100644 index 0000000..b002047 --- /dev/null +++ b/common/m4/gst-parser.m4 @@ -0,0 +1,55 @@ +AC_DEFUN([AG_GST_BISON_CHECK], +[ + dnl FIXME: check if AC_PROG_YACC is suitable here + dnl FIXME: make precious + AC_PATH_PROG(BISON_PATH, bison, no) + if test x$BISON_PATH = xno; then + AC_MSG_ERROR(Could not find bison) + fi + + dnl check bison version + dnl we need version >= 2.4 for the '<>' support + dnl in the parser. + dnl First lines observed: 'bison (GNU Bison) 2.3' or 'GNU Bison version 1.28' + bison_min_version=2.4 + bison_version=`$BISON_PATH --version | head -n 1 | sed 's/^[[^0-9]]*//' | sed 's/[[^0-9]]*$//' | cut -d' ' -f1` + AC_MSG_CHECKING([bison version $bison_version >= $bison_min_version]) + + if perl -we "exit ((v$bison_version ge v$bison_min_version) ? 0 : 1)"; then + AC_MSG_RESULT([yes]) + else + AC_MSG_ERROR([no]) + fi +]) + +AC_DEFUN([AG_GST_FLEX_CHECK], +[ + dnl we require flex for building the parser + AC_PATH_PROG(FLEX_PATH, flex, no) + if test x$FLEX_PATH = xno; then + AC_MSG_ERROR(Could not find flex) + fi + + dnl check flex version + dnl we need version >= 2.5.31 for the reentrancy support + dnl in the parser. + flex_min_version=2.5.31 + flex_version=`$FLEX_PATH --version | head -n 1 | awk '{print $2}'` + AC_MSG_CHECKING([flex version $flex_version >= $flex_min_version]) + if perl -w < \$min_version_major) || + ((\$flex_version_major == \$min_version_major) && + (\$flex_version_minor > \$min_version_minor)) || + ((\$flex_version_major == \$min_version_major) && + (\$flex_version_minor == \$min_version_minor) && + (\$flex_version_micro >= \$min_version_micro))) + ? 0 : 1); +EOF + then + AC_MSG_RESULT(yes) + else + AC_MSG_ERROR([no]) + fi +]) diff --git a/common/m4/gst-platform.m4 b/common/m4/gst-platform.m4 new file mode 100644 index 0000000..40d6faf --- /dev/null +++ b/common/m4/gst-platform.m4 @@ -0,0 +1,67 @@ +dnl AG_GST_PLATFORM +dnl Check for platform specific features and define some variables +dnl +dnl GST_EXTRA_MODULE_SUFFIX: contains a platform specific +dnl extra module suffix additional to G_MODULE_SUFFIX +dnl +dnl HAVE_OSX: Defined if compiling for OS X +dnl +dnl GST_HAVE_UNSAFE_FORK: Defined if fork is unsafe (Windows) +dnl +dnl HAVE_WIN32: Defined if compiling on Win32 +dnl + +AC_DEFUN([AG_GST_PLATFORM], +[ + AC_REQUIRE([AC_CANONICAL_HOST]) + + case $host_os in + rhapsody*) + AC_DEFINE_UNQUOTED(GST_EXTRA_MODULE_SUFFIX, [".dylib"], [Extra platform specific plugin suffix]) + ;; + darwin*) + AC_DEFINE_UNQUOTED(GST_EXTRA_MODULE_SUFFIX, [".dylib"], [Extra platform specific plugin suffix]) + AC_DEFINE_UNQUOTED(HAVE_OSX, 1, [Defined if compiling for OSX]) + ;; + cygwin*) + AC_DEFINE_UNQUOTED(GST_HAVE_UNSAFE_FORK, 1, [Defined when registry scanning through fork is unsafe]) + ;; + mingw* | msvc* | mks*) + dnl HAVE_WIN32 currently means "disable POSIXisms". + AC_DEFINE_UNQUOTED(HAVE_WIN32, 1, [Defined if compiling for Windows]) + + dnl define __MSVCRT_VERSION__ version if not set already by the + dnl compiler (ie. mostly for mingw). This is needed for things like + dnl __stat64 to be available. If set by the compiler, ensure it's + dnl new enough - we need at least WinXP SP2. + AC_TRY_COMPILE([ ], [ return __MSVCRT_VERSION__; ], [ + AC_TRY_COMPILE([ ], [ + #if __MSVCRT_VERSION__ < 0x0601 + #error "MSVCRT too old" + #endif + ], [ + AC_MSG_NOTICE([MSVCRT version looks ok]) + ], [ + AC_MSG_ERROR([MSVCRT version too old, need at least WinXP SP2]) + ]) + ], [ + AC_MSG_NOTICE([Setting MSVCRT version to 0x0601]) + AC_DEFINE_UNQUOTED(__MSVCRT_VERSION__, 0x0601, [We need at least WinXP SP2 for __stat64]) + ]) + ;; + *) + ;; + esac +]) + +AC_DEFUN([AG_GST_LIBTOOL_PREPARE], +[ + dnl Persuade libtool to also link (-l) a 'pure' (DirectX) static lib, + dnl i.e. as opposed to only import lib with dll counterpart. + dnl Needs to be tweaked before libtool's checks. + case $host_os in + cygwin* | mingw*) + lt_cv_deplibs_check_method=pass_all + ;; + esac +]) \ No newline at end of file diff --git a/common/m4/gst-plugin-docs.m4 b/common/m4/gst-plugin-docs.m4 new file mode 100644 index 0000000..0e2ab6e --- /dev/null +++ b/common/m4/gst-plugin-docs.m4 @@ -0,0 +1,25 @@ +dnl AG_GST_PLUGIN_DOCS([MINIMUM-GTK-DOC-VERSION]) +dnl +dnl checks for prerequisites for the common/mangle-tmpl.py script +dnl used when building the plugin documentation + +AC_DEFUN([AG_GST_PLUGIN_DOCS], +[ + AC_BEFORE([GTK_DOC_CHECK],[$0])dnl check for gtk-doc first + AC_REQUIRE([AM_PATH_PYTHON])dnl find python first + + build_plugin_docs=no + AC_MSG_CHECKING([whether to build plugin documentation]) + if test x$enable_gtk_doc = xyes; then + if test x$PYTHON != x; then + build_plugin_docs=yes + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no (python not found)]) + fi + else + AC_MSG_RESULT([no (gtk-doc disabled or not available)]) + fi + + AM_CONDITIONAL(ENABLE_PLUGIN_DOCS, test x$build_plugin_docs = xyes) +]) diff --git a/common/m4/gst-plugindir.m4 b/common/m4/gst-plugindir.m4 new file mode 100644 index 0000000..c9e1301 --- /dev/null +++ b/common/m4/gst-plugindir.m4 @@ -0,0 +1,17 @@ +dnl AG_GST_SET_PLUGINDIR + +dnl AC_DEFINE PLUGINDIR to the full location where plug-ins will be installed +dnl AC_SUBST plugindir, to be used in Makefile.am's + +AC_DEFUN([AG_GST_SET_PLUGINDIR], +[ + dnl define location of plugin directory + AS_AC_EXPAND(PLUGINDIR, ${libdir}/gstreamer-$GST_API_VERSION) + AC_DEFINE_UNQUOTED(PLUGINDIR, "$PLUGINDIR", + [directory where plugins are located]) + AC_MSG_NOTICE([Using $PLUGINDIR as the plugin install location]) + + dnl plugin directory configure-time variable for use in Makefile.am + plugindir="\$(libdir)/gstreamer-$GST_API_VERSION" + AC_SUBST(plugindir) +]) diff --git a/common/m4/gst-valgrind.m4 b/common/m4/gst-valgrind.m4 new file mode 100644 index 0000000..5c0d608 --- /dev/null +++ b/common/m4/gst-valgrind.m4 @@ -0,0 +1,35 @@ +AC_DEFUN([AG_GST_VALGRIND_CHECK], +[ + dnl valgrind inclusion + AC_ARG_ENABLE(valgrind, + AC_HELP_STRING([--disable-valgrind], [disable run-time valgrind detection]), + [ + case "${enableval}" in + yes) USE_VALGRIND="$USE_DEBUG" ;; + no) USE_VALGRIND=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-valgrind) ;; + esac], + [ + USE_VALGRIND="$USE_DEBUG" + ]) dnl Default value + + VALGRIND_REQ="3.0" + if test "x$USE_VALGRIND" = xyes; then + PKG_CHECK_MODULES(VALGRIND, valgrind >= $VALGRIND_REQ, + USE_VALGRIND="yes", + [ + USE_VALGRIND="no" + AC_MSG_RESULT([no]) + ]) + fi + + if test "x$USE_VALGRIND" = xyes; then + AC_DEFINE(HAVE_VALGRIND, 1, [Define if valgrind should be used]) + AC_MSG_NOTICE(Using extra code paths for valgrind) + fi + AC_SUBST(VALGRIND_CFLAGS) + AC_SUBST(VALGRIND_LIBS) + + AC_PATH_PROG(VALGRIND_PATH, valgrind, no) + AM_CONDITIONAL(HAVE_VALGRIND, test ! "x$VALGRIND_PATH" = "xno") +]) diff --git a/common/m4/gst-x11.m4 b/common/m4/gst-x11.m4 new file mode 100644 index 0000000..c41ddff --- /dev/null +++ b/common/m4/gst-x11.m4 @@ -0,0 +1,74 @@ +dnl macros for X-related detections +dnl AC_SUBST's HAVE_X, X_CFLAGS, X_LIBS +AC_DEFUN([AG_GST_CHECK_X], +[ + AC_PATH_XTRA + ac_cflags_save="$CFLAGS" + ac_cppflags_save="$CPPFLAGS" + CFLAGS="$CFLAGS $X_CFLAGS" + CPPFLAGS="$CPPFLAGS $X_CFLAGS" + + dnl now try to find the HEADER + HAVE_X="no" + AC_CHECK_HEADER([X11/Xlib.h], [ + dnl and then the library with the most uniquitous function + AC_CHECK_LIB(X11, [XSync], [HAVE_X="yes"], [], [$X_LIBS $X_PRE_LIBS $X_EXTRA_LIBS]) + ], [], [AC_INCLUDES_DEFAULT]) + + if test "x$HAVE_X" = "xno" + then + AC_MSG_NOTICE([cannot find X11 development files]) + else + dnl this is much more than we want + X_LIBS="$X_LIBS $X_PRE_LIBS $X_EXTRA_LIBS" + dnl AC_PATH_XTRA only defines the path needed to find the X libs, + dnl it does not add the libs; therefore we add them here + X_LIBS="$X_LIBS -lX11" + AC_SUBST(X_CFLAGS) + AC_SUBST(X_LIBS) + fi + AC_SUBST(HAVE_X) + + CFLAGS="$ac_cflags_save" + CPPFLAGS="$ac_cppflags_save" +]) + +dnl *** XVideo *** +dnl Look for the PIC library first, Debian requires it. +dnl Check debian-devel archives for gory details. +dnl 20020110: +dnl At the moment XFree86 doesn't distribute shared libXv due +dnl to unstable API. On many platforms you CAN NOT link a shared +dnl lib to a static non-PIC lib. This is what the xvideo GStreamer +dnl plug-in wants to do. So Debian distributes a PIC compiled +dnl version of the static lib for plug-ins to link to when it is +dnl inappropriate to link the main application to libXv directly. +dnl FIXME: add check if this platform can support linking to a +dnl non-PIC libXv, if not then don not use Xv. +dnl FIXME: perhaps warn user if they have a shared libXv since +dnl this is an error until XFree86 starts shipping one +AC_DEFUN([AG_GST_CHECK_XV], +[ + if test x$HAVE_X = xyes; then + AC_CHECK_LIB(Xv_pic, XvQueryExtension, + HAVE_XVIDEO="yes", HAVE_XVIDEO="no", + $X_LIBS -lXext) + + if test x$HAVE_XVIDEO = xyes; then + XVIDEO_LIBS="-lXv_pic -lXext" + AC_SUBST(XVIDEO_LIBS) + else + dnl try again using something else if we didn't find it first + if test x$HAVE_XVIDEO = xno; then + AC_CHECK_LIB(Xv, XvQueryExtension, + HAVE_XVIDEO="yes", HAVE_XVIDEO="no", + $X_LIBS -lXext) + + if test x$HAVE_XVIDEO = xyes; then + XVIDEO_LIBS="-lXv -lXext" + AC_SUBST(XVIDEO_LIBS) + fi + fi + fi + fi +]) diff --git a/common/m4/gst.m4 b/common/m4/gst.m4 new file mode 100644 index 0000000..d4c53cb --- /dev/null +++ b/common/m4/gst.m4 @@ -0,0 +1,36 @@ +dnl AG_GST_INIT +dnl sets up use of GStreamer configure.ac macros +dnl all GStreamer autoconf macros are prefixed +dnl with AG_GST_ for public macros +dnl with _AG_GST_ for private macros +dnl +dnl We call AC_CANONICAL_TARGET and AC_CANONICAL_HOST so that +dnl it is valid before AC_ARG_PROGRAM is called + +AC_DEFUN([AG_GST_INIT], +[ + m4_pattern_forbid(^_?AG_GST_) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use host_ variables + AC_REQUIRE([AC_CANONICAL_TARGET]) dnl we use target_ variables +]) + +dnl AG_GST_PKG_CONFIG_PATH +dnl +dnl sets up a GST_PKG_CONFIG_PATH variable for use in Makefile.am +dnl which contains the path of the in-tree pkgconfig directory first +dnl and then any paths specified in PKG_CONFIG_PATH. +dnl +dnl We do this mostly so we don't have to use unportable shell constructs +dnl such as ${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH} in Makefile.am to handle +dnl the case where the environment variable is not set, but also in order +dnl to avoid a trailing ':' in the PKG_CONFIG_PATH which apparently causes +dnl problems with pkg-config on windows with msys/mingw. +AC_DEFUN([AG_GST_PKG_CONFIG_PATH], +[ + GST_PKG_CONFIG_PATH="\$(top_builddir)/pkgconfig" + if test "x$PKG_CONFIG_PATH" != "x"; then + GST_PKG_CONFIG_PATH="$GST_PKG_CONFIG_PATH:$PKG_CONFIG_PATH" + fi + AC_SUBST([GST_PKG_CONFIG_PATH]) + AC_MSG_NOTICE([Using GST_PKG_CONFIG_PATH = $GST_PKG_CONFIG_PATH]) +]) diff --git a/common/m4/gtk-doc.m4 b/common/m4/gtk-doc.m4 new file mode 100644 index 0000000..b243f1c --- /dev/null +++ b/common/m4/gtk-doc.m4 @@ -0,0 +1,70 @@ +dnl -*- mode: autoconf -*- + +# serial 1 + +dnl Usage: +dnl GTK_DOC_CHECK([minimum-gtk-doc-version]) +AC_DEFUN([GTK_DOC_CHECK], +[ + AC_REQUIRE([PKG_PROG_PKG_CONFIG]) + AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first + AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first + + dnl check for tools we added during development + AC_PATH_PROG([GTKDOC_CHECK],[gtkdoc-check]) + AC_PATH_PROGS([GTKDOC_REBASE],[gtkdoc-rebase],[true]) + AC_PATH_PROG([GTKDOC_MKPDF],[gtkdoc-mkpdf]) + + dnl for overriding the documentation installation directory + AC_ARG_WITH([html-dir], + AS_HELP_STRING([--with-html-dir=PATH], [path to installed docs]),, + [with_html_dir='${datadir}/gtk-doc/html']) + HTML_DIR="$with_html_dir" + AC_SUBST([HTML_DIR]) + + dnl enable/disable documentation building + AC_ARG_ENABLE([gtk-doc], + AS_HELP_STRING([--enable-gtk-doc], + [use gtk-doc to build documentation [[default=no]]]),, + [enable_gtk_doc=no]) + + if test x$enable_gtk_doc = xyes; then + ifelse([$1],[], + [PKG_CHECK_EXISTS([gtk-doc],, + AC_MSG_ERROR([gtk-doc not installed and --enable-gtk-doc requested]))], + [PKG_CHECK_EXISTS([gtk-doc >= $1],, + AC_MSG_ERROR([You need to have gtk-doc >= $1 installed to build $PACKAGE_NAME]))]) + dnl don't check for glib if we build glib + if test "x$PACKAGE_NAME" != "xglib"; then + dnl don't fail if someone does not have glib + PKG_CHECK_MODULES(GTKDOC_DEPS, glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0,,) + fi + dnl don't rely on sed being pulled in implicitly. Fixes Solaris build. + if test -z "$SED"; then + AC_PROG_SED + fi + fi + + AC_MSG_CHECKING([whether to build gtk-doc documentation]) + AC_MSG_RESULT($enable_gtk_doc) + + dnl enable/disable output formats + AC_ARG_ENABLE([gtk-doc-html], + AS_HELP_STRING([--enable-gtk-doc-html], + [build documentation in html format [[default=yes]]]),, + [enable_gtk_doc_html=yes]) + AC_ARG_ENABLE([gtk-doc-pdf], + AS_HELP_STRING([--enable-gtk-doc-pdf], + [build documentation in pdf format [[default=no]]]),, + [enable_gtk_doc_pdf=no]) + + if test -z "$GTKDOC_MKPDF"; then + enable_gtk_doc_pdf=no + fi + + + AM_CONDITIONAL([ENABLE_GTK_DOC], [test x$enable_gtk_doc = xyes]) + AM_CONDITIONAL([GTK_DOC_BUILD_HTML], [test x$enable_gtk_doc_html = xyes]) + AM_CONDITIONAL([GTK_DOC_BUILD_PDF], [test x$enable_gtk_doc_pdf = xyes]) + AM_CONDITIONAL([GTK_DOC_USE_LIBTOOL], [test -n "$LIBTOOL"]) +]) diff --git a/common/m4/introspection.m4 b/common/m4/introspection.m4 new file mode 100644 index 0000000..589721c --- /dev/null +++ b/common/m4/introspection.m4 @@ -0,0 +1,94 @@ +dnl -*- mode: autoconf -*- +dnl Copyright 2009 Johan Dahlin +dnl +dnl This file is free software; the author(s) gives unlimited +dnl permission to copy and/or distribute it, with or without +dnl modifications, as long as this notice is preserved. +dnl + +# serial 1 + +m4_define([_GOBJECT_INTROSPECTION_CHECK_INTERNAL], +[ + AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first + AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first + AC_BEFORE([LT_INIT],[$0])dnl setup libtool first + + dnl enable/disable introspection + m4_if([$2], [require], + [dnl + enable_introspection=yes + ],[dnl + AC_ARG_ENABLE(introspection, + AS_HELP_STRING([--enable-introspection[=@<:@no/auto/yes@:>@]], + [Enable introspection for this build]),, + [enable_introspection=auto]) + ])dnl + + AC_MSG_CHECKING([for gobject-introspection]) + + dnl presence/version checking + AS_CASE([$enable_introspection], + [no], [dnl + found_introspection="no (disabled, use --enable-introspection to enable)" + ],dnl + [yes],[dnl + PKG_CHECK_EXISTS([gobject-introspection-1.0],, + AC_MSG_ERROR([gobject-introspection-1.0 is not installed])) + PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $1], + found_introspection=yes, + AC_MSG_ERROR([You need to have gobject-introspection >= $1 installed to build AC_PACKAGE_NAME])) + ],dnl + [auto],[dnl + PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $1], found_introspection=yes, found_introspection=no) + ],dnl + [dnl + AC_MSG_ERROR([invalid argument passed to --enable-introspection, should be one of @<:@no/auto/yes@:>@]) + ])dnl + + AC_MSG_RESULT([$found_introspection]) + + INTROSPECTION_SCANNER= + INTROSPECTION_COMPILER= + INTROSPECTION_GENERATE= + INTROSPECTION_GIRDIR= + INTROSPECTION_TYPELIBDIR= + if test "x$found_introspection" = "xyes"; then + INTROSPECTION_SCANNER=`$PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0` + INTROSPECTION_COMPILER=`$PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0` + INTROSPECTION_GENERATE=`$PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0` + INTROSPECTION_GIRDIR=`$PKG_CONFIG --variable=girdir gobject-introspection-1.0` + INTROSPECTION_TYPELIBDIR="$($PKG_CONFIG --variable=typelibdir gobject-introspection-1.0)" + INTROSPECTION_CFLAGS=`$PKG_CONFIG --cflags gobject-introspection-1.0` + INTROSPECTION_LIBS=`$PKG_CONFIG --libs gobject-introspection-1.0` + INTROSPECTION_MAKEFILE=`$PKG_CONFIG --variable=datadir gobject-introspection-1.0`/gobject-introspection-1.0/Makefile.introspection + fi + AC_SUBST(INTROSPECTION_SCANNER) + AC_SUBST(INTROSPECTION_COMPILER) + AC_SUBST(INTROSPECTION_GENERATE) + AC_SUBST(INTROSPECTION_GIRDIR) + AC_SUBST(INTROSPECTION_TYPELIBDIR) + AC_SUBST(INTROSPECTION_CFLAGS) + AC_SUBST(INTROSPECTION_LIBS) + AC_SUBST(INTROSPECTION_MAKEFILE) + + AM_CONDITIONAL(HAVE_INTROSPECTION, test "x$found_introspection" = "xyes") +]) + + +dnl Usage: +dnl GOBJECT_INTROSPECTION_CHECK([minimum-g-i-version]) + +AC_DEFUN([GOBJECT_INTROSPECTION_CHECK], +[ + _GOBJECT_INTROSPECTION_CHECK_INTERNAL([$1]) +]) + +dnl Usage: +dnl GOBJECT_INTROSPECTION_REQUIRE([minimum-g-i-version]) + + +AC_DEFUN([GOBJECT_INTROSPECTION_REQUIRE], +[ + _GOBJECT_INTROSPECTION_CHECK_INTERNAL([$1], [require]) +]) diff --git a/common/m4/orc.m4 b/common/m4/orc.m4 new file mode 100644 index 0000000..26b2459 --- /dev/null +++ b/common/m4/orc.m4 @@ -0,0 +1,70 @@ +dnl pkg-config-based checks for Orc + +dnl specific: +dnl ORC_CHECK([REQUIRED_VERSION]) + +AC_DEFUN([ORC_CHECK], +[ + ORC_REQ=ifelse([$1], , "0.4.6", [$1]) + + AC_ARG_ENABLE(orc, + AC_HELP_STRING([--enable-orc],[use Orc if installed]), + [case "${enableval}" in + auto) enable_orc=auto ;; + yes) enable_orc=yes ;; + no) enable_orc=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-orc) ;; + esac + ], + [enable_orc=auto]) dnl Default value + + if test "x$enable_orc" != "xno" ; then + PKG_CHECK_MODULES(ORC, orc-0.4 >= $ORC_REQ, [ + AC_DEFINE(HAVE_ORC, 1, [Use Orc]) + HAVE_ORC=yes + if test "x$ORCC" = "x" ; then + AC_MSG_CHECKING(for usable orcc) + ORCC=`$PKG_CONFIG --variable=orcc orc-0.4` + dnl check whether the orcc found by pkg-config can be run from the build environment + dnl if this is not the case (e.g. when cross-compiling) fall back to orcc from PATH + AS_IF([$ORCC --version 1> /dev/null 2> /dev/null], [], [ORCC=`which orcc`]) + AC_MSG_RESULT($ORCC) + fi + AC_SUBST(ORCC) + ORCC_FLAGS="--compat $ORC_REQ" + AC_SUBST(ORCC_FLAGS) + AS_IF([test "x$ORCC" = "x"], [HAVE_ORCC=no], [HAVE_ORCC=yes]) + ], [ + if test "x$enable_orc" = "xyes" ; then + AC_MSG_ERROR([--enable-orc specified, but Orc >= $ORC_REQ not found]) + fi + AC_DEFINE(DISABLE_ORC, 1, [Disable Orc]) + HAVE_ORC=no + HAVE_ORCC=no + ]) + else + AC_DEFINE(DISABLE_ORC, 1, [Disable Orc]) + HAVE_ORC=no + HAVE_ORCC=no + fi + AM_CONDITIONAL(HAVE_ORC, [test "x$HAVE_ORC" = "xyes"]) + AM_CONDITIONAL(HAVE_ORCC, [test "x$HAVE_ORCC" = "xyes"]) + +])) + +AC_DEFUN([ORC_OUTPUT], +[ + if test "$HAVE_ORC" = yes ; then + printf "configure: *** Orc acceleration enabled.\n" + else + if test "x$enable_orc" = "xno" ; then + printf "configure: *** Orc acceleration disabled by --disable-orc. Slower code paths\n" + printf " will be used.\n" + else + printf "configure: *** Orc acceleration disabled. Requires Orc >= $ORC_REQ, which was\n" + printf " not found. Slower code paths will be used.\n" + fi + fi + printf "\n" +]) + diff --git a/common/m4/pkg.m4 b/common/m4/pkg.m4 new file mode 100644 index 0000000..996e294 --- /dev/null +++ b/common/m4/pkg.m4 @@ -0,0 +1,157 @@ +# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- +# +# Copyright © 2004 Scott James Remnant . +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# 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. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# PKG_PROG_PKG_CONFIG([MIN-VERSION]) +# ---------------------------------- +AC_DEFUN([PKG_PROG_PKG_CONFIG], +[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) +m4_pattern_allow([^PKG_CONFIG(_PATH)?$]) +AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) +fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=m4_default([$1], [0.9.0]) + AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + PKG_CONFIG="" + fi + +fi[]dnl +])# PKG_PROG_PKG_CONFIG + +# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +# +# Check to see whether a particular set of modules exists. Similar +# to PKG_CHECK_MODULES(), but does not set variables or print errors. +# +# +# Similar to PKG_CHECK_MODULES, make sure that the first instance of +# this or PKG_CHECK_MODULES is called, or make sure to call +# PKG_CHECK_EXISTS manually +# -------------------------------------------------------------- +AC_DEFUN([PKG_CHECK_EXISTS], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +if test -n "$PKG_CONFIG" && \ + AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then + m4_ifval([$2], [$2], [:]) +m4_ifvaln([$3], [else + $3])dnl +fi]) + + +# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) +# --------------------------------------------- +m4_define([_PKG_CONFIG], +[if test -n "$PKG_CONFIG"; then + if test -n "$$1"; then + pkg_cv_[]$1="$$1" + else + PKG_CHECK_EXISTS([$3], + [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], + [pkg_failed=yes]) + fi +else + pkg_failed=untried +fi[]dnl +])# _PKG_CONFIG + +# _PKG_SHORT_ERRORS_SUPPORTED +# ----------------------------- +AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG]) +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi[]dnl +])# _PKG_SHORT_ERRORS_SUPPORTED + + +# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], +# [ACTION-IF-NOT-FOUND]) +# +# +# Note that if there is a possibility the first call to +# PKG_CHECK_MODULES might not happen, you should be sure to include an +# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac +# +# +# -------------------------------------------------------------- +AC_DEFUN([PKG_CHECK_MODULES], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl +AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl + +pkg_failed=no +AC_MSG_CHECKING([for $1]) + +_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) +_PKG_CONFIG([$1][_LIBS], [libs], [$2]) + +m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS +and $1[]_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details.]) + +if test $pkg_failed = yes; then + _PKG_SHORT_ERRORS_SUPPORTED + if test $_pkg_short_errors_supported = yes; then + $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"` + else + $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` + fi + # Put the nasty error message in config.log where it belongs + echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD + + ifelse([$4], , [AC_MSG_ERROR(dnl +[Package requirements ($2) were not met: + +$$1_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +_PKG_TEXT +])], + [AC_MSG_RESULT([no]) + $4]) +elif test $pkg_failed = untried; then + ifelse([$4], , [AC_MSG_FAILURE(dnl +[The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +_PKG_TEXT + +To get pkg-config, see .])], + [$4]) +else + $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS + $1[]_LIBS=$pkg_cv_[]$1[]_LIBS + AC_MSG_RESULT([yes]) + ifelse([$3], , :, [$3]) +fi[]dnl +])# PKG_CHECK_MODULES diff --git a/common/mangle-tmpl.py b/common/mangle-tmpl.py new file mode 100644 index 0000000..51ea8c2 --- /dev/null +++ b/common/mangle-tmpl.py @@ -0,0 +1,165 @@ +# -*- Mode: Python -*- +# vi:si:et:sw=4:sts=4:ts=4 + +""" +use the output from gst-xmlinspect.py to mangle tmpl/*.sgml and +insert/overwrite Short Description and Long Description +""" + +# FIXME: right now it uses pygst and scans on its own; +# we really should use inspect/*.xml instead since the result of +# gst-xmlinspect.py is committed by the docs maintainer, who can be +# expected to have pygst, but this step should be done for every docs build, +# so no pygst allowed + +# read in inspect/*.xml +# for every tmpl/element-(name).xml: mangle with details from element + +from __future__ import print_function, unicode_literals + +import glob +import re +import sys +import os + +class Tmpl: + def __init__(self, filename): + self.filename = filename + self._sectionids = [] + self._sections = {} + + def read(self): + """ + Read and parse the sections from the given file. + """ + lines = open(self.filename).readlines() + matcher = re.compile("\n") + id = None + + for line in lines: + match = matcher.search(line) + if match: + id = match.expand("\\1") + self._sectionids.append(id) + self._sections[id] = [] + else: + if not id: + sys.stderr.write( + "WARNING: line before a SECTION header: %s" % line) + else: + self._sections[id].append(line) + + def get_section(self, id): + """ + Get the content from the given section. + """ + return self._sections[id] + + def set_section(self, id, content): + """ + Replace the given section id with the given content. + """ + self._sections[id] = content + + def output(self): + """ + Return the output of the current template in the tmpl/*.sgml format. + """ + lines = [] + for id in self._sectionids: + lines.append("\n" % id) + for line in self._sections[id]: + lines.append(line) + + return "".join(lines) + + def write(self, backup=False): + """ + Write out the template file again, backing up the previous one. + """ + if backup: + target = self.filename + ".mangle.bak" + os.rename(self.filename, target) + + handle = open(self.filename, "w") + handle.write(self.output()) + handle.close() + +import xml.dom.minidom + +def get_elements(file): + elements = {} + doc = xml.dom.minidom.parse(file) + + elem = None + for e in doc.childNodes: + if e.nodeType == e.ELEMENT_NODE and e.localName == 'plugin': + elem = e + break + if elem == None: + return None + + elem2 = None + for e in elem.childNodes: + if e.nodeType == e.ELEMENT_NODE and e.localName == 'elements': + elem2 = e + break + if elem2 == None: + return None + + elem = elem2 + + for e in elem.childNodes: + if e.nodeType == e.ELEMENT_NODE and e.localName == 'element': + name = None + description = None + + for e2 in e.childNodes: + if e2.nodeType == e2.ELEMENT_NODE and e2.localName == 'name': + name = e2.childNodes[0].nodeValue.encode("UTF-8") + elif e2.nodeType == e2.ELEMENT_NODE and e2.localName == 'description': + if e2.childNodes: + description = e2.childNodes[0].nodeValue.encode("UTF-8") + else: + description = 'No description' + + if name != None and description != None: + elements[name] = {'description': description} + + return elements + +def main(): + if not len(sys.argv) == 3: + sys.stderr.write('Please specify the inspect/ dir and the tmpl/ dir') + sys.exit(1) + + inspectdir = sys.argv[1] + tmpldir = sys.argv[2] + + # parse all .xml files; build map of element name -> short desc + #for file in glob.glob("inspect/plugin-*.xml"): + elements = {} + for file in glob.glob("%s/plugin-*.xml" % inspectdir): + elements.update(get_elements(file)) + + for file in glob.glob("%s/element-*.sgml" % tmpldir): + base = os.path.basename(file) + element = base[len("element-"):-len(".sgml")] + tmpl = Tmpl(file) + tmpl.read() + if element in elements.keys(): + description = elements[element]['description'] + tmpl.set_section("Short_Description", "%s\n\n" % description) + + # put in an include if not yet there + line = '' + \ + '' + \ + '\n' + section = tmpl.get_section("Long_Description") + if not section[0] == line: + section.insert(0, line) + tmpl.set_section("Long_Description", section) + tmpl.write() + +main() diff --git a/common/orc.mak b/common/orc.mak new file mode 100644 index 0000000..a232b5d --- /dev/null +++ b/common/orc.mak @@ -0,0 +1,76 @@ +# +# This is a makefile.am fragment to build Orc code. +# +# Define ORC_SOURCE and then include this file, such as: +# +# ORC_SOURCE=gstadderorc +# include $(top_srcdir)/common/orc.mak +# +# This fragment will create tmp-orc.c and gstadderorc.h from +# gstadderorc.orc. +# +# When 'make dist' is run at the top level, or 'make orc-update' +# in a directory including this fragment, the generated source +# files will be copied to $(ORC_SOURCE)-dist.[ch]. These files +# should be checked in to git, since they are used if Orc is +# disabled. +# +# Note that this file defines BUILT_SOURCES, so any later usage +# of BUILT_SOURCES in the Makefile.am that includes this file +# must use '+='. +# + + +EXTRA_DIST = $(ORC_SOURCE).orc + +ORC_NODIST_SOURCES = tmp-orc.c $(ORC_SOURCE).h +BUILT_SOURCES = tmp-orc.c $(ORC_SOURCE).h + + +orc-update: tmp-orc.c $(ORC_SOURCE).h + $(top_srcdir)/common/gst-indent tmp-orc.c + cp tmp-orc.c $(srcdir)/$(ORC_SOURCE)-dist.c + cp $(ORC_SOURCE).h $(srcdir)/$(ORC_SOURCE)-dist.h + +orcc_v_gen = $(orcc_v_gen_$(V)) +orcc_v_gen_ = $(orcc_v_gen_$(AM_DEFAULT_VERBOSITY)) +orcc_v_gen_0 = @echo " ORCC $@"; + +cp_v_gen = $(cp_v_gen_$(V)) +cp_v_gen_ = $(cp_v_gen_$(AM_DEFAULT_VERBOSITY)) +cp_v_gen_0 = @echo " CP $@"; + +if HAVE_ORCC +tmp-orc.c: $(srcdir)/$(ORC_SOURCE).orc + $(orcc_v_gen)$(ORCC) $(ORCC_FLAGS) --implementation --include glib.h -o tmp-orc.c $(srcdir)/$(ORC_SOURCE).orc + +$(ORC_SOURCE).h: $(srcdir)/$(ORC_SOURCE).orc + $(orcc_v_gen)$(ORCC) $(ORCC_FLAGS) --header --include glib.h -o $(ORC_SOURCE).h $(srcdir)/$(ORC_SOURCE).orc +else +tmp-orc.c: $(srcdir)/$(ORC_SOURCE).orc $(srcdir)/$(ORC_SOURCE)-dist.c + $(cp_v_gen)cp $(srcdir)/$(ORC_SOURCE)-dist.c tmp-orc.c + +$(ORC_SOURCE).h: $(srcdir)/$(ORC_SOURCE).orc $(srcdir)/$(ORC_SOURCE)-dist.c + $(cp_v_gen)cp $(srcdir)/$(ORC_SOURCE)-dist.h $(ORC_SOURCE).h +endif + +clean-local: clean-orc +.PHONY: clean-orc +clean-orc: + rm -f tmp-orc.c $(ORC_SOURCE).h + +dist-hook: dist-hook-orc +.PHONY: dist-hook-orc + +# we try and copy updated orc -dist files below, but don't fail if it +# doesn't work as the srcdir might not be writable +dist-hook-orc: tmp-orc.c $(ORC_SOURCE).h + $(top_srcdir)/common/gst-indent tmp-orc.c + rm -f tmp-orc.c~ + cmp -s tmp-orc.c $(srcdir)/$(ORC_SOURCE)-dist.c || \ + cp tmp-orc.c $(srcdir)/$(ORC_SOURCE)-dist.c || true + cmp -s $(ORC_SOURCE).h $(srcdir)/$(ORC_SOURCE)-dist.h || \ + cp $(ORC_SOURCE).h $(srcdir)/$(ORC_SOURCE)-dist.h || true + cp -p tmp-orc.c $(distdir)/$(ORC_SOURCE)-dist.c + cp -p $(ORC_SOURCE).h $(distdir)/$(ORC_SOURCE)-dist.h + diff --git a/common/parallel-subdirs.mak b/common/parallel-subdirs.mak new file mode 100644 index 0000000..36885df --- /dev/null +++ b/common/parallel-subdirs.mak @@ -0,0 +1,13 @@ +# include this at the end of $MODULE/ext/Makefile.am to force make to +# build subdirectories in parallel when make -jN is used. We will end up +# descending into all subdirectories a second time, but only after the first +# (parallel) run has finished, so it should go right through the second time. + +.PHONY: independent-subdirs $(SUBDIRS) + +independent-subdirs: $(SUBDIRS) + +$(SUBDIRS): + $(MAKE) -C $@ + +all-recursive: independent-subdirs diff --git a/common/plugins.xsl b/common/plugins.xsl new file mode 100644 index 0000000..60515b6 --- /dev/null +++ b/common/plugins.xsl @@ -0,0 +1,209 @@ + + + + + + + + + + + + -plugins- + + + + + + + + + + + + + + Element Information + + + + + plugin + + + + plugin- + + + + + + + + author + + + + + + + class + + + + + + + + + + Element Pads + + + + + name + + + + + + + direction + + + + + + + presence + + + + + + + + + details + + + + + + + + + + + + + + + + + + + + + -plugins-plugin- + + + + + + 3 + FIXME Library + + + + + + + + + + plugin- + + + + + + + Plugin Information + + + + filename + + + + + + + version + + + + + + + run-time license + + + + + + + package + + + + + + + origin + + + + + + + + + + + + + + + + + + + + + + + Elements + + + + + + + + + + + + + + diff --git a/common/po.mak b/common/po.mak new file mode 100644 index 0000000..e019fac --- /dev/null +++ b/common/po.mak @@ -0,0 +1,4 @@ +# rule to download the latest .po files +download-po: $(top_srcdir)/common/download-translations + $(top_srcdir)/common/download-translations $(PACKAGE) + diff --git a/common/release.mak b/common/release.mak new file mode 100644 index 0000000..715657b --- /dev/null +++ b/common/release.mak @@ -0,0 +1,34 @@ +# include this snippet to add a common release: target by using +# include $(top_srcdir)/common/release.mak + +release: dist + @$(MAKE) $(PACKAGE)-$(VERSION).tar.xz.sha256sum + @echo + @echo "=================================================================================================" + @echo "http://gstreamer.freedesktop.org/src/$(PACKAGE)/$(PACKAGE)-$(VERSION).tar.xz" + @cat $(PACKAGE)-$(VERSION).tar.xz.sha256sum + @echo "=================================================================================================" + @if [ -d ~/releases/ ]; then \ + cp -v $(PACKAGE)-$(VERSION).tar.xz ~/releases/; \ + fi + @if [ -d ../www/data/src ]; then \ + mv -v $(PACKAGE)-$(VERSION).tar.xz ../www/data/src/$(PACKAGE)/ ; \ + mv -v $(PACKAGE)-$(VERSION).tar.xz.sha256sum ../www/data/src/$(PACKAGE)/ ; \ + fi + @echo "=================================================================================================" + +# generate sha256 sum files +%.sha256sum: % + @sha256sum $< > $@ + +# check that no marshal or enumtypes files are included +# this in turn ensures that distcheck fails for missing .list files which is currently +# shadowed when the corresponding .c and .h files are included. +distcheck-hook: + @test "x" = "x`find $(distdir) -name \*-enumtypes.[ch] | grep -v win32`" && \ + test "x" = "x`find $(distdir) -name \*-marshal.[ch]`" || \ + ( echo "*** Leftover enumtypes or marshal files in the tarball." && \ + echo "*** Make sure the following files are not disted:" && \ + find $(distdir) -name \*-enumtypes.[ch] | grep -v win32 && \ + find $(distdir) -name \*-marshal.[ch] && \ + false ) diff --git a/common/scangobj-merge.py b/common/scangobj-merge.py new file mode 100755 index 0000000..4a9f1fc --- /dev/null +++ b/common/scangobj-merge.py @@ -0,0 +1,311 @@ +#!/usr/bin/python +# -*- Mode: Python -*- +# vi:si:et:sw=4:sts=4:ts=4 + +""" +parse, merge and write gstdoc-scanobj files +""" + +from __future__ import print_function, unicode_literals + +import sys +import os + +def debug(*args): + pass + +# OrderedDict class based on +# http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/107747 +# Licensed under the Python License +class OrderedDict(dict): + def __init__(self): + self._keys = [] + dict.__init__(self) + + def __delitem__(self, key): + dict.__delitem__(self, key) + self._keys.remove(key) + + def __setitem__(self, key, item): + dict.__setitem__(self, key, item) + if key not in self._keys: self._keys.append(key) + + def clear(self): + dict.clear(self) + self._keys = [] + + def copy(self): + dict = dict.copy(self) + dict._keys = self._keys[:] + return dict + + def items(self): + return zip(self._keys, self.values()) + + def keys(self): + return self._keys + + def popitem(self): + try: + key = self._keys[-1] + except IndexError: + raise KeyError('dictionary is empty') + + val = self[key] + del self[key] + + return (key, val) + + def setdefault(self, key, failobj = None): + dict.setdefault(self, key, failobj) + if key not in self._keys: self._keys.append(key) + + def update(self, dict): + dict.update(self, dict) + for key in dict.keys(): + if key not in self._keys: self._keys.append(key) + + def values(self): + return map(self.get, self._keys) + +class Object: + def __init__(self, name): + self._signals = OrderedDict() + self._args = OrderedDict() + self.name = name + + def __repr__(self): + return "" % self.name + + def add_signal(self, signal, overwrite=True): + if not overwrite and signal.name in self._signals: + raise IndexError("signal %s already in %r" % (signal.name, self)) + self._signals[signal.name] = signal + + def add_arg(self, arg, overwrite=True): + if not overwrite and arg.name in self._args: + raise IndexError("arg %s already in %r" % (arg.name, self)) + self._args[arg.name] = arg + +class Docable: + def __init__(self, **kwargs): + for key in self.attrs: + setattr(self, key, kwargs[key]) + self.dict = kwargs + + def __repr__(self): + return "<%r %s>" % (str(self.__class__), self.name) + +class Signal(Docable): + attrs = ['name', 'returns', 'args'] + +class Arg(Docable): + attrs = ['name', 'type', 'range', 'flags', 'nick', 'blurb', 'default'] + +class GDoc: + def load_file(self, filename): + try: + lines = open(filename).readlines() + self.load_data("".join(lines)) + except IOError: + print ("WARNING - could not read from %s" % filename) + + def save_file(self, filename, backup=False): + """ + Save the information to the given file if the file content changed. + """ + olddata = None + try: + lines = open(filename).readlines() + olddata = "".join(lines) + except IOError: + print ("WARNING - could not read from %s" % filename) + newdata = self.get_data() + if olddata and olddata == newdata: + return + + if olddata: + if backup: + os.rename(filename, filename + '.bak') + + handle = open(filename, "w") + handle.write(newdata) + handle.close() + +class Signals(GDoc): + def __init__(self): + self._objects = OrderedDict() + + def load_data(self, data): + """ + Load the .signals lines, creating our list of objects and signals. + """ + import re + smatcher = re.compile( + '(?s)' # make . match \n + '\n(.*?)\n' + ) + nmatcher = re.compile( + '' + '(?P\S*)' # store object + '::' + '(?P\S*)' # store signal + '' + ) + rmatcher = re.compile( + '(?s)' # make . match \n + '(?P\S*)\n' # store returns + '(?P.*)' # store args + ) + for block in smatcher.findall(data): + nmatch = nmatcher.search(block) + if nmatch: + o = nmatch.group('object') + debug("Found object", o) + debug("Found signal", nmatch.group('signal')) + if o not in self._objects: + object = Object(o) + self._objects[o] = object + + rmatch = rmatcher.search(block) + if rmatch: + dict = rmatch.groupdict().copy() + dict['name'] = nmatch.group('signal') + signal = Signal(**dict) + self._objects[o].add_signal(signal) + + def get_data(self): + lines = [] + for o in self._objects.values(): + for s in o._signals.values(): + block = """ +%(object)s::%(name)s +%(returns)s +%(args)s +""" + d = s.dict.copy() + d['object'] = o.name + lines.append(block % d) + + return "\n".join(lines) + '\n' + +class Args(GDoc): + def __init__(self): + self._objects = OrderedDict() + + def load_data(self, data): + """ + Load the .args lines, creating our list of objects and args. + """ + import re + amatcher = re.compile( + '(?s)' # make . match \n + '\n(.*?)\n' + ) + nmatcher = re.compile( + '' + '(?P\S*)' # store object + '::' + '(?P\S*)' # store arg + '' + ) + rmatcher = re.compile( + '(?s)' # make . match \n + '(?P\S*)\n' # store type + '(?P.*?)\n' # store range + '(?P\S*)\n' # store flags + '(?P.*?)\n' # store nick + '(?P.*?)\n' # store blurb + '(?P.*?)\n' # store default + ) + for block in amatcher.findall(data): + nmatch = nmatcher.search(block) + if nmatch: + o = nmatch.group('object') + debug("Found object", o) + debug("Found arg", nmatch.group('arg')) + if o not in self._objects: + object = Object(o) + self._objects[o] = object + + rmatch = rmatcher.search(block) + if rmatch: + dict = rmatch.groupdict().copy() + dict['name'] = nmatch.group('arg') + arg = Arg(**dict) + self._objects[o].add_arg(arg) + else: + print ("ERROR: could not match arg from block %s" % block) + + def get_data(self): + lines = [] + for o in self._objects.values(): + for a in o._args.values(): + block = """ +%(object)s::%(name)s +%(type)s +%(range)s +%(flags)s +%(nick)s +%(blurb)s +%(default)s + +""" + d = a.dict.copy() + d['object'] = o.name + lines.append(block % d) + + return "\n".join(lines) + '\n' + +class SingleLine(GDoc): + def __init__(self): + self._objects = [] + + def load_data(self, data): + """ + Load the .interfaces/.prerequisites lines, merge duplicates + """ + # split data on '\n' + lines = data.splitlines(); + # merge them into self._objects + for line in lines: + if line not in self._objects: + self._objects.append(line) + + def get_data(self): + lines = sorted(self._objects) + return "\n".join(lines) + '\n' + +def main(argv): + modulename = None + try: + modulename = argv[1] + except IndexError: + sys.stderr.write('Please provide a documentation module name\n') + sys.exit(1) + + signals = Signals() + signals.load_file(modulename + '.signals') + signals.load_file(modulename + '.signals.new') + signals.save_file(modulename + '.signals', backup=True) + os.unlink(modulename + '.signals.new') + + args = Args() + args.load_file(modulename + '.args') + args.load_file(modulename + '.args.new') + args.save_file(modulename + '.args', backup=True) + os.unlink(modulename + '.args.new') + + ifaces = SingleLine() + ifaces.load_file(modulename + '.interfaces') + ifaces.load_file(modulename + '.interfaces.new') + ifaces.save_file(modulename + '.interfaces', backup=True) + os.unlink(modulename + '.interfaces.new') + + prereq = SingleLine() + prereq.load_file(modulename + '.prerequisites') + prereq.load_file(modulename + '.prerequisites.new') + prereq.save_file(modulename + '.prerequisites', backup=True) + os.unlink(modulename + '.prerequisites.new') + +main(sys.argv) diff --git a/common/update-autogen b/common/update-autogen new file mode 100755 index 0000000..d267556 --- /dev/null +++ b/common/update-autogen @@ -0,0 +1,48 @@ +#!/bin/bash + +if [ ! -f "common/update-autogen" ]; then + echo "Run ./common/update-autogen from the top-level source directory of a GStreamer module"; + exit 1; +fi + +if ! ls -1 *.doap 2>/dev/null >/dev/null; then + echo "Could not find *.doap file"; + exit 1; +fi + +PACKAGE=`ls -1 *.doap | head -n1 | sed -e 's/.doap$//'` + +#echo "Package: $PACKAGE" + +DIR=`mktemp -d` +if [[ $? != 0 ]]; then + echo "Could not create temp dir"; + exit 1; +fi + +TEMP_AUTOGEN_SH="$DIR/autogen.sh" +echo "\ +#!/bin/sh +# +# $PACKAGE autogen.sh +# +# Run this to generate all the initial makefiles, etc. +# +# This file has been generated from common/autogen.sh.in via common/update-autogen + +" > $TEMP_AUTOGEN_SH + +sed \ + -e "s/@API_VERSION@/1.0/g" \ + -e "s/@PACKAGE@/$PACKAGE/g" \ + -e "s/@SRCFILE@/$PACKAGE.doap/g" < common/autogen.sh.in >> $TEMP_AUTOGEN_SH + +chmod +x $TEMP_AUTOGEN_SH + +mv $TEMP_AUTOGEN_SH autogen.sh || { + echo "Failed to update autogen.sh" + exit 1; +} +rmdir $DIR + +echo "Updated $PACKAGE autogen.sh" diff --git a/common/update-common b/common/update-common new file mode 100755 index 0000000..ec7566a --- /dev/null +++ b/common/update-common @@ -0,0 +1,109 @@ +#!/bin/bash +# +# This script will update all the modules listed below so that +# common points to master in the common module. +# +# If you have many of the GStreamer modules checked out in a particular +# directory, it's best to run this script from that directory. For +# example, I check everything out in ~/gst, so this file is +# ~/gst/common/update-common. To do an update, I do +# 'cd ~/gst ; ./common/update-common'. This will automatically use +# the refs in your existing checkout when cloning the temporary +# checkout. Alternatively, you can use the reference variable below. +# + +# Set this variable to point to any directory containing existing +# git # checkouts, and git will pull objects from there, decreasing +# network usage. +BRANCH=master +reference=~/gst +PUSHURL=ssh://git.freedesktop.org/git/gstreamer + +set -e +set -x + +modules="gstreamer gst-plugins-base gst-plugins-good gst-plugins-bad \ + gst-plugins-ugly gst-libav gst-omx \ + gnonlin gst-rtsp-server gst-editing-services" + +topdir=`pwd` +dir=`mktemp -d $topdir/common-update-XXXXXX` + +for module in $modules +do + cd $dir + if test -e $reference/$module/.git ; then + pushd $reference/$module + PUSHURL=`git config remote.origin.url | sed 's@\(git/gstreamer\).*@\1@'` + popd + git clone --reference $reference/$module/.git --shared ssh://git.freedesktop.org/git/gstreamer/$module + elif test -e $topdir/$module/.git ; then + pushd $topdir/$module + PUSHURL=`git config remote.origin.url | sed 's@\(git/gstreamer\).*@\1@'` + popd + git clone --reference $topdir/$module/.git --shared $PUSHURL/$module + else + git clone $PUSHURL/$module + fi + cd $dir/$module + + # ignore modules that don't have such a branch + if ! git show-ref origin/$BRANCH >/dev/null; then + continue; + fi + + if test $BRANCH = 'master'; then + git checkout $BRANCH + else + git checkout -b $BRANCH origin/$BRANCH + fi + + git submodule init + git submodule update + cd $dir/$module/common + ref_from=`git log --pretty=format:%h -n 1 HEAD` + if test $BRANCH = 'master'; then + git checkout $BRANCH + else + git checkout -b $BRANCH origin/$BRANCH + fi + git pull origin + ref_to=`git log --pretty=format:%h -n 1 HEAD` + echo updating common from $ref_from to $ref_to + if [ "$ref_from" != "$ref_to" ] ; then + cd $dir/$module + # update autogen.sh for selected modules + case $module in + gstreamer|gst-plugins-base|gst-plugins-good|gst-plugins-ugly|gst-plugins-bad|gst-libav|gst-editing-services ) + ./common/update-autogen + git add autogen.sh + ;; + *) + ;; + esac + # update README and MAINTAINERS for selected modules + case $module in + gstreamer|gst-plugins-base|gst-plugins-good|gst-plugins-ugly|gst-plugins-bad ) + ./common/update-readmes --run-git-add + ;; + *) + ;; + esac + # and finally update the common submodule + git add common + git commit -m "Automatic update of common submodule + +From $ref_from to $ref_to" + fi + cd $dir +done + +for module in $modules +do + cd $dir/$module + if git show-ref origin/$BRANCH >/dev/null; then + git push origin $BRANCH + fi +done + +rm -rf $dir diff --git a/common/update-readmes b/common/update-readmes new file mode 100755 index 0000000..1eb9912 --- /dev/null +++ b/common/update-readmes @@ -0,0 +1,42 @@ +#!/bin/bash +# +# update-readmes +# +# Updates a module's README and MAINTAINERS files from the copy in the +# common submodule. + +README_FILES="README README.static-linking MAINTAINERS" + +if [ ! -f "common/update-readmes" -o ! -f configure.ac ]; then + echo "Run ./common/update-readmes from the top-level source directory of a GStreamer module"; + exit 1; +fi + +MAJOR_VERSION=`grep '^AC_INIT' configure.ac | sed -e 's/[^0-9]*\([0-9]\)\.\([0-9]*\).*/\1/'` +MINOR_VERSION=`grep '^AC_INIT' configure.ac | sed -e 's/[^0-9]*\([0-9]\)\.\([0-9]*\).*/\2/'` + +if test x$MAJOR_VERSION = x -o x$MINOR_VERSION = x ; then + echo "Failed to extract major/minor version"; + exit 1; +fi + +let m=$MINOR_VERSION%2 +if test $m = 0; then + SERIES_VERSION="$MAJOR_VERSION.$MINOR_VERSION.x stable series" +else + SERIES_VERSION="$MAJOR_VERSION.$MINOR_VERSION.x development series" +fi +#echo "$SERIES_VERSION" + +for f in $README_FILES ; do + cp --preserve "common/$f" $f || { + echo "Failed to update $f" + exit 1; + } +done + +sed -i "s/@SERIES_VERSION@/$SERIES_VERSION/g" README + +if test x$1 = "x--run-git-add"; then + git add $README_FILES; +fi diff --git a/common/upload-doc.mak b/common/upload-doc.mak new file mode 100644 index 0000000..c1c4945 --- /dev/null +++ b/common/upload-doc.mak @@ -0,0 +1,64 @@ +# this snippet is to be included by both our docbook manuals +# and gtk-doc API references + +# it adds an upload target to each of these dir's Makefiles + +# each Makefile.am should define the following variables: +# - DOC: the base name of the documentation +# (faq, manual, pwg, gstreamer, gstreamer-libs) +# - FORMATS: the formats in which DOC is output +# (html ps pdf) + +# if you want to use it, make sure your $HOME/.ssh/config file contains the +# correct User entry for the Host entry for the DOC_SERVER + +# these variables define the location of the online docs +DOC_SERVER = gstreamer.freedesktop.org +DOC_BASE = /srv/gstreamer.freedesktop.org/www/data/doc +DOC_URL = $(DOC_SERVER):$(DOC_BASE) + +upload: $(FORMATS) + @if echo $(FORMATS) | grep html > /dev/null; then \ + echo "Preparing docs for upload (rebasing cross-references) ..." ; \ + if test x$(builddir) != x$(srcdir); then \ + echo "make upload can only be used if srcdir == builddir"; \ + exit 1; \ + fi; \ + # gtkdoc-rebase sometimes gets confused, so reset everything to \ + # local links before rebasing to online links \ + gtkdoc-rebase --html-dir=$(builddir)/html 2>/dev/null 2>/dev/null ; \ + rebase=`gtkdoc-rebase --verbose --online --html-dir=$(builddir)/html` ; \ + echo "$$rebase" | grep -e "On-*line"; \ + for req in glib gobject gstreamer gstreamer-libs gst-plugins-base-libs; do \ + if ! ( echo "$$rebase" | grep -i -e "On-*line.*/$$req/" ); then \ + echo "===============================================================================" ; \ + echo " Could not determine online location for $$req docs. Cross-referencing will be " ; \ + echo " broken, so not uploading. Make sure the library's gtk-doc documentation is " ; \ + echo " installed somewhere in /usr/share/gtk-doc. " ; \ + echo "===============================================================================" ; \ + exit 1; \ + fi; \ + done; \ + export SRC="$$SRC html"; \ + fi; \ + if echo $(FORMATS) | grep ps > /dev/null; then export SRC="$$SRC $(DOC).ps"; fi; \ + if echo $(FORMATS) | grep pdf > /dev/null; then export SRC="$$SRC $(DOC).pdf"; fi; \ + \ + # upload releases to both X.Y/ and head/ subdirectories \ + export DIR=$(DOC_BASE)/gstreamer/$(PACKAGE_VERSION_MAJOR).$(PACKAGE_VERSION_MINOR)/$(DOC); \ + echo Uploading $$SRC to $(DOC_SERVER):$$DIR; \ + ssh $(DOC_SERVER) mkdir -p $$DIR; \ + rsync -rv -e ssh --delete $$SRC $(DOC_SERVER):$$DIR; \ + ssh $(DOC_SERVER) chmod -R g+w $$DIR; \ + \ + export DIR=$(DOC_BASE)/gstreamer/head/$(DOC); \ + echo Uploading $$SRC to $(DOC_SERVER):$$DIR; \ + ssh $(DOC_SERVER) mkdir -p $$DIR; \ + rsync -rv -e ssh --delete $$SRC $(DOC_SERVER):$$DIR; \ + ssh $(DOC_SERVER) chmod -R g+w $$DIR; \ + \ + if echo $(FORMATS) | grep html > /dev/null; then \ + echo "Un-preparing docs for upload (rebasing cross-references) ..." ; \ + gtkdoc-rebase --html-dir=$(builddir)/html ; \ + fi; \ + echo Done diff --git a/common/win32.mak b/common/win32.mak new file mode 100644 index 0000000..30e347e --- /dev/null +++ b/common/win32.mak @@ -0,0 +1,78 @@ +# various tests to make sure we dist the win32 stuff (for MSVC builds) right + +# the MANIFEST contains all win32 related files that should be disted +win32 = $(shell cat $(top_srcdir)/win32/MANIFEST) + +# wildcard is apparently not portable to other makes, hence the use of find +# these are library .def files with the symbols to export +win32defs = $(shell find $(top_srcdir)/win32/common -name '*.def') + +# wildcard is apparently not portable to other makes, hence the use of find +# these are files that need to be disted with CRLF line endings: +win32crlf = $(shell find $(top_srcdir)/win32 -name '*.dsw' -o -name '*.dsp') + +win32-debug: + @echo; \ + echo win32 = $(win32); \ + echo; \ + echo win32defs = $(win32defs); \ + echo; \ + echo win32crlf = $(win32crlf); \ + echo + +win32-check-crlf: + @echo Checking win32 files for CR LF line endings ...; \ + fail=0 ; \ + for each in $(win32crlf) ; do \ + result=`perl -e 'print grep(/\r\n/,<>)' "$$each" | wc -l`; \ + if test "$$result" = 0 ; then \ + echo $$each must be fixed to have CRLF line endings ; \ + fail=1; \ + fi ; \ + done ; \ + exit $$fail + +# make sure all symbols we export on linux are defined in the win32 .def too +# (don't care about other unixes for now, it's enough if it works on one of +# the linux build bots; we assume .so ) +check-exports: + @fail=0 ; \ + for l in $(win32defs); do \ + libbase=`basename "$$l" ".def"`; \ + libso=`find "$(top_builddir)" -name "$$libbase-@GST_API_VERSION@.so" | grep -v /_build/ | head -n1`; \ + libdef="$(top_srcdir)/win32/common/$$libbase.def"; \ + if test "x$$libso" != "x"; then \ + echo Checking symbols in $$libso; \ + if ! ($(top_srcdir)/common/check-exports $$libdef $$libso) ; then \ + fail=1; \ + fi; \ + fi; \ + done ; \ + if test $$fail != 0; then \ + echo '-----------------------------------------------------------'; \ + echo 'Run this to update the .def files:'; \ + echo 'make update-exports'; \ + echo '-----------------------------------------------------------'; \ + fi; \ + exit $$fail + +update-exports: + make check-exports 2>&1 | patch -p1 + git add win32/common/libgst*.def + git diff --cached -- win32/common/ + echo '^^^--- updated and staged changes above' + +# complain about nonportable printf format strings (%lld, %llu, %zu etc.) +check-nonportable-print-format: + @fail=0 ; \ + loc=`find "$(top_srcdir)" -name '*.c' | xargs grep -n -e '%[0-9]*ll[udx]' -e '%[0-9]*z[udx]'`; \ + if test "x$$loc" != "x"; then \ + echo "Please fix the following print format strings:" ; \ + find "$(top_srcdir)" -name '*.c' | xargs grep -n -e '%[0-9]*ll[udx]' -e '%[0-9]*z[udx]'; \ + fail=1; \ + fi; \ + exit $$fail + +dist-hook: check-exports win32-check-crlf + + diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..9774fee --- /dev/null +++ b/configure.ac @@ -0,0 +1,157 @@ +AC_PREREQ([2.68]) + +dnl initialize autoconf +dnl when going to/from release please set the nano (fourth number) right ! +dnl releases only do Wall, cvs and prerelease does Werror too +AC_INIT(GStreamer GObject Introspection overrides for Python , 1.5.2.1, + http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer, + gst-python) + +AG_GST_INIT + +dnl initialize automake +AM_INIT_AUTOMAKE([-Wno-portability 1.11 no-dist-gzip dist-xz tar-ustar subdir-objects]) + +dnl define PACKAGE_VERSION_* variables +AS_VERSION + +dnl check if this is a release version +AS_NANO(GST_GIT="no", GST_GIT="yes") + +dnl can autoconf find the source ? +# FIXME Port testsuite to 1.0 +# AC_CONFIG_SRCDIR([testsuite/common.py]) + +dnl define the output header for config +AC_CONFIG_HEADERS([config.h]) + +dnl AM_MAINTAINER_MODE only provides the option to configure to enable it +AM_MAINTAINER_MODE([enable]) + +dnl use pretty build output with automake >= 1.11 +m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])], + [AM_DEFAULT_VERBOSITY=1 + AC_SUBST(AM_DEFAULT_VERBOSITY)]) + +dnl Add parameters for aclocal +AC_SUBST(ACLOCAL_AMFLAGS, "-I m4 -I common/m4") + +dnl required versions of other packages +dnl Note that they are runtime requirements +AC_SUBST(GST_REQ, 1.4.0) +AC_SUBST(PYGOBJECT_REQ, 3.0) + +AC_DISABLE_STATIC + +LT_PREREQ([2.2.6]) +LT_INIT([dlopen win32-dll disable-static]) + +dnl find a compiler +AC_PROG_CC +AC_PROG_CC_STDC + +dnl check if the compiler supports '-c' and '-o' options +AM_PROG_CC_C_O + +dnl check for python +dnl AM_PATH_PYTHON(2.7) +AM_PATH_PYTHON +AC_MSG_CHECKING(for python >= 2.7) +prog=" +import sys, string +minver = (2,7,0,'final',0) +if sys.version_info < minver: + sys.exit(1) +sys.exit(0)" + +dnl check for GStreamer +GST_API_VERSION=1.0 +AC_SUBST(GST_API_VERSION) +PKG_CHECK_MODULES(GST, gstreamer-$GST_API_VERSION >= $GST_REQ) +AC_DEFINE_UNQUOTED(GST_API_VERSION, "$GST_API_VERSION", [Gst API version]) +GST_CFLAGS="$GST_CFLAGS $GLIB_EXTRA_CFLAGS" +AC_SUBST(GST_CFLAGS) +AC_SUBST(GST_LIBS) + + +dnl check for pygobject +PKG_CHECK_MODULES(PYGOBJECT, pygobject-3.0 >= $PYGOBJECT_REQ) +AC_SUBST(PYGOBJECT_CFLAGS) + +dnl check for python +if $PYTHON -c "$prog" 1>&AC_FD_CC 2>&AC_FD_CC +then + AC_MSG_RESULT(okay) +else + AC_MSG_ERROR(too old) +fi + +# - 'SO' for PyPy, CPython 2.7-3.2 +# - 'EXT_SUFFIX' for CPython3.3+ (http://bugs.python.org/issue16754) +# - fallback to '.so' +PYTHON_SO=`$PYTHON -c "import distutils.sysconfig, sys; get = distutils.sysconfig.get_config_var; sys.stdout.write(get('EXT_SUFFIX') or get('SO') or '.so');"` +AC_SUBST(PYTHON_SO) + +AM_CHECK_PYTHON_HEADERS(,[AC_MSG_ERROR(could not find Python headers)]) +AS_AC_EXPAND(PYTHONDIR, $pythondir) +AS_AC_EXPAND(PYEXECDIR, $pyexecdir) + +AC_ARG_WITH([pygi_overrides_dir], + AC_HELP_STRING([--with-pygi-overrides-dir], [Path to pygobject overrides directory])) + +AC_MSG_CHECKING(for pygobject overrides directory) +if test "x$with_pygi_overrides_dir" = "x" ; then + overrides_dir="`$PYTHON -c 'import gi; print(gi._overridesdir)' 2>/dev/null`" + # fallback if the previous failed + if test "x$overrides_dir" = "x" ; then + overrides_dir="${pyexecdir}/gi/overrides" + fi +else + overrides_dir="$with_pygi_overrides_dir" +fi + +PYGI_OVERRIDES_DIR="$overrides_dir" +AC_SUBST(PYGI_OVERRIDES_DIR) +AC_MSG_RESULT($PYGI_OVERRIDES_DIR) + +dnl check for GStreamer +GST_API_VERSION=1.0 +AC_SUBST(GST_API_VERSION) +PKG_CHECK_MODULES(GST, gstreamer-$GST_API_VERSION >= $GST_REQ) +AC_DEFINE_UNQUOTED(GST_API_VERSION, "$GST_API_VERSION", [Gst API version]) +GST_CFLAGS="$GST_CFLAGS $GLIB_EXTRA_CFLAGS" +AC_SUBST(GST_CFLAGS) +AC_SUBST(GST_LIBS) + +AG_GST_SET_PLUGINDIR + +dnl check for pygobject +PKG_CHECK_MODULES(PYGOBJECT, pygobject-3.0 >= $PYGOBJECT_REQ) +AC_SUBST(PYGOBJECT_CFLAGS) + +dnl and set the override directory +AC_ARG_WITH([pygi_overrides_dir], + AC_HELP_STRING([--with-pygi-overrides-dir], [Path to pygobject overrides directory])) + +AM_CHECK_PYTHON_LIBS(, AC_MSG_ERROR([Python libs not found. Windows requires Python modules to be explicitly linked to libpython.])) + +AG_GST_VALGRIND_CHECK + +dnl set release date/time +#AG_GST_SET_PACKAGE_RELEASE_DATETIME_WITH_NANO([$PACKAGE_VERSION_NANO], + #["${srcdir}/gst-python.doap"], + #[$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR.$PACKAGE_VERSION_MICRO]) + +# Examples and testsuite need to be ported to 1.0 +# examples/Makefile +# testsuite/Makefile + +AC_OUTPUT([ + Makefile + common/Makefile + common/m4/Makefile + gi/Makefile + plugin/Makefile + testsuite/Makefile + gi/overrides/Makefile +]) diff --git a/env b/env new file mode 100755 index 0000000..c52ab9d --- /dev/null +++ b/env @@ -0,0 +1,15 @@ +#!/bin/bash + +thisdir=$(cd `dirname $0` && pwd) + +if [[ -n $PYTHONPATH ]]; then + export PYTHONPATH=$thisdir:$PYTHONPATH +else + export PYTHONPATH=$thisdir +fi + +export PKG_CONFIG_PATH=$thisdir/pkgconfig:$PKG_CONFIG_PATH + +export PACKAGES="pygst $PACKAGES" + +exec "$@" diff --git a/examples/plugins/python/sinkelement.py b/examples/plugins/python/sinkelement.py new file mode 100644 index 0000000..639d9b8 --- /dev/null +++ b/examples/plugins/python/sinkelement.py @@ -0,0 +1,52 @@ +#!/usr/bin/env python +# -*- Mode: Python -*- +# vi:si:et:sw=4:sts=4:ts=4 + +# sinkelement.py +# (c) 2005 Edward Hervey +# (c) 2007 Jan Schmidt +# Licensed under LGPL +# +# Small test application to show how to write a sink element +# in 20 lines in python and place into the gstreamer registry +# so it can be autoplugged or used from parse_launch. +# +# Run this script with GST_DEBUG=python:5 to see the debug +# messages + +from gi.repository import Gst, GObject + +# +# Simple Sink element created entirely in python +# +class MySink(Gst.Element): + __gstmetadata__ = ('CustomSink','Sink', \ + 'Custom test sink element', 'Edward Hervey') + + __gsttemplates__ = Gst.PadTemplate.new ("sinkpadtemplate", + Gst.PadDirection.SINK, + Gst.PadPresence.ALWAYS, + Gst.Caps.new_any()) + + def __init__(self): + Gst.Element.__init__(self) + Gst.info('creating sinkpad') + self.sinkpad = Gst.Pad.new_from_template(self.__gsttemplates__, "sink") + Gst.info('adding sinkpad to self') + self.add_pad(self.sinkpad) + + Gst.info('setting chain/event functions') + self.sinkpad.set_chain_function(self.chainfunc) + self.sinkpad.set_event_function(self.eventfunc) + st = Gst.Structure.from_string("yes,fps=1/2")[0] + + def chainfunc(self, pad, buffer): + Gst.info("%s timestamp(buffer):%d" % (pad, buffer.pts)) + return Gst.FlowReturn.OK + + def eventfunc(self, pad, event): + Gst.info("%s event:%r" % (pad, event.type)) + return True + +GObject.type_register(MySink) +__gstelementfactory__ = ("mysink", Gst.Rank.NONE, MySink) diff --git a/gi/Makefile.am b/gi/Makefile.am new file mode 100644 index 0000000..eeba093 --- /dev/null +++ b/gi/Makefile.am @@ -0,0 +1 @@ +SUBDIRS = overrides diff --git a/gi/__init__.py b/gi/__init__.py new file mode 100644 index 0000000..4b1883c --- /dev/null +++ b/gi/__init__.py @@ -0,0 +1,29 @@ +#!/usr/bin/env python +# +# __init__.py +# +# Copyright (C) 2012 Thibault Saunier +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this program; if not, write to the +# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. + + +from pkgutil import extend_path + +__path__ = extend_path(__path__, __name__) diff --git a/gi/overrides/Gst.py b/gi/overrides/Gst.py new file mode 100644 index 0000000..f306fc5 --- /dev/null +++ b/gi/overrides/Gst.py @@ -0,0 +1,395 @@ +# -*- Mode: Python; py-indent-offset: 4 -*- +# vim: tabstop=4 shiftwidth=4 expandtab +# +# Gst.py +# +# Copyright (C) 2012 Thibault Saunier +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this program; if not, write to the +# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. + +import sys +import inspect +from ..overrides import override +from ..importer import modules + + +if sys.version_info >= (3, 0): + _basestring = str + _callable = lambda c: hasattr(c, '__call__') +else: + _basestring = basestring + _callable = callable + +Gst = modules['Gst']._introspection_module +__all__ = [] + +if Gst._version == '0.10': + import warnings + warn_msg = "You have imported the Gst 0.10 module. Because Gst 0.10 \ +was not designed for use with introspection some of the \ +interfaces and API will fail. As such this is not supported \ +by the GStreamer development team and we encourage you to \ +port your app to Gst 1 or greater. gst-python is the recomended \ +python module to use with Gst 0.10" + + warnings.warn(warn_msg, RuntimeWarning) + +class Bin(Gst.Bin): + def __init__(self, name=None): + Gst.Bin.__init__(self, name=name) + + def add(self, *args): + for arg in args: + if not Gst.Bin.add(self, arg): + raise AddError(arg) + +Bin = override(Bin) +__all__.append('Bin') + +class Caps(Gst.Caps): + + def __nonzero__(self): + return not self.is_empty() + + def __new__(cls, *kwargs): + if not kwargs: + return Caps.new_empty() + elif len(kwargs) > 1: + raise TypeError("wrong arguments when creating GstCaps object") + elif isinstance(kwargs[0], str): + return Caps.from_string(kwargs[0]) + elif isinstance(kwargs[0], Caps): + return kwargs[0].copy() + + raise TypeError("wrong arguments when creating GstCaps object") + + def __init__(self, *args, **kwargs): + return super(Caps, self).__init__() + + def __str__(self): + return self.to_string() + + def __getitem__(self, index): + if index >= self.get_size(): + raise IndexError('structure index out of range') + return self.get_structure(index) + + def __len__(self): + return self.get_size() + +Caps = override(Caps) +__all__.append('Caps') + +class Pad(Gst.Pad): + def __init__(self): + self._real_chain_func = None + self._real_event_func = None + self._real_query_func = None + + def _chain_override(self, pad, parent, buf): + return self._real_chain_func(pad, buf) + + def _event_override(self, pad, parent, event): + return self._real_event_func(pad, event) + + def _query_override(self, pad, parent, query): + query.mini_object.refcount -= 1 + try: + res = self._real_query_func(pad, query) + except TypeError: + try: + res = self._real_query_func(pad, parent, query) + except TypeError: + raise TypeError("Invalid query method %s, 2 or 3 arguments requiered" + % self._real_query_func) + query.mini_object.refcount += 1 + + return res + + def set_chain_function(self, func): + self._real_chain_func = func + self.set_chain_function_full(self._chain_override, None) + + def set_event_function(self, func): + self._real_event_func = func + self.set_event_function_full(self._event_override, None) + + def set_query_function(self, func): + self._real_query_func = func + self.set_query_function_full(self._chain_override, None) + + def set_query_function_full(self, func, udata): + self._real_query_func = func + self._real_set_query_function_full(self._query_override, None) + + def query_caps(self, filter=None): + return Gst.Pad.query_caps(self, filter) + + def link(self, pad): + ret = Gst.Pad.link(self, pad) + if ret != Gst.PadLinkReturn.OK: + raise LinkError(ret) + return ret + +Pad._real_set_query_function_full = Gst.Pad.set_query_function_full +Pad = override(Pad) +__all__.append('Pad') + +class GhostPad(Gst.GhostPad): + def __init__(self, name, target=None, direction=None): + if direction is None: + if target is None: + raise TypeError('you must pass at least one of target' + 'and direction') + direction = target.props.direction + + Gst.GhostPad.__init__(self, name=name, direction=direction) + self.construct() + if target is not None: + self.set_target(target) + + def query_caps(self, filter=None): + return Gst.GhostPad.query_caps(self, filter) + +GhostPad = override(GhostPad) +__all__.append('GhostPad') + +class IteratorError(Exception): + pass +__all__.append('IteratorError') + +class AddError(Exception): + pass +__all__.append('AddError') + +class LinkError(Exception): + pass +__all__.append('LinkError') + +class Iterator(Gst.Iterator): + def __iter__(self): + while True: + result, value = self.next() + if result == Gst.IteratorResult.DONE: + break + + if result != Gst.IteratorResult.OK: + raise IteratorError(result) + + yield value + +Iterator = override(Iterator) +__all__.append('Iterator') + + +class ElementFactory(Gst.ElementFactory): + + # ElementFactory + def get_longname(self): + return self.get_metadata("long-name") + + def get_description(self): + return self.get_metadata("description") + + def get_klass(self): + return self.get_metadata("klass") + + @classmethod + def make(cls, factory_name, instance_name=None): + return Gst.ElementFactory.make(factory_name, instance_name) + +class Pipeline(Gst.Pipeline): + def __init__(self, name=None): + Gst.Pipeline.__init__(self, name=name) + +Pipeline = override(Pipeline) +__all__.append('Pipeline') + +class Structure(Gst.Structure): + def __getitem__(self, key): + return self.get_value(key) + + def __setitem__(self, key, value): + return self.set_value(key, value) + +Structure = override(Structure) +__all__.append('Structure') + +ElementFactory = override(ElementFactory) +__all__.append('ElementFactory') + +class Fraction(Gst.Fraction): + def __init__(self, num, denom=1): + def __gcd(a, b): + while b != 0: + tmp = a + a = b + b = tmp % b + return abs(a) + + def __simplify(): + num = self.num + denom = self.denom + + if num < 0: + num = -num + denom = -denom + + # Compute greatest common divisor + gcd = __gcd(num, denom) + if gcd != 0: + num /= gcd + denom /= gcd + + self.num = num + self.denom = denom + + self.num = num + self.denom = denom + + __simplify() + self.type = "fraction" + + def __repr__(self): + return '' % (self.num, self.denom) + + def __value__(self): + return self.num / self.denom + + def __eq__(self, other): + if isinstance(other, Fraction): + return self.num * other.denom == other.num * self.denom + return False + + def __ne__(self, other): + return not self.__eq__(other) + + def __mul__(self, other): + if isinstance(other, Fraction): + return Fraction(self.num * other.num, + self.denom * other.denom) + elif isinstance(other, int): + return Fraction(self.num * other, self.denom) + raise TypeError + + __rmul__ = __mul__ + + def __truediv__(self, other): + if isinstance(other, Fraction): + return Fraction(self.num * other.denom, + self.denom * other.num) + elif isinstance(other, int): + return Fraction(self.num, self.denom * other) + return TypeError + + __div__ = __truediv__ + + def __rtruediv__(self, other): + if isinstance(other, int): + return Fraction(self.denom * other, self.num) + return TypeError + + __rdiv__ = __rtruediv__ + + def __float__(self): + return float(self.num) / float(self.denom) + +Fraction = override(Fraction) +__all__.append('Fraction') + +def TIME_ARGS(time): + if time == Gst.CLOCK_TIME_NONE: + return "CLOCK_TIME_NONE" + + return "%u:%02u:%02u.%09u" % (time / (Gst.SECOND * 60 * 60), + (time / (Gst.SECOND * 60)) % 60, + (time / Gst.SECOND) % 60, + time % Gst.SECOND) +__all__.append('TIME_ARGS') + +from . import _gi_gst +_gi_gst + +# maybe more python and less C some day if core turns a bit more introspection +# and binding friendly in the debug area +Gst.log = _gi_gst.log +Gst.debug = _gi_gst.debug +Gst.info = _gi_gst.info +Gst.warning = _gi_gst.warning +Gst.error = _gi_gst.error +Gst.fixme = _gi_gst.fixme +Gst.memdump = _gi_gst.memdump + +# Make sure PyGst is not usable if GStreamer has not been initialized +class NotInitialized(Exception): + pass +__all__.append('NotInitialized') + +def fake_method(*args): + raise NotInitialized("Please call Gst.init(argv) before using GStreamer") + + +real_functions = [o for o in inspect.getmembers(Gst) if isinstance(o[1], type(Gst.init))] + +class_methods = [] +for cname_klass in [o for o in inspect.getmembers(Gst) if isinstance(o[1], type(Gst.Element)) or isinstance(o[1], type(Gst.Caps))]: + class_methods.append((cname_klass, + [(o, cname_klass[1].__dict__[o]) + for o in cname_klass[1].__dict__ + if isinstance(cname_klass[1].__dict__[o], type(Gst.init))])) + +def init_pygst(): + for fname, function in real_functions: + if fname not in ["init", "init_check", "deinit"]: + setattr(Gst, fname, function) + + for cname_class, methods in class_methods: + for mname, method in methods: + setattr(cname_class[1], mname, method) + + +def deinit_pygst(): + for fname, func in real_functions: + if fname not in ["init", "init_check", "deinit"]: + setattr(Gst, fname, fake_method) + for cname_class, methods in class_methods: + for mname, method in methods: + setattr(cname_class[1], mname, fake_method) + +real_init = Gst.init +def init(argv): + init_pygst() + return real_init(argv) +Gst.init = init + +real_init_check = Gst.init_check +def init_check(argv): + init_pygst() + return real_init_check(argv) +Gst.init_check = init_check + +real_deinit = Gst.deinit +def deinit(): + deinit_pygst() + return real_deinit() + +Gst.deinit = deinit + +deinit_pygst() diff --git a/gi/overrides/GstPbutils.py b/gi/overrides/GstPbutils.py new file mode 100644 index 0000000..db16baf --- /dev/null +++ b/gi/overrides/GstPbutils.py @@ -0,0 +1,76 @@ +# -*- Mode: Python; py-indent-offset: 4 -*- +# vim: tabstop=4 shiftwidth=4 expandtab +# +# Gst.py +# +# Copyright (C) 2012 Alessandro Decina +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this program; if not, write to the +# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. + +from ..overrides import override as override_ +from ..importer import modules + +from gi.repository import Gst + +GstPbutils = modules['GstPbutils']._introspection_module +__all__ = [] + +def override(cls): + name = cls.__name__ + globals()[name] = override_(cls) + __all__.append(name) + + return cls + +@override +class EncodingVideoProfile(GstPbutils.EncodingVideoProfile): + def __init__(self, format, preset=None, restriction=None, presence=0): + GstPbutils.EncodingVideoProfile.__init__(self) + self.set_format(format) + if preset is not None: + self.set_preset(preset) + if restriction is None: + restriction = Gst.Caps('ANY') + self.set_restriction(restriction) + self.set_presence(presence) + +@override +class EncodingAudioProfile(GstPbutils.EncodingAudioProfile): + def __init__(self, format, preset=None, restriction=None, presence=0): + GstPbutils.EncodingAudioProfile.__init__(self) + self.set_format(format) + if preset is not None: + self.set_preset(preset) + if restriction is None: + restriction = Gst.Caps('ANY') + self.set_restriction(restriction) + self.set_presence(presence) + +@override +class EncodingContainerProfile(GstPbutils.EncodingContainerProfile): + def __init__(self, name, description, format, preset=None): + GstPbutils.EncodingContainerProfile.__init__(self) + self.set_format(format) + if name is not None: + self.set_name(name) + if description is not None: + self.set_description(description) + if preset is not None: + self.set_preset(preset) diff --git a/gi/overrides/Makefile.am b/gi/overrides/Makefile.am new file mode 100644 index 0000000..a1f23ea --- /dev/null +++ b/gi/overrides/Makefile.am @@ -0,0 +1,37 @@ +common_cflags = $(PYGOBJECT_CFLAGS) $(GST_CFLAGS) -fno-strict-aliasing +common_libadd = $(GST_LIBS) $(PYGOBJECT_LIBS) +common_ldflags = -module -avoid-version -shrext $(PYTHON_SO) + +# We install everything in the gi/overrides folder +#pygioverridesdir = $(PYGI_OVERRIDES_DIR) +#pygioverrides_PYTHON = Gst.py GstPbutils.py + +pygioverridesexecdir = $(PYGI_OVERRIDES_DIR) + +EXTRA_DIST = Gst.py + +AM_CPPFLAGS = $(PYTHON_INCLUDES) + +pygioverridesexec_LTLIBRARIES = _gi_gst.la + +_gi_gst_la_SOURCES = gstmodule.c +_gi_gst_la_CFLAGS = $(common_cflags) +_gi_gst_la_LIBADD = $(common_libadd) +_gi_gst_la_LDFLAGS = $(common_ldflags) + +# if we build in a separate tree, we need to symlink the *.so files from the +# source tree; Python does not accept the extensions and modules in different +# paths +build_pylinks: + for f in $(pygioverrides_PYTHON) __init__.py; do \ + [ -e $(builddir)/$$f ] || $(LN_S) -f $(srcdir)/$$f $(builddir)/$$f; \ + done + +all: $(pygioverridesexec_LTLIBRARIES:.la=$(PYTHON_SO)) build_pylinks +check-local: $(pygioverridesexec_LTLIBRARIES:.la=$(PYTHON_SO)) build_pylinks +clean-local: + rm -f $(pygioverridesexec_LTLIBRARIES:.la=$(PYTHON_SO)) + +%$(PYTHON_SO): %.la + $(LN_S) -f .libs/$@ $@ + diff --git a/gi/overrides/Makefile.am~ b/gi/overrides/Makefile.am~ new file mode 100644 index 0000000..ee94f7c --- /dev/null +++ b/gi/overrides/Makefile.am~ @@ -0,0 +1,37 @@ +common_cflags = $(PYGOBJECT_CFLAGS) $(GST_CFLAGS) -fno-strict-aliasing +common_libadd = $(GST_LIBS) $(PYGOBJECT_LIBS) +common_ldflags = -module -avoid-version -shrext $(PYTHON_SO) + +# We install everything in the gi/overrides folder +pygioverridesdir = $(PYGI_OVERRIDES_DIR) +pygioverrides_PYTHON = Gst.py GstPbutils.py + +pygioverridesexecdir = $(PYGI_OVERRIDES_DIR) + +EXTRA_DIST = Gst.py + +AM_CPPFLAGS = $(PYTHON_INCLUDES) + +pygioverridesexec_LTLIBRARIES = _gi_gst.la + +_gi_gst_la_SOURCES = gstmodule.c +_gi_gst_la_CFLAGS = $(common_cflags) +_gi_gst_la_LIBADD = $(common_libadd) +_gi_gst_la_LDFLAGS = $(common_ldflags) + +# if we build in a separate tree, we need to symlink the *.so files from the +# source tree; Python does not accept the extensions and modules in different +# paths +build_pylinks: + for f in $(pygioverrides_PYTHON) __init__.py; do \ + [ -e $(builddir)/$$f ] || $(LN_S) -f $(srcdir)/$$f $(builddir)/$$f; \ + done + +all: $(pygioverridesexec_LTLIBRARIES:.la=$(PYTHON_SO)) build_pylinks +check-local: $(pygioverridesexec_LTLIBRARIES:.la=$(PYTHON_SO)) build_pylinks +clean-local: + rm -f $(pygioverridesexec_LTLIBRARIES:.la=$(PYTHON_SO)) + +%$(PYTHON_SO): %.la + $(LN_S) -f .libs/$@ $@ + diff --git a/gi/overrides/__init__.py b/gi/overrides/__init__.py new file mode 100644 index 0000000..57abf1a --- /dev/null +++ b/gi/overrides/__init__.py @@ -0,0 +1,4 @@ +from pkgutil import extend_path + +__path__ = extend_path(__path__, __name__) +print(__path__, __name__) diff --git a/gi/overrides/gstmodule.c b/gi/overrides/gstmodule.c new file mode 100644 index 0000000..6f9a14b --- /dev/null +++ b/gi/overrides/gstmodule.c @@ -0,0 +1,367 @@ +/* -*- Mode: C; ; c-file-style: "k&r"; c-basic-offset: 4 -*- */ +/* gst-python + * Copyright (C) 2002 David I. Lehn + * Copyright (C) 2012 Thibault Saunier + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + * + * Author: David I. Lehn + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +/* include this first, before NO_IMPORT_PYGOBJECT is defined */ +#include +#include +#include + +#include + +#if PY_MAJOR_VERSION >= 3 +#define PYGLIB_MODULE_START(symbol, modname) \ + static struct PyModuleDef _##symbol##module = { \ + PyModuleDef_HEAD_INIT, \ + modname, \ + NULL, \ + -1, \ + symbol##_functions, \ + NULL, \ + NULL, \ + NULL, \ + NULL \ +}; \ +PyMODINIT_FUNC PyInit_##symbol(void); \ +PyMODINIT_FUNC PyInit_##symbol(void) \ +{ \ + PyObject *module; \ + module = PyModule_Create(&_##symbol##module); +#define PYGLIB_MODULE_END return module; } +#else +#define PYGLIB_MODULE_START(symbol, modname) \ +DL_EXPORT(void) init##symbol(void); \ +DL_EXPORT(void) init##symbol(void) \ +{ \ + PyObject *module; \ + module = Py_InitModule(modname, symbol##_functions); +#define PYGLIB_MODULE_END } +#endif + +GST_DEBUG_CATEGORY_STATIC (python_debug); +GST_DEBUG_CATEGORY_STATIC (pygst_debug); +#define GST_CAT_DEFAULT pygst_debug + +static PyObject * +gi_gst_fraction_from_value (const GValue * value) +{ + PyObject *module, *dict, *fraction_type, *args, *fraction; + gint numerator, denominator; + + numerator = gst_value_get_fraction_numerator (value); + denominator = gst_value_get_fraction_denominator (value); + + module = PyImport_ImportModule ("gi.repository.Gst"); + + if (module == NULL) { + PyErr_SetString (PyExc_KeyError, + "Could not get module for gi.repository.Gst"); + return NULL; + } + + dict = PyModule_GetDict (module); + Py_DECREF (module); + + /* For some reson we need this intermediary step */ + module = PyMapping_GetItemString (dict, "_overrides_module"); + if (module == NULL) { + PyErr_SetString (PyExc_KeyError, + "Could not get module for _overrides_module"); + return NULL; + } + + dict = PyModule_GetDict (module); + fraction_type = PyMapping_GetItemString (dict, "Fraction"); + + args = Py_BuildValue ("(ii)", numerator, denominator); + fraction = PyObject_Call (fraction_type, args, NULL); + Py_DECREF (args); + Py_DECREF (fraction_type); + Py_DECREF (module); + + return fraction; +} + +static int +gi_gst_fraction_to_value (GValue * value, PyObject * object) +{ + PyObject *numerator, *denominator; + + numerator = PyObject_GetAttrString (object, "num"); + if (numerator == NULL) + goto fail; + + denominator = PyObject_GetAttrString (object, "denom"); + if (denominator == NULL) + goto fail; + + gst_value_set_fraction (value, + PyLong_AsLong (numerator), PyLong_AsLong (denominator)); + + return 0; + +fail: + return -1; +} + +void +gi_gst_register_types (PyObject * d) +{ + pyg_register_gtype_custom (GST_TYPE_FRACTION, + gi_gst_fraction_from_value, gi_gst_fraction_to_value); +} + +static int +add_templates (gpointer gclass, PyObject * templates) +{ + if (PyTuple_Check (templates)) { + gint i, len; + PyGObject *templ; + + len = PyTuple_Size (templates); + if (len == 0) + return 0; + + for (i = 0; i < len; i++) { + templ = (PyGObject *) PyTuple_GetItem (templates, i); + if (GST_IS_PAD_TEMPLATE (pygobject_get (templ)) == FALSE) { + PyErr_SetString (PyExc_TypeError, + "entries for __gsttemplates__ must be of type GstPadTemplate"); + return -1; + } + } + + for (i = 0; i < len; i++) { + templ = (PyGObject *) PyTuple_GetItem (templates, i); + gst_element_class_add_pad_template (gclass, + GST_PAD_TEMPLATE (templ->obj)); + } + return 0; + + } + + if (GST_IS_PAD_TEMPLATE (pygobject_get (templates)) == FALSE) { + PyErr_SetString (PyExc_TypeError, + "entry for __gsttemplates__ must be of type GstPadTemplate"); + return -1; + } + + gst_element_class_add_pad_template (gclass, + GST_PAD_TEMPLATE (pygobject_get (templates))); + + return 0; +} + +static int +_pygst_element_set_metadata (gpointer gclass, PyObject * metadata) +{ + + const gchar *longname, *classification, *description, *author; + + if (!PyTuple_Check (metadata)) { + PyErr_SetString (PyExc_TypeError, "__gstmetadata__ must be a tuple"); + return -1; + } + if (PyTuple_Size (metadata) != 4) { + PyErr_SetString (PyExc_TypeError, + "__gstmetadata__ must contain 4 elements"); + return -1; + } + if (!PyArg_ParseTuple (metadata, "ssss", &longname, &classification, + &description, &author)) { + PyErr_SetString (PyExc_TypeError, "__gstmetadata__ must contain 4 strings"); + return -1; + } + GST_DEBUG + ("setting metadata on gclass %p from __gstmetadata__, longname %s", + gclass, longname); + + gst_element_class_set_metadata (gclass, longname, classification, + description, author); + return 0; +} + +static int +_pygst_element_init (gpointer gclass, PyTypeObject * pyclass) +{ + PyObject *templates, *metadata; + + GST_DEBUG ("_pygst_element_init for gclass %p", gclass); + templates = PyDict_GetItemString (pyclass->tp_dict, "__gsttemplates__"); + if (templates) { + if (add_templates (gclass, templates) != 0) + return -1; + } else { + PyErr_Clear (); + } + metadata = PyDict_GetItemString (pyclass->tp_dict, "__gstmetadata__"); + if (metadata) { + if (_pygst_element_set_metadata (gclass, metadata) != 0) + return -1; + PyDict_DelItemString (pyclass->tp_dict, "__gstmetadata__"); + } else { + PyErr_Clear (); + } + + return 0; +} + +#include + +static PyObject * +pygst_debug_log (PyObject * pyobject, PyObject * string, GstDebugLevel level, + gboolean isgstobject) +{ +#ifndef GST_DISABLE_GST_DEBUG + gchar *str; + gchar *function; + gchar *filename; + int lineno; + PyFrameObject *frame; + GObject *object = NULL; + + if (!PyArg_ParseTuple (string, "s:gst.debug_log", &str)) { + PyErr_SetString (PyExc_TypeError, "Need a string!"); + return NULL; + } + + frame = PyEval_GetFrame (); +#if PY_MAJOR_VERSION >= 3 + { + PyObject *utf8; + const gchar *utf8_str; + + utf8 = PyUnicode_AsUTF8String (frame->f_code->co_name); + utf8_str = PyBytes_AS_STRING (utf8); + + function = g_strdup (utf8_str); + Py_DECREF (utf8); + + utf8 = PyUnicode_AsUTF8String (frame->f_code->co_filename); + utf8_str = PyBytes_AS_STRING (utf8); + + filename = g_strdup (utf8_str); + Py_DECREF (utf8); + } +#else + function = g_strdup (PyString_AsString (frame->f_code->co_name)); + filename = + g_path_get_basename (PyString_AsString (frame->f_code->co_filename)); +#endif + lineno = PyCode_Addr2Line (frame->f_code, frame->f_lasti); + /* gst_debug_log : category, level, file, function, line, object, format, va_list */ + if (isgstobject) + object = G_OBJECT (pygobject_get (pyobject)); + gst_debug_log (python_debug, level, filename, function, lineno, object, + "%s", str); + if (function) + g_free (function); + if (filename) + g_free (filename); +#endif + Py_INCREF (Py_None); + return Py_None; +} + +static PyObject * +_wrap_gst_log (PyObject * whatever, PyObject * string) +{ + return pygst_debug_log (whatever, string, GST_LEVEL_LOG, FALSE); +} + +static PyObject * +_wrap_gst_debug (PyObject * whatever, PyObject * string) +{ + return pygst_debug_log (whatever, string, GST_LEVEL_DEBUG, FALSE); +} + +static PyObject * +_wrap_gst_info (PyObject * whatever, PyObject * string) +{ + return pygst_debug_log (whatever, string, GST_LEVEL_INFO, FALSE); +} + +static PyObject * +_wrap_gst_warning (PyObject * whatever, PyObject * string) +{ + return pygst_debug_log (whatever, string, GST_LEVEL_WARNING, FALSE); +} + +static PyObject * +_wrap_gst_error (PyObject * whatever, PyObject * string) +{ + return pygst_debug_log (whatever, string, GST_LEVEL_ERROR, FALSE); +} + +static PyObject * +_wrap_gst_fixme (PyObject * whatever, PyObject * string) +{ + return pygst_debug_log (whatever, string, GST_LEVEL_FIXME, FALSE); +} + +static PyObject * +_wrap_gst_memdump (PyObject * whatever, PyObject * string) +{ + return pygst_debug_log (whatever, string, GST_LEVEL_MEMDUMP, FALSE); +} + +static PyMethodDef _gi_gst_functions[] = { + {"log", (PyCFunction) _wrap_gst_log, METH_VARARGS, + NULL}, + {"debug", (PyCFunction) _wrap_gst_debug, METH_VARARGS, + NULL}, + {"info", (PyCFunction) _wrap_gst_info, METH_VARARGS, + NULL}, + {"warning", (PyCFunction) _wrap_gst_warning, METH_VARARGS, + NULL}, + {"error", (PyCFunction) _wrap_gst_error, METH_VARARGS, + NULL}, + {"fixme", (PyCFunction) _wrap_gst_fixme, METH_VARARGS, + NULL}, + {"memdump", (PyCFunction) _wrap_gst_memdump, METH_VARARGS, + NULL} +}; + +PYGLIB_MODULE_START (_gi_gst, "_gi_gst") +{ + PyObject *d; + + /* gst should have been initialized already */ + + /* Initialize debugging category */ + GST_DEBUG_CATEGORY_INIT (pygst_debug, "pygst", 0, + "GStreamer python bindings"); + GST_DEBUG_CATEGORY_INIT (python_debug, "python", GST_DEBUG_FG_GREEN, + "python code using gst-python"); + + pygobject_init (3, 0, 0); + + d = PyModule_GetDict (module); + gi_gst_register_types (d); + pyg_register_class_init (GST_TYPE_ELEMENT, _pygst_element_init); +} + +PYGLIB_MODULE_END; diff --git a/gst-python.doap b/gst-python.doap new file mode 100644 index 0000000..d1edda4 --- /dev/null +++ b/gst-python.doap @@ -0,0 +1,324 @@ + + + GStreamer Python Bindings + gst-python + + 1999-10-31 + +Python bindings for GStreamer + + +GStreamer Python Bindings is a set of overrides and Gst fundamental types handling for the dynamically generated PyGObject bindings. + + + + + + Python + + + + + + + + + + + + + 1.5.2 + 1.5 + 2015-06-24 + + + + + + + 1.4.0 + 1.4.0 + 2014-10-20 + + + + + + + 1.3.90 + 1.3.90 + 2014-09-24 + + + + + + + 1.2.0 + 1.2.0 + 2014-03-15 + + + + + + + 1.1.90 + 1.1 + 2013-09-25 + + + + + + + + 1.1.90 + 1.1 + 2013-09-25 + + + + + + + + 0.10.22 + 0.10 + Ninety Tons of Thunder + 2011-10-29 + + + + + + + + 0.10.21 + 0.10 + he used to be an ironhorse, twenty years ago + 2011-01-20 + + + + + + + + 0.10.19 + 0.10 + Insert Casablanca quote here + 2010-07-15 + + + + + + + + 0.10.18 + 0.10 + A pigeon carrying a 500ton block + 2010-02-11 + + + + + + + + 0.10.17 + 0.10 + Shiny new button + 2009-10-05 + + + + + + + + 0.10.16 + 0.10 + Distorted memory + 2009-08-04 + + + + + + + + 0.10.15 + 0.10 + We built a wall + 2009-05-10 + + + + + + + + 0.10.14 + 0.10 + You Better Think + 2009-01-19 + + + + + + + + 0.10.13 + 0.10 + Feel The Sun Rise + 2008-10-02 + + + + + + + + 0.10.12 + 0.10 + A Wild Finish + 2008-06-18 + + + + + + + + 0.10.11 + 0.10 + What I got + 2008-03-21 + + + + + + + + 0.10.10 + 0.10 + Destination Overtime + 2008-01-28 + + + + + + + + 0.10.9 + 0.10 + I've heard a lot of stories in my time + 2007-11-28 + + + + + + + + 0.10.6 + 0.10 + You're not very subtle, but you are effective + 2006-12-04 + + + + + + + + 0.10.5 + 0.10 + My Little Poney wants some Funk + 2006-07-20 + + + + + + + + 0.10.4 + 0.10 + Alegre + 2006-04-28 + + + + + + + + 0.10.3 + 0.10 + Maybe not today. Maybe not tomorrow, but soon... + 2006-03-21 + + + + + + 0.10.2 + 0.10 + And if the devil is six + 2006-01-16 + + + + + + 0.10.1 + 0.10 + Krisimas Yakanaka + 2005-12-23 + + + + + + 0.10.0 + 0.10 + Reblochon + 2005-12-05 + + + + + + 0.8.4 + 0.8 + 64 bit is enough for everyone + 2006-03-08 + + + + + + + + Wim Taymans + 0d93fde052812d51a05fd86de9bdbf674423daa2 + + + + + Edward Hervey + + + + diff --git a/gst-python.spec.in b/gst-python.spec.in new file mode 100644 index 0000000..c19ab7f --- /dev/null +++ b/gst-python.spec.in @@ -0,0 +1,117 @@ +%define majorminor @GST_MAJORMINOR@ +%define gstreamer gstreamer +%define _pygtk @PYGTK_REQ@ +%define _gst @GST_REQ@ + +Name: %{gstreamer}-python +Version: @VERSION@ +Release: 1 +Summary: Python bindings for GStreamer. + +Group: Development/Languages +License: LGPL +URL: http://gstreamer.freedesktop.org/ +Source: http://gstreamer.freedesktop.org/src/gst-python/gst-python-%{version}.tar.gz + +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) + +Requires: python >= 2 +Requires: gnome-python2 +Requires: pygtk2 >= %_pygtk +Requires: %{gstreamer} +Requires: %{gstreamer}-plugins-base + +BuildRequires: python >= 2 +BuildRequires: python-devel >= 2 +BuildRequires: pygtk2-devel >= %_pygtk +BuildRequires: xmlto +BuildRequires: links + +BuildRequires: %{gstreamer}-devel >= %_gst +BuildRequires: %{gstreamer}-plugins-base-devel >= %_gst + +# sigh, libtool +BuildRequires: gcc-c++ + +%description +This module contains a wrapper that allows GStreamer applications +to be written in Python. + +%package devel +Summary: Libraries/include files for Python bindings for GStreamer +Group: Development/Libraries + +Requires: %{gstreamer}-python = @VERSION@ + +%description devel +This package contains the libraries and includes files necessary to develop +python bindings for GStreamer-based C libraries. + +%prep +%setup -q -n gst-python-%{version} + +%build +%configure +make %{?_smp_mflags} + +%install +rm -rf $RPM_BUILD_ROOT + +%makeinstall +find $RPM_BUILD_ROOT -type f -name "*.la" -exec rm -f {} ';' + +%clean +rm -rf $RPM_BUILD_ROOT + +%files +%defattr(-,root,root,-) +%doc AUTHORS COPYING ChangeLog NEWS README gst-python.doap +%dir %{_libdir}/python?.?/site-packages/gst-%{majorminor} +%{_libdir}/python?.?/site-packages/pygst.pth +%{_libdir}/python?.?/site-packages/pygst.py +%{_libdir}/python?.?/site-packages/gst-%{majorminor}/gst/__init__.py* +%{_libdir}/python?.?/site-packages/gst-%{majorminor}/gst/extend +%{_libdir}/python?.?/site-packages/gst-%{majorminor}/gst/_gst.so +%{_libdir}/python?.?/site-packages/gst-%{majorminor}/gst/interfaces.so +%{_libdir}/python?.?/site-packages/gst-%{majorminor}/gst/pbutils.so +%{_libdir}/gstreamer-%{majorminor}/libgstpython.so +%{_libdir}/python?.?/site-packages/gst-%{majorminor}/gst/audio.so +%{_libdir}/python?.?/site-packages/gst-%{majorminor}/gst/tag.so +%{_libdir}/python?.?/site-packages/gst-%{majorminor}/gst/video.so +%{_libdir}/python?.?/site-packages/gstoption.so +%{_datadir}/gst-python + +%files devel +%defattr(-, root, root, -) +%dir %{_includedir}/gstreamer-%{majorminor} +%dir %{_includedir}/gstreamer-%{majorminor}/gst +%{_includedir}/gstreamer-%{majorminor}/gst/pygst.h +%{_includedir}/gstreamer-%{majorminor}/gst/pygstvalue.h +%{_includedir}/gstreamer-%{majorminor}/gst/pygstminiobject.h +%{_includedir}/gstreamer-%{majorminor}/gst/pygstexception.h +%{_libdir}/pkgconfig/gst-python-%{majorminor}.pc + +%changelog +* Fri Dec 15 2006 Thomas Vander Stichele +- add doap file + +* Tue Dec 20 2005 Thomas Vander Stichele +- updated spec file + +* Thu Oct 06 2005 Edward Hervey < edward at fluendo dot com > +- Updated spec file for 0.9 + +* Fri Nov 05 2004 Christian Schaller < uraeus at gnome org > +- Remerged spec file with cvs version + +* Tue Oct 12 2004 Thomas Vander Stichele +- 0.7.93-0.fdr.1: new upstream release + +* Mon Jun 21 2004 Thomas Vander Stichele +- 0.7.92-0.fdr.1: new upstream release + +* Wed Mar 31 2004 Thomas Vander Stichele +- 0.7.91-0.fdr.1: new upstream release + +* Tue Sep 02 2003 Thomas Vander Stichele +- 0.1.0-0.fdr.1: first fedora release diff --git a/old_examples/.gitignore b/old_examples/.gitignore new file mode 100644 index 0000000..3dda729 --- /dev/null +++ b/old_examples/.gitignore @@ -0,0 +1,2 @@ +Makefile.in +Makefile diff --git a/old_examples/Makefile.am b/old_examples/Makefile.am new file mode 100644 index 0000000..629b68e --- /dev/null +++ b/old_examples/Makefile.am @@ -0,0 +1,23 @@ +examplesdir = $(pkgdatadir)/$(GST_MAJORMINOR)/examples +examples_DATA = \ + audioconcat.py \ + audio-controller.py \ + bps.py \ + cp.py \ + debugslider.py \ + f2f.py \ + filesrc.py \ + fvumeter.py \ + gst-discover \ + gstfile.py \ + helloworld.py \ + mixer.py \ + play.py \ + pipeline-tester \ + remuxer.py \ + sinkelement.py \ + vumeter.py \ + decodebin.py \ + maemogst.py + +EXTRA_DIST = $(examples_DATA) diff --git a/old_examples/audio-controller.py b/old_examples/audio-controller.py new file mode 100644 index 0000000..d676910 --- /dev/null +++ b/old_examples/audio-controller.py @@ -0,0 +1,40 @@ +#!/usr/bin/env python +# -*- Mode: Python -*- +# vi:si:et:sw=4:sts=4:ts=4 + +# audio-controller.py +# (c) 2005 Edward Hervey +# Test case for the GstController on sinesrc -> alsasink +# Inspired from ensonic's examples/controller/audio-controller.c + +import pygst +pygst.require('0.10') +import gst +import time + +def main(): + pipeline = gst.Pipeline("audiocontroller") + src = gst.element_factory_make("audiotestsrc", "src") + sink = gst.element_factory_make("alsasink", "sink") + pipeline.add(src, sink) + src.link(sink) + + control = gst.Controller(src, "freq", "volume") + control.set_interpolation_mode("volume", gst.INTERPOLATE_LINEAR) + control.set_interpolation_mode("freq", gst.INTERPOLATE_LINEAR) + + control.set("volume", 0, 0.0) + control.set("volume", 2 * gst.SECOND, 1.0) + control.set("volume", 4 * gst.SECOND, 0.0) + control.set("volume", 6 * gst.SECOND, 1.0) + + control.set("freq", 0, 440.0) + control.set("freq", 3 * gst.SECOND, 3000.0) + control.set("freq", 6 * gst.SECOND, 880.0) + + pipeline.set_state(gst.STATE_PLAYING) + + time.sleep(7) + +if __name__ == "__main__": + main() diff --git a/old_examples/audioconcat.py b/old_examples/audioconcat.py new file mode 100644 index 0000000..84da302 --- /dev/null +++ b/old_examples/audioconcat.py @@ -0,0 +1,192 @@ +#!/usr/bin/env python +# -*- Mode: Python -*- +# vi:si:et:sw=4:sts=4:ts=4 + +# audioconcat.py - Concatenates multiple audio files to single ogg/vorbis file +# Uses the gnonlin elements (http://gnonlin.sf.net/) +# Copyright (C) 2005 Edward Hervey +# 2006 Jason Gerard DeRose +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Library General Public +# License as published by the Free Software Foundation; either +# version 2 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Library General Public License for more details. +# +# You should have received a copy of the GNU Library General Public +# License along with this library; if not, write to the +# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. +# + +import sys + +import gobject +gobject.threads_init() + +import pygst +pygst.require('0.10') +import gst +from gst.extend.discoverer import Discoverer + + + +class AudioDec(gst.Bin): + '''Decodes audio file, outputs at specified caps''' + + def __init__(self, location, caps): + gst.Bin.__init__(self) + + # Create elements + src = gst.element_factory_make('filesrc') + dec = gst.element_factory_make('decodebin') + conv = gst.element_factory_make('audioconvert') + rsmpl = gst.element_factory_make('audioresample') + ident = gst.element_factory_make('identity') + + # Set 'location' property on filesrc + src.set_property('location', location) + + # Connect handler for 'new-decoded-pad' signal + dec.connect('new-decoded-pad', self.__on_new_decoded_pad) + + # Add elements to bin + self.add(src, dec, conv, rsmpl, ident) + + # Link *some* elements + # This is completed in self.__on_new_decoded_pad() + src.link(dec) + conv.link(rsmpl) + rsmpl.link(ident, caps) + + # Reference used in self.__on_new_decoded_pad() + self.__apad = conv.get_pad('sink') + + # Add ghost pad + self.add_pad(gst.GhostPad('src', ident.get_pad('src'))) + + + def __on_new_decoded_pad(self, element, pad, last): + caps = pad.get_caps() + name = caps[0].get_name() + print '\n__on_new_decoded_pad:', name + if 'audio' in name: + if not self.__apad.is_linked(): # Only link once + pad.link(self.__apad) + + + + +class AudioConcat: + '''Concatenates multiple audio files to single ogg/vorbis file''' + + caps = gst.caps_from_string('audio/x-raw-float, rate=44100, channels=2, endianness=1234, width=32') + + def __init__(self, infiles, outfile): + # These are used in iteration through infiles + self.infiles = infiles + self.i = 0 + self.start = 0L + + # The pipeline + self.pipeline = gst.Pipeline() + + # Create bus and connect 'eos' and 'error' handlers + self.bus = self.pipeline.get_bus() + self.bus.add_signal_watch() + self.bus.connect('message::eos', self.on_eos) + self.bus.connect('message::error', self.on_error) + + # Create elements + self.comp = gst.element_factory_make('gnlcomposition') + self.enc = gst.element_factory_make('vorbisenc') + self.mux = gst.element_factory_make('oggmux') + self.sink = gst.element_factory_make('filesink') + + # Connect handler for 'pad-added' signal + self.comp.connect('pad-added', self.on_pad_added) + + # Set 'location' property on filesink + self.sink.set_property('location', outfile) + + # Add elements to pipeline + self.pipeline.add(self.comp, self.enc, self.mux, self.sink) + + # Link *some* elements + # This in completed in self.on_pad_added() + gst.element_link_many(self.enc, self.mux, self.sink) + + # Reference used in self.on_pad_added() + self.apad = self.enc.get_pad('sink') + + # The MainLoop + self.mainloop = gobject.MainLoop() + + # Iterate through infiles + gobject.idle_add(self.discover) + self.mainloop.run() + + + def discover(self): + infile = self.infiles[self.i] + discoverer = Discoverer(infile) + discoverer.connect('discovered', self.on_discovered, infile) + discoverer.discover() + return False # Don't repeat idle call + + + def on_discovered(self, discoverer, ismedia, infile): + print '\non_discovered:', infile + discoverer.print_info() + if discoverer.is_audio: + dec = AudioDec(infile, self.caps) + src = gst.element_factory_make('gnlsource') + src.add(dec) + src.set_property('media-start', 0L) + src.set_property('media-duration', discoverer.audiolength) + src.set_property('start', self.start) + src.set_property('duration', discoverer.audiolength) + self.comp.add(src) + self.start += discoverer.audiolength + self.i += 1 + if self.i < len(self.infiles): + gobject.idle_add(self.discover) + else: + if self.start > 0: # At least 1 infile is_audio and audiolength > 0 + self.pipeline.set_state(gst.STATE_PLAYING) + else: + self.mainloop.quit() + + + def on_pad_added(self, element, pad): + caps = pad.get_caps() + name = caps[0].get_name() + print '\non_pad_added:', name + if name == 'audio/x-raw-float': + if not self.apad.is_linked(): # Only link once + pad.link(self.apad) + + + def on_eos(self, bus, msg): + print '\non_eos' + self.mainloop.quit() + + + def on_error(self, bus, msg): + error = msg.parse_error() + print '\non_error:', error[1] + self.mainloop.quit() + + + + +if __name__ == '__main__': + if len(sys.argv) >= 3: + AudioConcat(sys.argv[1:-1], sys.argv[-1]) + else: + print 'Usage: %s ' % sys.argv[0] + print 'Example: %s song1.mp3 song2.ogg output.ogg' % sys.argv[0] diff --git a/old_examples/bps.py b/old_examples/bps.py new file mode 100755 index 0000000..4d61d29 --- /dev/null +++ b/old_examples/bps.py @@ -0,0 +1,120 @@ +#!/usr/bin/env python +# -*- Mode: Python -*- +# vi:si:et:sw=4:sts=4:ts=4 + +# gst-python +# Copyright (C) 2003 David I. Lehn +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Library General Public +# License as published by the Free Software Foundation; either +# version 2 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Library General Public License for more details. +# +# You should have received a copy of the GNU Library General Public +# License along with this library; if not, write to the +# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. +# +# Author: David I. Lehn +# + +import pygtk +pygtk.require('2.0') + +import sys +import time +import gobject +import gtk + +import pygst +pygst.require('0.10') + +import gst + +class BPS(object): + def __init__(self): + self.buffers = 0 + self.start = 0 + + def done(self): + end = time.time() + dt = end - self.start + bps = self.buffers/dt + spb = dt/self.buffers + print '\t%d buffers / %fs\t= %f bps\t= %f spb' % (self.buffers, dt, bps, spb) + + def fakesrc(self, buffers): + src = gst.element_factory_make('fakesrc','src') + src.set_property('silent', 1) + src.set_property('num_buffers', buffers) + return src + + def fakesink(self): + sink = gst.element_factory_make('fakesink','sink') + sink.set_property('silent', 1) + return sink + + def build_pipeline(self, buffers): + pipeline = gst.Pipeline('pipeline') + + src = self.fakesrc(buffers) + pipeline.add(src) + sink = self.fakesink() + pipeline.add(sink) + src.link(sink) + + return pipeline + + def idle(self, pipeline): + return pipeline.iterate() + + def test(self): + self.bus = self.pipeline.get_bus() + + self.start = time.time() + + self.pipeline.set_state(gst.STATE_PLAYING) + + while 1: + msg = self.bus.poll(gst.MESSAGE_EOS | gst.MESSAGE_ERROR, gst.SECOND) + if msg: + break + + self.pipeline.set_state(gst.STATE_NULL) + self.done() + + def run(self, buffers): + self.buffers = buffers + + print '# Testing buffer processing rate for "fakesrc ! fakesink"' + print '# bps = buffers per second' + print '# spb = seconds per buffer' + + self.pipeline = self.build_pipeline(buffers) + assert self.pipeline + + self.test() + +def main(args): + "GStreamer Buffers-Per-Second tester" + + if len(args) < 2: + print 'usage: %s buffers' % args[0] + return 1 + + bps = BPS() + + buffers = int(args[1]) + if buffers < 1: + print 'buffers must be higher than 0' + return + + bps.run(buffers) + +if __name__ == '__main__': + sys.exit(main(sys.argv)) diff --git a/old_examples/buffer-draw.py b/old_examples/buffer-draw.py new file mode 100644 index 0000000..7058382 --- /dev/null +++ b/old_examples/buffer-draw.py @@ -0,0 +1,138 @@ +#!/usr/bin/env python + +import sys +import traceback +from math import pi + +import pygtk +pygtk.require ("2.0") +import gobject +gobject.threads_init() + +import pygst +pygst.require('0.10') +import gst + +import cairo + +WIDTH, HEIGHT = 640, 480 +FRAMES = 300 +FRAMERATE = 15 + +class PyGstBufferDraw(gst.Element): + _sinkpadtemplate = gst.PadTemplate ("sink", + gst.PAD_SINK, + gst.PAD_ALWAYS, + gst.caps_from_string ("video/x-raw-rgb,bpp=32,depth=32,blue_mask=-16777216,green_mask=16711680, red_mask=65280, alpha_mask=255,width=[ 1, 2147483647 ],height=[ 1, 2147483647 ],framerate=[ 0/1, 2147483647/1 ]")) + _srcpadtemplate = gst.PadTemplate ("src", + gst.PAD_SRC, + gst.PAD_ALWAYS, + gst.caps_from_string ("video/x-raw-rgb,bpp=32,depth=32,blue_mask=-16777216,green_mask=16711680, red_mask=65280, alpha_mask=255,width=[ 1, 2147483647 ],height=[ 1, 2147483647 ],framerate=[ 0/1, 2147483647/1 ]")) + + def __init__(self): + gst.Element.__init__(self) + + self.sinkpad = gst.Pad(self._sinkpadtemplate, "sink") + self.sinkpad.set_chain_function(self.chainfunc) + self.sinkpad.set_event_function(self.eventfunc) + self.sinkpad.set_getcaps_function(gst.Pad.proxy_getcaps) + self.sinkpad.set_setcaps_function(gst.Pad.proxy_setcaps) + self.add_pad (self.sinkpad) + + self.srcpad = gst.Pad(self._srcpadtemplate, "src") + + self.srcpad.set_event_function(self.srceventfunc) + self.srcpad.set_query_function(self.srcqueryfunc) + self.srcpad.set_getcaps_function(gst.Pad.proxy_getcaps) + self.srcpad.set_setcaps_function(gst.Pad.proxy_setcaps) + self.add_pad (self.srcpad) + + def chainfunc(self, pad, buffer): + try: + outbuf = buffer.copy_on_write () + self.draw_on (outbuf) + return self.srcpad.push (outbuf) + except: + return GST_FLOW_ERROR + + def eventfunc(self, pad, event): + return self.srcpad.push_event (event) + + def srcqueryfunc (self, pad, query): + return self.sinkpad.query (query) + def srceventfunc (self, pad, event): + return self.sinkpad.push_event (event) + + def draw_on (self, buf): + try: + caps = buf.get_caps() + width = caps[0]['width'] + height = caps[0]['height'] + framerate = caps[0]['framerate'] + surface = cairo.ImageSurface.create_for_data (buf, cairo.FORMAT_ARGB32, width, height, 4 * width) + ctx = cairo.Context(surface) + except: + print "Failed to create cairo surface for buffer" + traceback.print_exc() + return + + try: + center_x = width/4 + center_y = 3*height/4 + + # draw a circle + radius = float (min (width, height)) * 0.25 + ctx.set_source_rgba (0.0, 0.0, 0.0, 0.9) + ctx.move_to (center_x, center_y) + ctx.arc (center_x, center_y, radius, 0, 2.0*pi) + ctx.close_path() + ctx.fill() + ctx.set_source_rgba (1.0, 1.0, 1.0, 1.0) + ctx.set_font_size(0.3 * radius) + txt = "Hello World" + extents = ctx.text_extents (txt) + ctx.move_to(center_x - extents[2]/2, center_y + extents[3]/2) + ctx.text_path(txt) + ctx.fill() + + except: + print "Failed cairo render" + traceback.print_exc() + +gobject.type_register(PyGstBufferDraw) + +pipe = gst.Pipeline() +vt = gst.element_factory_make ("videotestsrc") +cf = gst.element_factory_make ("capsfilter") +c1 = PyGstBufferDraw() +color = gst.element_factory_make ("ffmpegcolorspace") +scale = gst.element_factory_make ("videoscale") +q1 = gst.element_factory_make ("queue") +sink = gst.element_factory_make ("autovideosink") + +caps = gst.caps_from_string ("video/x-raw-rgb,width=%d,height=%d,framerate=%d/1" % (WIDTH, HEIGHT, FRAMERATE)) +cf.set_property ("caps", caps) + +vt.set_property ("num-buffers", FRAMES) + +pipe.add (vt, cf, c1, q1, color, scale, sink) +gst.element_link_many (vt, cf, c1, q1, color, scale, sink) + +def on_eos (bus, msg): + mainloop.quit() + +bus = pipe.get_bus() +bus.add_signal_watch() +bus.connect('message::eos', on_eos) + +pipe.set_state (gst.STATE_PLAYING) + +mainloop = gobject.MainLoop() +try: + mainloop.run() +except: + pass + +pipe.set_state (gst.STATE_NULL) +pipe.get_state (gst.CLOCK_TIME_NONE) + diff --git a/old_examples/cp.py b/old_examples/cp.py new file mode 100755 index 0000000..a1fd5d8 --- /dev/null +++ b/old_examples/cp.py @@ -0,0 +1,83 @@ +#!/usr/bin/env python +# -*- Mode: Python -*- +# vi:si:et:sw=4:sts=4:ts=4 + +# gst-python +# Copyright (C) 2002 David I. Lehn +# 2004 Johan Dahlin +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Library General Public +# License as published by the Free Software Foundation; either +# version 2 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Library General Public License for more details. +# +# You should have received a copy of the GNU Library General Public +# License along with this library; if not, write to the +# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. +# +# Author: David I. Lehn +# + +import sys + +import gobject +gobject.threads_init() + +import pygst +pygst.require('0.10') +import gst + + +mainloop = gobject.MainLoop() + +def on_eos(bus, msg): + mainloop.quit() + +def filter(input, output): + "A GStreamer copy pipeline which can add arbitrary filters" + + # create a new bin to hold the elements + bin = gst.parse_launch('filesrc name=source ! ' + + 'progressreport ! ' + + # This 'statistics' element is depreciated in 0.10 + #'statistics silent=false buffer-update-freq=1 ' + + #'update_on_eos=true ! ' + + 'filesink name=sink') + filesrc = bin.get_by_name('source') + filesrc.set_property('location', input) + + filesink = bin.get_by_name('sink') + filesink.set_property('location', output) + + bus = bin.get_bus() + bus.add_signal_watch() + bus.connect('message::eos', on_eos) + + # start playing + bin.set_state(gst.STATE_PLAYING) + + try: + mainloop.run() + except KeyboardInterrupt: + pass + + # stop the bin + bin.set_state(gst.STATE_NULL) + +def main(args): + "A GStreamer based cp(1) with stats" + + if len(args) != 3: + print 'usage: %s source dest' % (sys.argv[0]) + return -1 + + return filter(args[1], args[2]) + +if __name__ == '__main__': + sys.exit(main(sys.argv)) diff --git a/old_examples/cutter.py b/old_examples/cutter.py new file mode 100644 index 0000000..9b5295f --- /dev/null +++ b/old_examples/cutter.py @@ -0,0 +1,80 @@ +#!/usr/bin/env python +# -*- Mode: Python -*- +# vi:si:et:sw=4:sts=4:ts=4 + +# gst-python +# Copyright (C) 2005 Thomas Vander Stichele +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Library General Public +# License as published by the Free Software Foundation; either +# version 2 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Library General Public License for more details. +# +# You should have received a copy of the GNU Library General Public +# License along with this library; if not, write to the +# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. + +import gst +import time + +import gobject +#gobject.threads_init() # so we can safely receive signals from threads + +count = 0 + +def on_message_application(cutter, message, loop): + global count + s = message.structure + which = 'below' + if s['above']: which = 'above' + print "%s: %s threshold" % (gst.TIME_ARGS(s['timestamp']), which) + if s['above']: count += 1 + if count > 2: loop.quit() + +def main(): + type = 'async' + loop = gobject.MainLoop() + + pipeline = gst.Pipeline("cutter") + src = gst.element_factory_make("sinesrc", "src") + cutter = gst.element_factory_make("cutter") + cutter.set_property('threshold', 0.5) + sink = gst.element_factory_make("fakesink", "sink") + pipeline.add(src, cutter, sink) + src.link(cutter) + cutter.link(sink) + + control = gst.Controller(src, "volume") + control.set_interpolation_mode("volume", gst.INTERPOLATE_LINEAR) + + control.set("volume", 0, 0.0) + control.set("volume", 2 * gst.SECOND, 1.0) + control.set("volume", 4 * gst.SECOND, 0.0) + control.set("volume", 6 * gst.SECOND, 1.0) + control.set("volume", 8 * gst.SECOND, 0.0) + control.set("volume", 10 * gst.SECOND, 1.0) + + bus = pipeline.get_bus() + + if type == 'async': + bus.add_signal_watch() + bus.connect('message::element', on_message_application, loop) + else: + # FIXME: needs wrapping in gst-python + bus.set_sync_handler(bus.sync_signal_handler) + bus.connect('sync-message::element', on_message_application, loop) + + pipeline.set_state(gst.STATE_PLAYING) + + loop.run() + + pipeline.set_state(gst.STATE_NULL) + +if __name__ == "__main__": + main() diff --git a/old_examples/debugslider.py b/old_examples/debugslider.py new file mode 100644 index 0000000..be82eb3 --- /dev/null +++ b/old_examples/debugslider.py @@ -0,0 +1,59 @@ +#!/usr/bin/env python +# -*- Mode: Python -*- +# vi:si:et:sw=4:sts=4:ts=4 + +# gst-python +# Copyright (C) 2005 Fluendo S.L. +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Library General Public +# License as published by the Free Software Foundation; either +# version 2 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Library General Public License for more details. +# +# You should have received a copy of the GNU Library General Public +# License along with this library; if not, write to the +# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. +# +# Author: Andy Wingo + +import gtk +from gtk import gdk +import gobject + +import pygst +pygst.require('0.10') +import gst + +class DebugSlider(gtk.HScale): + def __init__(self): + adj = gtk.Adjustment(int(gst.debug_get_default_threshold()), + 0, 5, 1, 0, 0) + gtk.HScale.__init__(self, adj) + self.set_digits(0) + self.set_draw_value(True) + self.set_value_pos(gtk.POS_TOP) + + def value_changed(self): + newlevel = int(self.get_adjustment().get_value()) + gst.debug_set_default_threshold(newlevel) + + self.connect('value-changed', value_changed) + +if __name__ == '__main__': + p = gst.parse_launch('fakesrc ! fakesink') + p.set_state(gst.STATE_PLAYING) + + w = gtk.Window() + s = DebugSlider() + w.add(s) + s.show() + w.set_default_size(200, 40) + w.show() + w.connect('delete-event', lambda *args: gtk.main_quit()) + gtk.main() diff --git a/old_examples/decodebin.py b/old_examples/decodebin.py new file mode 100644 index 0000000..700e190 --- /dev/null +++ b/old_examples/decodebin.py @@ -0,0 +1,109 @@ +#!/usr/bin/env python + +# decodebin.py - Audio autopluging example using 'decodebin' element +# Copyright (C) 2006 Jason Gerard DeRose + +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Library General Public +# License as published by the Free Software Foundation; either +# version 2 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Library General Public License for more details. +# +# You should have received a copy of the GNU Library General Public +# License along with this library; if not, write to the +# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. + +import sys + +import gobject +gobject.threads_init() + +import pygst +pygst.require('0.10') +import gst + + +class Decodebin: + def __init__(self, location): + # The pipeline + self.pipeline = gst.Pipeline() + + # Create bus and connect several handlers + self.bus = self.pipeline.get_bus() + self.bus.add_signal_watch() + self.bus.connect('message::eos', self.on_eos) + self.bus.connect('message::tag', self.on_tag) + self.bus.connect('message::error', self.on_error) + + # Create elements + self.src = gst.element_factory_make('filesrc') + self.dec = gst.element_factory_make('decodebin') + self.conv = gst.element_factory_make('audioconvert') + self.rsmpl = gst.element_factory_make('audioresample') + self.sink = gst.element_factory_make('alsasink') + + # Set 'location' property on filesrc + self.src.set_property('location', location) + + # Connect handler for 'new-decoded-pad' signal + self.dec.connect('new-decoded-pad', self.on_new_decoded_pad) + + # Add elements to pipeline + self.pipeline.add(self.src, self.dec, self.conv, self.rsmpl, self.sink) + + # Link *some* elements + # This is completed in self.on_new_decoded_pad() + self.src.link(self.dec) + gst.element_link_many(self.conv, self.rsmpl, self.sink) + + # Reference used in self.on_new_decoded_pad() + self.apad = self.conv.get_pad('sink') + + # The MainLoop + self.mainloop = gobject.MainLoop() + + # And off we go! + self.pipeline.set_state(gst.STATE_PLAYING) + self.mainloop.run() + + + def on_new_decoded_pad(self, element, pad, last): + caps = pad.get_caps() + name = caps[0].get_name() + print 'on_new_decoded_pad:', name + if name == 'audio/x-raw-float' or name == 'audio/x-raw-int': + if not self.apad.is_linked(): # Only link once + pad.link(self.apad) + + + def on_eos(self, bus, msg): + print 'on_eos' + self.mainloop.quit() + + + def on_tag(self, bus, msg): + taglist = msg.parse_tag() + print 'on_tag:' + for key in taglist.keys(): + print '\t%s = %s' % (key, taglist[key]) + + + def on_error(self, bus, msg): + error = msg.parse_error() + print 'on_error:', error[1] + self.mainloop.quit() + + + + + +if __name__ == '__main__': + if len(sys.argv) == 2: + Decodebin(sys.argv[1]) + else: + print 'Usage: %s /path/to/media/file' % sys.argv[0] diff --git a/old_examples/f2f.py b/old_examples/f2f.py new file mode 100755 index 0000000..504848a --- /dev/null +++ b/old_examples/f2f.py @@ -0,0 +1,64 @@ +#!/usr/bin/env python +# -*- Mode: Python -*- +# vi:si:et:sw=4:sts=4:ts=4 + +# gst-python +# Copyright (C) 2002 David I. Lehn +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Library General Public +# License as published by the Free Software Foundation; either +# version 2 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Library General Public License for more details. +# +# You should have received a copy of the GNU Library General Public +# License along with this library; if not, write to the +# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. +# +# Author: David I. Lehn +# + +import sys + +import pygst +pygst.require('0.10') + +import gst + +def handoff_cb(sender, *args): + print sender.get_name(), args + +def main(args): + # create a new bin to hold the elements + #gst_debug_set_categories(-1) + bin = gst.parse_launch('fakesrc name=source silent=1 num-buffers=10 signal-handoffs=true ! ' + + 'fakesink name=sink silent=1 signal-handoffs=true') + source = bin.get_by_name('source') + source.connect('handoff', handoff_cb) + source.get_pad("src").connect("have-data", handoff_cb) + sink = bin.get_by_name('sink') + sink.connect('handoff', handoff_cb) + sink.get_pad("sink").connect('have-data', handoff_cb) + + print source, sink + + bus = bin.get_bus() + + res = bin.set_state(gst.STATE_PLAYING); + assert res + + while 1: + msg = bus.poll(gst.MESSAGE_EOS | gst.MESSAGE_ERROR, gst.SECOND) + if msg: + break + + res = bin.set_state(gst.STATE_NULL) + assert res + +if __name__ == '__main__': + sys.exit(main(sys.argv)) diff --git a/old_examples/filesrc.py b/old_examples/filesrc.py new file mode 100755 index 0000000..519d9bc --- /dev/null +++ b/old_examples/filesrc.py @@ -0,0 +1,99 @@ +#!/usr/bin/env python +# -*- Mode: Python -*- +# vi:si:et:sw=4:sts=4:ts=4 + +# GStreamer python bindings +# Copyright (C) 2002 David I. Lehn +# 2004 Johan Dahlin +# +# filesrc.py: implements a file source element completely in python +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Library General Public +# License as published by the Free Software Foundation; either +# version 2 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Library General Public License for more details. +# +# You should have received a copy of the GNU Library General Public +# License along with this library; if not, write to the +# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. + +import sys +import gobject; gobject.threads_init() +import pygst +pygst.require('0.10') +import gst + +class FileSource(gst.BaseSrc): + __gsttemplates__ = ( + gst.PadTemplate("src", + gst.PAD_SRC, + gst.PAD_ALWAYS, + gst.caps_new_any()), + ) + + blocksize = 4096 + fd = None + + def __init__(self, name): + self.__gobject_init__() + self.curoffset = 0 + self.set_name(name) + + def set_property(self, name, value): + if name == 'location': + self.fd = open(value, 'r') + + def do_create(self, offset, size): + if offset != self.curoffset: + self.fd.seek(offset, 0) + data = self.fd.read(self.blocksize) + if data: + self.curoffset += len(data) + return gst.FLOW_OK, gst.Buffer(data) + else: + return gst.FLOW_UNEXPECTED, None +gobject.type_register(FileSource) + +def main(args): + if len(args) != 3: + print 'Usage: %s input output' % (args[0]) + return -1 + + bin = gst.Pipeline('pipeline') + + filesrc = FileSource('filesource') + assert filesrc + filesrc.set_property('location', args[1]) + + filesink = gst.element_factory_make('filesink', 'sink') + filesink.set_property('location', args[2]) + + bin.add(filesrc, filesink) + gst.element_link_many(filesrc, filesink) + + bin.set_state(gst.STATE_PLAYING); + mainloop = gobject.MainLoop() + + def bus_event(bus, message): + t = message.type + if t == gst.MESSAGE_EOS: + mainloop.quit() + elif t == gst.MESSAGE_ERROR: + err, debug = message.parse_error() + print "Error: %s" % err, debug + mainloop.quit() + return True + bin.get_bus().add_watch(bus_event) + + mainloop.run() + bin.set_state(gst.STATE_NULL) + +if __name__ == '__main__': + sys.exit(main(sys.argv)) + diff --git a/old_examples/fvumeter.py b/old_examples/fvumeter.py new file mode 100644 index 0000000..3de147b --- /dev/null +++ b/old_examples/fvumeter.py @@ -0,0 +1,239 @@ +# -*- Mode: Python -*- +# vi:si:et:sw=4:sts=4:ts=4 + +# gst-python +# Copyright (C) 2005 Fluendo S.L. +# Originally from the Flumotion streaming server. +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Library General Public +# License as published by the Free Software Foundation; either +# version 2 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Library General Public License for more details. +# +# You should have received a copy of the GNU Library General Public +# License along with this library; if not, write to the +# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. +# +# Author: Zaheer Merali + +import gtk +from gtk import gdk +import gobject + + +# this VUMeter respects IEC standard +# BS 6840-18:1996/IEC-268-18 +# and is inspired by JACK's meterbridge dpm_meters.c + +class FVUMeter(gtk.DrawingArea): + __gsignals__ = { 'expose-event' : 'override', + 'size-allocate': 'override', + 'size-request': 'override', + 'realize' : 'override' + } + __gproperties__ = { + 'peak' : (gobject.TYPE_FLOAT, + 'peak volume level', + 'peak volume level in dB', + -90.0, + 0, + -90.0, + gobject.PARAM_READWRITE), + 'decay' : (gobject.TYPE_FLOAT, + 'decay volume level', + 'decay volume level in dB', + -90.0, + 0, + -90.0, + gobject.PARAM_READWRITE), + 'orange-threshold': (gobject.TYPE_FLOAT, + 'threshold for orange', + 'threshold for orange use in dB', + -90.0, + 0, + -10.0, + gobject.PARAM_READWRITE), + 'red-threshold': (gobject.TYPE_FLOAT, + 'threshold for red', + 'threshold for red use in dB', + -90.0, + 0, + -1.0, + gobject.PARAM_READWRITE) + + } + green_gc = None + orange_gc = None + red_gc = None + yellow_gc = None + + topborder = 7 + peaklevel = -90.0 + decaylevel = -90.0 + orange_threshold = -10.0 + red_threshold = -1.0 + bottomborder = 25 + leftborder = 15 + rightborder = 65 + + # Returns the meter deflection percentage given a db value + def iec_scale(self, db): + pct = 0.0 + + if db < -70.0: + pct = 0.0 + elif db < -60.0: + pct = (db + 70.0) * 0.25 + elif db < -50.0: + pct = (db + 60.0) * 0.5 + 2.5 + elif db < -40.0: + pct = (db + 50.0) * 0.75 + 7.5 + elif db < -30.0: + pct = (db + 40.0) * 1.5 + 15.0 + elif db < -20.0: + pct = (db + 30.0) * 2.0 + 30.0 + elif db < 0.0: + pct = (db + 20.0) * 2.5 + 50.0 + else: + pct = 100.0 + + return pct + + def do_get_property(self, property): + if property.name == 'peak': + return self.peaklevel + elif property.name == 'decay': + return self.decaylevel + elif property.name == 'orange-threshold': + return self.orange_threshold + elif property.name == 'red-threshold': + return self.red_threshold + else: + raise AttributeError, 'unknown property %s' % property.name + + def do_set_property(self, property, value): + if property.name == 'peak': + self.peaklevel = value + elif property.name == 'decay': + self.decaylevel = value + elif property.name == 'orange-threshold': + self.orange_threshold = value + elif property.name == 'red-threshold': + self.red_threshold = value + else: + raise AttributeError, 'unknown property %s' % property.name + + self.queue_draw() + + def do_size_request(self, requisition): + requisition.width = 250 + requisition.height = 50 + + def do_size_allocate(self, allocation): + self.allocation = allocation + if self.flags() & gtk.REALIZED: + self.window.move_resize(*allocation) + + def do_realize(self): + self.set_flags(self.flags() | gtk.REALIZED) + + self.window = gdk.Window(self.get_parent_window(), + width=self.allocation.width, + height=self.allocation.height, + window_type=gdk.WINDOW_CHILD, + wclass=gdk.INPUT_OUTPUT, + event_mask=self.get_events() | gdk.EXPOSURE_MASK) + + colormap = gtk.gdk.colormap_get_system() + green = colormap.alloc_color(0, 65535, 0) + orange = colormap.alloc_color(65535, 32768, 0) + red = colormap.alloc_color(65535, 0, 0) + yellow = colormap.alloc_color(65535, 65535, 0) + self.green_gc = gdk.GC(self.window, foreground=green) + self.orange_gc = gdk.GC(self.window, foreground=orange) + self.red_gc = gdk.GC(self.window, foreground=red) + self.yellow_gc = gdk.GC(self.window, foreground=yellow) + + self.window.set_user_data(self) + self.style.attach(self.window) + self.style.set_background(self.window, gtk.STATE_NORMAL) + + def do_expose_event(self, event): + self.chain(event) + + x, y, w, h = self.allocation + vumeter_width = w - (self.leftborder + self.rightborder) + vumeter_height = h - (self.topborder + self.bottomborder) + self.window.draw_rectangle(self.style.black_gc, True, + self.leftborder, self.topborder, + vumeter_width, + vumeter_height) + # draw peak level + # 0 maps to width of 0, full scale maps to total width + peaklevelpct = self.iec_scale(self.peaklevel) + peakwidth = int(vumeter_width * (peaklevelpct / 100)) + draw_gc = self.green_gc + if self.peaklevel >= self.orange_threshold: + draw_gc = self.orange_gc + if self.peaklevel >= self.red_threshold: + draw_gc = self.red_gc + if peakwidth > 0: + self.window.draw_rectangle(draw_gc, True, + self.leftborder, self.topborder, + peakwidth, vumeter_height) + + # draw yellow decay level + if self.decaylevel > -90.0: + decaylevelpct = self.iec_scale(self.decaylevel) + decaywidth = int(vumeter_width * (decaylevelpct / 100)) + # cheat the geometry by drawing 0% level at pixel 0, + # which is same position as just above 0% + if decaywidth == 0: + decaywidth = 1 + self.window.draw_line(self.yellow_gc, + self.leftborder + decaywidth - 1, + self.topborder, + self.leftborder + decaywidth - 1, + self.topborder + vumeter_height - 1) + + # draw tick marks + scalers = [ + ('-90', 0.0), + ('-40', 0.15), + ('-30', 0.30), + ('-20', 0.50), + ('-10', 0.75), + ( '-5', 0.875), + ( '0', 1.0), + ] + for level, scale in scalers: + # tick mark, 6 pixels high + # we cheat again here by putting the 0 at the first pixel + self.window.draw_line(self.style.black_gc, + self.leftborder + int(scale * (vumeter_width - 1)), + h - self.bottomborder, + self.leftborder + int(scale * (vumeter_width - 1)), + h - self.bottomborder + 5) + # tick label + layout = self.create_pango_layout(level) + layout_width, layout_height = layout.get_pixel_size() + self.window.draw_layout(self.style.black_gc, + self.leftborder + int(scale * vumeter_width) + - int(layout_width / 2), + h - self.bottomborder + 7, layout) + + # draw the peak level to the right + layout = self.create_pango_layout("%.2fdB" % self.peaklevel) + layout_width, layout_height = layout.get_pixel_size() + self.window.draw_layout(self.style.black_gc, + self.leftborder + vumeter_width + 5, + self.topborder + int(vumeter_height / 2 - layout_height / 2), + layout) + +gobject.type_register(FVUMeter) diff --git a/old_examples/gst-discover b/old_examples/gst-discover new file mode 100755 index 0000000..8b03966 --- /dev/null +++ b/old_examples/gst-discover @@ -0,0 +1,89 @@ +#!/usr/bin/env python +# gst-python +# Copyright (C) 2006 Andy Wingo +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Library General Public +# License as published by the Free Software Foundation; either +# version 2 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Library General Public License for more details. +# +# You should have received a copy of the GNU Library General Public +# License along with this library; if not, write to the +# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. + + +import os +import sys + +import pygtk +pygtk.require('2.0') +import gobject +gobject.threads_init() +import pygst +pygst.require('0.10') +import gst +from gst.extend import discoverer + +def fail(path): + print "error: %r does not appear to be a media file" % path + sys.exit(1) + +def succeed(d): + def pp(prop, val): + print '%s: %s' % (prop, val) + pp('media type', d.mimetype) + + pp('has video', d.is_video) + if d.is_video: + pp('video caps', d.videocaps) + pp('video width (pixels)', d.videowidth) + pp('video height (pixels)', d.videoheight) + pp('video length (hh:mm:ss)', gst.TIME_ARGS(d.videolength)) + pp('framerate (fps)', '%s/%s' % (d.videorate.num, d.videorate.denom)) + + pp('has audio', d.is_audio) + if d.is_audio: + pp('audio caps', d.audiocaps) + pp('audio format', d.audiofloat and 'floating-point' or 'integer') + pp('sample rate (Hz)', d.audiorate) + pp('sample width (bits)', d.audiowidth) + pp('sample depth (bits)', d.audiodepth) + pp('audio length (hh:mm:ss)', gst.TIME_ARGS(d.audiolength)) + pp('audio channels', d.audiochannels) + + sys.exit(0) + +def discover(path): + def discovered(d, is_media): + if is_media: + succeed(d) + else: + fail(path) + + d = discoverer.Discoverer(path) + d.connect('discovered', discovered) + d.discover() + gobject.MainLoop().run() + +def usage(): + print >>sys.stderr, "usage: gst-discover PATH-TO-MEDIA-FILE" + sys.exit(1) + +def main(argv): + if len(argv) != 2: + usage() + path = argv.pop() + if not os.path.isfile(path): + print >>sys.stderr, "error: file %r does not exist" % path + usage() + + return discover(path) + +if __name__ == '__main__': + sys.exit(main(sys.argv)) diff --git a/old_examples/gstfile.py b/old_examples/gstfile.py new file mode 100644 index 0000000..ea0a768 --- /dev/null +++ b/old_examples/gstfile.py @@ -0,0 +1,73 @@ +#!/usr/bin/env python +# -*- Mode: Python -*- +# vi:si:et:sw=4:sts=4:ts=4 + +# gstfile.py +# (c) 2005 Edward Hervey +# Discovers and prints out multimedia information of files + +# This example shows how to use gst-python: +# _ in an object-oriented way (Discoverer class) +# _ subclassing a gst.Pipeline +# _ and overidding existing methods (do_iterate()) + +import os +import sys + +import gobject +gobject.threads_init() + +import pygst +pygst.require('0.10') + +from gst.extend.discoverer import Discoverer + +class GstFile: + """ + Analyses one or more files and prints out the multimedia information of + each file. + """ + + def __init__(self, files): + self.files = files + self.mainloop = gobject.MainLoop() + self.current = None + + def run(self): + gobject.idle_add(self._discover_one) + self.mainloop.run() + + def _discovered(self, discoverer, ismedia): + discoverer.print_info() + self.current = None + if len(self.files): + print "\n" + gobject.idle_add(self._discover_one) + + def _discover_one(self): + if not len(self.files): + gobject.idle_add(self.mainloop.quit) + return False + filename = self.files.pop(0) + if not os.path.isfile(filename): + gobject.idle_add(self._discover_one) + return False + print "Running on", filename + # create a discoverer for that file + self.current = Discoverer(filename) + # connect a callback on the 'discovered' signal + self.current.connect('discovered', self._discovered) + # start the discovery + self.current.discover() + return False + +def main(args): + if len(args) < 2: + print 'usage: %s files...' % args[0] + return 2 + + gstfile = GstFile(args[1:]) + gstfile.run() + +if __name__ == '__main__': + sys.exit(main(sys.argv)) diff --git a/old_examples/helloworld.py b/old_examples/helloworld.py new file mode 100644 index 0000000..0ef0205 --- /dev/null +++ b/old_examples/helloworld.py @@ -0,0 +1,54 @@ +#!/usr/bin/env python + +import sys + +import gobject +gobject.threads_init() + +import pygst +pygst.require('0.10') +import gst + +def bus_call(bus, message, loop): + t = message.type + if t == gst.MESSAGE_EOS: + sys.stout.write("End-of-stream\n") + loop.quit() + elif t == gst.MESSAGE_ERROR: + err, debug = message.parse_error() + sys.stderr.write("Error: %s: %s\n" % err, debug) + loop.quit() + return True + +def main(args): + if len(args) != 2: + sys.stderr.write("usage: %s \n" % args[0]) + sys.exit(1) + + playbin = gst.element_factory_make("playbin2", None) + if not playbin: + sys.stderr.write("'playbin2' gstreamer plugin missing\n") + sys.exit(1) + + # take the commandline argument and ensure that it is a uri + if gst.uri_is_valid(args[1]): + uri = args[1] + else: + uri = gst.filename_to_uri(args[1]) + playbin.set_property('uri', uri) + + # create and event loop and feed gstreamer bus mesages to it + loop = gobject.MainLoop() + + bus = playbin.get_bus() + bus.add_watch(bus_call, loop) + + # start play back and listed to events + playbin.set_state(gst.STATE_PLAYING) + loop.run() + + # cleanup + playbin.set_state(gst.STATE_NULL) + +if __name__ == '__main__': + sys.exit(main(sys.argv)) diff --git a/old_examples/maemogst.py b/old_examples/maemogst.py new file mode 100644 index 0000000..1f9ae0d --- /dev/null +++ b/old_examples/maemogst.py @@ -0,0 +1,101 @@ +import gobject +gobject.threads_init() +import gtk +gtk.gdk.threads_init() +import hildon +import gst +import sys + +# VideoWidget taken from play.py in gst-python examples +class VideoWidget(gtk.DrawingArea): + def __init__(self): + gtk.DrawingArea.__init__(self) + self.imagesink = None + self.unset_flags(gtk.DOUBLE_BUFFERED) + + def do_expose_event(self, event): + if self.imagesink: + self.imagesink.expose() + return False + else: + return True + + def set_sink(self, sink): + assert self.window.xid + self.imagesink = sink + self.imagesink.set_xwindow_id(self.window.xid) + +class MaemoGstView: + + def __init__(self): + # hildon has one program instance per app, so get instance + self.p = hildon.Program.get_instance() + # set name of application: this shows in titlebar + gtk.set_application_name("Maemo GStreamer VideoTest") + # stackable window in case we want more windows in future in app + self.w = hildon.StackableWindow() + box = gtk.VBox() + self.video_widget = VideoWidget() + # video widget we want to expand to size + box.pack_start(self.video_widget, True, True, 0) + # a button finger height to play/pause + self.button = hildon.Button(gtk.HILDON_SIZE_FINGER_HEIGHT, + hildon.BUTTON_ARRANGEMENT_VERTICAL, title="Pause") + self.button.connect_after("clicked", self.on_button_clicked) + # don't want button to expand or fill, just stay finger height + box.pack_start(self.button, False, False, 0) + self.w.add(box) + self.w.connect("delete-event", gtk.main_quit) + self.p.add_window(self.w) + self.w.show_all() + self.start_streaming() + + def start_streaming(self): + # we use ximagesink solely for screenshotting ability + # less cpu usage would happen with videotestsrc ! xvimagesink + self.pipeline = \ + gst.parse_launch("videotestsrc ! videoscale ! ximagesink") + bus = self.pipeline.get_bus() + # need to connect to sync message handler so we get the sink to be + # embedded at the right time and not have a temporary new window + bus.enable_sync_message_emission() + bus.add_signal_watch() + bus.connect("sync-message::element", self.on_sync_message) + bus.connect("message", self.on_message) + self.pipeline.set_state(gst.STATE_PLAYING) + + def on_sync_message(self, bus, message): + if message.structure is None: + return + if message.structure.get_name() == 'prepare-xwindow-id': + # all this is needed to sync with the X server before giving the + # x id to the sink + gtk.gdk.threads_enter() + gtk.gdk.display_get_default().sync() + self.video_widget.set_sink(message.src) + message.src.set_property("force-aspect-ratio", True) + gtk.gdk.threads_leave() + + def on_message(self, bus, message): + if message.type == gst.MESSAGE_ERROR: + err, debug = message.parse_error() + hildon.hildon_banner_show_information(self.w, '', + "Error: %s" % err) + + def on_button_clicked(self, widget): + success, state, pending = self.pipeline.get_state(1) + # do not listen if in middle of state change + if not pending: + if state == gst.STATE_PLAYING: + self.pipeline.set_state(gst.STATE_PAUSED) + self.button.set_label("Play") + else: + self.pipeline.set_state(gst.STATE_PLAYING) + self.button.set_label("Pause") + +def main(): + view = MaemoGstView() + gtk.main() + +if __name__ == '__main__': + sys.exit(main()) diff --git a/old_examples/mixer.py b/old_examples/mixer.py new file mode 100644 index 0000000..e9cb432 --- /dev/null +++ b/old_examples/mixer.py @@ -0,0 +1,31 @@ +# -*- Mode: Python -*- +# vi:si:et:sw=4:sts=4:ts=4 + +import sys + +import gst +import gst.interfaces + +pipeline = "alsasrc" +if sys.argv[1:]: + pipeline = " ".join(sys.argv[1:]) +a = gst.element_factory_make(pipeline) +print dir(a) + +res = a.set_state(gst.STATE_PAUSED) +if res != gst.STATE_CHANGE_SUCCESS: + print "Could not set pipeline %s to PAUSED" % pipeline + +print "Inputs:" +for t in a.list_tracks(): + if t.flags & gst.interfaces.MIXER_TRACK_INPUT: + sys.stdout.write(t.label) + sys.stdout.write(': %d - %d' % (t.min_volume, t.max_volume)) + volumes = a.get_volume(t) + sys.stdout.write(': %r' % (volumes, )) + if t.props.num_channels > 0: + a.set_volume(t, volumes=volumes) + if t.flags & gst.interfaces.MIXER_TRACK_RECORD: + sys.stdout.write(' (selected)') + sys.stdout.write('\n') + diff --git a/old_examples/option-parser.py b/old_examples/option-parser.py new file mode 100644 index 0000000..89e1a64 --- /dev/null +++ b/old_examples/option-parser.py @@ -0,0 +1,43 @@ +#!/usr/bin/env python +# -*- Mode: Python -*- +# vi:si:et:sw=4:sts=4:ts=4 + +import sys + +import pygtk +pygtk.require('2.0') + +from gobject.option import OptionParser, OptionGroup +import pygst +pygst.require('0.10') + +import gstoption + +def main(args): + parser = OptionParser() + + group = OptionGroup('flumotion', 'Flumotion options', + option_list=[]) + group.add_option('-v', '--verbose', + action="store_true", dest="verbose", + help="be verbose") + group.add_option('', '--version', + action="store_true", dest="version", + default=False, + help="show version information") + parser.add_option_group(group) + + parser.add_option_group(gstoption.get_group()) + + options, args = parser.parse_args(args) + + if options.verbose: + print 'Verbose mode' + + import gst + + if options.version: + print sys.version, gst.version + +if __name__ == '__main__': + sys.exit(main(sys.argv)) diff --git a/old_examples/pipeline-tester b/old_examples/pipeline-tester new file mode 100755 index 0000000..d3cb696 --- /dev/null +++ b/old_examples/pipeline-tester @@ -0,0 +1,263 @@ +#!/usr/bin/env python +# +# gst-python +# Copyright (C) 2005 Andy Wingo +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Library General Public +# License as published by the Free Software Foundation; either +# version 2 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Library General Public License for more details. +# +# You should have received a copy of the GNU Library General Public +# License along with this library; if not, write to the +# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. + + +# A test more of gst-plugins than of gst-python. + + +import sys + +import pygtk +pygtk.require('2.0') +import gtk +import gtk.gdk +import pango +import gobject + +import pygst +pygst.require('0.10') +import gst + +import debugslider + + +data = (('Video capture via V4L', + 'v4lsrc name=source \n' + ' ! videorate \n' + ' ! ffmpegcolorspace ! autovideosink'), + ('Video capture via V4L, fixed frame rate', + 'v4lsrc name=source autoprobe=false autoprobe-fps=false \n' + ' ! video/x-raw-yuv,format=(fourcc)I420,framerate=(double)7.5 \n' + ' ! videorate \n' + ' ! ffmpegcolorspace \n' + ' ! autovideosink'), + ('Sound capture', + 'gconfaudiosrc\n' + ' ! audio/x-raw-int,rate=22050,depth=16,channels=1,width=16,signed=(boolean)TRUE,endianness=(int)BYTE_ORDER\n' + ' ! level message=true\n' + ' ! fakesink'), + ('Streaming Ogg/Theora+Vorbis playback, tee to disk', + 'gnomevfssrc location=http://gstreamer.freedesktop.org/media/small/cooldance.ogg \n' + ' ! tee name=tee \n' + ' tee. ! oggdemux name=demux \n' + ' demux. ! queue ! theoradec ! ffmpegcolorspace ! autovideosink \n' + ' demux. ! queue ! vorbisdec ! audioconvert ! autoaudiosink \n' + ' tee. ! queue ! filesink location=/tmp/cooldance.ogg'), + ('Video test, YUV format', + 'videotestsrc \n' + ' ! video/x-raw-yuv,format=(fourcc)I420 \n' + ' ! ffmpegcolorspace ! autovideosink'), + ('Video test, RGB format', + 'videotestsrc \n' + ' ! video/x-raw-rgb,red_mask=0xff00 \n' + ' ! ffmpegcolorspace \n' + ' ! autovideosink'), + ('Software scaling', + 'videotestsrc \n' + ' ! video/x-raw-rgb,height=200,width=320 \n' + ' ! videoscale method=2 \n' + ' ! ffmpegcolorspace ! autovideosink'), + ('Reencode Vorbis to mulaw, play', + 'filesrc location=/tmp/cooldance.ogg \n' + ' ! oggdemux \n' + ' ! vorbisdec ! audioconvert \n' + ' ! mulawenc ! mulawdec ! autoaudiosink'), + ('Capture DV via firewire, transcode into Ogg', + 'dv1394src \n' + ' ! dvdemux name=demux \n' + ' ! queue \n' + ' ! video/x-dv,systemstream=(boolean)false \n' + ' ! dvdec drop-factor=2 \n' + ' ! videorate \n' + ' ! videoscale \n' + ' ! video/x-raw-yuv,width=360,height=288 \n' + ' ! videoscale \n' + ' ! video/x-raw-yuv,width=240,height=192,framerate=10.0,format=(fourcc)YUY2 \n' + ' ! ffmpegcolorspace \n' + ' ! theoraenc \n' + ' ! oggmux name=mux \n' + ' ! filesink location=/tmp/dv.ogg \n' + ' \n' + ' demux. \n' + ' ! audio/x-raw-int \n' + ' ! queue \n' + ' ! audioconvert \n' + ' ! vorbisenc \n' + ' ! mux.')) + + +def escape(s, chars, escaper='\\'): + for c in chars: + s = s.replace(c, '%s%s' % (escaper, c)) + return s + + +def make_model(): + m = gtk.ListStore(str, str) + for pair in data: + i = m.append() + m.set_value(i, 0, pair[0]) + m.set_value(i, 1, pair[1]) + return m + + +class Window(gtk.Window): + def __init__(self): + gtk.Window.__init__(self, gtk.WINDOW_TOPLEVEL) + self.playing = False + self.selected_pipe = None + self.pipeline = None + self.prepare_ui() + + def prepare_ui(self): + self.set_default_size(300,400) + self.set_title('GStreamer Pipeline Tester') + self.set_type_hint(gtk.gdk.WINDOW_TYPE_HINT_DIALOG) + self.connect('delete-event', lambda *x: gtk.main_quit()) + self.set_border_width(18) + b = gtk.VBox(False, 12) + b.show() + self.add(b) + l = gtk.Label() + l.set_markup('GStreamer Pipeline Tester') + l.show() + b.pack_start(l, False, False, 6) + l = gtk.Label('Choose a pipeline below to run.') + l.show() + b.pack_start(l, False, False, 0) + sw = gtk.ScrolledWindow() + sw.set_policy(gtk.POLICY_NEVER, gtk.POLICY_NEVER) + sw.set_shadow_type(gtk.SHADOW_IN) + sw.show() + b.pack_start(sw, True, True, 6) + tv = gtk.TreeView(make_model()) + tv.set_property('can-default', False) + r = gtk.CellRendererText() + r.set_property('xalign', 0.5) + c = gtk.TreeViewColumn('System', r, text=0) + tv.append_column(c) + tv.set_headers_visible(False) + tv.show() + sw.add(tv) + ds = debugslider.DebugSlider() + ds.show() + b.pack_start(ds, False, False, 0) + l = gtk.Label() + l.set_selectable(True) + l.show() + b.pack_start(l, False, False, 0) + bb = gtk.HButtonBox() + bb.set_layout(gtk.BUTTONBOX_SPREAD) + bb.show() + b.pack_start(bb, False, False, 0) + bu = gtk.Button(stock=gtk.STOCK_MEDIA_PLAY) + bu.set_property('can-default', True) + bu.set_focus_on_click(False) + bu.show() + bb.pack_start(bu, True, False, 0) + bu.set_property('has-default', True) + self.button = bu + + def on_changed(s): + m, i = s.get_selected() + if m: + self.selected_pipe = m.get_value(i, 1) + pasteable = escape(self.selected_pipe, '\n)(') + l.set_markup('%s' % pasteable) + else: + self.selected_pipe = None + l.set_markup('') + tv.get_selection().connect('changed', on_changed) + + tv.connect('row-activated', lambda *x: self.play_toggled()) + + bu.connect('clicked', lambda *x: self.play_toggled()) + + def error(self, message, secondary=None): + m = gtk.MessageDialog(self, + gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT, + gtk.MESSAGE_ERROR, + gtk.BUTTONS_OK, + message) + if secondary: + m.format_secondary_text(secondary) + m.run() + m.destroy() + self.stop() + + def on_message(self, bus, message): + t = message.type + print message + if t == gst.MESSAGE_STATE_CHANGED: + pass + elif t == gst.MESSAGE_ERROR: + err, debug = message.parse_error() + self.error("%s" % err, debug) + elif t == gst.MESSAGE_EOS: + self.play_toggled() + else: + print '%s: %s:' % (message.src.get_path_string(), + message.type.value_nicks[1]) + if message.structure: + print ' %s' % message.structure.to_string() + else: + print ' (no structure)' + return True + + def play(self): + pipestr = self.selected_pipe + try: + self.set_sensitive(False) + pipeline = gst.parse_launch(pipestr) + self.set_sensitive(True) + except gobject.GError, e: + self.set_sensitive(True) + self.error('Could not create pipeline', str(e)) + return False + + bus = pipeline.get_bus() + bus.add_signal_watch() + watch_id = bus.connect('message', self.on_message) + self.pipeline = pipeline + self.watch_id = watch_id + pipeline.set_state(gst.STATE_PLAYING) + + def stop(self): + bus = self.pipeline.get_bus() + bus.disconnect(self.watch_id) + bus.remove_signal_watch() + self.pipeline.set_state(gst.STATE_NULL) + self.pipeline = None + del self.watch_id + + def play_toggled(self): + if self.playing: + self.stop() + self.button.set_label(gtk.STOCK_MEDIA_PLAY) + self.playing = False + else: + self.play() + self.playing = True + self.button.set_label(gtk.STOCK_MEDIA_STOP) + +if __name__ == '__main__': + w = Window() + w.show() + gtk.main() diff --git a/old_examples/play.py b/old_examples/play.py new file mode 100644 index 0000000..4045dff --- /dev/null +++ b/old_examples/play.py @@ -0,0 +1,299 @@ +#!/usr/bin/env python +# -*- Mode: Python -*- +# vi:si:et:sw=4:sts=4:ts=4 + +import pygtk +pygtk.require('2.0') + +import sys + +import gobject +gobject.threads_init() + +import pygst +pygst.require('0.10') +import gst +import gst.interfaces +import gtk +gtk.gdk.threads_init() + +class GstPlayer: + def __init__(self, videowidget): + self.playing = False + self.player = gst.element_factory_make("playbin", "player") + self.videowidget = videowidget + self.on_eos = False + + bus = self.player.get_bus() + bus.enable_sync_message_emission() + bus.add_signal_watch() + bus.connect('sync-message::element', self.on_sync_message) + bus.connect('message', self.on_message) + + def on_sync_message(self, bus, message): + if message.structure is None: + return + if message.structure.get_name() == 'prepare-xwindow-id': + # Sync with the X server before giving the X-id to the sink + gtk.gdk.threads_enter() + gtk.gdk.display_get_default().sync() + self.videowidget.set_sink(message.src) + message.src.set_property('force-aspect-ratio', True) + gtk.gdk.threads_leave() + + def on_message(self, bus, message): + t = message.type + if t == gst.MESSAGE_ERROR: + err, debug = message.parse_error() + print "Error: %s" % err, debug + if self.on_eos: + self.on_eos() + self.playing = False + elif t == gst.MESSAGE_EOS: + if self.on_eos: + self.on_eos() + self.playing = False + + def set_location(self, location): + self.player.set_property('uri', location) + + def query_position(self): + "Returns a (position, duration) tuple" + try: + position, format = self.player.query_position(gst.FORMAT_TIME) + except: + position = gst.CLOCK_TIME_NONE + + try: + duration, format = self.player.query_duration(gst.FORMAT_TIME) + except: + duration = gst.CLOCK_TIME_NONE + + return (position, duration) + + def seek(self, location): + """ + @param location: time to seek to, in nanoseconds + """ + gst.debug("seeking to %r" % location) + event = gst.event_new_seek(1.0, gst.FORMAT_TIME, + gst.SEEK_FLAG_FLUSH | gst.SEEK_FLAG_ACCURATE, + gst.SEEK_TYPE_SET, location, + gst.SEEK_TYPE_NONE, 0) + + res = self.player.send_event(event) + if res: + gst.info("setting new stream time to 0") + self.player.set_new_stream_time(0L) + else: + gst.error("seek to %r failed" % location) + + def pause(self): + gst.info("pausing player") + self.player.set_state(gst.STATE_PAUSED) + self.playing = False + + def play(self): + gst.info("playing player") + self.player.set_state(gst.STATE_PLAYING) + self.playing = True + + def stop(self): + self.player.set_state(gst.STATE_NULL) + gst.info("stopped player") + + def get_state(self, timeout=1): + return self.player.get_state(timeout=timeout) + + def is_playing(self): + return self.playing + +class VideoWidget(gtk.DrawingArea): + def __init__(self): + gtk.DrawingArea.__init__(self) + self.imagesink = None + self.unset_flags(gtk.DOUBLE_BUFFERED) + + def do_expose_event(self, event): + if self.imagesink: + self.imagesink.expose() + return False + else: + return True + + def set_sink(self, sink): + assert self.window.xid + self.imagesink = sink + self.imagesink.set_xwindow_id(self.window.xid) + +class PlayerWindow(gtk.Window): + UPDATE_INTERVAL = 500 + def __init__(self): + gtk.Window.__init__(self) + self.set_default_size(410, 325) + + self.create_ui() + + self.player = GstPlayer(self.videowidget) + + def on_eos(): + self.player.seek(0L) + self.play_toggled() + self.player.on_eos = lambda *x: on_eos() + + self.update_id = -1 + self.changed_id = -1 + self.seek_timeout_id = -1 + + self.p_position = gst.CLOCK_TIME_NONE + self.p_duration = gst.CLOCK_TIME_NONE + + def on_delete_event(): + self.player.stop() + gtk.main_quit() + self.connect('delete-event', lambda *x: on_delete_event()) + + def load_file(self, location): + self.player.set_location(location) + + def create_ui(self): + vbox = gtk.VBox() + self.add(vbox) + + self.videowidget = VideoWidget() + vbox.pack_start(self.videowidget) + + hbox = gtk.HBox() + vbox.pack_start(hbox, fill=False, expand=False) + + self.pause_image = gtk.image_new_from_stock(gtk.STOCK_MEDIA_PAUSE, + gtk.ICON_SIZE_BUTTON) + self.pause_image.show() + self.play_image = gtk.image_new_from_stock(gtk.STOCK_MEDIA_PLAY, + gtk.ICON_SIZE_BUTTON) + self.play_image.show() + self.button = button = gtk.Button() + button.add(self.play_image) + button.set_property('can-default', True) + button.set_focus_on_click(False) + button.show() + hbox.pack_start(button, False) + button.set_property('has-default', True) + button.connect('clicked', lambda *args: self.play_toggled()) + + self.adjustment = gtk.Adjustment(0.0, 0.00, 100.0, 0.1, 1.0, 1.0) + hscale = gtk.HScale(self.adjustment) + hscale.set_digits(2) + hscale.set_update_policy(gtk.UPDATE_CONTINUOUS) + hscale.connect('button-press-event', self.scale_button_press_cb) + hscale.connect('button-release-event', self.scale_button_release_cb) + hscale.connect('format-value', self.scale_format_value_cb) + hbox.pack_start(hscale) + self.hscale = hscale + + self.videowidget.connect_after('realize', + lambda *x: self.play_toggled()) + + def play_toggled(self): + self.button.remove(self.button.child) + if self.player.is_playing(): + self.player.pause() + self.button.add(self.play_image) + else: + self.player.play() + if self.update_id == -1: + self.update_id = gobject.timeout_add(self.UPDATE_INTERVAL, + self.update_scale_cb) + self.button.add(self.pause_image) + + def scale_format_value_cb(self, scale, value): + if self.p_duration == -1: + real = 0 + else: + real = value * self.p_duration / 100 + + seconds = real / gst.SECOND + + return "%02d:%02d" % (seconds / 60, seconds % 60) + + def scale_button_press_cb(self, widget, event): + # see seek.c:start_seek + gst.debug('starting seek') + + self.button.set_sensitive(False) + self.was_playing = self.player.is_playing() + if self.was_playing: + self.player.pause() + + # don't timeout-update position during seek + if self.update_id != -1: + gobject.source_remove(self.update_id) + self.update_id = -1 + + # make sure we get changed notifies + if self.changed_id == -1: + self.changed_id = self.hscale.connect('value-changed', + self.scale_value_changed_cb) + + def scale_value_changed_cb(self, scale): + # see seek.c:seek_cb + real = long(scale.get_value() * self.p_duration / 100) # in ns + gst.debug('value changed, perform seek to %r' % real) + self.player.seek(real) + # allow for a preroll + self.player.get_state(timeout=50*gst.MSECOND) # 50 ms + + def scale_button_release_cb(self, widget, event): + # see seek.cstop_seek + widget.disconnect(self.changed_id) + self.changed_id = -1 + + self.button.set_sensitive(True) + if self.seek_timeout_id != -1: + gobject.source_remove(self.seek_timeout_id) + self.seek_timeout_id = -1 + else: + gst.debug('released slider, setting back to playing') + if self.was_playing: + self.player.play() + + if self.update_id != -1: + self.error('Had a previous update timeout id') + else: + self.update_id = gobject.timeout_add(self.UPDATE_INTERVAL, + self.update_scale_cb) + + def update_scale_cb(self): + self.p_position, self.p_duration = self.player.query_position() + if self.p_position != gst.CLOCK_TIME_NONE: + value = self.p_position * 100.0 / self.p_duration + self.adjustment.set_value(value) + + return True + +def main(args): + def usage(): + sys.stderr.write("usage: %s URI-OF-MEDIA-FILE\n" % args[0]) + sys.exit(1) + + # Need to register our derived widget types for implicit event + # handlers to get called. + gobject.type_register(PlayerWindow) + gobject.type_register(VideoWidget) + + w = PlayerWindow() + + if len(args) != 2: + usage() + + if not gst.uri_is_valid(args[1]): + sys.stderr.write("Error: Invalid URI: %s\n" % args[1]) + sys.exit(1) + + w.load_file(args[1]) + w.show_all() + + gtk.main() + +if __name__ == '__main__': + sys.exit(main(sys.argv)) diff --git a/old_examples/pyidentity.py b/old_examples/pyidentity.py new file mode 100644 index 0000000..184c8c5 --- /dev/null +++ b/old_examples/pyidentity.py @@ -0,0 +1,68 @@ +#!/usr/bin/env python + +import pygtk +pygtk.require ("2.0") +import gobject +gobject.threads_init() + +import pygst +pygst.require('0.10') +import gst + +class PyIdentity(gst.Element): + _sinkpadtemplate = gst.PadTemplate ("sink", + gst.PAD_SINK, + gst.PAD_ALWAYS, + gst.caps_new_any()) + _srcpadtemplate = gst.PadTemplate ("src", + gst.PAD_SRC, + gst.PAD_ALWAYS, + gst.caps_new_any()) + + def __init__(self): + gst.Element.__init__(self) + + self.sinkpad = gst.Pad(self._sinkpadtemplate, "sink") + self.sinkpad.set_chain_function(self.chainfunc) + self.sinkpad.set_event_function(self.eventfunc) + self.sinkpad.set_getcaps_function(gst.Pad.proxy_getcaps) + self.sinkpad.set_setcaps_function(gst.Pad.proxy_setcaps) + self.add_pad (self.sinkpad) + + self.srcpad = gst.Pad(self._srcpadtemplate, "src") + + self.srcpad.set_event_function(self.srceventfunc) + self.srcpad.set_query_function(self.srcqueryfunc) + self.srcpad.set_getcaps_function(gst.Pad.proxy_getcaps) + self.srcpad.set_setcaps_function(gst.Pad.proxy_setcaps) + self.add_pad (self.srcpad) + + def chainfunc(self, pad, buffer): + gst.log ("Passing buffer with ts %d" % (buffer.timestamp)) + return self.srcpad.push (buffer) + + def eventfunc(self, pad, event): + return self.srcpad.push_event (event) + + def srcqueryfunc (self, pad, query): + return self.sinkpad.query (query) + def srceventfunc (self, pad, event): + return self.sinkpad.push_event (event) + +gobject.type_register(PyIdentity) + +pipe = gst.Pipeline() +vt = gst.element_factory_make ("videotestsrc") +i1 = PyIdentity() +color = gst.element_factory_make ("ffmpegcolorspace") +scale = gst.element_factory_make ("videoscale") +q1 = gst.element_factory_make ("queue") +i2 = PyIdentity() +sink = gst.element_factory_make ("autovideosink") + +pipe.add (vt, i1, q1, i2, color, scale, sink) +gst.element_link_many (vt, i1, q1, i2, color, scale, sink) + +pipe.set_state (gst.STATE_PLAYING) + +gobject.MainLoop().run() diff --git a/old_examples/remuxer.py b/old_examples/remuxer.py new file mode 100644 index 0000000..1ed4ab7 --- /dev/null +++ b/old_examples/remuxer.py @@ -0,0 +1,840 @@ +#!/usr/bin/env python +# -*- Mode: Python -*- +# vi:si:et:sw=4:sts=4:ts=4 + +import pygtk +pygtk.require('2.0') + +import sys + +import gobject +gobject.threads_init() + +import pygst +pygst.require('0.10') +import gst +import gst.interfaces +import gtk +gtk.gdk.threads_init() + +class GstPlayer: + def __init__(self, videowidget): + self.playing = False + self.player = gst.element_factory_make("playbin", "player") + self.videowidget = videowidget + + bus = self.player.get_bus() + bus.enable_sync_message_emission() + bus.add_signal_watch() + bus.connect('sync-message::element', self.on_sync_message) + bus.connect('message', self.on_message) + + def on_sync_message(self, bus, message): + if message.structure is None: + return + if message.structure.get_name() == 'prepare-xwindow-id': + # Sync with the X server before giving the X-id to the sink + gtk.gdk.threads_enter() + gtk.gdk.display_get_default().sync() + self.videowidget.set_sink(message.src) + message.src.set_property('force-aspect-ratio', True) + gtk.gdk.threads_leave() + + def on_message(self, bus, message): + t = message.type + if t == gst.MESSAGE_ERROR: + err, debug = message.parse_error() + print "Error: %s" % err, debug + if self.on_eos: + self.on_eos() + self.playing = False + elif t == gst.MESSAGE_EOS: + if self.on_eos: + self.on_eos() + self.playing = False + + def set_location(self, location): + self.player.set_state(gst.STATE_NULL) + self.player.set_property('uri', location) + + def get_location(self): + return self.player.get_property('uri') + + def query_position(self): + "Returns a (position, duration) tuple" + try: + position, format = self.player.query_position(gst.FORMAT_TIME) + except: + position = gst.CLOCK_TIME_NONE + + try: + duration, format = self.player.query_duration(gst.FORMAT_TIME) + except: + duration = gst.CLOCK_TIME_NONE + + return (position, duration) + + def seek(self, location): + """ + @param location: time to seek to, in nanoseconds + """ + gst.debug("seeking to %r" % location) + event = gst.event_new_seek(1.0, gst.FORMAT_TIME, + gst.SEEK_FLAG_FLUSH, + gst.SEEK_TYPE_SET, location, + gst.SEEK_TYPE_NONE, 0) + + res = self.player.send_event(event) + if res: + gst.info("setting new stream time to 0") + self.player.set_new_stream_time(0L) + else: + gst.error("seek to %r failed" % location) + + def pause(self): + gst.info("pausing player") + self.player.set_state(gst.STATE_PAUSED) + self.playing = False + + def play(self): + gst.info("playing player") + self.player.set_state(gst.STATE_PLAYING) + self.playing = True + + def stop(self): + self.player.set_state(gst.STATE_NULL) + gst.info("stopped player") + + def get_state(self, timeout=1): + return self.player.get_state(timeout=timeout) + + def is_playing(self): + return self.playing + +class VideoWidget(gtk.DrawingArea): + def __init__(self): + gtk.DrawingArea.__init__(self) + self.imagesink = None + self.unset_flags(gtk.DOUBLE_BUFFERED) + + def do_expose_event(self, event): + if self.imagesink: + self.imagesink.expose() + return False + else: + return True + + def set_sink(self, sink): + assert self.window.xid + self.imagesink = sink + self.imagesink.set_xwindow_id(self.window.xid) + +class TimeControl(gtk.HBox): + # all labels same size + sizegroup = gtk.SizeGroup(gtk.SIZE_GROUP_HORIZONTAL) + __gproperties__ = {'time': (gobject.TYPE_UINT64, 'Time', 'Time', + # not actually usable: see #335854 + # kept for .notify() usage + 0L, (1<<63)-1, 0L, + gobject.PARAM_READABLE)} + + def __init__(self, window, label): + gtk.HBox.__init__(self) + self.pwindow = window + self.label = label + self.create_ui() + + def get_property(self, param, pspec): + if param == 'time': + return self.get_time() + else: + assert param in self.__gproperties__, \ + 'Unknown property: %s' % param + + def create_ui(self): + label = gtk.Label(self.label + ": ") + label.show() + a = gtk.Alignment(1.0, 0.5) + a.add(label) + a.set_padding(0, 0, 12, 0) + a.show() + self.sizegroup.add_widget(a) + self.pack_start(a, True, False, 0) + + self.minutes = minutes = gtk.Entry(5) + minutes.set_width_chars(5) + minutes.set_alignment(1.0) + minutes.connect('changed', lambda *x: self.notify('time')) + minutes.connect_after('activate', lambda *x: self.activated()) + label2 = gtk.Label(":") + self.seconds = seconds = gtk.Entry(2) + seconds.set_width_chars(2) + seconds.set_alignment(1.0) + seconds.connect('changed', lambda *x: self.notify('time')) + seconds.connect_after('activate', lambda *x: self.activated()) + label3 = gtk.Label(".") + self.milliseconds = milliseconds = gtk.Entry(3) + milliseconds.set_width_chars(3) + milliseconds.set_alignment(0.0) + milliseconds.connect('changed', lambda *x: self.notify('time')) + milliseconds.connect_after('activate', lambda *x: self.activated()) + set = gtk.Button('Set') + goto = gtk.Button('Go') + goto.set_property('image', + gtk.image_new_from_stock(gtk.STOCK_JUMP_TO, + gtk.ICON_SIZE_BUTTON)) + for w in minutes, label2, seconds, label3, milliseconds: + w.show() + self.pack_start(w, False) + set.show() + self.pack_start(set, False, False, 6) + goto.show() + self.pack_start(goto, False, False, 0) + set.connect('clicked', lambda *x: self.set_now()) + goto.connect('clicked', lambda *x: self.activated()) + pad = gtk.Label("") + pad.show() + self.pack_start(pad, True, False, 0) + + def get_time(self): + time = 0 + for w, multiplier in ((self.minutes, gst.SECOND*60), + (self.seconds, gst.SECOND), + (self.milliseconds, gst.MSECOND)): + text = w.get_text() + try: + val = int(text) + except ValueError: + val = 0 + w.set_text(val and str(val) or '0') + time += val * multiplier + return time + + def set_time(self, time): + if time == gst.CLOCK_TIME_NONE: + print "Can't set '%s' (invalid time)" % self.label + return + self.freeze_notify() + for w, multiplier in ((self.minutes, gst.SECOND*60), + (self.seconds, gst.SECOND), + (self.milliseconds, gst.MSECOND)): + val = time // multiplier + w.set_text(str(val)) + time -= val * multiplier + self.thaw_notify() + + def set_now(self): + time, dur = self.pwindow.player.query_position() + self.set_time(time) + + def activated(self): + time = self.get_time() + if self.pwindow.player.is_playing(): + self.pwindow.play_toggled() + self.pwindow.player.seek(time) + self.pwindow.player.get_state(timeout=gst.MSECOND * 200) + +class ProgressDialog(gtk.Dialog): + def __init__(self, title, description, task, parent, flags, buttons): + gtk.Dialog.__init__(self, title, parent, flags, buttons) + self._create_ui(title, description, task) + + def _create_ui(self, title, description, task): + self.set_border_width(6) + self.set_resizable(False) + self.set_has_separator(False) + + vbox = gtk.VBox() + vbox.set_border_width(6) + vbox.show() + self.vbox.pack_start(vbox, False) + + label = gtk.Label('%s' % title) + label.set_use_markup(True) + label.set_alignment(0.0, 0.0) + label.show() + vbox.pack_start(label, False) + + label = gtk.Label(description) + label.set_use_markup(True) + label.set_alignment(0.0, 0.0) + label.set_line_wrap(True) + label.set_padding(0, 12) + label.show() + vbox.pack_start(label, False) + + self.progress = progress = gtk.ProgressBar() + progress.show() + vbox.pack_start(progress, False) + + self.progresstext = label = gtk.Label('') + label.set_line_wrap(True) + label.set_use_markup(True) + label.set_alignment(0.0, 0.0) + label.show() + vbox.pack_start(label) + self.set_task(task) + + def set_task(self, task): + self.progresstext.set_markup('%s' % task) + +UNKNOWN = 0 +SUCCESS = 1 +FAILURE = 2 +CANCELLED = 3 + +class RemuxProgressDialog(ProgressDialog): + def __init__(self, parent, start, stop, fromname, toname): + ProgressDialog.__init__(self, + "Writing to disk", + ('Writing the selected segment of %s ' + 'to %s. This may take some time.' + % (fromname, toname)), + 'Starting media pipeline', + parent, + gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT, + (gtk.STOCK_CANCEL, CANCELLED, + gtk.STOCK_CLOSE, SUCCESS)) + self.start = start + self.stop = stop + self.update_position(start) + self.set_completed(False) + + def update_position(self, pos): + pos = min(max(pos, self.start), self.stop) + remaining = self.stop - pos + minutes = remaining // (gst.SECOND * 60) + seconds = (remaining - minutes * gst.SECOND * 60) // gst.SECOND + self.progress.set_text('%d:%02d of video remaining' % (minutes, seconds)) + self.progress.set_fraction(1.0 - float(remaining) / (self.stop - self.start)) + + def set_completed(self, completed): + self.set_response_sensitive(CANCELLED, not completed) + self.set_response_sensitive(SUCCESS, completed) + +def set_connection_blocked_async_marshalled(pads, proc, *args, **kwargs): + def clear_list(l): + while l: + l.pop() + + to_block = list(pads) + to_relink = [(x, x.get_peer()) for x in pads] + + def on_pad_blocked_sync(pad, is_blocked): + if pad not in to_block: + # can happen after the seek and before unblocking -- racy, + # but no prob, bob. + return + to_block.remove(pad) + if not to_block: + # marshal to main thread + gobject.idle_add(on_pads_blocked) + + def on_pads_blocked(): + for src, sink in to_relink: + src.link(sink) + proc(*args, **kwargs) + for src, sink in to_relink: + src.set_blocked_async(False, lambda *x: None) + clear_list(to_relink) + + for src, sink in to_relink: + src.unlink(sink) + src.set_blocked_async(True, on_pad_blocked_sync) + +class Remuxer(gst.Pipeline): + + __gsignals__ = {'done': (gobject.SIGNAL_RUN_LAST, None, (int,))} + + def __init__(self, fromuri, touri, start, stop): + # HACK: should do Pipeline.__init__, but that doesn't do what we + # want; there's a bug open aboooot that + self.__gobject_init__() + + assert start >= 0 + assert stop > start + + self.fromuri = fromuri + self.touri = None + self.start_time = start + self.stop_time = stop + + self.src = self.remuxbin = self.sink = None + self.resolution = UNKNOWN + + self.window = None + self.pdialog = None + + self._query_id = -1 + + def do_setup_pipeline(self): + self.src = gst.element_make_from_uri(gst.URI_SRC, self.fromuri) + self.remuxbin = RemuxBin(self.start_time, self.stop_time) + self.sink = gst.element_make_from_uri(gst.URI_SINK, self.touri) + self.resolution = UNKNOWN + + if gobject.signal_lookup('allow-overwrite', self.sink.__class__): + self.sink.connect('allow-overwrite', lambda *x: True) + + self.add(self.src, self.remuxbin, self.sink) + + self.src.link(self.remuxbin) + self.remuxbin.link(self.sink) + + def do_get_touri(self): + chooser = gtk.FileChooserDialog('Save as...', + self.window, + action=gtk.FILE_CHOOSER_ACTION_SAVE, + buttons=(gtk.STOCK_CANCEL, + CANCELLED, + gtk.STOCK_SAVE, + SUCCESS)) + chooser.set_uri(self.fromuri) # to select the folder + chooser.unselect_all() + chooser.set_do_overwrite_confirmation(True) + name = self.fromuri.split('/')[-1][:-4] + '-remuxed.ogg' + chooser.set_current_name(name) + resp = chooser.run() + uri = chooser.get_uri() + chooser.destroy() + + if resp == SUCCESS: + return uri + else: + return None + + def _start_queries(self): + def do_query(): + try: + # HACK: self.remuxbin.query() should do the same + # (requires implementing a vmethod, dunno how to do that + # although i think it's possible) + # HACK: why does self.query_position(..) not give useful + # answers? + pad = self.remuxbin.get_pad('src') + pos, duration = pad.query_position(gst.FORMAT_TIME) + if pos != gst.CLOCK_TIME_NONE: + self.pdialog.update_position(pos) + except: + # print 'query failed' + pass + return True + if self._query_id == -1: + self._query_id = gobject.timeout_add(100, # 10 Hz + do_query) + + def _stop_queries(self): + if self._query_id != -1: + gobject.source_remove(self._query_id) + self._query_id = -1 + + def _bus_watch(self, bus, message): + if message.type == gst.MESSAGE_ERROR: + print 'error', message + self._stop_queries() + m = gtk.MessageDialog(self.window, + gtk.DIALOG_MODAL|gtk.DIALOG_DESTROY_WITH_PARENT, + gtk.MESSAGE_ERROR, + gtk.BUTTONS_CLOSE, + "Error processing file") + gerror, debug = message.parse_error() + txt = ('There was an error processing your file: %s\n\n' + 'Debug information:\n%s' % (gerror, debug)) + m.format_secondary_text(txt) + m.run() + m.destroy() + self.response(FAILURE) + elif message.type == gst.MESSAGE_WARNING: + print 'warning', message + elif message.type == gst.MESSAGE_EOS: + # print 'eos, woot', message.src + name = self.touri + if name.startswith('file://'): + name = name[7:] + self.pdialog.set_task('Finished writing %s' % name) + self.pdialog.update_position(self.stop_time) + self._stop_queries() + self.pdialog.set_completed(True) + elif message.type == gst.MESSAGE_STATE_CHANGED: + if message.src == self: + old, new, pending = message.parse_state_changed() + if ((old, new, pending) == + (gst.STATE_READY, gst.STATE_PAUSED, + gst.STATE_VOID_PENDING)): + self.pdialog.set_task('Processing file') + self.pdialog.update_position(self.start_time) + self._start_queries() + self.set_state(gst.STATE_PLAYING) + + def response(self, response): + assert self.resolution == UNKNOWN + self.resolution = response + self.set_state(gst.STATE_NULL) + self.pdialog.destroy() + self.pdialog = None + self.window.set_sensitive(True) + self.emit('done', response) + + def start(self, main_window): + self.window = main_window + self.touri = self.do_get_touri() + if not self.touri: + return False + self.do_setup_pipeline() + bus = self.get_bus() + bus.add_signal_watch() + bus.connect('message', self._bus_watch) + if self.window: + # can be None if we are debugging... + self.window.set_sensitive(False) + fromname = self.fromuri.split('/')[-1] + toname = self.touri.split('/')[-1] + self.pdialog = RemuxProgressDialog(main_window, self.start_time, + self.stop_time, fromname, toname) + self.pdialog.show() + self.pdialog.connect('response', lambda w, r: self.response(r)) + + self.set_state(gst.STATE_PAUSED) + return True + + def run(self, main_window): + if self.start(main_window): + loop = gobject.MainLoop() + self.connect('done', lambda *x: gobject.idle_add(loop.quit)) + loop.run() + else: + self.resolution = CANCELLED + return self.resolution + +class RemuxBin(gst.Bin): + def __init__(self, start_time, stop_time): + self.__gobject_init__() + + self.parsefactories = self._find_parsers() + self.parsers = [] + + self.demux = gst.element_factory_make('oggdemux') + self.mux = gst.element_factory_make('oggmux') + + self.add(self.demux, self.mux) + + self.add_pad(gst.GhostPad('sink', self.demux.get_pad('sink'))) + self.add_pad(gst.GhostPad('src', self.mux.get_pad('src'))) + + self.demux.connect('pad-added', self._new_demuxed_pad) + self.demux.connect('no-more-pads', self._no_more_pads) + + self.start_time = start_time + self.stop_time = stop_time + + def _find_parsers(self): + registry = gst.registry_get_default() + ret = {} + for f in registry.get_feature_list(gst.ElementFactory): + if f.get_klass().find('Parser') >= 0: + for t in f.get_static_pad_templates(): + if t.direction == gst.PAD_SINK: + for s in t.get_caps(): + ret[s.get_name()] = f.get_name() + break + return ret + + def _new_demuxed_pad(self, element, pad): + format = pad.get_caps()[0].get_name() + + if format not in self.parsefactories: + self.async_error("Unsupported media type: %s", format) + return + + queue = gst.element_factory_make('queue', None); + queue.set_property('max-size-buffers', 1000) + parser = gst.element_factory_make(self.parsefactories[format]) + self.add(queue) + self.add(parser) + queue.set_state(gst.STATE_PAUSED) + parser.set_state(gst.STATE_PAUSED) + pad.link(queue.get_compatible_pad(pad)) + queue.link(parser) + parser.link(self.mux) + self.parsers.append(parser) + + def _do_seek(self): + flags = gst.SEEK_FLAG_FLUSH + # HACK: self.seek should work, should try that at some point + return self.demux.seek(1.0, gst.FORMAT_TIME, flags, + gst.SEEK_TYPE_SET, self.start_time, + gst.SEEK_TYPE_SET, self.stop_time) + + def _no_more_pads(self, element): + pads = [x.get_pad('src') for x in self.parsers] + set_connection_blocked_async_marshalled(pads, + self._do_seek) + + +class PlayerWindow(gtk.Window): + UPDATE_INTERVAL = 500 + def __init__(self): + gtk.Window.__init__(self) + self.set_default_size(600, 425) + + self.create_ui() + + self.player = GstPlayer(self.videowidget) + + def on_eos(): + self.player.seek(0L) + self.play_toggled() + self.player.on_eos = lambda *x: on_eos() + + self.update_id = -1 + self.changed_id = -1 + self.seek_timeout_id = -1 + + self.p_position = gst.CLOCK_TIME_NONE + self.p_duration = gst.CLOCK_TIME_NONE + + def on_delete_event(): + self.player.stop() + gtk.main_quit() + self.connect('delete-event', lambda *x: on_delete_event()) + + def load_file(self, location): + filename = location.split('/')[-1] + self.set_title('%s munger' % filename) + self.player.set_location(location) + if self.videowidget.flags() & gtk.REALIZED: + self.play_toggled() + else: + self.videowidget.connect_after('realize', + lambda *x: self.play_toggled()) + + def create_ui(self): + vbox = gtk.VBox() + vbox.show() + self.add(vbox) + + self.videowidget = VideoWidget() + self.videowidget.show() + vbox.pack_start(self.videowidget) + + hbox = gtk.HBox() + hbox.show() + vbox.pack_start(hbox, fill=False, expand=False) + + self.adjustment = gtk.Adjustment(0.0, 0.00, 100.0, 0.1, 1.0, 1.0) + hscale = gtk.HScale(self.adjustment) + hscale.set_digits(2) + hscale.set_update_policy(gtk.UPDATE_CONTINUOUS) + hscale.connect('button-press-event', self.scale_button_press_cb) + hscale.connect('button-release-event', self.scale_button_release_cb) + hscale.connect('format-value', self.scale_format_value_cb) + hbox.pack_start(hscale) + hscale.show() + self.hscale = hscale + + table = gtk.Table(2,3) + table.show() + vbox.pack_start(table, fill=False, expand=False, padding=6) + + self.button = button = gtk.Button(stock=gtk.STOCK_MEDIA_PLAY) + button.set_property('can-default', True) + button.set_focus_on_click(False) + button.show() + + # problem: play and paused are of different widths and cause the + # window to re-layout + # "solution": add more buttons to a vbox so that the horizontal + # width is enough + bvbox = gtk.VBox() + bvbox.add(button) + bvbox.add(gtk.Button(stock=gtk.STOCK_MEDIA_PLAY)) + bvbox.add(gtk.Button(stock=gtk.STOCK_MEDIA_PAUSE)) + sizegroup = gtk.SizeGroup(gtk.SIZE_GROUP_HORIZONTAL) + for kid in bvbox.get_children(): + sizegroup.add_widget(kid) + bvbox.show() + table.attach(bvbox, 0, 1, 0, 2, gtk.FILL, gtk.FILL) + + # can't set this property before the button has a window + button.set_property('has-default', True) + button.connect('clicked', lambda *args: self.play_toggled()) + + self.cutin = cut = TimeControl(self, "Cut in time") + cut.show() + table.attach(cut, 1, 2, 0, 1, gtk.EXPAND, 0, 12) + + self.cutout = cut = TimeControl(self, "Cut out time") + cut.show() + table.attach(cut, 1, 2, 1, 2, gtk.EXPAND, 0, 12) + + button = gtk.Button("_Open other movie...") + button.show() + button.connect('clicked', lambda *x: self.do_choose_file()) + table.attach(button, 2, 3, 0, 1, gtk.FILL, gtk.FILL) + + button = gtk.Button("_Write to disk") + button.set_property('image', + gtk.image_new_from_stock(gtk.STOCK_SAVE_AS, + gtk.ICON_SIZE_BUTTON)) + button.connect('clicked', lambda *x: self.do_remux()) + button.show() + table.attach(button, 2, 3, 1, 2, gtk.FILL, gtk.FILL) + + #self.cutin.connect('notify::time', lambda *x: self.check_cutout()) + #self.cutout.connect('notify::time', lambda *x: self.check_cutin()) + + def do_remux(self): + if self.player.is_playing(): + self.play_toggled() + in_uri = self.player.get_location() + out_uri = in_uri[:-4] + '-remuxed.ogg' + r = Remuxer(in_uri, out_uri, + self.cutin.get_time(), self.cutout.get_time()) + r.run(self) + + def do_choose_file(self): + if self.player.is_playing(): + self.play_toggled() + chooser = gtk.FileChooserDialog('Choose a movie to cut cut cut', + self, + buttons=(gtk.STOCK_CANCEL, + CANCELLED, + gtk.STOCK_OPEN, + SUCCESS)) + chooser.set_local_only(False) + chooser.set_select_multiple(False) + f = gtk.FileFilter() + f.set_name("All files") + f.add_pattern("*") + chooser.add_filter(f) + f = gtk.FileFilter() + f.set_name("Ogg files") + f.add_pattern("*.og[gvax]") # as long as this is the only thing we + # support... + chooser.add_filter(f) + chooser.set_filter(f) + + prev = self.player.get_location() + if prev: + chooser.set_uri(prev) + + resp = chooser.run() + uri = chooser.get_uri() + chooser.destroy() + + if resp == SUCCESS and uri != None: + self.load_file(uri) + return True + else: + return False + + def check_cutout(self): + if self.cutout.get_time() <= self.cutin.get_time(): + pos, dur = self.player.query_position() + self.cutout.set_time(dur) + + def check_cutin(self): + if self.cutin.get_time() >= self.cutout.get_time(): + self.cutin.set_time(0) + + def play_toggled(self): + if self.player.is_playing(): + self.player.pause() + self.button.set_label(gtk.STOCK_MEDIA_PLAY) + else: + self.player.play() + if self.update_id == -1: + self.update_id = gobject.timeout_add(self.UPDATE_INTERVAL, + self.update_scale_cb) + self.button.set_label(gtk.STOCK_MEDIA_PAUSE) + + def scale_format_value_cb(self, scale, value): + if self.p_duration == -1: + real = 0 + else: + real = value * self.p_duration / 100 + + seconds = real / gst.SECOND + + return "%02d:%02d" % (seconds / 60, seconds % 60) + + def scale_button_press_cb(self, widget, event): + # see seek.c:start_seek + gst.debug('starting seek') + + self.button.set_sensitive(False) + self.was_playing = self.player.is_playing() + if self.was_playing: + self.player.pause() + + # don't timeout-update position during seek + if self.update_id != -1: + gobject.source_remove(self.update_id) + self.update_id = -1 + + # make sure we get changed notifies + if self.changed_id == -1: + self.changed_id = self.hscale.connect('value-changed', + self.scale_value_changed_cb) + + def scale_value_changed_cb(self, scale): + # see seek.c:seek_cb + real = long(scale.get_value() * self.p_duration / 100) # in ns + gst.debug('value changed, perform seek to %r' % real) + self.player.seek(real) + # allow for a preroll + self.player.get_state(timeout=50*gst.MSECOND) # 50 ms + + def scale_button_release_cb(self, widget, event): + # see seek.cstop_seek + widget.disconnect(self.changed_id) + self.changed_id = -1 + + self.button.set_sensitive(True) + if self.seek_timeout_id != -1: + gobject.source_remove(self.seek_timeout_id) + self.seek_timeout_id = -1 + else: + gst.debug('released slider, setting back to playing') + if self.was_playing: + self.player.play() + + if self.update_id != -1: + self.error('Had a previous update timeout id') + else: + self.update_id = gobject.timeout_add(self.UPDATE_INTERVAL, + self.update_scale_cb) + + def update_scale_cb(self): + had_duration = self.p_duration != gst.CLOCK_TIME_NONE + self.p_position, self.p_duration = self.player.query_position() + if self.p_position != gst.CLOCK_TIME_NONE: + value = self.p_position * 100.0 / self.p_duration + self.adjustment.set_value(value) + if not had_duration: + self.cutin.set_time(0) + return True + +def main(args): + def usage(): + sys.stderr.write("usage: %s [URI-OF-MEDIA-FILE]\n" % args[0]) + return 1 + + w = PlayerWindow() + w.show() + + if len(args) == 1: + if not w.do_choose_file(): + return 1 + elif len(args) == 2: + if not gst.uri_is_valid(args[1]): + sys.stderr.write("Error: Invalid URI: %s\n" % args[1]) + return 1 + w.load_file(args[1]) + else: + return usage() + + gtk.main() + +if __name__ == '__main__': + sys.exit(main(sys.argv)) diff --git a/old_examples/segments.py b/old_examples/segments.py new file mode 100755 index 0000000..6ce3cfb --- /dev/null +++ b/old_examples/segments.py @@ -0,0 +1,198 @@ +#! /usr/bin/env python +# -*- coding: utf-8 -*- + +# Segments.py +# Copyright (C) 2006 Artem Popov +# +# This example demonstrates segment seeking +# and seamless looping within playbin. + +import pygst +pygst.require ("0.10") +import gst + +import pygtk +pygtk.require ("2.0") +import gobject + +class Looper (gobject.GObject): + __gproperties__ = { + "loop": (gobject.TYPE_BOOLEAN, + "loop", + "Whether to loop the segment", + False, + gobject.PARAM_READWRITE), + "start-pos": (gobject.TYPE_UINT64, + "start position", + "The segment start marker", + 0, + 0xfffffffffffffff, # max long possible + 0, + gobject.PARAM_READWRITE), + "stop-pos": (gobject.TYPE_UINT64, + "stop position", + "The segment stop marker", + 0, + 0xfffffffffffffff, # max long possible + 0, + gobject.PARAM_READWRITE), + } # __gproperties__ + + __gsignals__ = { + "stopped": (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, ()), + "position-updated": (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, (gobject.TYPE_FLOAT,)), + "error": (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, (gobject.TYPE_PYOBJECT,)) + } # __gsignals__ + + def __init__ (self, location = None): + gobject.GObject.__init__ (self) + + self.__playbin = gst.element_factory_make ("playbin") + self.__playbin.props.video_sink = gst.element_factory_make ("fakesink") + + bus = self.__playbin.get_bus () + bus.add_watch (self.__on_bus_message) + + self.__loop = False + self.__start_pos = 0 + self.__stop_pos = 0 + + self.__timeout_id = 0 + + if location: + self.load (location) + + def load (self, location): + self.__playbin.props.uri = location + self.__start_position = 0 + self.__stop_position = 0 + + def set_segment (self, start, stop): + self.props.start_pos = start + self.props.stop_pos = stop + + def play (self): + if not (self.__start_pos or self.__stop_pos): + raise RuntimeError, "Cannot start playback, segment was not set!" + + self.__playbin.set_state (gst.STATE_PLAYING) + + def stop (self, silent = False): + self.__playbin.set_state (gst.STATE_NULL) + if not silent: + self.emit ("stopped") + + def do_get_property (self, property): + if property.name == "loop": + return self.__loop + elif property.name == "start-pos": + return self.__start_pos + elif property.name == "stop-pos": + return self.__stop_pos + else: + raise AttributeError, "Unknown property %s" % property.name + + def do_set_property (self, property, value): + if property.name == "loop": + self.__loop = value + elif property.name == "start-pos": + self.__start_pos = value + elif property.name == "stop-pos": + self.__stop_pos = value + else: + raise AttributeError, "Unknown property %s" % property.name + + def do_stopped (self): + if self.__timeout_id: + gobject.source_remove (self.__timeout_id) + self.__timeout_id = 0 + + def __seek (self, start, stop, flush): + flags = gst.SEEK_FLAG_SEGMENT | gst.SEEK_FLAG_ACCURATE + if flush: + flags = flags | gst.SEEK_FLAG_FLUSH + self.__playbin.seek (1.0, gst.FORMAT_TIME, flags, + gst.SEEK_TYPE_SET, start, + gst.SEEK_TYPE_SET, stop) + + def __on_timeout (self): + position = self.__playbin.query_position (gst.FORMAT_TIME) [0] + self.emit ("position-updated", float (position)) + return True + + def __on_bus_message (self, bus, message): + if message.type == gst.MESSAGE_ERROR: + error, debug = message.parse_error () + self.stop () # this looks neccessary here + self.emit ("error", (error, debug)) + + elif message.type == gst.MESSAGE_NEW_CLOCK: + # we connect the timeout handler here to be sure that further queries succeed + interval = int ((self.__stop_position - self.__start_position) / (2 * gst.SECOND) + 50) + self.__timeout_id = gobject.timeout_add (interval, self.__on_timeout) + + elif message.type == gst.MESSAGE_STATE_CHANGED: + old_state, new_state, pending = message.parse_state_changed () + if old_state == gst.STATE_READY and new_state == gst.STATE_PAUSED and message.src == self.__playbin: + self.__seek (self.__start_pos, self.__stop_pos, True) + + elif message.type == gst.MESSAGE_SEGMENT_DONE: + if self.__loop: + self.__seek (self.__start_pos, self.__stop_pos, False) + else: + src = self.__playbin.get_property ("source") + pad = src.get_pad ('src') + pad.push_event (gst.event_new_eos ()) + + # this is the good old way: + # + # pads = src.src_pads () + # while True: + # try: + # pad = pads.next () + # pad.push_event (gst.event_new_eos ()) + # except: + # break + + elif message.type == gst.MESSAGE_EOS: + self.stop () + + return True + +mainloop = gobject.MainLoop () + +def on_looper_stopped (looper): + mainloop.quit () + +def on_looper_pos_updated (looper, position): + print round (position / gst.SECOND, 2) + +def on_looper_error (looper, error_tuple): + error, debug = error_tuple + print "\n\n%s\n\n%s\n\n" % (error, debug) + mainloop.quit () + +if __name__ == "__main__": + import sys + if len (sys.argv) != 5: + print "Usage: %s " % sys.argv [0] + sys.exit (1) + + if "://" in sys.argv [1]: + uri = sys.argv [1] + else: + import os.path + uri = "file://" + os.path.abspath (sys.argv [1]) + + looper = Looper (uri) + + looper.props.start_pos = long (sys.argv [2]) * gst.SECOND + looper.props.stop_pos = long (sys.argv [3]) * gst.SECOND + looper.props.loop = int (sys.argv [4]) + + looper.connect ("stopped", on_looper_stopped) + looper.connect ("position-updated", on_looper_pos_updated) + looper.connect ("error", on_looper_error) + + looper.play () + mainloop.run () diff --git a/old_examples/sinkelement-registry.py b/old_examples/sinkelement-registry.py new file mode 100644 index 0000000..8131acd --- /dev/null +++ b/old_examples/sinkelement-registry.py @@ -0,0 +1,69 @@ +#!/usr/bin/env python +# -*- Mode: Python -*- +# vi:si:et:sw=4:sts=4:ts=4 + +# sinkelement.py +# (c) 2005 Edward Hervey +# (c) 2007 Jan Schmidt +# Licensed under LGPL +# +# Small test application to show how to write a sink element +# in 20 lines in python and place into the gstreamer registry +# so it can be autoplugged or used from parse_launch. +# +# Run this script with GST_DEBUG=python:5 to see the debug +# messages + +import pygst +pygst.require('0.10') +import gst +import gobject +gobject.threads_init () + +# +# Simple Sink element created entirely in python +# + +class MySink(gst.Element): + __gstdetails__ = ('CustomSink','Sink', \ + 'Custom test sink element', 'Edward Hervey') + + _sinkpadtemplate = gst.PadTemplate ("sinkpadtemplate", + gst.PAD_SINK, + gst.PAD_ALWAYS, + gst.caps_new_any()) + + def __init__(self): + gst.Element.__init__(self) + gst.info('creating sinkpad') + self.sinkpad = gst.Pad(self._sinkpadtemplate, "sink") + gst.info('adding sinkpad to self') + self.add_pad(self.sinkpad) + + gst.info('setting chain/event functions') + self.sinkpad.set_chain_function(self.chainfunc) + self.sinkpad.set_event_function(self.eventfunc) + + def chainfunc(self, pad, buffer): + self.info("%s timestamp(buffer):%d" % (pad, buffer.timestamp)) + return gst.FLOW_OK + + def eventfunc(self, pad, event): + self.info("%s event:%r" % (pad, event.type)) + return True + +gobject.type_register(MySink) + +# Register the element into this process' registry. +gst.element_register (MySink, 'mysink', gst.RANK_MARGINAL) + +print "Use --gst-debug=python:3 to see output from this example" + +# +# Code to test the MySink class +# +gst.info('About to create MySink') +pipeline = gst.parse_launch ("fakesrc ! mysink") +pipeline.set_state(gst.STATE_PLAYING) + +gobject.MainLoop().run() diff --git a/old_examples/sinkelement.py b/old_examples/sinkelement.py new file mode 100644 index 0000000..a596601 --- /dev/null +++ b/old_examples/sinkelement.py @@ -0,0 +1,68 @@ +#!/usr/bin/env python +# -*- Mode: Python -*- +# vi:si:et:sw=4:sts=4:ts=4 + +# sinkelement.py +# (c) 2005 Edward Hervey +# Licensed under LGPL +# +# Small test application to show how to write a sink element +# in 20 lines in python +# +# Run this script with GST_DEBUG=python:5 to see the debug +# messages + +import pygst +pygst.require('0.10') +import gst +import gobject +gobject.threads_init () + +# +# Simple Sink element created entirely in python +# + +class MySink(gst.Element): + + _sinkpadtemplate = gst.PadTemplate ("sinkpadtemplate", + gst.PAD_SINK, + gst.PAD_ALWAYS, + gst.caps_new_any()) + + def __init__(self): + gst.Element.__init__(self) + gst.info('creating sinkpad') + self.sinkpad = gst.Pad(self._sinkpadtemplate, "sink") + gst.info('adding sinkpad to self') + self.add_pad(self.sinkpad) + + gst.info('setting chain/event functions') + self.sinkpad.set_chain_function(self.chainfunc) + self.sinkpad.set_event_function(self.eventfunc) + + def chainfunc(self, pad, buffer): + self.info("%s timestamp(buffer):%d" % (pad, buffer.timestamp)) + return gst.FLOW_OK + + def eventfunc(self, pad, event): + self.info("%s event:%r" % (pad, event.type)) + return True + +gobject.type_register(MySink) + +# +# Code to test the MySink class +# + +src = gst.element_factory_make('fakesrc') +gst.info('About to create MySink') +sink = MySink() + +pipeline = gst.Pipeline() +pipeline.add(src, sink) + +src.link(sink) + +pipeline.set_state(gst.STATE_PLAYING) + +gobject.MainLoop().run() diff --git a/old_examples/switch.py b/old_examples/switch.py new file mode 100755 index 0000000..c47b71a --- /dev/null +++ b/old_examples/switch.py @@ -0,0 +1,192 @@ +#!/usr/bin/env python +# -*- Mode: Python -*- +# vi:si:et:sw=4:sts=4:ts=4 + +import pygtk +pygtk.require('2.0') + +import sys + +import gobject +gobject.threads_init() + +import pygst +pygst.require('0.10') +import gst +import gst.interfaces +import gtk +gtk.gdk.threads_init() + +class SwitchTest: + def __init__(self, videowidget): + self.playing = False + pipestr = ('videotestsrc pattern=0 ! queue ! s.sink0' + ' videotestsrc pattern=1 ! queue ! s.sink1' + ' input-selector name=s ! autovideosink') + self.pipeline = gst.parse_launch(pipestr) + self.videowidget = videowidget + + bus = self.pipeline.get_bus() + bus.enable_sync_message_emission() + bus.add_signal_watch() + bus.connect('sync-message::element', self.on_sync_message) + bus.connect('message', self.on_message) + + def on_sync_message(self, bus, message): + if message.structure is None: + return + if message.structure.get_name() == 'prepare-xwindow-id': + # Sync with the X server before giving the X-id to the sink + gtk.gdk.threads_enter() + gtk.gdk.display_get_default().sync() + self.videowidget.set_sink(message.src) + message.src.set_property('force-aspect-ratio', True) + gtk.gdk.threads_leave() + + def on_message(self, bus, message): + t = message.type + if t == gst.MESSAGE_ERROR: + err, debug = message.parse_error() + print "Error: %s" % err, debug + if self.on_eos: + self.on_eos() + self.playing = False + elif t == gst.MESSAGE_EOS: + if self.on_eos: + self.on_eos() + self.playing = False + + def play(self): + self.playing = True + gst.info("playing player") + self.pipeline.set_state(gst.STATE_PLAYING) + + def stop(self): + self.pipeline.set_state(gst.STATE_NULL) + gst.info("stopped player") + self.playing = False + + def get_state(self, timeout=1): + return self.pipeline.get_state(timeout=timeout) + + def is_playing(self): + return self.playing + + def switch(self, padname): + switch = self.pipeline.get_by_name('s') + stop_time = switch.emit('block') + newpad = switch.get_static_pad(padname) + start_time = newpad.get_property('running-time') + + gst.warning('stop time = %d' % (stop_time,)) + gst.warning('stop time = %s' % (gst.TIME_ARGS(stop_time),)) + + gst.warning('start time = %d' % (start_time,)) + gst.warning('start time = %s' % (gst.TIME_ARGS(start_time),)) + + gst.warning('switching from %r to %r' + % (switch.get_property('active-pad'), padname)) + switch.emit('switch', newpad, stop_time, start_time) + +class VideoWidget(gtk.DrawingArea): + def __init__(self): + gtk.DrawingArea.__init__(self) + self.imagesink = None + self.unset_flags(gtk.DOUBLE_BUFFERED) + + def do_expose_event(self, event): + if self.imagesink: + self.imagesink.expose() + return False + else: + return True + + def set_sink(self, sink): + assert self.window.xid + self.imagesink = sink + self.imagesink.set_xwindow_id(self.window.xid) + +class SwitchWindow(gtk.Window): + UPDATE_INTERVAL = 500 + def __init__(self): + gtk.Window.__init__(self) + self.set_default_size(410, 325) + + self.create_ui() + self.player = SwitchTest(self.videowidget) + self.populate_combobox() + + self.update_id = -1 + self.changed_id = -1 + self.seek_timeout_id = -1 + + self.p_position = gst.CLOCK_TIME_NONE + self.p_duration = gst.CLOCK_TIME_NONE + + def on_delete_event(): + self.player.stop() + gtk.main_quit() + self.connect('delete-event', lambda *x: on_delete_event()) + + def load_file(self, location): + self.player.set_location(location) + + def play(self): + self.player.play() + + def populate_combobox(self): + switch = self.player.pipeline.get_by_name('s') + for i, pad in enumerate([p for p in switch.pads() + if p.get_direction() == gst.PAD_SINK]): + self.combobox.append_text(pad.get_name()) + if switch.get_property('active-pad') == pad.get_name(): + self.combobox.set_active(i) + if self.combobox.get_active() == -1: + self.combobox.set_active(0) + + def combobox_changed(self): + model = self.combobox.get_model() + row = model[self.combobox.get_active()] + padname, = row + self.player.switch(padname) + + def create_ui(self): + vbox = gtk.VBox() + self.add(vbox) + + self.videowidget = VideoWidget() + vbox.pack_start(self.videowidget) + + hbox = gtk.HBox() + vbox.pack_start(hbox, fill=False, expand=False) + + self.combobox = combobox = gtk.combo_box_new_text() + combobox.show() + hbox.pack_start(combobox) + + self.combobox.connect('changed', + lambda *x: self.combobox_changed()) + + self.videowidget.connect_after('realize', + lambda *x: self.play()) + +def main(args): + def usage(): + sys.stderr.write("usage: %s\n" % args[0]) + return 1 + + # Need to register our derived widget types for implicit event + # handlers to get called. + gobject.type_register(SwitchWindow) + gobject.type_register(VideoWidget) + + if len(args) != 1: + return usage() + + w = SwitchWindow() + w.show_all() + gtk.main() + return 0 + +if __name__ == '__main__': + sys.exit(main(sys.argv)) diff --git a/old_examples/synchronizer.py b/old_examples/synchronizer.py new file mode 100755 index 0000000..656e332 --- /dev/null +++ b/old_examples/synchronizer.py @@ -0,0 +1,820 @@ +#!/usr/bin/env python +# -*- Mode: Python -*- +# vi:si:et:sw=4:sts=4:ts=4 + +import pygtk +pygtk.require('2.0') + +import sys + +import gobject +gobject.threads_init() + +import pygst +pygst.require('0.10') +import gst +import gst.interfaces +import gtk +gtk.gdk.threads_init() + +class GstPlayer: + def __init__(self, videowidget): + self.playing = False + self.player = gst.element_factory_make("playbin", "player") + self.videowidget = videowidget + + bus = self.player.get_bus() + bus.enable_sync_message_emission() + bus.add_signal_watch() + bus.connect('sync-message::element', self.on_sync_message) + bus.connect('message', self.on_message) + + def on_sync_message(self, bus, message): + if message.structure is None: + return + if message.structure.get_name() == 'prepare-xwindow-id': + # Sync with the X server before giving the X-id to the sink + gtk.gdk.threads_enter() + gtk.gdk.display_get_default().sync() + self.videowidget.set_sink(message.src) + message.src.set_property('force-aspect-ratio', True) + gtk.gdk.threads_leave() + + def on_message(self, bus, message): + t = message.type + if t == gst.MESSAGE_ERROR: + err, debug = message.parse_error() + print "Error: %s" % err, debug + if self.on_eos: + self.on_eos() + self.playing = False + elif t == gst.MESSAGE_EOS: + if self.on_eos: + self.on_eos() + self.playing = False + + def set_location(self, location): + self.player.set_state(gst.STATE_NULL) + self.player.set_property('uri', location) + + def get_location(self): + return self.player.get_property('uri') + + def query_position(self): + "Returns a (position, duration) tuple" + try: + position, format = self.player.query_position(gst.FORMAT_TIME) + except: + position = gst.CLOCK_TIME_NONE + + try: + duration, format = self.player.query_duration(gst.FORMAT_TIME) + except: + duration = gst.CLOCK_TIME_NONE + + return (position, duration) + + def seek(self, location): + """ + @param location: time to seek to, in nanoseconds + """ + gst.debug("seeking to %r" % location) + event = gst.event_new_seek(1.0, gst.FORMAT_TIME, + gst.SEEK_FLAG_FLUSH, + gst.SEEK_TYPE_SET, location, + gst.SEEK_TYPE_NONE, 0) + + res = self.player.send_event(event) + if res: + gst.info("setting new stream time to 0") + self.player.set_new_stream_time(0L) + else: + gst.error("seek to %r failed" % location) + + def pause(self): + gst.info("pausing player") + self.player.set_state(gst.STATE_PAUSED) + self.playing = False + + def play(self): + gst.info("playing player") + self.player.set_state(gst.STATE_PLAYING) + self.playing = True + + def stop(self): + self.player.set_state(gst.STATE_NULL) + gst.info("stopped player") + + def get_state(self, timeout=1): + return self.player.get_state(timeout=timeout) + + def is_playing(self): + return self.playing + +class VideoWidget(gtk.DrawingArea): + def __init__(self): + gtk.DrawingArea.__init__(self) + self.imagesink = None + self.unset_flags(gtk.DOUBLE_BUFFERED) + + def do_expose_event(self, event): + if self.imagesink: + self.imagesink.expose() + return False + else: + return True + + def set_sink(self, sink): + assert self.window.xid + self.imagesink = sink + self.imagesink.set_xwindow_id(self.window.xid) + +class SyncPoints(gtk.VBox): + def __init__(self, window): + gtk.VBox.__init__(self) + self.pwindow = window + self.create_ui() + + def get_time_as_str(self, iter, i): + value = self.model.get_value(iter, i) + ret = '' + for div, sep, mod, pad in ((gst.SECOND*60, '', 0, 0), + (gst.SECOND, ':', 60, 2), + (gst.MSECOND, '.', 1000, 3)): + n = value // div + if mod: + n %= mod + ret += sep + ('%%0%dd' % pad) % n + return ret + + def create_ui(self): + self.model = model = gtk.ListStore(gobject.TYPE_UINT64, + gobject.TYPE_UINT64) + self.view = view = gtk.TreeView(self.model) + + renderer = gtk.CellRendererText() + column = gtk.TreeViewColumn("Audio time", renderer) + def time_to_text(column, cell, method, iter, i): + cell.set_property('text', self.get_time_as_str(iter, i)) + column.set_cell_data_func(renderer, time_to_text, 0) + column.set_expand(True) + column.set_clickable(True) + view.append_column(column) + + renderer = gtk.CellRendererText() + column = gtk.TreeViewColumn("Video time", renderer) + column.set_cell_data_func(renderer, time_to_text, 1) + column.set_expand(True) + view.append_column(column) + + view.show() + self.pack_start(view, True, True, 6) + + hbox = gtk.HBox(False, 0) + hbox.show() + self.pack_start(hbox, False, False, 0) + + add = gtk.Button(stock=gtk.STOCK_ADD) + add.show() + def add_and_select(*x): + iter = model.append() + self.view.get_selection().select_iter(iter) + self.changed() + add.connect("clicked", add_and_select) + hbox.pack_end(add, False, False, 0) + + remove = gtk.Button(stock=gtk.STOCK_REMOVE) + remove.show() + def remove_selected(*x): + model, iter = self.view.get_selection().get_selected() + model.remove(iter) + self.changed() + remove.connect("clicked", remove_selected) + hbox.pack_end(remove, False, False, 0) + + pad = gtk.Label(' ') + pad.show() + hbox.pack_end(pad) + + label = gtk.Label("Set: ") + label.show() + hbox.pack_start(label) + + a = gtk.Button("A_udio") + a.show() + a.connect("clicked", lambda *x: self.set_selected_audio_now()) + hbox.pack_start(a) + + l = gtk.Label(" / ") + l.show() + hbox.pack_start(l) + + v = gtk.Button("_Video") + v.show() + v.connect("clicked", lambda *x: self.set_selected_video_now()) + hbox.pack_start(v) + + def get_sync_points(self): + def get_value(row, i): + return self.model.get_value(row.iter, i) + pairs = [(get_value(row, 1), get_value(row, 0)) for row in self.model] + pairs.sort() + ret = [] + maxdiff = 0 + for pair in pairs: + maxdiff = max(maxdiff, abs(pair[1] - pair[0])) + ret.extend(pair) + return ret, maxdiff + + def changed(self): + print 'Sync times now:' + for index, row in enumerate(self.model): + print 'A/V %d: %s -- %s' % (index, + self.get_time_as_str(row.iter, 0), + self.get_time_as_str(row.iter, 1)) + + + def set_selected_audio(self, time): + sel = self.view.get_selection() + model, iter = sel.get_selected() + if iter: + model.set_value(iter, 0, time) + self.changed() + + def set_selected_video(self, time): + sel = self.view.get_selection() + model, iter = sel.get_selected() + if iter: + model.set_value(iter, 1, time) + self.changed() + + def set_selected_audio_now(self): + time, dur = self.pwindow.player.query_position() + self.set_selected_audio(time) + + def set_selected_video_now(self): + # pause and preroll first + if self.pwindow.player.is_playing(): + self.pwindow.play_toggled() + self.pwindow.player.get_state(timeout=gst.MSECOND * 200) + + time, dur = self.pwindow.player.query_position() + self.set_selected_video(time) + + def seek_and_pause(self, time): + if self.pwindow.player.is_playing(): + self.pwindow.play_toggled() + self.pwindow.player.seek(time) + if self.pwindow.player.is_playing(): + self.pwindow.play_toggled() + self.pwindow.player.get_state(timeout=gst.MSECOND * 200) + +class ProgressDialog(gtk.Dialog): + def __init__(self, title, description, task, parent, flags, buttons): + gtk.Dialog.__init__(self, title, parent, flags, buttons) + self._create_ui(title, description, task) + + def _create_ui(self, title, description, task): + self.set_border_width(6) + self.set_resizable(False) + self.set_has_separator(False) + + vbox = gtk.VBox() + vbox.set_border_width(6) + vbox.show() + self.vbox.pack_start(vbox, False) + + label = gtk.Label('%s' % title) + label.set_use_markup(True) + label.set_alignment(0.0, 0.0) + label.show() + vbox.pack_start(label, False) + + label = gtk.Label(description) + label.set_use_markup(True) + label.set_alignment(0.0, 0.0) + label.set_line_wrap(True) + label.set_padding(0, 12) + label.show() + vbox.pack_start(label, False) + + self.progress = progress = gtk.ProgressBar() + progress.show() + vbox.pack_start(progress, False) + + self.progresstext = label = gtk.Label('') + label.set_line_wrap(True) + label.set_use_markup(True) + label.set_alignment(0.0, 0.0) + label.show() + vbox.pack_start(label) + self.set_task(task) + + def set_task(self, task): + self.progresstext.set_markup('%s' % task) + +UNKNOWN = 0 +SUCCESS = 1 +FAILURE = 2 +CANCELLED = 3 + +class RemuxProgressDialog(ProgressDialog): + def __init__(self, parent, fromname, toname): + ProgressDialog.__init__(self, + "Writing to disk", + ('Writing the newly synchronized %s ' + 'to %s. This may take some time.' + % (fromname, toname)), + 'Starting media pipeline', + parent, + gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT, + (gtk.STOCK_CANCEL, CANCELLED, + gtk.STOCK_CLOSE, SUCCESS)) + self.set_completed(False) + + def update_position(self, pos, dur): + remaining = dur - pos + minutes = remaining // (gst.SECOND * 60) + seconds = (remaining - minutes * gst.SECOND * 60) // gst.SECOND + self.progress.set_text('%d:%02d of video remaining' % (minutes, seconds)) + self.progress.set_fraction(1.0 - float(remaining) / dur) + + def set_completed(self, completed): + self.set_response_sensitive(CANCELLED, not completed) + self.set_response_sensitive(SUCCESS, completed) + +class Resynchronizer(gst.Pipeline): + + __gsignals__ = {'done': (gobject.SIGNAL_RUN_LAST, None, (int,))} + + def __init__(self, fromuri, touri, (syncpoints, maxdiff)): + # HACK: should do Pipeline.__init__, but that doesn't do what we + # want; there's a bug open aboooot that + self.__gobject_init__() + + self.fromuri = fromuri + self.touri = None + self.syncpoints = syncpoints + self.maxdiff = maxdiff + + self.src = self.resyncbin = self.sink = None + self.resolution = UNKNOWN + + self.window = None + self.pdialog = None + + self._query_id = -1 + + def do_setup_pipeline(self): + self.src = gst.element_make_from_uri(gst.URI_SRC, self.fromuri) + self.resyncbin = ResyncBin(self.syncpoints, self.maxdiff) + self.sink = gst.element_make_from_uri(gst.URI_SINK, self.touri) + self.resolution = UNKNOWN + + if gobject.signal_lookup('allow-overwrite', self.sink.__class__): + self.sink.connect('allow-overwrite', lambda *x: True) + + self.add(self.src, self.resyncbin, self.sink) + + self.src.link(self.resyncbin) + self.resyncbin.link(self.sink) + + def do_get_touri(self): + chooser = gtk.FileChooserDialog('Save as...', + self.window, + action=gtk.FILE_CHOOSER_ACTION_SAVE, + buttons=(gtk.STOCK_CANCEL, + CANCELLED, + gtk.STOCK_SAVE, + SUCCESS)) + chooser.set_uri(self.fromuri) # to select the folder + chooser.unselect_all() + chooser.set_do_overwrite_confirmation(True) + name = self.fromuri.split('/')[-1][:-4] + '-remuxed.ogg' + chooser.set_current_name(name) + resp = chooser.run() + uri = chooser.get_uri() + chooser.destroy() + + if resp == SUCCESS: + return uri + else: + return None + + def _start_queries(self): + def do_query(): + try: + # HACK: self.remuxbin.query() should do the same + # (requires implementing a vmethod, dunno how to do that + # although i think it's possible) + # HACK: why does self.query_position(..) not give useful + # answers? + pad = self.resyncbin.get_pad('src') + pos, format = pad.query_position(gst.FORMAT_TIME) + dur, format = pad.query_duration(gst.FORMAT_TIME) + if pos != gst.CLOCK_TIME_NONE: + self.pdialog.update_position(pos, duration) + except: + # print 'query failed' + pass + return True + if self._query_id == -1: + self._query_id = gobject.timeout_add(100, # 10 Hz + do_query) + + def _stop_queries(self): + if self._query_id != -1: + gobject.source_remove(self._query_id) + self._query_id = -1 + + def _bus_watch(self, bus, message): + if message.type == gst.MESSAGE_ERROR: + print 'error', message + self._stop_queries() + m = gtk.MessageDialog(self.window, + gtk.DIALOG_MODAL|gtk.DIALOG_DESTROY_WITH_PARENT, + gtk.MESSAGE_ERROR, + gtk.BUTTONS_CLOSE, + "Error processing file") + gerror, debug = message.parse_error() + txt = ('There was an error processing your file: %s\n\n' + 'Debug information:\n%s' % (gerror, debug)) + m.format_secondary_text(txt) + m.run() + m.destroy() + self.response(FAILURE) + elif message.type == gst.MESSAGE_WARNING: + print 'warning', message + elif message.type == gst.MESSAGE_EOS: + # print 'eos, woot', message.src + name = self.touri + if name.startswith('file://'): + name = name[7:] + self.pdialog.set_task('Finished writing %s' % name) + self.pdialog.update_position(1,1) + self._stop_queries() + self.pdialog.set_completed(True) + elif message.type == gst.MESSAGE_STATE_CHANGED: + if message.src == self: + old, new, pending = message.parse_state_changed() + if ((old, new, pending) == + (gst.STATE_READY, gst.STATE_PAUSED, + gst.STATE_VOID_PENDING)): + self.pdialog.set_task('Processing file') + self._start_queries() + self.set_state(gst.STATE_PLAYING) + + def response(self, response): + assert self.resolution == UNKNOWN + self.resolution = response + self.set_state(gst.STATE_NULL) + self.pdialog.destroy() + self.pdialog = None + self.window.set_sensitive(True) + self.emit('done', response) + + def start(self, main_window): + self.window = main_window + self.touri = self.do_get_touri() + if not self.touri: + return False + self.do_setup_pipeline() + bus = self.get_bus() + bus.add_signal_watch() + bus.connect('message', self._bus_watch) + if self.window: + # can be None if we are debugging... + self.window.set_sensitive(False) + fromname = self.fromuri.split('/')[-1] + toname = self.touri.split('/')[-1] + self.pdialog = RemuxProgressDialog(main_window, fromname, toname) + self.pdialog.show() + self.pdialog.connect('response', lambda w, r: self.response(r)) + + self.set_state(gst.STATE_PAUSED) + return True + + def run(self, main_window): + if self.start(main_window): + loop = gobject.MainLoop() + self.connect('done', lambda *x: gobject.idle_add(loop.quit)) + loop.run() + else: + self.resolution = CANCELLED + return self.resolution + +class ResyncBin(gst.Bin): + def __init__(self, sync_points, maxdiff): + self.__gobject_init__() + + self.parsefactories = self._find_parsers() + self.parsers = [] + + self.demux = gst.element_factory_make('oggdemux') + self.mux = gst.element_factory_make('oggmux') + + self.add(self.demux, self.mux) + + self.add_pad(gst.GhostPad('sink', self.demux.get_pad('sink'))) + self.add_pad(gst.GhostPad('src', self.mux.get_pad('src'))) + + self.demux.connect('pad-added', self._new_demuxed_pad) + + self.sync_points = sync_points + self.maxdiff = maxdiff + + def _find_parsers(self): + registry = gst.registry_get_default() + ret = {} + for f in registry.get_feature_list(gst.ElementFactory): + if f.get_klass().find('Parser') >= 0: + for t in f.get_static_pad_templates(): + if t.direction == gst.PAD_SINK: + for s in t.get_caps(): + ret[s.get_name()] = f.get_name() + break + return ret + + def _new_demuxed_pad(self, element, pad): + format = pad.get_caps()[0].get_name() + + if format not in self.parsefactories: + self.async_error("Unsupported media type: %s", format) + return + + queue = gst.element_factory_make('queue', 'queue_' + format) + queue.set_property('max-size-buffers', 0) + queue.set_property('max-size-bytes', 0) + print self.maxdiff + queue.set_property('max-size-time', int(self.maxdiff * 1.5)) + parser = gst.element_factory_make(self.parsefactories[format]) + self.add(queue) + self.add(parser) + queue.set_state(gst.STATE_PAUSED) + parser.set_state(gst.STATE_PAUSED) + pad.link(queue.get_compatible_pad(pad)) + queue.link(parser) + parser.link(self.mux) + self.parsers.append(parser) + + print repr(self.sync_points) + + if 'video' in format: + parser.set_property('synchronization-points', + self.sync_points) + +class PlayerWindow(gtk.Window): + UPDATE_INTERVAL = 500 + def __init__(self): + gtk.Window.__init__(self) + self.set_default_size(600, 500) + + self.create_ui() + + self.player = GstPlayer(self.videowidget) + + def on_eos(): + self.player.seek(0L) + self.play_toggled() + self.player.on_eos = lambda *x: on_eos() + + self.update_id = -1 + self.changed_id = -1 + self.seek_timeout_id = -1 + + self.p_position = gst.CLOCK_TIME_NONE + self.p_duration = gst.CLOCK_TIME_NONE + + def on_delete_event(): + self.player.stop() + gtk.main_quit() + self.connect('delete-event', lambda *x: on_delete_event()) + + def load_file(self, location): + filename = location.split('/')[-1] + self.set_title('%s munger' % filename) + self.player.set_location(location) + if self.videowidget.flags() & gtk.REALIZED: + self.play_toggled() + else: + self.videowidget.connect_after('realize', + lambda *x: self.play_toggled()) + + def create_ui(self): + vbox = gtk.VBox() + vbox.show() + self.add(vbox) + + self.videowidget = VideoWidget() + self.videowidget.show() + vbox.pack_start(self.videowidget) + + hbox = gtk.HBox() + hbox.show() + vbox.pack_start(hbox, fill=False, expand=False) + + self.adjustment = gtk.Adjustment(0.0, 0.00, 100.0, 0.1, 1.0, 1.0) + hscale = gtk.HScale(self.adjustment) + hscale.set_digits(2) + hscale.set_update_policy(gtk.UPDATE_CONTINUOUS) + hscale.connect('button-press-event', self.scale_button_press_cb) + hscale.connect('button-release-event', self.scale_button_release_cb) + hscale.connect('format-value', self.scale_format_value_cb) + hbox.pack_start(hscale) + hscale.show() + self.hscale = hscale + + table = gtk.Table(3,3) + table.show() + vbox.pack_start(table, fill=False, expand=False, padding=6) + + self.button = button = gtk.Button(stock=gtk.STOCK_MEDIA_PLAY) + button.set_property('can-default', True) + button.set_focus_on_click(False) + button.show() + + # problem: play and paused are of different widths and cause the + # window to re-layout + # "solution": add more buttons to a vbox so that the horizontal + # width is enough + bvbox = gtk.VBox() + bvbox.add(button) + bvbox.add(gtk.Button(stock=gtk.STOCK_MEDIA_PLAY)) + bvbox.add(gtk.Button(stock=gtk.STOCK_MEDIA_PAUSE)) + sizegroup = gtk.SizeGroup(gtk.SIZE_GROUP_HORIZONTAL) + for kid in bvbox.get_children(): + sizegroup.add_widget(kid) + bvbox.show() + table.attach(bvbox, 0, 1, 1, 3, gtk.FILL, gtk.FILL) + + # can't set this property before the button has a window + button.set_property('has-default', True) + button.connect('clicked', lambda *args: self.play_toggled()) + + self.sync = sync = SyncPoints(self) + sync.show() + table.attach(sync, 1, 2, 0, 3, gtk.EXPAND, gtk.EXPAND|gtk.FILL, 12) + # nasty things to get sizes + l = gtk.Label('\n\n\n') + l.show() + table.attach(l, 0, 1, 0, 1, 0, 0, 0) + l = gtk.Label('\n\n\n') + l.show() + table.attach(l, 2, 3, 0, 1, 0, 0, 0) + + button = gtk.Button("_Open other movie...") + button.show() + button.connect('clicked', lambda *x: self.do_choose_file()) + table.attach(button, 2, 3, 1, 2, gtk.FILL, gtk.FILL) + + button = gtk.Button("_Write to disk") + button.set_property('image', + gtk.image_new_from_stock(gtk.STOCK_SAVE_AS, + gtk.ICON_SIZE_BUTTON)) + button.connect('clicked', lambda *x: self.do_remux()) + button.show() + table.attach(button, 2, 3, 2, 3, gtk.FILL, gtk.FILL) + + def do_remux(self): + if self.player.is_playing(): + self.play_toggled() + in_uri = self.player.get_location() + out_uri = in_uri[:-4] + '-remuxed.ogg' + r = Resynchronizer(in_uri, out_uri, self.sync.get_sync_points()) + r.run(self) + + def do_choose_file(self): + if self.player.is_playing(): + self.play_toggled() + chooser = gtk.FileChooserDialog('Choose a movie to bork bork bork', + self, + buttons=(gtk.STOCK_CANCEL, + CANCELLED, + gtk.STOCK_OPEN, + SUCCESS)) + chooser.set_local_only(False) + chooser.set_select_multiple(False) + f = gtk.FileFilter() + f.set_name("All files") + f.add_pattern("*") + chooser.add_filter(f) + f = gtk.FileFilter() + f.set_name("Ogg files") + f.add_pattern("*.ogg") # as long as this is the only thing we + # support... + chooser.add_filter(f) + chooser.set_filter(f) + + prev = self.player.get_location() + if prev: + chooser.set_uri(prev) + + resp = chooser.run() + uri = chooser.get_uri() + chooser.destroy() + + if resp == SUCCESS: + self.load_file(uri) + return True + else: + return False + + def play_toggled(self): + if self.player.is_playing(): + self.player.pause() + self.button.set_label(gtk.STOCK_MEDIA_PLAY) + else: + self.player.play() + if self.update_id == -1: + self.update_id = gobject.timeout_add(self.UPDATE_INTERVAL, + self.update_scale_cb) + self.button.set_label(gtk.STOCK_MEDIA_PAUSE) + + def scale_format_value_cb(self, scale, value): + if self.p_duration == -1: + real = 0 + else: + real = value * self.p_duration / 100 + + seconds = real / gst.SECOND + + return "%02d:%02d" % (seconds / 60, seconds % 60) + + def scale_button_press_cb(self, widget, event): + # see seek.c:start_seek + gst.debug('starting seek') + + self.button.set_sensitive(False) + self.was_playing = self.player.is_playing() + if self.was_playing: + self.player.pause() + + # don't timeout-update position during seek + if self.update_id != -1: + gobject.source_remove(self.update_id) + self.update_id = -1 + + # make sure we get changed notifies + if self.changed_id == -1: + self.changed_id = self.hscale.connect('value-changed', + self.scale_value_changed_cb) + + def scale_value_changed_cb(self, scale): + # see seek.c:seek_cb + real = long(scale.get_value() * self.p_duration / 100) # in ns + gst.debug('value changed, perform seek to %r' % real) + self.player.seek(real) + # allow for a preroll + self.player.get_state(timeout=50*gst.MSECOND) # 50 ms + + def scale_button_release_cb(self, widget, event): + # see seek.cstop_seek + widget.disconnect(self.changed_id) + self.changed_id = -1 + + self.button.set_sensitive(True) + if self.seek_timeout_id != -1: + gobject.source_remove(self.seek_timeout_id) + self.seek_timeout_id = -1 + else: + gst.debug('released slider, setting back to playing') + if self.was_playing: + self.player.play() + + if self.update_id != -1: + self.error('Had a previous update timeout id') + else: + self.update_id = gobject.timeout_add(self.UPDATE_INTERVAL, + self.update_scale_cb) + + def update_scale_cb(self): + had_duration = self.p_duration != gst.CLOCK_TIME_NONE + self.p_position, self.p_duration = self.player.query_position() + if self.p_position != gst.CLOCK_TIME_NONE: + value = self.p_position * 100.0 / self.p_duration + self.adjustment.set_value(value) + return True + +def main(args): + def usage(): + sys.stderr.write("usage: %s [URI-OF-MEDIA-FILE]\n" % args[0]) + return 1 + + w = PlayerWindow() + w.show() + + if len(args) == 1: + if not w.do_choose_file(): + return 1 + elif len(args) == 2: + if not gst.uri_is_valid(args[1]): + sys.stderr.write("Error: Invalid URI: %s\n" % args[1]) + return 1 + w.load_file(args[1]) + else: + return usage() + + gtk.main() + +if __name__ == '__main__': + sys.exit(main(sys.argv)) diff --git a/old_examples/tagsetter.py b/old_examples/tagsetter.py new file mode 100755 index 0000000..4f04da3 --- /dev/null +++ b/old_examples/tagsetter.py @@ -0,0 +1,77 @@ +#!/usr/bin/env python +# -*- Mode: Python -*- +# vi:si:et:sw=4:sts=4:ts=4 + +# gst-python +# Copyright (C) 2009 Stefan Kost +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Library General Public +# License as published by the Free Software Foundation; either +# version 2 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Library General Public License for more details. +# +# You should have received a copy of the GNU Library General Public +# License along with this library; if not, write to the +# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. +# + +import sys + +import gobject +gobject.threads_init() + +import pygst +pygst.require('0.10') +import gst + + +mainloop = gobject.MainLoop() + +def on_eos(bus, msg): + mainloop.quit() + +def main(args): + "Tagsetter test, test result with:" + "gst-launch -t playbin uri=file://$PWD/test.avi" + + # create a new bin to hold the elements + bin = gst.parse_launch('audiotestsrc num-buffers=100 ! ' + + 'lame ! ' + + 'avimux name=mux ! ' + + 'filesink location=test.avi') + + mux = bin.get_by_name('mux') + + bus = bin.get_bus() + bus.add_signal_watch() + bus.connect('message::eos', on_eos) + + # prepare + bin.set_state(gst.STATE_READY) + + # send tags + l = gst.TagList() + l[gst.TAG_ARTIST] = "Unknown Genius" + l[gst.TAG_TITLE] = "Unnamed Artwork" + mux.merge_tags(l, gst.TAG_MERGE_APPEND) + + # start playing + bin.set_state(gst.STATE_PLAYING) + + try: + mainloop.run() + except KeyboardInterrupt: + pass + + # stop the bin + bin.set_state(gst.STATE_NULL) + +if __name__ == '__main__': + sys.exit(main(sys.argv)) + diff --git a/old_examples/video-controller.py b/old_examples/video-controller.py new file mode 100644 index 0000000..4b561d1 --- /dev/null +++ b/old_examples/video-controller.py @@ -0,0 +1,44 @@ +#!/usr/bin/env python +# -*- Mode: Python -*- +# vi:si:et:sw=4:sts=4:ts=4 + +# videomixer-controller.py +# (c) 2008 Stefan Kost +# Test case for the GstController using videomixer and videotestsrc + +import pygst +pygst.require('0.10') +import gst +import time + +def main(): + pipeline = gst.Pipeline("videocontroller") + src = gst.element_factory_make("videotestsrc", "src") + mix = gst.element_factory_make("videomixer", "mix") + conv = gst.element_factory_make("ffmpegcolorspace", "conv") + sink = gst.element_factory_make("autovideosink", "sink") + pipeline.add(src, mix, conv, sink) + + spad = src.get_static_pad('src') + dpad = mix.get_request_pad('sink_%d') + + spad.link(dpad) + mix.link(conv) + conv.link(sink) + + control = gst.Controller(dpad, "xpos", "ypos") + control.set_interpolation_mode("xpos", gst.INTERPOLATE_LINEAR) + control.set_interpolation_mode("ypos", gst.INTERPOLATE_LINEAR) + + control.set("xpos", 0, 0) + control.set("xpos", 5 * gst.SECOND, 200) + + control.set("ypos", 0, 0) + control.set("ypos", 5 * gst.SECOND, 200) + + pipeline.set_state(gst.STATE_PLAYING) + + time.sleep(7) + +if __name__ == "__main__": + main() diff --git a/old_examples/vumeter.py b/old_examples/vumeter.py new file mode 100755 index 0000000..5e0fb45 --- /dev/null +++ b/old_examples/vumeter.py @@ -0,0 +1,108 @@ +#!/usr/bin/env python +# -*- Mode: Python -*- +# vi:si:et:sw=4:sts=4:ts=4 + +# gst-python +# Copyright (C) 2005 Andy Wingo +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Library General Public +# License as published by the Free Software Foundation; either +# version 2 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Library General Public License for more details. +# +# You should have received a copy of the GNU Library General Public +# License along with this library; if not, write to the +# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. + + +# A test more of gst-plugins than of gst-python. + + +import pygtk +pygtk.require('2.0') +import gtk +import gobject + +import pygst +pygst.require('0.10') +import gst + +import fvumeter + + +def clamp(x, min, max): + if x < min: + return min + elif x > max: + return max + return x + + +class Window(gtk.Dialog): + def __init__(self): + gtk.Dialog.__init__(self, 'Volume Level') + self.prepare_ui() + + def prepare_ui(self): + self.set_default_size(200,60) + self.set_title('Volume Level') + self.connect('delete-event', lambda *x: gtk.main_quit()) + self.vus = [] + self.vus.append(fvumeter.FVUMeter()) + self.vus.append(fvumeter.FVUMeter()) + self.vbox.add(self.vus[0]) + self.vbox.add(self.vus[1]) + self.vus[0].show() + self.vus[1].show() + + def error(self, message, secondary=None): + m = gtk.MessageDialog(self, + gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT, + gtk.MESSAGE_ERROR, + gtk.BUTTONS_OK, + message) + if secondary: + m.format_secondary_text(secondary) + m.run() + + def on_message(self, bus, message): + if message.structure.get_name() == 'level': + s = message.structure + for i in range(0, len(s['peak'])): + self.vus[i].freeze_notify() + decay = clamp(s['decay'][i], -90.0, 0.0) + peak = clamp(s['peak'][i], -90.0, 0.0) + if peak > decay: + print "ERROR: peak bigger than decay!" + + self.vus[i].set_property('decay', decay) + self.vus[i].set_property('peak', peak) + return True + + def run(self): + try: + self.set_sensitive(False) + s = 'alsasrc ! level message=true ! fakesink' + pipeline = gst.parse_launch(s) + self.set_sensitive(True) + pipeline.get_bus().add_signal_watch() + i = pipeline.get_bus().connect('message::element', self.on_message) + pipeline.set_state(gst.STATE_PLAYING) + gtk.Dialog.run(self) + pipeline.get_bus().disconnect(i) + pipeline.get_bus().remove_signal_watch() + pipeline.set_state(gst.STATE_NULL) + except gobject.GError, e: + self.set_sensitive(True) + self.error('Could not create pipeline', e.__str__) + +if __name__ == '__main__': + w = Window() + w.show_all() + w.run() diff --git a/packaging/gst-python.spec b/packaging/gst-python.spec new file mode 100644 index 0000000..ac3af58 --- /dev/null +++ b/packaging/gst-python.spec @@ -0,0 +1,75 @@ +Name: gstreamer-python +Version: 1.4.5 +Release: 1 +Summary: Python bindings for GStreamer + +Group: Development/Languages +License: LGPL +URL: http://gstreamer.freedesktop.org/ +Source: http://gstreamer.freedesktop.org/src/gst-python/gst-python-1.4.0.tar.gz + +Requires: python >= 2 +Requires: gnome-python2 +Requires: pygtk2 + + +BuildRequires: python >= 2 +BuildRequires: python-devel >= 2 + + +BuildRequires: pkgconfig(gstreamer-1.0) +BuildRequires: pkgconfig(gstreamer-plugins-base-1.0) +BuildRequires: pkgconfig(pygobject-3.0) + +# sigh, libtool +BuildRequires: gcc-c++ + +%description +This module contains a wrapper that allows GStreamer applications +to be written in Python. + +%package devel +Summary: Libraries/include files for Python bindings for GStreamer +Group: Development/Libraries +#Requires: gstreamer-python-debuginfo = 1.4.5-1 + +%description devel +This package contains the libraries and includes files necessary to develop +python bindings for GStreamer-based C libraries. + +%prep +%setup -q -n gst-python-%{version} + + + +%build +%autogen --noconfigure +%configure +make %{?_smp_mflags} + +%install +rm -rf $RPM_BUILD_ROOT + +%makeinstall +find $RPM_BUILD_ROOT -type f -name "*.la" -exec rm -f {} ';' + +%clean +rm -rf $RPM_BUILD_ROOT + + +%files +%defattr(-,root,root,-) +%doc gst-python.doap +%license COPYING +%{_libdir}/gstreamer-1.0/libgstpythonplugin.so +#%{_libdir}/python2.7/site-packages/gi/overrides/Gst.py +#%{_libdir}/python2.7/site-packages/gi/overrides/Gst.pyc +#%{_libdir}/python2.7/site-packages/gi/overrides/Gst.pyo +#%{_libdir}/python2.7/site-packages/gi/overrides/GstPbutils.py +#%{_libdir}/python2.7/site-packages/gi/overrides/GstPbutils.pyc +#%{_libdir}/python2.7/site-packages/gi/overrides/GstPbutils.pyo +%{_libdir}/python2.7/site-packages/gi/overrides/_gi_gst.so + + +%files devel +%defattr(-, root, root, -) diff --git a/packaging/gst-python.spec~ b/packaging/gst-python.spec~ new file mode 100644 index 0000000..038f682 --- /dev/null +++ b/packaging/gst-python.spec~ @@ -0,0 +1,75 @@ +Name: gstreamer-python +Version: 1.4.5 +Release: 1 +Summary: Python bindings for GStreamer + +Group: Development/Languages +License: LGPL-2.1+ +URL: http://gstreamer.freedesktop.org/ +Source: http://gstreamer.freedesktop.org/src/gst-python/gst-python-1.4.0.tar.gz + +Requires: python >= 2 +Requires: gnome-python2 +Requires: pygtk2 + + +BuildRequires: python >= 2 +BuildRequires: python-devel >= 2 + + +BuildRequires: pkgconfig(gstreamer-1.0) +BuildRequires: pkgconfig(gstreamer-plugins-base-1.0) +BuildRequires: pkgconfig(pygobject-3.0) + +# sigh, libtool +BuildRequires: gcc-c++ + +%description +This module contains a wrapper that allows GStreamer applications +to be written in Python. + +%package devel +Summary: Libraries/include files for Python bindings for GStreamer +Group: Development/Libraries +#Requires: gstreamer-python-debuginfo = 1.4.5-1 + +%description devel +This package contains the libraries and includes files necessary to develop +python bindings for GStreamer-based C libraries. + +%prep +%setup -q -n gst-python-%{version} + + + +%build +%autogen --noconfigure +%configure +make %{?_smp_mflags} + +%install +rm -rf $RPM_BUILD_ROOT + +%makeinstall +find $RPM_BUILD_ROOT -type f -name "*.la" -exec rm -f {} ';' + +%clean +rm -rf $RPM_BUILD_ROOT + + +%files +%defattr(-,root,root,-) +%doc gst-python.doap +%license COPYING +%{_libdir}/gstreamer-1.0/libgstpythonplugin.so +#%{_libdir}/python2.7/site-packages/gi/overrides/Gst.py +#%{_libdir}/python2.7/site-packages/gi/overrides/Gst.pyc +#%{_libdir}/python2.7/site-packages/gi/overrides/Gst.pyo +#%{_libdir}/python2.7/site-packages/gi/overrides/GstPbutils.py +#%{_libdir}/python2.7/site-packages/gi/overrides/GstPbutils.pyc +#%{_libdir}/python2.7/site-packages/gi/overrides/GstPbutils.pyo +%{_libdir}/python2.7/site-packages/gi/overrides/_gi_gst.so + + +%files devel +%defattr(-, root, root, -) diff --git a/plugin/Makefile.am b/plugin/Makefile.am new file mode 100644 index 0000000..1216c4f --- /dev/null +++ b/plugin/Makefile.am @@ -0,0 +1,13 @@ +plugin_LTLIBRARIES = libgstpythonplugin.la + +INCLUDES = $(PYGOBJECT_CFLAGS) $(GST_CFLAGS)\ +-DPYTHON_VERSION=\"$(PYTHON_VERSION)\" \ + -DPY_LIB_LOC="\"$(PYTHON_LIB_LOC)\"" \ + -DPY_ABI_FLAGS="\"$(PYTHON_ABI_FLAGS)\"" \ + -DPY_LIB_SUFFIX=$(PYTHON_LIB_SUFFIX) \ + $(PYTHON_INCLUDES) + +libgstpythonplugin_la_SOURCES = gstpythonplugin.c +libgstpythonplugin_la_LDFLAGS = -avoid-version -shrext $(PYTHON_SO) +libgstpythonplugin_la_LIBADD = $(PYTHON_LIBS) $(PYGOBJECT_LIBS) $(GST_LIBS) +libgstpythonplugin_la_CFLAGS = $(GST_CFLAGS) $(PYGOBJECT_CFLAGS) $(GST_PLUGINS_BASE_CFLAGS) $(PYTHON_INCLUDES) diff --git a/plugin/gstpythonplugin.c b/plugin/gstpythonplugin.c new file mode 100644 index 0000000..32b7405 --- /dev/null +++ b/plugin/gstpythonplugin.c @@ -0,0 +1,304 @@ +/* gst-python + * Copyright (C) 2009 Edward Hervey + * 2005 Benjamin Otte + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +/* include this first, before NO_IMPORT_PYGOBJECT is defined */ +#include +#include +#include +#include + +void *_PyGstElement_Type; + +GST_DEBUG_CATEGORY_STATIC (pyplugindebug); +#define GST_CAT_DEFAULT pyplugindebug + +#define GST_ORIGIN "http://gstreamer.freedesktop.org" + +static PyObject *element; + +static gboolean +gst_python_plugin_load_file (GstPlugin * plugin, const char *name) +{ + PyObject *main_module, *main_locals; + PyObject *elementfactory; + PyObject *module; + const gchar *facname; + guint rank; + PyObject *class; + + GST_DEBUG ("loading plugin %s", name); + + main_module = PyImport_AddModule ("__main__"); + if (main_module == NULL) { + GST_WARNING ("Could not get __main__, ignoring plugin %s", name); + PyErr_Print (); + PyErr_Clear (); + return FALSE; + } + + main_locals = PyModule_GetDict (main_module); + module = + PyImport_ImportModuleEx ((char *) name, main_locals, main_locals, NULL); + if (!module) { + GST_DEBUG ("Could not load module, ignoring plugin %s", name); + PyErr_Print (); + PyErr_Clear (); + return FALSE; + } + + /* Get __gstelementfactory__ from file */ + elementfactory = PyObject_GetAttrString (module, "__gstelementfactory__"); + if (!elementfactory) { + GST_DEBUG ("python file doesn't contain __gstelementfactory__"); + PyErr_Clear (); + return FALSE; + } + + /* parse tuple : name, rank, gst.ElementClass */ + if (!PyArg_ParseTuple (elementfactory, "sIO", &facname, &rank, &class)) { + GST_WARNING ("__gstelementfactory__ isn't correctly formatted"); + PyErr_Print (); + PyErr_Clear (); + Py_DECREF (elementfactory); + return FALSE; + } + + if (!PyObject_IsSubclass (class, (PyObject *) & PyGObject_Type)) { + GST_WARNING ("the class provided isn't a subclass of GObject.Object"); + PyErr_Print (); + PyErr_Clear (); + Py_DECREF (elementfactory); + Py_DECREF (class); + return FALSE; + } + + if (!g_type_is_a (pyg_type_from_object (class), GST_TYPE_ELEMENT)) { + GST_WARNING ("the class provided isn't a subclass of Gst.Element"); + PyErr_Print (); + PyErr_Clear (); + Py_DECREF (elementfactory); + Py_DECREF (class); + return FALSE; + } + + GST_INFO ("Valid plugin"); + Py_DECREF (elementfactory); + + return gst_element_register (plugin, facname, rank, + pyg_type_from_object (class)); +} + +static gboolean +gst_python_load_directory (GstPlugin * plugin, gchar * path) +{ + GDir *dir; + const gchar *file; + GError *error = NULL; + gboolean ret = TRUE; + + dir = g_dir_open (path, 0, &error); + if (!dir) { + /*retval should probably be depending on error, but since we ignore it... */ + GST_DEBUG ("Couldn't open Python plugin dir: %s", error->message); + g_error_free (error); + return FALSE; + } + while ((file = g_dir_read_name (dir))) { + /* FIXME : go down in subdirectories */ + if (g_str_has_suffix (file, ".py")) { + gsize len = strlen (file) - 3; + gchar *name = g_strndup (file, len); + ret &= gst_python_plugin_load_file (plugin, name); + g_free (name); + } + } + return TRUE; +} + +static gboolean +gst_python_plugin_load (GstPlugin * plugin) +{ + PyObject *sys_path; + const gchar *plugin_path; + gboolean ret = TRUE; + + sys_path = PySys_GetObject ("path"); + + /* Mimic the order in which the registry is checked in core */ + + /* 1. check env_variable GST_PLUGIN_PATH */ + plugin_path = g_getenv ("GST_PLUGIN_PATH"); + if (plugin_path) { + char **list; + int i; + + GST_DEBUG ("GST_PLUGIN_PATH set to %s", plugin_path); + list = g_strsplit (plugin_path, G_SEARCHPATH_SEPARATOR_S, 0); + for (i = 0; list[i]; i++) { + gchar *sysdir = g_build_filename (list[i], "python", NULL); + PyList_Insert (sys_path, 0, PyUnicode_FromString (sysdir)); + gst_python_load_directory (plugin, sysdir); + g_free (sysdir); + } + + g_strfreev (list); + } + + /* 2. Check for GST_PLUGIN_SYSTEM_PATH */ + plugin_path = g_getenv ("GST_PLUGIN_SYSTEM_PATH"); + if (plugin_path == NULL) { + char *home_plugins; + + /* 2.a. Scan user and system-wide plugin directory */ + GST_DEBUG ("GST_PLUGIN_SYSTEM_PATH not set"); + + /* plugins in the user's home directory take precedence over + * system-installed ones */ + home_plugins = g_build_filename (g_get_home_dir (), + ".gstreamer-" GST_API_VERSION, "plugins", "python", NULL); + PyList_Insert (sys_path, 0, PyUnicode_FromString (home_plugins)); + gst_python_load_directory (plugin, home_plugins); + g_free (home_plugins); + + /* add the main (installed) library path */ + PyList_Insert (sys_path, 0, PyUnicode_FromString (PLUGINDIR "/python")); + gst_python_load_directory (plugin, PLUGINDIR "/python"); + } else { + gchar **list; + gint i; + + /* 2.b. Scan GST_PLUGIN_SYSTEM_PATH */ + GST_DEBUG ("GST_PLUGIN_SYSTEM_PATH set to %s", plugin_path); + list = g_strsplit (plugin_path, G_SEARCHPATH_SEPARATOR_S, 0); + for (i = 0; list[i]; i++) { + gchar *sysdir; + + sysdir = g_build_filename (list[i], "python", NULL); + + PyList_Insert (sys_path, 0, PyUnicode_FromString (sysdir)); + gst_python_load_directory (plugin, sysdir); + g_free (sysdir); + } + g_strfreev (list); + } + + + return ret; +} + +static gboolean +plugin_init (GstPlugin * plugin) +{ + PyGILState_STATE state; + PyObject *gst, *dict, *pyplugin; + gboolean we_initialized = FALSE; + GModule *libpython; + gpointer has_python = NULL; + PyObject *seq, *list; + int i, len; + + GST_DEBUG_CATEGORY_INIT (pyplugindebug, "pyplugin", 0, + "Python plugin loader"); + + gst_plugin_add_dependency_simple (plugin, + "HOME/.gstreamer-" GST_API_VERSION + "/plugins/python:GST_PLUGIN_SYSTEM_PATH/python:GST_PLUGIN_PATH/python", + PLUGINDIR "/python:HOME/.gstreamer-" GST_API_VERSION "/plugins/python:" + "GST_PLUGIN_SYSTEM_PATH/python:GST_PLUGIN_PATH/python", NULL, + GST_PLUGIN_DEPENDENCY_FLAG_NONE); + + GST_LOG ("Checking to see if libpython is already loaded"); + g_module_symbol (g_module_open (NULL, G_MODULE_BIND_LOCAL), "_Py_NoneStruct", + &has_python); + if (has_python) { + GST_LOG ("libpython is already loaded"); + } else { + GST_LOG ("loading libpython"); + libpython = + g_module_open (PY_LIB_LOC "/libpython" PYTHON_VERSION PY_ABI_FLAGS + "." PY_LIB_SUFFIX, 0); + if (!libpython) { + GST_WARNING ("Couldn't g_module_open libpython. Reason: %s", + g_module_error ()); + return FALSE; + } + } + + if (!Py_IsInitialized ()) { + GST_LOG ("python wasn't initialized"); + /* set the correct plugin for registering stuff */ + Py_Initialize (); + we_initialized = TRUE; + } else { + GST_LOG ("python was already initialized"); + state = PyGILState_Ensure (); + } + + GST_LOG ("initializing pygobject"); + if (!pygobject_init (3, 0, 0)) { + GST_WARNING ("pygobject initialization failed"); + return FALSE; + } + + gst = PyImport_ImportModule ("gi.repository.Gst"); + if (we_initialized) { + PyObject *tmp; + + dict = PyModule_GetDict (gst); + if (!dict) { + GST_ERROR ("no dict?!"); + } + + + tmp = + PyObject_GetAttr (PyMapping_GetItemString (dict, + "_introspection_module"), PyUnicode_FromString ("__dict__")); + + _PyGstElement_Type = PyMapping_GetItemString (tmp, "Element"); + + if (!_PyGstElement_Type) { + g_error ("Could not get Gst.Element"); + Py_DECREF (pyplugin); + } + pyplugin = pygobject_new (G_OBJECT (plugin)); + if (!pyplugin || PyModule_AddObject (gst, "__plugin__", pyplugin) != 0) { + g_warning ("Couldn't set plugin"); + Py_DECREF (pyplugin); + } + } + + gst_python_plugin_load (plugin); + + if (we_initialized) { + /* We need to release the GIL since we're going back to C land */ + PyEval_SaveThread (); + } else + PyGILState_Release (state); + return TRUE; +} + +GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, + GST_VERSION_MINOR, python, + "loader for plugins written in python", + plugin_init, VERSION, "LGPL", PACKAGE_NAME, GST_ORIGIN) diff --git a/pygst.py.in b/pygst.py.in new file mode 100644 index 0000000..61aaa20 --- /dev/null +++ b/pygst.py.in @@ -0,0 +1,63 @@ +# -*- Mode: Python; py-indent-offset: 4 -*- +# pygst - Python bindings for the GStreamer multimedia framework. +# Copyright (C) 1998-2002 James Henstridge +# (C) 2005 Edward Hervey +# +# pygst.py: pygst version selection code. +# +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Library General Public +# License as published by the Free Software Foundation; either +# version 2 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Library General Public License for more details. +# +# You should have received a copy of the GNU Library General Public +# License along with this library; if not, write to the +# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. +# +# This allows parallel installation of gst-python +# +# In order to have backward compatibility + +import sys + +__all__ = ['require'] + +_pygst_dir = '@PYGSTDIR@' + +_pygst_version = '@GST_MAJORMINOR@' + +_pygst_required_version = None + +class RequiredVersionError(ValueError, AssertionError): + # AssertionError is subclassed for compatibility reasons. + pass + + +def require(version): + global _pygst_required_version + + if _pygst_required_version != None: + if _pygst_required_version != version: + raise RequiredVersionError, "a different version of gst was already required" + else: + return + + if sys.modules.has_key('gst'): + raise RequiredVersionError, "pygst.require() must be called before importing gst" + + if version != _pygst_version: + raise RequiredVersionError, "Only version '%s' is available" % _pygst_version + + # move the pygst path to the front + while _pygst_dir in sys.path: + sys.path.remove(_pygst_dir) + sys.path.insert(0, _pygst_dir) + + _pygst_required_version = version diff --git a/testsuite/.gitignore b/testsuite/.gitignore new file mode 100644 index 0000000..b88dc34 --- /dev/null +++ b/testsuite/.gitignore @@ -0,0 +1,2 @@ +*.pyc +log diff --git a/testsuite/Makefile.am b/testsuite/Makefile.am new file mode 100644 index 0000000..d37e0a3 --- /dev/null +++ b/testsuite/Makefile.am @@ -0,0 +1,45 @@ +# Don't try to use wildcards to replace the list of tests below. +# http://www.gnu.org/software/automake/manual/automake.html#Wildcards +# Keep this list sorted! +tests = \ + test_gst.py \ + test_fraction.py + +EXTRA_DIST = \ + __init__.py \ + common.py \ + runtests.py \ + overrides_hack.py \ + $(tests) + +clean-local: + rm -rf *.pyc *.pyo + +check-local: + $(PYTHON) $(srcdir)/runtests.py $(tests) + +%.check: % + $(PYTHON) $(srcdir)/runtests.py $* +%.forever: % + $(srcdir)/cleanup.py + @while true; do \ + $(PYTHON) $(srcdir)/runtests.py $* || break; done + @rm -fr *.pyc + +# valgrind all tests +valgrind: $(tests) + @echo "Valgrinding tests ..." + @failed=0; \ + for t in $(filter-out $(VALGRIND_TESTS_DISABLE),$(tests)); do \ + make $$t.valgrind; \ + if test "$$?" -ne 0; then \ + echo "Valgrind error for test $$t"; \ + failed=`expr $$failed + 1`; \ + whicht="$$whicht $$t"; \ + fi; \ + done; \ + if test "$$failed" -ne 0; then \ + echo "$$failed tests had leaks under valgrind:"; \ + echo "$$whicht"; \ + false; \ + fi diff --git a/testsuite/__init__.py b/testsuite/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/testsuite/cleanup.py b/testsuite/cleanup.py new file mode 100644 index 0000000..6673d56 --- /dev/null +++ b/testsuite/cleanup.py @@ -0,0 +1,4 @@ +import pygst +pygst.require('0.10') +import gst + diff --git a/testsuite/common.py b/testsuite/common.py new file mode 100644 index 0000000..9aab74c --- /dev/null +++ b/testsuite/common.py @@ -0,0 +1,138 @@ +# -*- Mode: Python; py-indent-offset: 4 -*- +# vim: tabstop=4 shiftwidth=4 expandtab +# +# Copyright (C) 2015 Thibault Saunier +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this program; if not, write to the +# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +""" +A collection of objects to use for testing + +Copyied from pitivi +""" + +import os +import gc +import unittest +import gi.overrides +gi.overrides + +from gi.repository import Gst + + +detect_leaks = os.environ.get("TEST_DETECT_LEAKS", "1") not in ("0", "") + + +class TestCase(unittest.TestCase): + _tracked_types = (Gst.MiniObject, Gst.Element, Gst.Pad, Gst.Caps) + + def gctrack(self): + self.gccollect() + self._tracked = [] + for obj in gc.get_objects(): + if not isinstance(obj, self._tracked_types): + continue + + self._tracked.append(obj) + + def gccollect(self): + ret = 0 + while True: + c = gc.collect() + ret += c + if c == 0: + break + return ret + + def gcverify(self): + leaked = [] + for obj in gc.get_objects(): + if not isinstance(obj, self._tracked_types) or \ + obj in self._tracked: + continue + + leaked.append(obj) + + # we collect again here to get rid of temporary objects created in the + # above loop + self.gccollect() + + for elt in leaked: + print(elt) + for i in gc.get_referrers(elt): + print(" ", i) + + self.assertFalse(leaked, leaked) + del self._tracked + + def setUp(self): + self._num_failures = len(getattr(self._result, 'failures', [])) + self._num_errors = len(getattr(self._result, 'errors', [])) + if detect_leaks: + self.gctrack() + + def tearDown(self): + # don't barf gc info all over the console if we have already failed a + # test case + if (self._num_failures < len(getattr(self._result, 'failures', [])) + or self._num_errors < len(getattr(self._result, 'failures', []))): + return + if detect_leaks: + self.gccollect() + self.gcverify() + + # override run() to save a reference to the test result object + def run(self, result=None): + if not result: + result = self.defaultTestResult() + self._result = result + unittest.TestCase.run(self, result) + + +class SignalMonitor(object): + + def __init__(self, obj, *signals): + self.signals = signals + self.connectToObj(obj) + + def connectToObj(self, obj): + self.obj = obj + for signal in self.signals: + obj.connect(signal, self._signalCb, signal) + setattr(self, self._getSignalCounterName(signal), 0) + setattr(self, self._getSignalCollectName(signal), []) + + def disconnectFromObj(self, obj): + obj.disconnect_by_func(self._signalCb) + del self.obj + + def _getSignalCounterName(self, signal): + field = '%s_count' % signal.replace('-', '_') + return field + + def _getSignalCollectName(self, signal): + field = '%s_collect' % signal.replace('-', '_') + return field + + def _signalCb(self, obj, *args): + name = args[-1] + field = self._getSignalCounterName(name) + setattr(self, field, getattr(self, field, 0) + 1) + field = self._getSignalCollectName(name) + setattr(self, field, getattr(self, field, []) + [args[:-1]]) diff --git a/testsuite/gstpython.supp b/testsuite/gstpython.supp new file mode 100644 index 0000000..d3b9abc --- /dev/null +++ b/testsuite/gstpython.supp @@ -0,0 +1,241 @@ +{ + pthread leak + Memcheck:Leak + fun:calloc + fun:allocate_dtv + fun:_dl_allocate_tls* +} + +{ + pthread leak 2 + Memcheck:Leak + fun:memalign + fun:_dl_allocate_tls* +} + +{ + popt leak + Memcheck:Leak + fun:malloc + fun:nss_parse_service_list + fun:__nss_database_lookup + obj:* + obj:* + fun:getpwuid_r@@GLIBC_2.2.5 + fun:g_get_any_init_do + fun:g_get_home_dir + fun:init_post + fun:init_popt_callback +} + +{ + pygobject init leak + Memcheck:Leak + fun:calloc + fun:g_malloc0 + fun:type_node_* + fun:type_node_* + fun:* + fun:* + fun:g_type_init* + fun:initgobject +} + +{ + borked pthread creation + Memcheck:Param + write(buf) + fun:__pthread_initialize_manager + fun:pthread_create@@GLIBC_2.2.5 + fun:g_thread_create* + fun:g_thread_create* +} + +{ + borked pthread creation 2 + Memcheck:Param + write(buf) + fun:pthread_create@@GLIBC_2.2.5 + fun:* + fun:* + fun:* + fun:* + fun:gst_task_start +} + +{ + Syscall param clone(child_tidptr) contains uninitialised byte(s) + Memcheck:Param + clone(child_tidptr) + fun:clone +} + +{ + memory loss when creating thread + Memcheck:Leak + fun:malloc + fun:__pthread_initialize_manager + fun:pthread_create* +} + +# pyg_enable_threads memleak + +{ + memleak in pyg_enable_threads + Memcheck:Leak + fun:malloc + fun:* + fun:* + fun:* + fun:* + fun:* + fun:pyg_enable_threads +} + + +{ + memleak in pyg_enable_threads 2 + Memcheck:Leak + fun:malloc + fun:* + fun:* + fun:* + fun:* + fun:pyg_enable_threads +} + +{ + memleak in pyg_enable_threads 3 + Memcheck:Leak + fun:malloc + fun:* + fun:* + fun:* + fun:pyg_enable_threads +} + +#pygobject leaks + +{ + PyType_Ready leak + Memcheck:Leak + fun:malloc + fun:PyObject_Malloc + fun:_PyObject_GC_Malloc + fun:PyType_GenericAlloc + fun:* + fun:* + fun:PyType_Ready +} + +#gst debug category new leak +{ + gst debug category new leak + Memcheck:Leak + fun:malloc + fun:g_malloc + fun:g_strdup + fun:_gst_debug_category_new +} + +# memleak in gst_element_state_get_name that we can't get rid of +{ + gst_element_state_get_name + Memcheck:Leak + fun:malloc + fun:* + fun:g_vasprintf + fun:g_strdup* + fun:g_strdup* + fun:_wrap_gst_element_state_get_name +} + +#memleak in pygobject_new_with_interfaces +# weird, cos it seems to free the return value of g_type_interfaces +{ + _gst_element_factory_make + Memcheck:Leak + fun:malloc + fun:g_malloc + fun:g_type_interfaces +} + +#memleak in static_pad_template +{ + gst_static_pad_template_get + Memcheck:Leak + fun:calloc + fun:g_malloc0 + fun:g_type_create_instance + fun:g_object_constructor + fun:gst_object_constructor + fun:* + fun:* + fun:* + fun:gst_static_pad_template_get +} + +#leak in libxml +{ + xml_parse_memory leak + Memcheck:Leak + fun:malloc + fun:* + fun:xml* +} + +# FIXME : This is an awful leak that has do to with the gst_pad_set_*_function wrappers +{ + leak in gst_pad_set_*_function wrappers + Memcheck:Leak + fun:calloc + fun:g_malloc0 + fun:pad_private +} + +# python leak in runtime compiler +{ + python leak in runtime compiler + Memcheck:Leak + fun:malloc + fun:_PyObject_GC_Malloc + fun:_PyObject_GC_New* + fun:PyDict_New + fun:PySymtableEntry_New + fun:symtable_* + fun:symtable_* + fun:jcompile +} + +#FIXME : These leaks are in core. See bug #344761 +{ + leak in init_gst, when creating the argv to give to gst_init_check() + Memcheck:Leak + fun:* + fun:g_malloc + fun:init_gst +} + +{ + The GOption context is leaking in gst_init_check + Memcheck:Leak + fun:* + fun:g_malloc0 + fun:g_option_context_new + fun:gst_init_check + fun:init_gst +} + +{ + The GDir is leaked. + Memcheck:Leak + fun:* + fun:g_malloc + fun:g_dir_open + fun:gst_registry_scan_path_level + fun:gst_registry_scan_path + fun:init_post + fun:g_option_context_parse + fun:gst_init_check + fun:init_gst +} diff --git a/testsuite/old/test-object.c b/testsuite/old/test-object.c new file mode 100644 index 0000000..738f568 --- /dev/null +++ b/testsuite/old/test-object.c @@ -0,0 +1,25 @@ +#include "test-object.h" + +enum +{ + /* FILL ME */ + SIGNAL_EVENT, + LAST_SIGNAL +}; + + +static guint test_object_signals[LAST_SIGNAL] = { 0 }; + +G_DEFINE_TYPE(TestObject, test_object, G_TYPE_OBJECT); + +static void test_object_init (TestObject *self) {} +static void test_object_class_init (TestObjectClass *klass) +{ + test_object_signals[SIGNAL_EVENT] = + g_signal_new ("event", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (TestObjectClass, event), NULL, NULL, + g_cclosure_marshal_VOID__BOXED, G_TYPE_NONE, 1, + GST_TYPE_EVENT); + +} + diff --git a/testsuite/old/test-object.h b/testsuite/old/test-object.h new file mode 100644 index 0000000..973cfc1 --- /dev/null +++ b/testsuite/old/test-object.h @@ -0,0 +1,23 @@ +#include +#include + +/* TestObject */ + +typedef struct { + GObject parent; +} TestObject; + +typedef struct { + GObjectClass parent_class; + /* signals */ + void (*event) (TestObject *object, GstEvent *event); +} TestObjectClass; + +#define TEST_TYPE_OBJECT (test_object_get_type()) +#define TEST_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TEST_TYPE_OBJECT, TestObject)) +#define TEST_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TEST_TYPE_OBJECT, TestObjectClass)) +#define TEST_IS_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TEST_TYPE_OBJECT)) +#define TEST_IS_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TEST_TYPE_OBJECT)) +#define TEST_OBJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), TEST_TYPE_OBJECT, TestObjectClass)) + +GType test_object_get_type (void); diff --git a/testsuite/old/test_adapter.py b/testsuite/old/test_adapter.py new file mode 100644 index 0000000..005f976 --- /dev/null +++ b/testsuite/old/test_adapter.py @@ -0,0 +1,83 @@ +# -*- Mode: Python -*- +# vi:si:et:sw=4:sts=4:ts=4 +# +# gst-python - Python bindings for GStreamer +# Copyright (C) 2009 Edward Hervey +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +from common import gobject, gst, unittest, TestCase + +class AdapterTest(TestCase): + + def setUp(self): + TestCase.setUp(self) + self.adapter = gst.Adapter() + + def tearDown(self): + self.adapter = None + TestCase.tearDown(self) + + def testAvailable(self): + # starts empty + self.assertEquals(self.adapter.available(), 0) + self.assertEquals(self.adapter.available_fast(), 0) + + # let's give it 4 bytes + self.adapter.push(gst.Buffer("1234")) + self.assertEquals(self.adapter.available_fast(), 4) + + # let's give it another 5 bytes + self.adapter.push(gst.Buffer("56789")) + # we now have 9 bytes + self.assertEquals(self.adapter.available(), 9) + # but can only do a fast take of 4 bytes (the first buffer) + self.assertEquals(self.adapter.available_fast(), 4) + + def testPeek(self): + self.adapter.push(gst.Buffer("0123456789")) + + # let's peek at 5 bytes + b = self.adapter.peek(5) + # it can return more than 5 bytes + self.assert_(len(b) >= 5) + self.assertEquals(b, "01234") + + # it's still 10 bytes big + self.assertEquals(self.adapter.available(), 10) + + # if we try to peek more than what's available, we'll have None + self.assertEquals(self.adapter.peek(11), None) + + def testFlush(self): + self.adapter.push(gst.Buffer("0123456789")) + self.assertEquals(self.adapter.available(), 10) + + self.adapter.flush(5) + self.assertEquals(self.adapter.available(), 5) + + # it flushed the first 5 bytes + self.assertEquals(self.adapter.peek(5), "56789") + + self.adapter.flush(5) + self.assertEquals(self.adapter.available(), 0) + + def testTake(self): + self.adapter.push(gst.Buffer("0123456789")) + self.assertEquals(self.adapter.available(), 10) + + s = self.adapter.take(5) + self.assertEquals(s, "01234") + self.assertEquals(self.adapter.available(), 5) diff --git a/testsuite/old/test_audio.py b/testsuite/old/test_audio.py new file mode 100644 index 0000000..d09a62f --- /dev/null +++ b/testsuite/old/test_audio.py @@ -0,0 +1,38 @@ +# -*- Mode: Python -*- +# vi:si:et:sw=4:sts=4:ts=4 +# +# gst-python - Python bindings for GStreamer +# Copyright (C) 2009 Edward Hervey +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +from common import gobject, gst, unittest, TestCase + +class Audio(TestCase): + + def testBufferclip(self): + assert hasattr(gst.audio, "buffer_clip") + # create a segment + segment = gst.Segment() + gst.debug("Created the new segment") + # we'll put a new segment of 500ms to 1000ms + segment.set_newsegment(False, 1.0, gst.FORMAT_TIME, 0, -1, 0) + gst.debug("Initialized the new segment") + # create a new dummy buffer + b = gst.Buffer("this is a really useless line") + gst.debug("Created the buffer") + # clip... which shouldn't do anything + b2 = gst.audio.buffer_clip(b, segment, 44100, 8) + gst.debug("DONE !") diff --git a/testsuite/old/test_bin.py b/testsuite/old/test_bin.py new file mode 100644 index 0000000..c0300f0 --- /dev/null +++ b/testsuite/old/test_bin.py @@ -0,0 +1,196 @@ +# -*- Mode: Python -*- +# vi:si:et:sw=4:sts=4:ts=4 +# +# gst-python - Python bindings for GStreamer +# Copyright (C) 2002 David I. Lehn +# Copyright (C) 2004 Johan Dahlin +# Copyright (C) 2005 Edward Hervey +# Copyright (C) 2005 Thomas Vander Stichele +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +from common import gobject, gst, unittest, TestCase, pygobject_2_13 + +import sys +import time + +# see +# http://www.sicem.biz/personal/lgs/docs/gobject-python/gobject-tutorial.html +class MyBin(gst.Bin): + _state_changed = False + + def __init__(self, name): + # we need to call GObject's init to be able to do self.do_* + gobject.GObject.__init__(self) + # since we can't chain up to our parent's __init__, we set the + # name manually + self.set_property('name', name) + + def do_change_state(self, state_change): + if state_change == gst.STATE_CHANGE_PAUSED_TO_PLAYING: + self._state_changed = True + # FIXME: it seems a vmethod increases the refcount without unreffing + # print self.__gstrefcount__ + # print self.__grefcount__ + + # chain up to parent + return gst.Bin.do_change_state(self, state_change) + +# we need to register the type for PyGTK < 2.8 +gobject.type_register(MyBin) + +# FIXME: fix leak in vmethods before removing overriding fixture +class BinSubclassTest(TestCase): + def setUp(self): + pass + + def tearDown(self): + pass + + def testStateChange(self): + bin = MyBin("mybin") + self.assertEquals(bin.__gstrefcount__, 1) + self.assertEquals(sys.getrefcount(bin), pygobject_2_13 and 2 or 3) + + self.assertEquals(bin.get_name(), "mybin") + self.assertEquals(bin.__gstrefcount__, 1) + + # test get_state with no timeout + (ret, state, pending) = bin.get_state() + self.failIfEqual(ret, gst.STATE_CHANGE_FAILURE) + self.assertEquals(bin.__gstrefcount__, 1) + + # set to playing + bin.set_state(gst.STATE_PLAYING) + self.failUnless(bin._state_changed) + + # test get_state with no timeout + (ret, state, pending) = bin.get_state() + self.failIfEqual(ret, gst.STATE_CHANGE_FAILURE) + + if ret == gst.STATE_CHANGE_SUCCESS: + self.assertEquals(state, gst.STATE_PLAYING) + self.assertEquals(pending, gst.STATE_VOID_PENDING) + + # test get_state with a timeout + (ret, state, pending) = bin.get_state(1) + self.failIfEqual(ret, gst.STATE_CHANGE_FAILURE) + + if ret == gst.STATE_CHANGE_SUCCESS: + self.assertEquals(state, gst.STATE_PLAYING) + self.assertEquals(pending, gst.STATE_VOID_PENDING) + + (ret, state, pending) = bin.get_state(timeout=gst.SECOND) + + # back to NULL + bin.set_state(gst.STATE_NULL) + +class BinAddRemove(TestCase): + def setUp(self): + TestCase.setUp(self) + self.bin = gst.Bin('bin') + + def tearDown(self): + del self.bin + TestCase.tearDown(self) + + def testError(self): + gst.info("creating fakesrc") + src = gst.element_factory_make('fakesrc', 'name') + gst.info("creating fakesink") + sink = gst.element_factory_make('fakesink', 'name') + gst.info("adding src:%d to bin" % src.__gstrefcount__) + self.assertEqual(src.__gstrefcount__, 1) + self.bin.add(src) + self.assertEqual(src.__gstrefcount__, 2) + gst.info("added src:%d" % src.__gstrefcount__) + self.assertRaises(gst.AddError, self.bin.add, sink) + self.assertRaises(gst.AddError, self.bin.add, src) + self.assertRaises(gst.RemoveError, self.bin.remove, sink) + gst.info("removing src") + self.bin.remove(src) + gst.info("removed") + self.assertRaises(gst.RemoveError, self.bin.remove, src) + + def testMany(self): + src = gst.element_factory_make('fakesrc') + sink = gst.element_factory_make('fakesink') + self.bin.add(src, sink) + self.assertRaises(gst.AddError, self.bin.add, src, sink) + self.bin.remove(src, sink) + self.assertRaises(gst.RemoveError, self.bin.remove, src, sink) + +class Preroll(TestCase): + def setUp(self): + TestCase.setUp(self) + self.bin = gst.Bin('bin') + + def tearDown(self): + # FIXME: wait for state change thread to settle down + while self.bin.__gstrefcount__ > 1: + time.sleep(0.1) + self.assertEquals(self.bin.__gstrefcount__, 1) + del self.bin + TestCase.tearDown(self) + + def testFake(self): + src = gst.element_factory_make('fakesrc') + sink = gst.element_factory_make('fakesink') + self.bin.add(src) + + # bin will go to paused, src pad task will start and error out + self.bin.set_state(gst.STATE_PAUSED) + ret = self.bin.get_state() + self.assertEquals(ret[0], gst.STATE_CHANGE_SUCCESS) + self.assertEquals(ret[1], gst.STATE_PAUSED) + self.assertEquals(ret[2], gst.STATE_VOID_PENDING) + + # adding the sink will cause the bin to go in preroll mode + gst.debug('adding sink and setting to PAUSED, should cause preroll') + self.bin.add(sink) + sink.set_state(gst.STATE_PAUSED) + ret = self.bin.get_state(timeout=0) + self.assertEquals(ret[0], gst.STATE_CHANGE_ASYNC) + self.assertEquals(ret[1], gst.STATE_PAUSED) + self.assertEquals(ret[2], gst.STATE_PAUSED) + + # to actually complete preroll, we need to link and re-enable fakesrc + src.set_state(gst.STATE_READY) + src.link(sink) + src.set_state(gst.STATE_PAUSED) + ret = self.bin.get_state() + self.assertEquals(ret[0], gst.STATE_CHANGE_SUCCESS) + self.assertEquals(ret[1], gst.STATE_PAUSED) + self.assertEquals(ret[2], gst.STATE_VOID_PENDING) + + self.bin.set_state(gst.STATE_NULL) + self.bin.get_state() + +class ConstructorTest(TestCase): + def testGood(self): + bin = gst.Bin() + bin = gst.Bin(None) + bin = gst.Bin('') + bin = gst.Bin('myname') + + def testBad(self): + # these are now valid. pygobject will take care of converting + # the arguments to a string. + #self.assertRaises(TypeError, gst.Bin, 0) + #self.assertRaises(TypeError, gst.Bin, gst.Bin()) + pass + +if __name__ == "__main__": + unittest.main() diff --git a/testsuite/old/test_buffer.py b/testsuite/old/test_buffer.py new file mode 100644 index 0000000..6056206 --- /dev/null +++ b/testsuite/old/test_buffer.py @@ -0,0 +1,178 @@ +# -*- Mode: Python -*- +# vi:si:et:sw=4:sts=4:ts=4 +# +# gst-python - Python bindings for GStreamer +# Copyright (C) 2002 David I. Lehn +# Copyright (C) 2004 Johan Dahlin +# Copyright (C) 2005 Edward Hervey +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +import sys +import gc +from common import gobject, gst, unittest, TestCase + +class BufferTest(TestCase): + def testBufferBuffer(self): + buf = gst.Buffer('test') + assert str(buffer(buf)) == 'test' + + def testBufferStr(self): + buffer = gst.Buffer('test') + assert str(buffer) == 'test' + + def testBufferAlloc(self): + bla = 'mooooooo' + buffer = gst.Buffer(bla + '12345') + gc.collect () + assert str(buffer) == 'mooooooo12345' + + def testBufferBadConstructor(self): + self.assertRaises(TypeError, gst.Buffer, 'test', 0) + + def testBufferStrNull(self): + test_string = 't\0e\0s\0t\0' + buffer = gst.Buffer(test_string) + assert str(buffer) == test_string + + def testBufferSize(self): + test_string = 'a little string' + buffer = gst.Buffer(test_string) + assert len(buffer) == len(test_string) + assert hasattr(buffer, 'size') + assert buffer.size == len(buffer) + + def testBufferCreateSub(self): + s = '' + for i in range(64): + s += '%02d' % i + + buffer = gst.Buffer(s) + self.assertEquals(len(buffer), 128) + + sub = buffer.create_sub(16, 16) + self.assertEquals(sub.size, 16) + self.assertEquals(sub.data, buffer.data[16:32]) + self.assertEquals(sub.offset, gst.CLOCK_TIME_NONE) + + def testBufferMerge(self): + buffer1 = gst.Buffer('foo') + buffer2 = gst.Buffer('bar') + + merged_buffer = buffer1.merge(buffer2) + assert str(merged_buffer) == 'foobar' + + def testBufferJoin(self): + buffer1 = gst.Buffer('foo') + buffer2 = gst.Buffer('bar') + + joined_buffer = buffer1.merge(buffer2) + assert str(joined_buffer) == 'foobar' + + def testBufferSpan(self): + buffer1 = gst.Buffer('foo') + buffer2 = gst.Buffer('bar') + + spaned_buffer = buffer1.span(0L, buffer2, 6L) + assert str(spaned_buffer) == 'foobar' + def testBufferCopyOnWrite(self): + s='test_vector' + buffer = gst.Buffer(s) + sub = buffer.create_sub(0, buffer.size) + self.assertEquals(sub.size, buffer.size) + out = sub.copy_on_write () + self.assertEquals(out.size, sub.size) + assert str(out) == str(buffer) + out[5] = 'w' + assert str(out) == 'test_wector' + + def testBufferFlagIsSet(self): + buffer = gst.Buffer() + # Off by default + assert not buffer.flag_is_set(gst.BUFFER_FLAG_READONLY) + + # Try switching on and off + buffer.flag_set(gst.BUFFER_FLAG_READONLY) + assert buffer.flag_is_set(gst.BUFFER_FLAG_READONLY) + buffer.flag_unset(gst.BUFFER_FLAG_READONLY) + assert not buffer.flag_is_set(gst.BUFFER_FLAG_READONLY) + + # Try switching on and off + buffer.flag_set(gst.BUFFER_FLAG_IN_CAPS) + assert buffer.flag_is_set(gst.BUFFER_FLAG_IN_CAPS) + buffer.flag_unset(gst.BUFFER_FLAG_IN_CAPS) + assert not buffer.flag_is_set(gst.BUFFER_FLAG_IN_CAPS) + + def testAttrFlags(self): + buffer = gst.Buffer() + assert hasattr(buffer, "flags") + assert isinstance(buffer.flags, int) + + def testAttrTimestamp(self): + buffer = gst.Buffer() + assert hasattr(buffer, "timestamp") + assert isinstance(buffer.timestamp, long) + + assert buffer.timestamp == gst.CLOCK_TIME_NONE + buffer.timestamp = 0 + assert buffer.timestamp == 0 + buffer.timestamp = 2**64 - 1 + assert buffer.timestamp == 2**64 - 1 + + def testAttrDuration(self): + buffer = gst.Buffer() + assert hasattr(buffer, "duration") + assert isinstance(buffer.duration, long) + + assert buffer.duration == gst.CLOCK_TIME_NONE + buffer.duration = 0 + assert buffer.duration == 0 + buffer.duration = 2**64 - 1 + assert buffer.duration == 2**64 - 1 + + def testAttrOffset(self): + buffer = gst.Buffer() + assert hasattr(buffer, "offset") + assert isinstance(buffer.offset, long) + + assert buffer.offset == gst.CLOCK_TIME_NONE + buffer.offset = 0 + assert buffer.offset == 0 + buffer.offset = 2**64 - 1 + assert buffer.offset == 2**64 - 1 + + def testAttrOffset_end(self): + buffer = gst.Buffer() + assert hasattr(buffer, "offset_end") + assert isinstance(buffer.offset_end, long) + + assert buffer.offset_end == gst.CLOCK_TIME_NONE + buffer.offset_end = 0 + assert buffer.offset_end == 0 + buffer.offset_end = 2**64 - 1 + assert buffer.offset_end == 2**64 - 1 + + def testBufferCaps(self): + buffer = gst.Buffer() + caps = gst.caps_from_string('foo/blah') + gst.info("before settings caps") + buffer.set_caps(caps) + gst.info("after settings caps") + c = buffer.get_caps() + gst.info("after getting caps") + self.assertEquals(caps, c) + +if __name__ == "__main__": + unittest.main() diff --git a/testsuite/old/test_bus.py b/testsuite/old/test_bus.py new file mode 100644 index 0000000..0a99f9d --- /dev/null +++ b/testsuite/old/test_bus.py @@ -0,0 +1,242 @@ +# -*- Mode: Python -*- +# vi:si:et:sw=4:sts=4:ts=4 +# +# gst-python - Python bindings for GStreamer +# Copyright (C) 2005 Thomas Vander Stichele +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +from common import gst, unittest, TestCase + +import gobject +import time +import sys + +class BusSignalTest(TestCase): + def testGoodConstructor(self): + loop = gobject.MainLoop() + gst.info ("creating pipeline") + pipeline = gst.parse_launch("fakesrc ! fakesink") + gst.info ("getting bus") + bus = pipeline.get_bus() + gst.info ("got bus") + gst.info("pipeliner:%d busr:%d" % (pipeline.__gstrefcount__, bus.__gstrefcount__)) + self.assertEquals(bus.__gstrefcount__, 2) + self.assertEquals(pipeline.__gstrefcount__, 1) + gst.info ("about to add a watch on the bus") + watch_id = bus.connect("message", self._message_received, pipeline, loop, "one") + bus.add_signal_watch() + gst.info ("added a watch on the bus") + gst.info("pipeliner:%d busr:%d" % (pipeline.__gstrefcount__, bus.__gstrefcount__)) + self.assertEquals(bus.__gstrefcount__, 3) + self.assertEquals(pipeline.__gstrefcount__, 1) + + gst.info("setting to playing") + ret = pipeline.set_state(gst.STATE_PLAYING) + gst.info("set to playing %s, loop.run" % ret) + gst.info("pipeliner:%d busr:%d" % (pipeline.__gstrefcount__, bus.__gstrefcount__)) + loop.run() + + gst.info("pipeliner:%d busr:%d" % (pipeline.__gstrefcount__, bus.__gstrefcount__)) + gst.info("setting to paused") + ret = pipeline.set_state(gst.STATE_PAUSED) + gst.info("set to paused %s, loop.run" % ret) + gst.info("pipeliner:%d busr:%d" % (pipeline.__gstrefcount__, bus.__gstrefcount__)) + loop.run() + gst.info("pipeliner:%d busr:%d" % (pipeline.__gstrefcount__, bus.__gstrefcount__)) + + gst.info("setting to ready") + ret = pipeline.set_state(gst.STATE_READY) + gst.info("pipeliner:%d busr:%d" % (pipeline.__gstrefcount__, bus.__gstrefcount__)) + gst.info("set to READY %s, loop.run" % ret) + loop.run() + + gst.info("pipeliner:%d busr:%d" % (pipeline.__gstrefcount__, bus.__gstrefcount__)) + gst.info("setting to NULL") + ret = pipeline.set_state(gst.STATE_NULL) + gst.info("pipeliner:%d busr:%d" % (pipeline.__gstrefcount__, bus.__gstrefcount__)) + gst.info("set to NULL %s" % ret) + self.gccollect() + self.assertEquals(bus.__gstrefcount__, 3) + # FIXME: state change thread needs to die + while pipeline.__gstrefcount__ > 1: + gst.debug('waiting for pipeline refcount to drop') + time.sleep(0.1) + self.assertEquals(pipeline.__gstrefcount__, 1) + + gst.info("about to remove the watch id") + gst.info("pipeliner:%d busr:%d" % (pipeline.__gstrefcount__, bus.__gstrefcount__)) + bus.remove_signal_watch() + gst.info("bus watch id removed") + bus.disconnect(watch_id) + gst.info("disconnected callback") + gst.info("pipeliner:%d busr:%d" % (pipeline.__gstrefcount__, bus.__gstrefcount__)) + self.gccollect() + gst.info("pipeliner:%d/%d busr:%d" % (pipeline.__gstrefcount__, pipeline.__grefcount__, bus.__gstrefcount__)) + + self.assertEquals(bus.__gstrefcount__, 2) + self.assertEquals(pipeline.__gstrefcount__, 1) + + gst.info("removing pipeline") + del pipeline + gst.info("pipeline removed") + gst.info("busr:%d" % bus.__gstrefcount__) + + self.gccollect() + + # flush the bus + bus.set_flushing(True) + bus.set_flushing(False) + self.gccollect() + # FIXME: refcount is still 2 + self.assertEquals(bus.__gstrefcount__, 1) + + def _message_received(self, bus, message, pipeline, loop, id): + self.failUnless(isinstance(bus, gst.Bus)) + self.failUnless(isinstance(message, gst.Message)) + self.assertEquals(id, "one") + loop.quit() + return True + + def testSyncHandlerCallbackRefcount(self): + def callback1(): + pass + + def callback2(): + pass + + bus = gst.Bus() + + # set + self.failUnless(sys.getrefcount(callback1), 2) + bus.set_sync_handler(callback1) + self.failUnless(sys.getrefcount(callback1), 3) + + # set again + self.failUnless(sys.getrefcount(callback1), 3) + bus.set_sync_handler(callback1) + self.failUnless(sys.getrefcount(callback1), 3) + + # replace + # this erros out in gst_bus_set_sync_handler, but we need to check that + # we don't leak anyway + self.failUnless(sys.getrefcount(callback2), 2) + bus.set_sync_handler(callback2) + self.failUnless(sys.getrefcount(callback1), 2) + self.failUnless(sys.getrefcount(callback2), 3) + + # unset + bus.set_sync_handler(None) + self.failUnless(sys.getrefcount(callback2), 2) + +class BusAddWatchTest(TestCase): + + def testADumbExample(self): + gst.info("creating pipeline") + pipeline = gst.parse_launch("fakesrc ! fakesink") + gst.info("pipeliner:%s" % pipeline.__gstrefcount__) + bus = pipeline.get_bus() + gst.info("got bus, pipeliner:%d, busr:%d" % (pipeline.__gstrefcount__, + bus.__gstrefcount__)) +## watch_id = bus.add_watch(self._message_received, pipeline) +## gst.info("added watch, pipeliner:%d, busr:%d" % (pipeline.__gstrefcount__, +## bus.__gstrefcount__)) +## gobject.source_remove(watch_id) +## gst.info("removed watch, pipeliner:%d, busr:%d" % (pipeline.__gstrefcount__, +## bus.__gstrefcount__)) + + + def testGoodConstructor(self): + loop = gobject.MainLoop() + gst.info ("creating pipeline") + pipeline = gst.parse_launch("fakesrc ! fakesink") + gst.info ("getting bus") + bus = pipeline.get_bus() + gst.info ("got bus") + gst.info("pipeliner:%d busr:%d" % (pipeline.__gstrefcount__, bus.__gstrefcount__)) + self.assertEquals(bus.__gstrefcount__, 2) + self.assertEquals(pipeline.__gstrefcount__, 1) + gst.info ("about to add a watch on the bus") + watch_id = bus.add_watch(self._message_received, pipeline, loop, "one") + gst.info ("added a watch on the bus") + gst.info("pipeliner:%d busr:%d" % (pipeline.__gstrefcount__, bus.__gstrefcount__)) + self.assertEquals(bus.__gstrefcount__, 3) + self.assertEquals(pipeline.__gstrefcount__, 1) + + gst.info("setting to playing") + ret = pipeline.set_state(gst.STATE_PLAYING) + gst.info("set to playing %s, loop.run" % ret) + gst.info("pipeliner:%d busr:%d" % (pipeline.__gstrefcount__, bus.__gstrefcount__)) + loop.run() + + gst.info("pipeliner:%d busr:%d" % (pipeline.__gstrefcount__, bus.__gstrefcount__)) + gst.info("setting to paused") + ret = pipeline.set_state(gst.STATE_PAUSED) + gst.info("set to paused %s, loop.run" % ret) + gst.info("pipeliner:%d busr:%d" % (pipeline.__gstrefcount__, bus.__gstrefcount__)) + loop.run() + gst.info("pipeliner:%d busr:%d" % (pipeline.__gstrefcount__, bus.__gstrefcount__)) + + gst.info("setting to ready") + ret = pipeline.set_state(gst.STATE_READY) + gst.info("pipeliner:%d busr:%d" % (pipeline.__gstrefcount__, bus.__gstrefcount__)) + gst.info("set to READY %s, loop.run" % ret) + loop.run() + + gst.info("pipeliner:%d busr:%d" % (pipeline.__gstrefcount__, bus.__gstrefcount__)) + gst.info("setting to NULL") + ret = pipeline.set_state(gst.STATE_NULL) + gst.info("pipeliner:%d busr:%d" % (pipeline.__gstrefcount__, bus.__gstrefcount__)) + gst.info("set to NULL %s" % ret) + self.gccollect() + self.assertEquals(bus.__gstrefcount__, 3) + self.assertEquals(pipeline.__gstrefcount__, 1) + + gst.info("about to remove the watch id") + gst.info("pipeliner:%d busr:%d" % (pipeline.__gstrefcount__, bus.__gstrefcount__)) + self.failUnless(gobject.source_remove(watch_id)) + gst.info("bus watch id removed") + gst.info("pipeliner:%d busr:%d" % (pipeline.__gstrefcount__, bus.__gstrefcount__)) + self.gccollect() + gst.info("pipeliner:%d/%d busr:%d" % (pipeline.__gstrefcount__, pipeline.__grefcount__, bus.__gstrefcount__)) + + self.assertEquals(bus.__gstrefcount__, 2) + self.assertEquals(pipeline.__gstrefcount__, 1) + + gst.info("removing pipeline") + del pipeline + gst.info("pipeline removed") + gst.info("busr:%d" % bus.__gstrefcount__) + + self.gccollect() + + # flush the bus + bus.set_flushing(True) + bus.set_flushing(False) + self.gccollect() + # FIXME: refcount is still 2 + self.assertEquals(bus.__gstrefcount__, 1) + + def _message_received(self, bus, message, pipeline, loop, id): + self.failUnless(isinstance(bus, gst.Bus)) + self.failUnless(isinstance(message, gst.Message)) + self.assertEquals(id, "one") + # doesn't the following line stop the mainloop before the end of the state change ? + loop.quit() + return True + + +if __name__ == "__main__": + unittest.main() diff --git a/testsuite/old/test_caps.py b/testsuite/old/test_caps.py new file mode 100644 index 0000000..39ecde8 --- /dev/null +++ b/testsuite/old/test_caps.py @@ -0,0 +1,196 @@ +# -*- Mode: Python -*- +# vi:si:et:sw=4:sts=4:ts=4 +# +# gst-python - Python bindings for GStreamer +# Copyright (C) 2002 David I. Lehn +# Copyright (C) 2004 Johan Dahlin +# Copyright (C) 2005 Edward Hervey +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +import sys +from common import gst, unittest, TestCase + +class CapsTest(TestCase): + def setUp(self): + TestCase.setUp(self) + self.caps = gst.caps_from_string('video/x-raw-yuv,width=10,framerate=5/1;video/x-raw-rgb,width=15,framerate=10/1') + self.assertEquals(self.caps.__refcount__, 1) + self.structure = self.caps[0] + self.any = gst.Caps("ANY") + self.assertEquals(self.any.__refcount__, 1) + self.empty = gst.Caps() + self.assertEquals(self.empty.__refcount__, 1) + + def testCapsMime(self): + mime = self.structure.get_name() + assert mime == 'video/x-raw-yuv' + + def testCapsList(self): + 'check if we can access Caps as a list' + structure = self.caps[0] + mime = structure.get_name() + assert mime == 'video/x-raw-yuv' + structure = self.caps[1] + mime = structure.get_name() + assert mime == 'video/x-raw-rgb' + + def testCapsContainingMiniObjects(self): + # buffer contains hex encoding of ascii 'abcd' + caps = gst.Caps("video/x-raw-yuv, buf=(buffer)61626364") + buf = caps[0]['buf'] + assert isinstance(buf, gst.Buffer) + assert buf.data == "abcd" + + buf = gst.Buffer("1234") + caps[0]['buf2'] = buf + buf2 = caps[0]['buf2'] + assert buf2 == buf + + def testCapsConstructEmpty(self): + caps = gst.Caps() + assert isinstance(caps, gst.Caps) + + def testCapsConstructFromString(self): + caps = gst.Caps('video/x-raw-yuv,width=10') + assert isinstance(caps, gst.Caps) + assert len(caps) == 1 + assert isinstance(caps[0], gst.Structure) + assert caps[0].get_name() == 'video/x-raw-yuv' + assert isinstance(caps[0]['width'], int) + assert caps[0]['width'] == 10 + + def testCapsConstructFromStructure(self): + struct = gst.structure_from_string('video/x-raw-yuv,width=10,framerate=[0/1, 25/3]') + caps = gst.Caps(struct) + assert isinstance(caps, gst.Caps) + assert len(caps) == 1 + assert isinstance(caps[0], gst.Structure) + assert caps[0].get_name() == 'video/x-raw-yuv' + assert isinstance(caps[0]['width'], int) + assert caps[0]['width'] == 10 + assert isinstance(caps[0]['framerate'], gst.FractionRange) + + def testCapsConstructFromStructures(self): + struct1 = gst.structure_from_string('video/x-raw-yuv,width=10') + struct2 = gst.structure_from_string('video/x-raw-rgb,height=20.0') + caps = gst.Caps(struct1, struct2) + assert isinstance(caps, gst.Caps) + assert len(caps) == 2 + struct = caps[0] + assert isinstance(struct, gst.Structure), struct + assert struct.get_name() == 'video/x-raw-yuv', struct.get_name() + assert struct.has_key('width') + assert isinstance(struct['width'], int) + assert struct['width'] == 10 + struct = caps[1] + assert isinstance(struct, gst.Structure), struct + assert struct.get_name() == 'video/x-raw-rgb', struct.get_name() + assert struct.has_key('height') + assert isinstance(struct['height'], float) + assert struct['height'] == 20.0 + + def testCapsReferenceStructs(self): + 'test that shows why it\'s not a good idea to use structures by reference' + caps = gst.Caps('hi/mom,width=0') + structure = caps[0] + del caps + assert structure['width'] == 0 + + + def testCapsStructureChange(self): + 'test if changing the structure of the caps works by reference' + assert self.structure['width'] == 10 + self.structure['width'] = 5 + assert self.structure['width'] == 5.0 + # check if we changed the caps as well + structure = self.caps[0] + assert structure['width'] == 5.0 + + def testCapsBadConstructor(self): + struct = gst.structure_from_string('video/x-raw-yuv,width=10') + self.assertRaises(TypeError, gst.Caps, None) + self.assertRaises(TypeError, gst.Caps, 1) + self.assertRaises(TypeError, gst.Caps, 2.0) + self.assertRaises(TypeError, gst.Caps, object) + self.assertRaises(TypeError, gst.Caps, 1, 2, 3) + + # This causes segfault! + #self.assertRaises(TypeError, gst.Caps, struct, 10, None) + + def testTrueFalse(self): + 'test that comparisons using caps work the intended way' + assert self.any # not empty even though it has no structures + assert not self.empty + assert not gst.Caps('EMPTY') # also empty + assert gst.Caps('your/mom') + + def testComparisons(self): + assert self.empty < self.any + assert self.empty < self.structure + assert self.empty < self.caps + assert self.caps < self.any + assert self.empty <= self.empty + assert self.caps <= self.caps + assert self.caps <= self.any + assert self.empty == "EMPTY" + assert self.caps != self.any + assert self.empty != self.any + assert self.any > self.empty + assert self.any >= self.empty + + def testFilters(self): + name = 'video/x-raw-yuv' + filtercaps = gst.Caps(*[struct for struct in self.caps if struct.get_name() == name]) + intersection = self.caps & 'video/x-raw-yuv' + assert filtercaps == intersection + + def doSubtract(self, set, subset): + '''mimic the test in GStreamer core's testsuite/caps/subtract.c''' + assert not set - set + assert not subset - subset + assert not subset - set + test = set - subset + assert test + test2 = test | subset + test = test2 - set + assert not test + #our own extensions foolow here + assert subset == set & subset + assert set == set | subset + assert set - subset == set ^ subset + + def testSubtract(self): + self.doSubtract( + gst.Caps ("some/mime, _int = [ 1, 2 ], list = { \"A\", \"B\", \"C\" }"), + gst.Caps ("some/mime, _int = 1, list = \"A\"")) + self.doSubtract( + gst.Caps ("some/mime, _double = (double) 1.0; other/mime, _int = { 1, 2 }"), + gst.Caps ("some/mime, _double = (double) 1.0")) + + def testNoneValue(self): + caps = gst.Caps("foo") + + def invalid_assignment(): + caps[0]["bar"] = None + self.assertRaises(TypeError, invalid_assignment) + + def invalid_set_value(): + caps[0].set_value("bar", None) + self.assertRaises(TypeError, invalid_set_value) + + +if __name__ == "__main__": + unittest.main() diff --git a/testsuite/old/test_element.py b/testsuite/old/test_element.py new file mode 100644 index 0000000..6bfd7a5 --- /dev/null +++ b/testsuite/old/test_element.py @@ -0,0 +1,268 @@ +# -*- Mode: Python -*- +# vi:si:et:sw=4:sts=4:ts=4 +# +# gst-python - Python bindings for GStreamer +# Copyright (C) 2002 David I. Lehn +# Copyright (C) 2004 Johan Dahlin +# Copyright (C) 2005 Edward Hervey +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +from common import gst, unittest, TestCase, pygobject_2_13 + +import sys + +# since I can't subclass gst.Element for some reason, I use a bin here +# it don't matter to Jesus +class TestElement(gst.Bin): + def break_it_down(self): + self.debug('Hammer Time') + +class ElementTest(TestCase): + name = 'fakesink' + alias = 'sink' + + def testGoodConstructor(self): + element = gst.element_factory_make(self.name, self.alias) + assert element is not None, 'element is None' + assert isinstance(element, gst.Element) + assert element.get_name() == self.alias + +## FIXME : Make a new test for state changes, using bus signals + +## class FakeSinkTest(ElementTest): +## FAKESINK_STATE_ERROR_NONE = "0" +## FAKESINK_STATE_ERROR_NULL_READY, = "1" +## FAKESINK_STATE_ERROR_READY_PAUSED, = "2" +## FAKESINK_STATE_ERROR_PAUSED_PLAYING = "3" +## FAKESINK_STATE_ERROR_PLAYING_PAUSED = "4" +## FAKESINK_STATE_ERROR_PAUSED_READY = "5" +## FAKESINK_STATE_ERROR_READY_NULL = "6" + +## name = 'fakesink' +## alias = 'sink' +## def setUp(self): +## ElementTest.setUp(self) +## self.element = gst.element_factory_make('fakesink', 'sink') + +## def tearDown(self): +## self.element.set_state(gst.STATE_NULL) +## del self.element +## ElementTest.tearDown(self) + +## def checkError(self, old_state, state, name): +## assert self.element.get_state() == gst.STATE_NULL +## assert self.element.set_state(old_state) +## assert self.element.get_state() == old_state +## self.element.set_property('state-error', name) +## self.error = False +## def error_cb(element, source, gerror, debug): +## assert isinstance(element, gst.Element) +## assert element == self.element +## assert isinstance(source, gst.Element) +## assert source == self.element +## assert isinstance(gerror, gst.GError) +## self.error = True + +## self.element.connect('error', error_cb) +## self.element.set_state (state) +## assert self.error, 'error not set' +## #assert error_message.find('ERROR') != -1 + +## self.element.get_state() == old_state, 'state changed' + +## def testStateErrorNullReady(self): +## self.checkError(gst.STATE_NULL, gst.STATE_READY, +## self.FAKESINK_STATE_ERROR_NULL_READY) + +## def testStateErrorReadyPaused(self): +## self.checkError(gst.STATE_READY, gst.STATE_PAUSED, +## self.FAKESINK_STATE_ERROR_READY_PAUSED) + +## def testStateErrorPausedPlaying(self): +## self.checkError(gst.STATE_PAUSED, gst.STATE_PLAYING, +## self.FAKESINK_STATE_ERROR_PAUSED_PLAYING) + +## def testStateErrorPlayingPaused(self): +## self.checkError(gst.STATE_PLAYING, gst.STATE_PAUSED, +## self.FAKESINK_STATE_ERROR_PLAYING_PAUSED) + +## def testStateErrorPausedReady(self): +## self.checkError(gst.STATE_PAUSED, gst.STATE_READY, +## self.FAKESINK_STATE_ERROR_PAUSED_READY) + +## def testStateErrorReadyNull(self): +## self.checkError(gst.STATE_READY, gst.STATE_NULL, +## self.FAKESINK_STATE_ERROR_READY_NULL) + +## def checkStateChange(self, old, new): +## def state_change_cb(element, old_s, new_s): +## assert isinstance(element, gst.Element) +## assert element == self.element +## assert old_s == old +## assert new_s == new + +## assert self.element.set_state(old) +## assert self.element.get_state(0.0)[1] == old + +## # FIXME: replace with messages +## # self.element.connect('state-change', state_change_cb) + +## assert self.element.set_state(new) +## assert self.element.get_state(0.0)[1] == new + +## def testStateChangeNullReady(self): +## self.checkStateChange(gst.STATE_NULL, gst.STATE_READY) + +## def testStateChangeReadyPaused(self): +## self.checkStateChange(gst.STATE_READY, gst.STATE_PAUSED) + +## def testStateChangePausedPlaying(self): +## self.checkStateChange(gst.STATE_PAUSED, gst.STATE_PLAYING) + +## def testStateChangePlayingPaused(self): +## self.checkStateChange(gst.STATE_PLAYING, gst.STATE_PAUSED) + +## def testStateChangePausedReady(self): +## self.checkStateChange(gst.STATE_PAUSED, gst.STATE_READY) + +## def testStateChangeReadyNull(self): +## self.checkStateChange(gst.STATE_READY, gst.STATE_NULL) + +class NonExistentTest(ElementTest): + name = 'this-element-does-not-exist' + alias = 'no-alias' + + testGoodConstructor = lambda s: None + testGoodConstructor2 = lambda s: None + +class FileSrcTest(ElementTest): + name = 'filesrc' + alias = 'source' + +class FileSinkTest(ElementTest): + name = 'filesink' + alias = 'sink' + +class ElementName(TestCase): + def testElementStateGetName(self): + get_name = gst.element_state_get_name + for state in ('NULL', + 'READY', + 'PLAYING', + 'PAUSED'): + name = 'STATE_' + state + assert hasattr(gst, name) + attr = getattr(gst, name) + assert get_name(attr) == state + + assert get_name(gst.STATE_VOID_PENDING) == 'VOID_PENDING' + assert get_name(-1) == 'UNKNOWN!(-1)' + self.assertRaises(TypeError, get_name, '') + +class QueryTest(TestCase): + def setUp(self): + TestCase.setUp(self) + self.pipeline = gst.parse_launch('fakesrc name=source ! fakesink') + self.assertEquals(self.pipeline.__gstrefcount__, 1) + + self.element = self.pipeline.get_by_name('source') + self.assertEquals(self.pipeline.__gstrefcount__, 1) + self.assertEquals(self.element.__gstrefcount__, 2) + self.assertEquals(sys.getrefcount(self.element), pygobject_2_13 and 2 or 3) + + def tearDown(self): + del self.pipeline + del self.element + TestCase.tearDown(self) + + def testQuery(self): + gst.debug('querying fakesrc in FORMAT_BYTES') + res = self.element.query_position(gst.FORMAT_BYTES) + self.assertEquals(self.pipeline.__gstrefcount__, 1) + self.assertEquals(sys.getrefcount(self.pipeline), pygobject_2_13 and 2 or 3) + self.assertEquals(self.element.__gstrefcount__, 2) + self.assertEquals(sys.getrefcount(self.element), pygobject_2_13 and 2 or 3) + assert res + assert res[0] == 0 + self.assertRaises(gst.QueryError, self.element.query_position, + gst.FORMAT_TIME) + self.gccollect() + +class QueueTest(TestCase): + def testConstruct(self): + queue = gst.element_factory_make('queue') + assert queue.get_name() == 'queue0' + self.assertEquals(queue.__gstrefcount__, 1) + +class DebugTest(TestCase): + def testDebug(self): + e = gst.element_factory_make('fakesrc') + e.error('I am an error string') + e.warning('I am a warning string') + e.info('I am an info string') + e.debug('I am a debug string') + e.log('I am a log string') + e.debug('I am a formatted %s %s' % ('log', 'string')) + + def testElementDebug(self): + e = TestElement("testelement") + e.set_property("name", "testelement") + e.break_it_down() + +class LinkTest(TestCase): + def testLinkNoPads(self): + src = gst.Bin() + sink = gst.Bin() + self.assertRaises(gst.LinkError, src.link, sink) + + def testLink(self): + src = gst.element_factory_make('fakesrc') + sink = gst.element_factory_make('fakesink') + self.failUnless(src.link(sink)) + # FIXME: this unlink leaks, no idea why + # src.unlink(sink) + # print src.__gstrefcount__ + + def testLinkPads(self): + src = gst.element_factory_make('fakesrc') + sink = gst.element_factory_make('fakesink') + # print src.__gstrefcount__ + self.failUnless(src.link_pads("src", sink, "sink")) + src.unlink_pads("src", sink, "sink") + + def testLinkFiltered(self): + # a filtered link uses capsfilter and thus needs a bin + bin = gst.Bin() + src = gst.element_factory_make('fakesrc') + sink = gst.element_factory_make('fakesink') + bin.add(src, sink) + caps = gst.caps_from_string("audio/x-raw-int") + + self.failUnless(src.link(sink, caps)) + + # DANGER WILL. src is not actually connected to sink, since + # there's a capsfilter in the way. What a leaky abstraction. + # FIXME + # src.unlink(sink) + + # instead, mess with pads directly + pad = src.get_pad('src') + pad.unlink(pad.get_peer()) + pad = sink.get_pad('sink') + pad.get_peer().unlink(pad) + +if __name__ == "__main__": + unittest.main() diff --git a/testsuite/old/test_event.py b/testsuite/old/test_event.py new file mode 100644 index 0000000..c7bdf77 --- /dev/null +++ b/testsuite/old/test_event.py @@ -0,0 +1,244 @@ +# -*- Mode: Python -*- +# vi:si:et:sw=4:sts=4:ts=4 +# +# gst-python - Python bindings for GStreamer +# Copyright (C) 2002 David I. Lehn +# Copyright (C) 2004 Johan Dahlin +# Copyright (C) 2005 Edward Hervey +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +import os +import sys +import time +import tempfile + +from common import gst, unittest, testhelper, TestCase + +class EventTest(TestCase): + def setUp(self): + TestCase.setUp(self) + self.pipeline = gst.parse_launch('fakesrc ! fakesink name=sink') + self.sink = self.pipeline.get_by_name('sink') + self.pipeline.set_state(gst.STATE_PLAYING) + + def tearDown(self): + gst.debug('setting pipeline to NULL') + self.pipeline.set_state(gst.STATE_NULL) + gst.debug('set pipeline to NULL') + # FIXME: wait for state change thread to die + while self.pipeline.__gstrefcount__ > 1: + gst.debug('waiting for self.pipeline G rc to drop to 1') + time.sleep(0.1) + self.assertEquals(self.pipeline.__gstrefcount__, 1) + + del self.sink + del self.pipeline + TestCase.tearDown(self) + + def testEventSeek(self): + # this event only serves to change the rate of data transfer + event = gst.event_new_seek(1.0, gst.FORMAT_BYTES, gst.SEEK_FLAG_FLUSH, + gst.SEEK_TYPE_NONE, 0, gst.SEEK_TYPE_NONE, 0) + # FIXME: but basesrc goes into an mmap/munmap spree, needs to be fixed + + event = gst.event_new_seek(1.0, gst.FORMAT_BYTES, gst.SEEK_FLAG_FLUSH, + gst.SEEK_TYPE_SET, 0, gst.SEEK_TYPE_NONE, 0) + assert event + gst.debug('sending event') + self.sink.send_event(event) + gst.debug('sent event') + + self.assertEqual(event.parse_seek(), (1.0, gst.FORMAT_BYTES, gst.SEEK_FLAG_FLUSH, + gst.SEEK_TYPE_SET, 0, gst.SEEK_TYPE_NONE, 0)) + + def testWrongEvent(self): + buffer = gst.Buffer() + self.assertRaises(TypeError, self.sink.send_event, buffer) + number = 1 + self.assertRaises(TypeError, self.sink.send_event, number) + + +class EventFileSrcTest(TestCase): + + def setUp(self): + TestCase.setUp(self) + gst.info("start") + self.filename = tempfile.mktemp() + open(self.filename, 'w').write(''.join(map(str, range(10)))) + + self.pipeline = gst.parse_launch('filesrc name=source location=%s blocksize=1 ! fakesink signal-handoffs=1 name=sink' % self.filename) + self.source = self.pipeline.get_by_name('source') + self.sink = self.pipeline.get_by_name('sink') + self.sigid = self.sink.connect('handoff', self.handoff_cb) + self.bus = self.pipeline.get_bus() + + def tearDown(self): + self.pipeline.set_state(gst.STATE_NULL) + self.sink.disconnect(self.sigid) + if os.path.exists(self.filename): + os.remove(self.filename) + del self.bus + del self.pipeline + del self.source + del self.sink + del self.handoffs + TestCase.tearDown(self) + + def handoff_cb(self, element, buffer, pad): + self.handoffs.append(str(buffer)) + + def playAndIter(self): + self.handoffs = [] + self.pipeline.set_state(gst.STATE_PLAYING) + assert self.pipeline.set_state(gst.STATE_PLAYING) + while 42: + msg = self.bus.pop() + if msg and msg.type == gst.MESSAGE_EOS: + break + assert self.pipeline.set_state(gst.STATE_PAUSED) + handoffs = self.handoffs + self.handoffs = [] + return handoffs + + def sink_seek(self, offset, method=gst.SEEK_TYPE_SET): + self.sink.seek(1.0, gst.FORMAT_BYTES, gst.SEEK_FLAG_FLUSH, + method, offset, + gst.SEEK_TYPE_NONE, 0) + + def testSimple(self): + handoffs = self.playAndIter() + assert handoffs == map(str, range(10)) + + def testSeekCur(self): + self.sink_seek(8) + self.playAndIter() + +class TestEmit(TestCase): + def testEmit(self): + object = testhelper.get_object() + object.connect('event', self._event_cb) + + # First emit from C + testhelper.emit_event(object) + + # Then emit from Python + object.emit('event', gst.event_new_eos()) + + def _event_cb(self, obj, event): + assert isinstance(event, gst.Event) + + +class TestDelayedEventProbe(TestCase): + # this test: + # starts a pipeline with only a source + # adds an event probe to catch the (first) new-segment + # adds a buffer probe to "autoplug" and send out this event + def setUp(self): + TestCase.setUp(self) + self.pipeline = gst.Pipeline() + self.src = gst.element_factory_make('fakesrc') + self.src.set_property('num-buffers', 10) + self.pipeline.add(self.src) + self.srcpad = self.src.get_pad('src') + + def tearDown(self): + gst.debug('setting pipeline to NULL') + self.pipeline.set_state(gst.STATE_NULL) + gst.debug('set pipeline to NULL') + # FIXME: wait for state change thread to die + while self.pipeline.__gstrefcount__ > 1: + gst.debug('waiting for self.pipeline G rc to drop to 1') + time.sleep(0.1) + self.assertEquals(self.pipeline.__gstrefcount__, 1) + + def testProbe(self): + self.srcpad.add_event_probe(self._event_probe_cb) + self._buffer_probe_id = self.srcpad.add_buffer_probe( + self._buffer_probe_cb) + + self._newsegment = None + self._eos = None + self._had_buffer = False + + self.pipeline.set_state(gst.STATE_PLAYING) + + while not self._eos: + time.sleep(0.1) + + # verify if our newsegment event is still around and valid + self.failUnless(self._newsegment) + self.assertEquals(self._newsegment.type, gst.EVENT_NEWSEGMENT) + self.assertEquals(self._newsegment.__grefcount__, 1) + + # verify if our eos event is still around and valid + self.failUnless(self._eos) + self.assertEquals(self._eos.type, gst.EVENT_EOS) + self.assertEquals(self._eos.__grefcount__, 1) + + def _event_probe_cb(self, pad, event): + if event.type == gst.EVENT_NEWSEGMENT: + self._newsegment = event + self.assertEquals(event.__grefcount__, 3) + # drop the event, we're storing it for later sending + return False + + if event.type == gst.EVENT_EOS: + self._eos = event + # we also want fakesink to get it + return True + + # sinks now send Latency events upstream + if event.type == gst.EVENT_LATENCY: + return True + + self.fail("Got an unknown event %r" % event) + + def _buffer_probe_cb(self, pad, buffer): + self.failUnless(self._newsegment) + + # fake autoplugging by now putting in a fakesink + sink = gst.element_factory_make('fakesink') + self.pipeline.add(sink) + self.src.link(sink) + sink.set_state(gst.STATE_PLAYING) + + pad = sink.get_pad('sink') + pad.send_event(self._newsegment) + + # we don't want to be called again + self.srcpad.remove_buffer_probe(self._buffer_probe_id) + + self._had_buffer = True + # now let the buffer through + return True + +class TestEventCreationParsing(TestCase): + + def testEventStep(self): + if hasattr(gst.Event, "parse_step"): + e = gst.event_new_step(gst.FORMAT_TIME, 42, 1.0, True, True) + + self.assertEquals(e.type, gst.EVENT_STEP) + + fmt, amount, rate, flush, intermediate = e.parse_step() + self.assertEquals(fmt, gst.FORMAT_TIME) + self.assertEquals(amount, 42) + self.assertEquals(rate, 1.0) + self.assertEquals(flush, True) + self.assertEquals(intermediate, True) + +if __name__ == "__main__": + unittest.main() diff --git a/testsuite/old/test_ghostpad.py b/testsuite/old/test_ghostpad.py new file mode 100644 index 0000000..86a71ee --- /dev/null +++ b/testsuite/old/test_ghostpad.py @@ -0,0 +1,194 @@ +# -*- Mode: Python -*- +# vi:si:et:sw=4:sts=4:ts=4 +# +# gst-python - Python bindings for GStreamer +# Copyright (C) 2002 David I. Lehn +# Copyright (C) 2004 Johan Dahlin +# Copyright (C) 2005 Edward Hervey +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +from common import gst, unittest, TestCase, pygobject_2_13 + +import sys +import gc +import gobject + +class SrcBin(gst.Bin): + def prepare(self): + src = gst.element_factory_make('fakesrc') + self.add(src) + pad = src.get_pad("src") + ghostpad = gst.GhostPad("src", pad) + self.add_pad(ghostpad) +gobject.type_register(SrcBin) + +class SinkBin(gst.Bin): + def prepare(self): + sink = gst.element_factory_make('fakesink') + self.add(sink) + pad = sink.get_pad("sink") + ghostpad = gst.GhostPad("sink", pad) + self.add_pad(ghostpad) + self.sink = sink + + def connect_handoff(self, cb, *args, **kwargs): + self.sink.set_property('signal-handoffs', True) + self.sink.connect('handoff', cb, *args, **kwargs) + +gobject.type_register(SinkBin) + + +class PipeTest(TestCase): + def setUp(self): + gst.info("setUp") + TestCase.setUp(self) + self.pipeline = gst.Pipeline() + self.assertEquals(self.pipeline.__gstrefcount__, 1) + self.assertEquals(sys.getrefcount(self.pipeline), pygobject_2_13 and 2 or 3) + + self.src = SrcBin() + self.src.prepare() + self.sink = SinkBin() + self.sink.prepare() + self.assertEquals(self.src.__gstrefcount__, 1) + self.assertEquals(sys.getrefcount(self.src), pygobject_2_13 and 2 or 3) + self.assertEquals(self.sink.__gstrefcount__, 1) + self.assertEquals(sys.getrefcount(self.sink), pygobject_2_13 and 2 or 3) + gst.info("end of SetUp") + + def tearDown(self): + gst.info("tearDown") + self.assertTrue (self.pipeline.__gstrefcount__ >= 1 and self.pipeline.__gstrefcount__ <= 2) + self.assertEquals(sys.getrefcount(self.pipeline), pygobject_2_13 and 2 or 3) + self.assertEquals(self.src.__gstrefcount__, 2) + self.assertEquals(sys.getrefcount(self.src), pygobject_2_13 and 2 or 3) + self.assertEquals(self.sink.__gstrefcount__, 2) + self.assertEquals(sys.getrefcount(self.sink), 3) + gst.debug('deleting pipeline') + del self.pipeline + self.gccollect() + + self.assertEquals(self.src.__gstrefcount__, 1) # parent gone + self.assertEquals(self.sink.__gstrefcount__, 1) # parent gone + self.assertEquals(sys.getrefcount(self.src), pygobject_2_13 and 2 or 3) + self.assertEquals(sys.getrefcount(self.sink), pygobject_2_13 and 2 or 3) + gst.debug('deleting src') + del self.src + self.gccollect() + gst.debug('deleting sink') + del self.sink + self.gccollect() + + TestCase.tearDown(self) + + def testBinState(self): + self.pipeline.add(self.src, self.sink) + self.src.link(self.sink) + self.sink.connect_handoff(self._sink_handoff_cb) + self._handoffs = 0 + + self.assertTrue(self.pipeline.set_state(gst.STATE_PLAYING) != gst.STATE_CHANGE_FAILURE) + while True: + (ret, cur, pen) = self.pipeline.get_state() + if ret == gst.STATE_CHANGE_SUCCESS and cur == gst.STATE_PLAYING: + break + + while self._handoffs < 10: + pass + + self.assertEquals(self.pipeline.set_state(gst.STATE_NULL), gst.STATE_CHANGE_SUCCESS) + while True: + (ret, cur, pen) = self.pipeline.get_state() + if ret == gst.STATE_CHANGE_SUCCESS and cur == gst.STATE_NULL: + break + +## def testProbedLink(self): +## self.pipeline.add(self.src) +## pad = self.src.get_pad("src") + +## self.sink.connect_handoff(self._sink_handoff_cb) +## self._handoffs = 0 + +## # FIXME: adding a probe to the ghost pad does not work atm +## # id = pad.add_buffer_probe(self._src_buffer_probe_cb) +## realpad = pad.get_target() +## self._probe_id = realpad.add_buffer_probe(self._src_buffer_probe_cb) + +## self._probed = False + +## while True: +## (ret, cur, pen) = self.pipeline.get_state() +## if ret == gst.STATE_CHANGE_SUCCESS and cur == gst.STATE_PLAYING: +## break + +## while not self._probed: +## pass + +## while self._handoffs < 10: +## pass + +## self.pipeline.set_state(gst.STATE_NULL) +## while True: +## (ret, cur, pen) = self.pipeline.get_state() +## if ret == gst.STATE_CHANGE_SUCCESS and cur == gst.STATE_NULL: +## break + + def _src_buffer_probe_cb(self, pad, buffer): + gst.debug("received probe on pad %r" % pad) + self._probed = True + gst.debug('adding sink bin') + self.pipeline.add(self.sink) + # this seems to get rid of the warnings about pushing on an unactivated + # pad + gst.debug('setting sink state') + + # FIXME: attempt one: sync to current pending state of bin + (res, cur, pen) = self.pipeline.get_state(timeout=0) + target = pen + if target == gst.STATE_VOID_PENDING: + target = cur + gst.debug("setting sink state to %r" % target) + # FIXME: the following print can cause a lock-up; why ? + # print target + # if we don't set async, it will possibly end up in PAUSED + self.sink.set_state(target) + + gst.debug('linking') + self.src.link(self.sink) + gst.debug('removing buffer probe id %r' % self._probe_id) + pad.remove_buffer_probe(self._probe_id) + self._probe_id = None + gst.debug('done') + + def _sink_handoff_cb(self, sink, buffer, pad): + gst.debug('received handoff on pad %r' % pad) + self._handoffs += 1 + +class TargetTest(TestCase): + def test_target(self): + src = gst.Pad("src", gst.PAD_SRC) + + ghost = gst.GhostPad("ghost_src", src) + self.failUnless(ghost.get_target() is src) + + ghost.set_target(None) + self.failUnless(ghost.get_target() is None) + + ghost.set_target(src) + self.failUnless(ghost.get_target() is src) + +if __name__ == "__main__": + unittest.main() diff --git a/testsuite/old/test_interface.py b/testsuite/old/test_interface.py new file mode 100644 index 0000000..79bc842 --- /dev/null +++ b/testsuite/old/test_interface.py @@ -0,0 +1,92 @@ +# -*- Mode: Python -*- +# vi:si:et:sw=4:sts=4:ts=4 +# +# gst-python - Python bindings for GStreamer +# Copyright (C) 2002 David I. Lehn +# Copyright (C) 2004 Johan Dahlin +# Copyright (C) 2005 Edward Hervey +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +from common import gst, unittest, TestCase + +import gobject + +def find_mixer_element(): + """ Searches for an element implementing the mixer interface """ + allmix = [x for x in gst.registry_get_default().get_feature_list(gst.ElementFactory) + if x.has_interface("GstMixer") and x.has_interface("GstPropertyProbe")] + if allmix == []: + return None + return allmix[0] + +class Availability(TestCase): + def testXOverlay(self): + assert hasattr(gst.interfaces, 'XOverlay') + assert issubclass(gst.interfaces.XOverlay, gobject.GInterface) + + def testMixer(self): + assert hasattr(gst.interfaces, 'Mixer') + assert issubclass(gst.interfaces.Mixer, gobject.GInterface) + +class FunctionCall(TestCase): + def FIXME_testXOverlay(self): + # obviously a testsuite is not allowed to instantiate this + # since it needs a running X or will fail. find some way to + # deal with that. + element = gst.element_factory_make('xvimagesink') + assert isinstance(element, gst.Element) + assert isinstance(element, gst.interfaces.XOverlay) + element.set_xwindow_id(0L) + +class MixerTest(TestCase): + def setUp(self): + TestCase.setUp(self) + amix = find_mixer_element() + if amix: + self.mixer = amix.create() + else: + self.mixer = None + + def tearDown(self): + del self.mixer + TestCase.tearDown(self) + + def testGetProperty(self): + if self.mixer == None: + return + self.failUnless(self.mixer.probe_get_property('device')) + self.assertRaises(ValueError, + self.mixer.probe_get_property, 'non-existent') + + def testGetProperties(self): + if self.mixer == None: + return + properties = self.mixer.probe_get_properties() + self.failUnless(properties) + self.assertEqual(type(properties), list) + prop = properties[0] + self.assertEqual(prop.name, 'device') + self.assertEqual(prop.value_type, gobject.TYPE_STRING) + + def testGetValuesName(self): + if self.mixer == None: + return + values = self.mixer.probe_get_values_name('device') + self.assertEqual(type(values), list) + + +if __name__ == "__main__": + unittest.main() diff --git a/testsuite/old/test_iterator.py b/testsuite/old/test_iterator.py new file mode 100644 index 0000000..b540fb4 --- /dev/null +++ b/testsuite/old/test_iterator.py @@ -0,0 +1,117 @@ +# -*- Mode: Python -*- +# vi:si:et:sw=4:sts=4:ts=4 +# +# Copyright (C) 2005 Johan Dahlin +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +import unittest +from common import gst, TestCase + +class IteratorTest(TestCase): + # XXX: Elements + def testBinIterateElements(self): + pipeline = gst.parse_launch("fakesrc name=src ! fakesink name=sink") + elements = list(pipeline.elements()) + fakesrc = pipeline.get_by_name("src") + fakesink = pipeline.get_by_name("sink") + + self.assertEqual(len(elements), 2) + self.failUnless(fakesrc in elements) + self.failUnless(fakesink in elements) + + pipeline.remove(fakesrc) + elements = list(pipeline.elements()) + + self.assertEqual(len(elements), 1) + self.failUnless(not fakesrc in pipeline) + + # XXX : There seems to be a problem about the GType + # set in gst_bin_iterated_sorted + + def testBinIterateSorted(self): + pipeline = gst.parse_launch("fakesrc name=src ! fakesink name=sink") + elements = list(pipeline.sorted()) + fakesrc = pipeline.get_by_name("src") + fakesink = pipeline.get_by_name("sink") + + self.assertEqual(elements[0], fakesink) + self.assertEqual(elements[1], fakesrc) + + def testBinIterateRecurse(self): + pipeline = gst.parse_launch("fakesrc name=src ! fakesink name=sink") + elements = list(pipeline.recurse()) + fakesrc = pipeline.get_by_name("src") + fakesink = pipeline.get_by_name("sink") + + self.assertEqual(elements[0], fakesink) + self.assertEqual(elements[1], fakesrc) + + def testBinIterateSinks(self): + pipeline = gst.parse_launch("fakesrc name=src ! fakesink name=sink") + elements = list(pipeline.sinks()) + fakesrc = pipeline.get_by_name("src") + fakesink = pipeline.get_by_name("sink") + + self.assertEqual(len(elements), 1) + self.failUnless(fakesink in elements) + self.failUnless(not fakesrc in elements) + + + def testIteratePadsFakeSrc(self): + fakesrc = gst.element_factory_make('fakesrc') + pads = list(fakesrc.pads()) + srcpad = fakesrc.get_pad('src') + self.assertEqual(len(pads), 1) + self.assertEqual(pads[0], srcpad) + srcpads = list(fakesrc.src_pads()) + self.assertEqual(len(srcpads), 1) + self.assertEqual(srcpads[0], srcpad) + sinkpads = list(fakesrc.sink_pads()) + self.assertEqual(sinkpads, []) + + self.assertEqual(len(list(fakesrc)), 1) + for pad in fakesrc: + self.assertEqual(pad, srcpad) + break + else: + raise AssertionError + + def testIteratePadsFakeSink(self): + fakesink = gst.element_factory_make('fakesink') + pads = list(fakesink.pads()) + sinkpad = fakesink.get_pad('sink') + self.assertEqual(len(pads), 1) + self.assertEqual(pads[0], sinkpad) + srcpads = list(fakesink.src_pads()) + self.assertEqual(srcpads, []) + sinkpads = list(fakesink.sink_pads()) + self.assertEqual(len(sinkpads), 1) + self.assertEqual(sinkpads[0], sinkpad) + + self.assertEqual(len(list(fakesink)), 1) + for pad in fakesink: + self.assertEqual(pad, sinkpad) + break + else: + raise AssertionError + + def testInvalidIterator(self): + p = gst.Pad("p", gst.PAD_SRC) + # The C function will return NULL, we should + # therefore have an exception raised + self.assertRaises(TypeError, p.iterate_internal_links) + del p + diff --git a/testsuite/old/test_libtag.py b/testsuite/old/test_libtag.py new file mode 100644 index 0000000..d0e98d1 --- /dev/null +++ b/testsuite/old/test_libtag.py @@ -0,0 +1,37 @@ +# -*- Mode: Python -*- +# vi:si:et:sw=4:sts=4:ts=4 +# +# gst-python - Python bindings for GStreamer +# Copyright (C) 2010 Thiago Santos +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +from common import gst, TestCase +from gst import tag + +class TesLibTag(TestCase): + def testXmp(self): + taglist = gst.TagList() + taglist['title'] = 'my funny title' + taglist['geo-location-latitude'] = 23.25 + + xmp = tag.tag_list_to_xmp_buffer (taglist, True) + self.assertNotEquals(xmp, None) + taglist2 = tag.tag_list_from_xmp_buffer (xmp) + + self.assertEquals(len(taglist2), 2) + self.assertEquals(taglist2['title'], 'my funny title') + self.assertEquals(taglist2['geo-location-latitude'], 23.25) + diff --git a/testsuite/old/test_message.py b/testsuite/old/test_message.py new file mode 100644 index 0000000..1db40be --- /dev/null +++ b/testsuite/old/test_message.py @@ -0,0 +1,202 @@ +# -*- Mode: Python -*- +# vi:si:et:sw=4:sts=4:ts=4 +# +# gst-python - Python bindings for GStreamer +# Copyright (C) 2005 Thomas Vander Stichele +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +import sys +from common import gobject, gst, unittest, TestCase +import gc + +class NewTest(TestCase): + def testEOS(self): + gst.info("creating new bin") + b = gst.Bin() + gst.info("creating new EOS message from that bin") + m = gst.message_new_eos(b) + gst.info("got message : %s" % m) + + def message_application_cb(self, bus, message): + gst.info("got application message") + self.got_message = True + self.loop.quit() + + def testApplication(self): + self.loop = gobject.MainLoop() + gst.info("creating new pipeline") + bin = gst.Pipeline() + bus = bin.get_bus() + bus.add_signal_watch() + self.got_message = False + bus.connect('message::application', self.message_application_cb) + + struc = gst.Structure("foo") + msg = gst.message_new_application(bin, struc) + # the bus is flushing in NULL, so we need to set the pipeline to READY + bin.set_state(gst.STATE_READY) + bus.post(msg) + self.loop.run() + bus.remove_signal_watch() + bin.set_state(gst.STATE_NULL) + self.failUnless(self.got_message == True) + self.gccollect() + +class TestCreateMessages(TestCase): + + def setUp(self): + TestCase.setUp(self) + self.element = gst.Bin() + + def tearDown(self): + del self.element + + def testCustomMessage(self): + # create two custom messages using the same structure + s = gst.Structure("something") + assert s != None + e1 = gst.message_new_custom(gst.MESSAGE_APPLICATION, self.element, s) + assert e1 + e2 = gst.message_new_custom(gst.MESSAGE_APPLICATION, self.element, s) + assert e2 + + # make sure the two structures are equal + self.assertEquals(e1.structure.to_string(), + e2.structure.to_string()) + + def testTagMessage(self): + # Create a taglist + t = gst.TagList() + t['something'] = "else" + t['another'] = 42 + + # Create two messages using that same taglist + m1 = gst.message_new_tag(self.element, t) + assert m1 + m2 = gst.message_new_tag(self.element, t) + assert m2 + + # make sure the two messages have the same taglist + t1 = m1.parse_tag() + assert t1 + keys = t1.keys() + keys.sort() + self.assertEquals(keys, ['another', 'something']) + self.assertEquals(t1['something'], "else") + self.assertEquals(t1['another'], 42) + t2 = m2.parse_tag() + assert t2 + keys = t2.keys() + keys.sort() + self.assertEquals(keys, ['another', 'something']) + self.assertEquals(t2['something'], "else") + self.assertEquals(t2['another'], 42) + + def testTagFullMessage(self): + if hasattr(gst.Message, 'parse_tag_full'): + p = gst.Pad("blahblah", gst.PAD_SRC) + # Create a taglist + t = gst.TagList() + t['something'] = "else" + t['another'] = 42 + + # Create two messages using that same taglist + m1 = gst.message_new_tag_full(self.element, p, t) + assert m1 + m2 = gst.message_new_tag_full(self.element, p, t) + assert m2 + + # make sure the two messages have the same taglist + p1, t1 = m1.parse_tag_full() + assert t1 + keys = t1.keys() + keys.sort() + self.assertEquals(p1, p) + self.assertEquals(keys, ['another', 'something']) + self.assertEquals(t1['something'], "else") + self.assertEquals(t1['another'], 42) + p2, t2 = m2.parse_tag_full() + assert t2 + keys = t2.keys() + keys.sort() + self.assertEquals(p2, p) + self.assertEquals(keys, ['another', 'something']) + self.assertEquals(t2['something'], "else") + self.assertEquals(t2['another'], 42) + + def testStepStartMessage(self): + if hasattr(gst, 'message_new_step_start'): + m = gst.message_new_step_start(self.element, True, + gst.FORMAT_TIME, 42, 1.0, + True, True) + self.assertEquals(m.type, gst.MESSAGE_STEP_START) + active, format, amount, rate, flush, intermediate = m.parse_step_start() + self.assertEquals(active, True) + self.assertEquals(format, gst.FORMAT_TIME) + self.assertEquals(amount, 42) + self.assertEquals(rate, 1.0) + self.assertEquals(flush, True) + self.assertEquals(intermediate, True) + + def testStepDoneMessage(self): + if hasattr(gst, 'message_new_step_done'): + m = gst.message_new_step_done(self.element, gst.FORMAT_TIME, 42, + 1.0, True, True, 54, True) + self.assertEquals(m.type, gst.MESSAGE_STEP_DONE) + + fmt, am, rat, flu, inter, dur, eos = m.parse_step_done() + self.assertEquals(fmt, gst.FORMAT_TIME) + self.assertEquals(am, 42) + self.assertEquals(rat, 1.0) + self.assertEquals(flu, True) + self.assertEquals(inter, True) + self.assertEquals(dur, 54) + self.assertEquals(eos, True) + + def testStructureChangeMessage(self): + if hasattr(gst, 'message_new_structure_change'): + p = gst.Pad("blah", gst.PAD_SINK) + m = gst.message_new_structure_change(p, + gst.STRUCTURE_CHANGE_TYPE_PAD_LINK, + self.element, True) + + self.assertEquals(m.type, gst.MESSAGE_STRUCTURE_CHANGE) + sct, owner, busy = m.parse_structure_change() + self.assertEquals(sct, gst.STRUCTURE_CHANGE_TYPE_PAD_LINK) + self.assertEquals(owner, self.element) + self.assertEquals(busy, True) + + def testRequestStateMessage(self): + if hasattr(gst, 'message_new_request_state'): + m = gst.message_new_request_state(self.element, gst.STATE_NULL) + self.assertEquals(m.type, gst.MESSAGE_REQUEST_STATE) + self.assertEquals(m.parse_request_state(), gst.STATE_NULL) + + def testBufferingStatsMessage(self): + if hasattr(gst.Message, 'set_buffering_stats'): + gst.debug("Creating buffering message") + m = gst.message_new_buffering(self.element, 50) + gst.debug("Setting stats") + m.set_buffering_stats(gst.BUFFERING_LIVE, 30, 1024, 123456) + self.assertEquals(m.type, gst.MESSAGE_BUFFERING) + mode, ain, aout, left = m.parse_buffering_stats() + self.assertEquals(mode, gst.BUFFERING_LIVE) + self.assertEquals(ain, 30) + self.assertEquals(aout, 1024) + self.assertEquals(left, 123456) + +if __name__ == "__main__": + unittest.main() diff --git a/testsuite/old/test_pad.py b/testsuite/old/test_pad.py new file mode 100644 index 0000000..f2cc1fd --- /dev/null +++ b/testsuite/old/test_pad.py @@ -0,0 +1,568 @@ +# -*- Mode: Python -*- +# vi:si:et:sw=4:sts=4:ts=4 +# +# gst-python - Python bindings for GStreamer +# Copyright (C) 2002 David I. Lehn +# Copyright (C) 2004 Johan Dahlin +# Copyright (C) 2005 Edward Hervey +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +from common import gst, unittest, TestCase, pygobject_2_13 + +import sys +import time + +class PadTemplateTest(TestCase): + def testConstructor(self): + template = gst.PadTemplate("template", gst.PAD_SINK, + gst.PAD_ALWAYS, gst.caps_from_string("audio/x-raw-int")) + self.failUnless(template) + self.assertEquals(sys.getrefcount(template), pygobject_2_13 and 2 or 3) + #self.assertEquals(template.__gstrefcount__, 1) + +class PadPushUnlinkedTest(TestCase): + def setUp(self): + TestCase.setUp(self) + self.src = gst.Pad("src", gst.PAD_SRC) + self.sink = gst.Pad("sink", gst.PAD_SINK) + + def tearDown(self): + self.assertEquals(sys.getrefcount(self.src), pygobject_2_13 and 2 or 3) + self.assertEquals(self.src.__gstrefcount__, 1) + del self.src + self.assertEquals(sys.getrefcount(self.sink), pygobject_2_13 and 2 or 3) + self.assertEquals(self.sink.__gstrefcount__, 1) + del self.sink + TestCase.tearDown(self) + + def testNoProbe(self): + self.buffer = gst.Buffer() + self.assertEquals(self.buffer.__grefcount__, 1) + self.assertEquals(self.src.push(self.buffer), gst.FLOW_NOT_LINKED) + # pushing it takes a ref in the python wrapper to keep buffer + # alive afterwards; but the core unrefs the ref it receives + self.assertEquals(self.buffer.__grefcount__, 1) + + def testFalseProbe(self): + id = self.src.add_buffer_probe(self._probe_handler, False) + self.buffer = gst.Buffer() + self.assertEquals(self.buffer.__grefcount__, 1) + self.assertEquals(self.src.push(self.buffer), gst.FLOW_OK) + self.assertEquals(self.buffer.__grefcount__, 1) + self.src.remove_buffer_probe(id) + + def testTrueProbe(self): + id = self.src.add_buffer_probe(self._probe_handler, True) + self.buffer = gst.Buffer() + self.assertEquals(self.buffer.__grefcount__, 1) + self.assertEquals(self.src.push(self.buffer), gst.FLOW_NOT_LINKED) + self.assertEquals(self.buffer.__grefcount__, 1) + self.src.remove_buffer_probe(id) + + def _probe_handler(self, pad, buffer, ret): + return ret + +class PadPushLinkedTest(TestCase): + def setUp(self): + TestCase.setUp(self) + self.src = gst.Pad("src", gst.PAD_SRC) + self.sink = gst.Pad("sink", gst.PAD_SINK) + caps = gst.caps_from_string("foo/bar") + self.src.set_caps(caps) + self.sink.set_caps(caps) + self.sink.set_chain_function(self._chain_func) + self.src.set_active(True) + self.sink.set_active(True) + self.src.link(self.sink) + self.buffers = [] + + def tearDown(self): + self.assertEquals(sys.getrefcount(self.src), pygobject_2_13 and 2 or 3) + self.assertEquals(self.src.__gstrefcount__, 1) + self.src.set_caps(None) + del self.src + self.assertEquals(sys.getrefcount(self.sink), pygobject_2_13 and 2 or 3) + self.assertEquals(self.sink.__gstrefcount__, 1) + self.sink.set_caps(None) + del self.sink + TestCase.tearDown(self) + + def _chain_func(self, pad, buffer): + gst.debug('got buffer %r, id %x, with GMO rc %d'% ( + buffer, id(buffer), buffer.__grefcount__)) + self.buffers.append(buffer) + + return gst.FLOW_OK + + def testNoProbe(self): + self.buffer = gst.Buffer() + gst.debug('created new buffer %r, id %x' % ( + self.buffer, id(self.buffer))) + self.assertEquals(self.buffer.__grefcount__, 1) + gst.debug('pushing buffer on linked pad, no probe') + self.assertEquals(self.src.push(self.buffer), gst.FLOW_OK) + gst.debug('pushed buffer on linked pad, no probe') + # one refcount is held by our scope, another is held on + # self.buffers through _chain_func + self.assertEquals(self.buffer.__grefcount__, 2) + self.assertEquals(len(self.buffers), 1) + self.buffers = None + self.assertEquals(self.buffer.__grefcount__, 1) + + def testFalseProbe(self): + id = self.src.add_buffer_probe(self._probe_handler, False) + self.buffer = gst.Buffer() + self.assertEquals(self.buffer.__grefcount__, 1) + self.assertEquals(self.src.push(self.buffer), gst.FLOW_OK) + self.assertEquals(self.buffer.__grefcount__, 1) + self.src.remove_buffer_probe(id) + self.assertEquals(len(self.buffers), 0) + + def testTrueProbe(self): + probe_id = self.src.add_buffer_probe(self._probe_handler, True) + self.buffer = gst.Buffer() + self.assertEquals(self.buffer.__grefcount__, 1) + self.assertEquals(self.src.push(self.buffer), gst.FLOW_OK) + # one refcount is held by our scope, another is held on + # self.buffers through _chain_func + self.assertEquals(self.buffer.__grefcount__, 2) + + # they are not the same Python object ... + self.failIf(self.buffer is self.buffers[0]) + self.failIf(id(self.buffer) == id(self.buffers[0])) + # ... but they wrap the same GstBuffer + self.failUnless(self.buffer == self.buffers[0]) + self.assertEquals(repr(self.buffer), repr(self.buffers[0])) + + self.src.remove_buffer_probe(probe_id) + self.assertEquals(len(self.buffers), 1) + self.buffers = None + self.assertEquals(self.buffer.__grefcount__, 1) + + def _probe_handler(self, pad, buffer, ret): + return ret + +# test for event probes with linked pads +class PadPushEventLinkedTest(TestCase): + def setUp(self): + TestCase.setUp(self) + self.src = gst.Pad("src", gst.PAD_SRC) + self.sink = gst.Pad("sink", gst.PAD_SINK) + caps = gst.caps_from_string("foo/bar") + self.src.set_caps(caps) + self.sink.set_caps(caps) + self.sink.set_chain_function(self._chain_func) + self.src.set_active(True) + self.sink.set_active(True) + self.src.link(self.sink) + self.events = [] + + def tearDown(self): + self.assertEquals(sys.getrefcount(self.src), pygobject_2_13 and 2 or 3) + self.assertEquals(self.src.__gstrefcount__, 1) + self.src.set_caps(None) + del self.src + self.assertEquals(sys.getrefcount(self.sink), pygobject_2_13 and 2 or 3) + self.assertEquals(self.sink.__gstrefcount__, 1) + self.sink.set_caps(None) + del self.sink + TestCase.tearDown(self) + + def _chain_func(self, pad, buffer): + gst.debug('got buffer %r, id %x, with GMO rc %d'% ( + buffer, id(buffer), buffer.__grefcount__)) + self.buffers.append(buffer) + + return gst.FLOW_OK + + def testNoProbe(self): + self.event = gst.event_new_eos() + gst.debug('created new eos %r, id %x' % ( + self.event, id(self.event))) + self.assertEquals(self.event.__grefcount__, 1) + gst.debug('pushing event on linked pad, no probe') + self.assertEquals(self.src.push_event(self.event), True) + gst.debug('pushed event on linked pad, no probe') + # one refcount is held by our scope + self.assertEquals(self.event.__grefcount__, 1) + # the event has reffed the src pad as the src of the event + self.assertEquals(self.src.__grefcount__, 2) + # clear it + self.event = None + self.assertEquals(self.src.__grefcount__, 1) + + def testFalseProbe(self): + probe_id = self.src.add_event_probe(self._probe_handler, False) + self.event = gst.event_new_eos() + gst.debug('created new eos %r, id %x' % ( + self.event, id(self.event))) + self.assertEquals(self.event.__grefcount__, 1) + # a false probe return drops the event and returns False + self.assertEquals(self.src.push_event(self.event), False) + # one ref in our local scope, another in self.events + self.assertEquals(self.event.__grefcount__, 2) + self.assertEquals(self.sink.__grefcount__, 1) + # the event has reffed the src pad as the src of the event + self.assertEquals(self.src.__grefcount__, 2) + # remove the event from existence + self.event = None + self.events = None + self.assertEquals(self.src.__grefcount__, 1) + self.src.remove_buffer_probe(probe_id) + + def testTrueProbe(self): + probe_id = self.src.add_event_probe(self._probe_handler, True) + self.event = gst.event_new_eos() + gst.debug('created new eos %r, id %x' % ( + self.event, id(self.event))) + self.assertEquals(self.event.__grefcount__, 1) + # a True probe lets it pass + self.assertEquals(self.src.push_event(self.event), True) + + # one refcount is held by our scope, another is held on + # self.events through _probe + self.assertEquals(self.event.__grefcount__, 2) + + # they are not the same Python object ... + self.failIf(self.event is self.events[0]) + self.failIf(id(self.event) == id(self.events[0])) + # ... but they wrap the same GstEvent + self.assertEquals(repr(self.event), repr(self.events[0])) + self.failUnless(self.event == self.events[0]) + + self.src.remove_buffer_probe(probe_id) + self.assertEquals(len(self.events), 1) + self.events = None + self.assertEquals(self.event.__grefcount__, 1) + + # the event has reffed the src pad as the src of the event + self.assertEquals(self.src.__grefcount__, 2) + # clear it + self.event = None + self.assertEquals(self.src.__grefcount__, 1) + + def _probe_handler(self, pad, event, ret): + gst.debug("probed, pad %r, event %r" % (pad, event)) + self.events.append(event) + return ret + +# a test to show that we can link a pad from the probe handler + +class PadPushProbeLinkTest(TestCase): + def setUp(self): + TestCase.setUp(self) + self.src = gst.Pad("src", gst.PAD_SRC) + self.sink = gst.Pad("sink", gst.PAD_SINK) + caps = gst.caps_from_string("foo/bar") + self.src.set_caps(caps) + self.sink.set_caps(caps) + self.src.set_active(True) + self.sink.set_active(True) + self.sink.set_chain_function(self._chain_func) + self.buffers = [] + + def tearDown(self): + self.assertEquals(sys.getrefcount(self.src), pygobject_2_13 and 2 or 3) + self.assertEquals(self.src.__gstrefcount__, 1) + self.src.set_caps(None) + del self.src + self.assertEquals(sys.getrefcount(self.sink), pygobject_2_13 and 2 or 3) + self.assertEquals(self.sink.__gstrefcount__, 1) + self.sink.set_caps(None) + del self.sink + TestCase.tearDown(self) + + def _chain_func(self, pad, buffer): + self.buffers.append(buffer) + + return gst.FLOW_OK + + def testProbeLink(self): + id = self.src.add_buffer_probe(self._probe_handler) + self.buffer = gst.Buffer() + self.assertEquals(self.buffer.__grefcount__, 1) + gst.debug('pushing buffer on linked pad, no probe') + self.assertEquals(self.src.push(self.buffer), gst.FLOW_OK) + gst.debug('pushed buffer on linked pad, no probe') + # one refcount is held by our scope, another is held on + # self.buffers through _chain_func + self.assertEquals(self.buffer.__grefcount__, 2) + self.assertEquals(len(self.buffers), 1) + self.buffers = None + self.assertEquals(self.buffer.__grefcount__, 1) + + + def _probe_handler(self, pad, buffer): + self.src.link(self.sink) + return True + + +class PadTest(TestCase): + def testConstructor(self): + # first style uses gst_pad_new + gst.debug('creating pad with name src') + pad = gst.Pad("src", gst.PAD_SRC) + self.failUnless(pad) + self.assertEquals(sys.getrefcount(pad), pygobject_2_13 and 2 or 3) + self.assertEquals(pad.__gstrefcount__, 1) + + gst.debug('creating pad with no name') + self.failUnless(gst.Pad(None, gst.PAD_SRC)) + self.failUnless(gst.Pad(name=None, direction=gst.PAD_SRC)) + self.failUnless(gst.Pad(direction=gst.PAD_SRC, name=None)) + self.failUnless(gst.Pad(direction=gst.PAD_SRC, name="src")) + + # second uses gst_pad_new_from_template + #template = gst.PadTemplate() + +class PadPipelineTest(TestCase): + def setUp(self): + TestCase.setUp(self) + self.pipeline = gst.parse_launch('fakesrc name=source ! fakesink') + src = self.pipeline.get_by_name('source') + self.srcpad = src.get_pad('src') + + def tearDown(self): + del self.pipeline + del self.srcpad + TestCase.tearDown(self) + +# FIXME: now that GstQuery is a miniobject with various _new_ factory +# functions, we need to figure out a way to deal with them in python +# def testQuery(self): +# assert self.sink.query(gst.QUERY_TOTAL, gst.FORMAT_BYTES) == -1 +# assert self.srcpad.query(gst.QUERY_POSITION, gst.FORMAT_BYTES) == 0 +# assert self.srcpad.query(gst.QUERY_POSITION, gst.FORMAT_TIME) == 0 + + +class PadProbePipeTest(TestCase): + def setUp(self): + TestCase.setUp(self) + self.pipeline = gst.Pipeline() + self.assertEquals(self.pipeline.__gstrefcount__, 1) + self.assertEquals(sys.getrefcount(self.pipeline), pygobject_2_13 and 2 or 3) + + self.fakesrc = gst.element_factory_make('fakesrc') + self.fakesink = gst.element_factory_make('fakesink') + self.assertEquals(self.fakesrc.__gstrefcount__, 1) + self.assertEquals(sys.getrefcount(self.fakesrc), pygobject_2_13 and 2 or 3) + + self.pipeline.add(self.fakesrc, self.fakesink) + self.assertEquals(self.fakesrc.__gstrefcount__, 2) # added + self.assertEquals(sys.getrefcount(self.fakesrc), pygobject_2_13 and 2 or 3) + self.assertEquals(self.fakesink.__gstrefcount__, 2) # added + self.assertEquals(sys.getrefcount(self.fakesink), pygobject_2_13 and 2 or 3) + + self.fakesrc.link(self.fakesink) + + self.assertEquals(self.pipeline.__gstrefcount__, 1) + self.assertEquals(sys.getrefcount(self.pipeline), pygobject_2_13 and 2 or 3) + self.assertEquals(self.fakesrc.__gstrefcount__, 2) + self.assertEquals(sys.getrefcount(self.fakesrc), pygobject_2_13 and 2 or 3) + self.assertEquals(self.fakesink.__gstrefcount__, 2) + self.assertEquals(sys.getrefcount(self.fakesink), pygobject_2_13 and 2 or 3) + + def tearDown(self): + # Refcount must be either 1 or 2, to allow for a possibly still running + # state-recalculation thread + self.assertTrue (self.pipeline.__gstrefcount__ >= 1 and self.pipeline.__gstrefcount__ <= 2) + + self.assertEquals(sys.getrefcount(self.pipeline), pygobject_2_13 and 2 or 3) + self.assertEquals(self.fakesrc.__gstrefcount__, 2) + self.assertEquals(sys.getrefcount(self.fakesrc), pygobject_2_13 and 2 or 3) + gst.debug('deleting pipeline') + del self.pipeline + self.gccollect() + + self.assertEquals(self.fakesrc.__gstrefcount__, 1) # parent gone + self.assertEquals(self.fakesink.__gstrefcount__, 1) # parent gone + self.assertEquals(sys.getrefcount(self.fakesrc), pygobject_2_13 and 2 or 3) + self.assertEquals(sys.getrefcount(self.fakesink), pygobject_2_13 and 2 or 3) + gst.debug('deleting fakesrc') + del self.fakesrc + self.gccollect() + gst.debug('deleting fakesink') + del self.fakesink + self.gccollect() + + TestCase.tearDown(self) + + def testFakeSrcProbeOnceKeep(self): + self.fakesrc.set_property('num-buffers', 1) + + self.fakesink.set_property('signal-handoffs', True) + self.fakesink.connect('handoff', self._handoff_callback_fakesink) + + pad = self.fakesrc.get_pad('src') + id = pad.add_buffer_probe(self._probe_callback_fakesrc) + self._got_fakesrc_buffer = 0 + self._got_fakesink_buffer = 0 + self.pipeline.set_state(gst.STATE_PLAYING) + while not self._got_fakesrc_buffer: + gst.debug('waiting for fakesrc buffer') + pass + while not self._got_fakesink_buffer: + gst.debug('waiting for fakesink buffer') + pass + + gst.debug('got buffers from fakesrc and fakesink') + self.assertEquals(self._got_fakesink_buffer, 1) + pad.remove_buffer_probe(id) + + self.pipeline.set_state(gst.STATE_NULL) + + def testFakeSrcProbeMany(self): + self.fakesrc.set_property('num-buffers', 1000) + + pad = self.fakesrc.get_pad('src') + id = pad.add_buffer_probe(self._probe_callback_fakesrc) + self._got_fakesrc_buffer = 0 + self.pipeline.set_state(gst.STATE_PLAYING) + while not self._got_fakesrc_buffer == 1000: + import time + # allow for context switching; a busy loop here locks up the + # streaming thread too much + time.sleep(.0001) + pad.remove_buffer_probe(id) + + self.pipeline.set_state(gst.STATE_NULL) + + def _probe_callback_fakesrc(self, pad, buffer): + self.failUnless(isinstance(pad, gst.Pad)) + self.failUnless(isinstance(buffer, gst.Buffer)) + self._got_fakesrc_buffer += 1 + gst.debug('fakesrc sent buffer %r, %d total sent' % ( + buffer, self._got_fakesrc_buffer)) + return True + + def _handoff_callback_fakesink(self, sink, buffer, pad): + self.failUnless(isinstance(buffer, gst.Buffer)) + self.failUnless(isinstance(pad, gst.Pad)) + self._got_fakesink_buffer += 1 + gst.debug('fakesink got buffer %r, %d total received' % ( + buffer, self._got_fakesrc_buffer)) + gst.debug('pad %r, py refcount %d, go rc %d, gst rc %d' % ( + pad, sys.getrefcount(pad), pad.__grefcount__, pad.__gstrefcount__)) + return True + + def testRemovingProbe(self): + self.fakesrc.set_property('num-buffers', 10) + + handle = None + self._num_times_called = 0 + def buffer_probe(pad, buffer, data): + self._num_times_called += 1 + pad.remove_buffer_probe(handle) + return True + + pad = self.fakesrc.get_pad('src') + data = [] + handle = pad.add_buffer_probe(buffer_probe, data) + self.pipeline.set_state(gst.STATE_PLAYING) + m = self.pipeline.get_bus().poll(gst.MESSAGE_EOS, -1) + assert m + assert self._num_times_called == 1 + self.pipeline.set_state(gst.STATE_NULL) + assert sys.getrefcount(buffer_probe) == 2 + assert sys.getrefcount(data) == 2 + # FIXME: having m going out of scope doesn't seem to be enough + # to get it gc collected, and it keeps a ref to the pipeline. + # Look for a way to not have to do this explicitly + del m + self.gccollect() + +class PadRefCountTest(TestCase): + def testAddPad(self): + # add a pad to an element + e = gst.element_factory_make('fakesrc') + self.assertEquals(sys.getrefcount(e), pygobject_2_13 and 2 or 3) + self.assertEquals(e.__gstrefcount__, 1) + + gst.debug('creating pad with name mypad') + pad = gst.Pad("mypad", gst.PAD_SRC) + self.failUnless(pad) + self.assertEquals(sys.getrefcount(pad), pygobject_2_13 and 2 or 3) + self.assertEquals(pad.__gstrefcount__, 1) + + gst.debug('adding pad to element') + e.add_pad(pad) + self.assertEquals(sys.getrefcount(e), pygobject_2_13 and 2 or 3) + self.assertEquals(e.__gstrefcount__, 1) + self.assertEquals(sys.getrefcount(pad), pygobject_2_13 and 2 or 3) + self.assertEquals(pad.__gstrefcount__, 2) # added to element + + gst.debug('deleting element and collecting') + self.gccollect() + del e + if not pygobject_2_13: + # the element will be collected at 'del e' if we're using + # pygobject >= 2.13.0 + self.assertEquals(self.gccollect(), 1) # collected the element + self.assertEquals(sys.getrefcount(pad), pygobject_2_13 and 2 or 3) + self.assertEquals(pad.__gstrefcount__, 1) # removed from element + + gst.debug('deleting pad and collecting') + del pad + if not pygobject_2_13: + # the pad will be collected at 'del pad' if we're using + # pygobject >= 2.13.0 + self.assertEquals(self.gccollect(), 1) # collected the pad + gst.debug('going into teardown') + +class PadBlockTest(TestCase): + def testCallbackFlush(self): + # check that the same block callback can be called more than once (weird + # test but it was broken) + + def blocked_cb(pad, blocked): + pad.push_event(gst.event_new_flush_start()) + + pad = gst.Pad('src', gst.PAD_SRC) + pad.set_active(True) + pad.set_blocked_async(True, blocked_cb) + + for i in xrange(10): + buf = gst.Buffer('ciao') + pad.push(buf) + pad.push_event(gst.event_new_flush_stop()) + + def testCallbackRefcount(self): + def blocked_cb(pad, blocked): + pad.set_blocked_async(False, unblocked_cb) + + def unblocked_cb(pad, blocked): + pass + + cb_refcount = sys.getrefcount(blocked_cb) + # sys.getrefcount() returns refcount + 1 + self.assertEquals(cb_refcount, 2) + + pad = gst.Pad('src', gst.PAD_SRC) + pad.set_active(True) + pad.set_blocked_async(True, blocked_cb) + # set_blocked_async refs the callback + self.assertEquals(sys.getrefcount(blocked_cb), 3) + + buf = gst.Buffer('ciao') + pad.push(buf) + + # in blocked_cb() we called set_blocked_async() with a different + # callback, so blocked_cb() should have been unreffed + cb_refcount_after = sys.getrefcount(blocked_cb) + self.assertEquals(sys.getrefcount(blocked_cb), cb_refcount) + +if __name__ == "__main__": + unittest.main() diff --git a/testsuite/old/test_pbutils.py b/testsuite/old/test_pbutils.py new file mode 100644 index 0000000..a179393 --- /dev/null +++ b/testsuite/old/test_pbutils.py @@ -0,0 +1,63 @@ +# -*- Mode: Python -*- +# vi:si:et:sw=4:sts=4:ts=4 +# +# gst-python - Python bindings for GStreamer +# Copyright (C) 2008 Edward Hervey +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +from common import gobject, gst, unittest, TestCase + +class Descriptions(TestCase): + + def testSourceDescription(self): + assert hasattr(gst.pbutils, 'get_source_description') + self.assertEquals(gst.pbutils.get_source_description("file"), + "FILE protocol source") + + def testSinkDescription(self): + assert hasattr(gst.pbutils, 'get_sink_description') + self.assertEquals(gst.pbutils.get_sink_description("file"), + "FILE protocol sink") + + def testDecoderDescription(self): + assert hasattr(gst.pbutils, 'get_decoder_description') + self.assertEquals(gst.pbutils.get_decoder_description(gst.caps_from_string("audio/mpeg,mpegversion=1,layer=3")), + 'MPEG-1 Layer 3 (MP3) decoder') + + def testCodecDescription(self): + assert hasattr(gst.pbutils, 'get_codec_description') + self.assertEquals(gst.pbutils.get_codec_description(gst.caps_from_string("audio/mpeg,mpegversion=1,layer=3")), + 'MPEG-1 Layer 3 (MP3)') + + def testEncoderDescription(self): + assert hasattr(gst.pbutils, 'get_encoder_description') + self.assertEquals(gst.pbutils.get_encoder_description(gst.caps_from_string("audio/mpeg,mpegversion=1,layer=3")), + 'MPEG-1 Layer 3 (MP3) encoder') + + def testElementDescription(self): + assert hasattr(gst.pbutils, 'get_element_description') + self.assertEquals(gst.pbutils.get_element_description("something"), + "GStreamer element something") + + def testAddCodecDescription(self): + assert hasattr(gst.pbutils, 'add_codec_description_to_tag_list') + +# TODO +# Add tests for the other parts of pbutils: +# * missing-plugins +# * install-plugins (and detect if there weren't compiled because of a version +# of plugins-base too low) + diff --git a/testsuite/old/test_pipeline.py b/testsuite/old/test_pipeline.py new file mode 100644 index 0000000..e37c925 --- /dev/null +++ b/testsuite/old/test_pipeline.py @@ -0,0 +1,250 @@ +# -*- Mode: Python -*- +# vi:si:et:sw=4:sts=4:ts=4 +# +# gst-python - Python bindings for GStreamer +# Copyright (C) 2002 David I. Lehn +# Copyright (C) 2004 Johan Dahlin +# Copyright (C) 2005 Edward Hervey +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +import time + +from common import gst, unittest, TestCase, pygobject_2_13 + +import gobject + +class TestConstruction(TestCase): + def setUp(self): + self.gctrack() + + def tearDown(self): + self.gccollect() + self.gcverify() + + def testGoodConstructor(self): + name = 'test-pipeline' + pipeline = gst.Pipeline(name) + self.assertEquals(pipeline.__gstrefcount__, 1) + assert pipeline is not None, 'pipeline is None' + self.failUnless(isinstance(pipeline, gst.Pipeline), + 'pipeline is not a GstPipline') + assert pipeline.get_name() == name, 'pipelines name is wrong' + self.assertEquals(pipeline.__gstrefcount__, 1) + + def testParseLaunch(self): + pipeline = gst.parse_launch('fakesrc ! fakesink') + +class Pipeline(TestCase): + def setUp(self): + self.gctrack() + self.pipeline = gst.Pipeline('test-pipeline') + source = gst.element_factory_make('fakesrc', 'source') + source.set_property('num-buffers', 5) + sink = gst.element_factory_make('fakesink', 'sink') + self.pipeline.add(source, sink) + gst.element_link_many(source, sink) + + def tearDown(self): + del self.pipeline + self.gccollect() + self.gcverify() + + def testRun(self): + self.assertEqual(self.pipeline.get_state()[1], gst.STATE_NULL) + self.pipeline.set_state(gst.STATE_PLAYING) + self.assertEqual(self.pipeline.get_state()[1], gst.STATE_PLAYING) + + time.sleep(1) + + self.assertEqual(self.pipeline.get_state()[1], gst.STATE_PLAYING) + self.pipeline.set_state(gst.STATE_NULL) + self.assertEqual(self.pipeline.get_state()[1], gst.STATE_NULL) + +class PipelineTags(TestCase): + def setUp(self): + self.gctrack() + self.pipeline = gst.parse_launch('audiotestsrc num-buffers=100 ! vorbisenc name=encoder ! oggmux name=muxer ! fakesink') + + def tearDown(self): + del self.pipeline + self.gccollect() + self.gcverify() + + def testRun(self): + # in 0.10.15.1, this triggers + # sys:1: gobject.Warning: g_value_get_uint: assertion `G_VALUE_HOLDS_UINT (value)' failed + # during pipeline playing + + l = gst.TagList() + l[gst.TAG_ARTIST] = 'artist' + l[gst.TAG_TRACK_NUMBER] = 1 + encoder = self.pipeline.get_by_name('encoder') + encoder.merge_tags(l, gst.TAG_MERGE_APPEND) + + self.assertEqual(self.pipeline.get_state()[1], gst.STATE_NULL) + self.pipeline.set_state(gst.STATE_PLAYING) + self.assertEqual(self.pipeline.get_state()[1], gst.STATE_PLAYING) + + time.sleep(1) + + self.assertEqual(self.pipeline.get_state()[1], gst.STATE_PLAYING) + self.pipeline.set_state(gst.STATE_NULL) + self.assertEqual(self.pipeline.get_state()[1], gst.STATE_NULL) + + +class Bus(TestCase): + def testGet(self): + pipeline = gst.Pipeline('test') + self.assertEquals(pipeline.__gstrefcount__, 1) + bus = pipeline.get_bus() + self.assertEquals(pipeline.__gstrefcount__, 1) + # one for python and one for the pipeline + self.assertEquals(bus.__gstrefcount__, 2) + + del pipeline + if not pygobject_2_13: + self.failUnless(self.gccollect()) + self.assertEquals(bus.__gstrefcount__, 1) + +class PipelineAndBus(TestCase): + def setUp(self): + TestCase.setUp(self) + self.pipeline = gst.Pipeline('test-pipeline') + source = gst.element_factory_make('fakesrc', 'source') + sink = gst.element_factory_make('fakesink', 'sink') + self.pipeline.add(source, sink) + gst.element_link_many(source, sink) + + self.bus = self.pipeline.get_bus() + self.assertEquals(self.bus.__gstrefcount__, 2) + self.handler = self.bus.add_watch(self._message_received) + self.assertEquals(self.bus.__gstrefcount__, 3) + self.assertEquals(self.pipeline.__gstrefcount__, 1) + + self.loop = gobject.MainLoop() + + def tearDown(self): + # FIXME: fix the refcount issues with the bus/pipeline + # flush the bus to be able to assert on the pipeline refcount + #while self.pipeline.__gstrefcount__ > 1: + self.gccollect() + + # one for the pipeline, two for the snake + # three for the watch now shake shake shake but don't you + self.assertEquals(self.bus.__gstrefcount__, 3) + self.failUnless(gobject.source_remove(self.handler)) + self.assertEquals(self.bus.__gstrefcount__, 2) + self.gccollect() + + gst.debug('THOMAS: pipeline rc %d' % self.pipeline.__gstrefcount__) + #self.assertEquals(self.pipeline.__gstrefcount__, 1) + del self.pipeline + self.gccollect() + #self.assertEquals(self.bus.__gstrefcount__, 2) + del self.bus + self.gccollect() + + # the async thread can be holding a ref, Wim is going to work on this + #TestCase.tearDown(self) + + def _message_received(self, bus, message): + gst.debug('received message: %s, %s' % ( + message.src.get_path_string(), message.type.value_nicks[1])) + t = message.type + if t == gst.MESSAGE_STATE_CHANGED: + old, new, pen = message.parse_state_changed() + gst.debug('%r state change from %r to %r' % ( + message.src.get_path_string(), old, new)) + if message.src == self.pipeline and new == self.final: + self.loop.quit() + + return True + + def testPlaying(self): + self.final = gst.STATE_PLAYING + ret = self.pipeline.set_state(gst.STATE_PLAYING) + self.assertEquals(ret, gst.STATE_CHANGE_ASYNC) + + # go into a main loop to wait for messages + self.loop.run() + + # we go to READY so we get messages; going to NULL would set + # the bus flushing + self.final = gst.STATE_READY + ret = self.pipeline.set_state(gst.STATE_READY) + self.assertEquals(ret, gst.STATE_CHANGE_SUCCESS) + self.loop.run() + + # FIXME: not setting to NULL causes a deadlock; we might want to + # fix this in the bindings + self.assertEquals(self.pipeline.set_state(gst.STATE_NULL), + gst.STATE_CHANGE_SUCCESS) + self.assertEquals(self.pipeline.get_state(), + (gst.STATE_CHANGE_SUCCESS, gst.STATE_NULL, gst.STATE_VOID_PENDING)) + self.gccollect() + +class TestPipeSub(gst.Pipeline): + def do_handle_message(self, message): + self.debug('do_handle_message') + gst.Pipeline.do_handle_message(self, message) + self.type = message.type +gobject.type_register(TestPipeSub) + +class TestPipeSubSub(TestPipeSub): + def do_handle_message(self, message): + self.debug('do_handle_message') + TestPipeSub.do_handle_message(self, message) +gobject.type_register(TestPipeSubSub) + + +# see http://bugzilla.gnome.org/show_bug.cgi?id=577735 +class TestSubClass(TestCase): + def setUp(self): + self.gctrack() + + def tearDown(self): + self.gccollect() + self.gcverify() + + def testSubClass(self): + p = TestPipeSub() + u = gst.element_factory_make('uridecodebin') + self.assertEquals(u.__grefcount__, 1) + self.failIf(getattr(p, 'type', None)) + # adding uridecodebin triggers a clock-provide message; + # this message should be dropped, and thus not affect + # the refcount of u beyond the parenting. + p.add(u) + self.assertEquals(getattr(p, 'type', None), gst.MESSAGE_CLOCK_PROVIDE) + self.assertEquals(u.__grefcount__, 2) + del p + self.assertEquals(u.__grefcount__, 1) + + def testSubSubClass(self): + # Edward is worried that a subclass of a subclass will screw up + # the refcounting wrt. GST_BUS_DROP + p = TestPipeSubSub() + u = gst.element_factory_make('uridecodebin') + self.assertEquals(u.__grefcount__, 1) + self.failIf(getattr(p, 'type', None)) + p.add(u) + self.assertEquals(getattr(p, 'type', None), gst.MESSAGE_CLOCK_PROVIDE) + self.assertEquals(u.__grefcount__, 2) + del p + self.assertEquals(u.__grefcount__, 1) + +if __name__ == "__main__": + unittest.main() diff --git a/testsuite/old/test_registry.py b/testsuite/old/test_registry.py new file mode 100644 index 0000000..2b745dc --- /dev/null +++ b/testsuite/old/test_registry.py @@ -0,0 +1,68 @@ +# -*- Mode: Python -*- +# vi:si:et:sw=4:sts=4:ts=4 +# +# gst-python - Python bindings for GStreamer +# Copyright (C) 2002 David I. Lehn +# Copyright (C) 2004 Johan Dahlin +# Copyright (C) 2005 Edward Hervey +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +import sys +import gc +from common import gst, unittest, TestCase + +class RegistryTest(TestCase): + def setUp(self): + self.registry = gst.registry_get_default() + self.plugins = self.registry.get_plugin_list() + TestCase.setUp(self) + + def testGetDefault(self): + assert(self.registry) + + def testPluginList(self): + names = map(lambda p: p.get_name(), self.plugins) + self.failUnless('staticelements' in names) + + def testGetPathList(self): + # FIXME: this returns an empty list; probably due to core; + # examine problem + + paths = self.registry.get_path_list() + +class RegistryFeatureTest(TestCase): + def setUp(self): + self.registry = gst.registry_get_default() + self.plugins = self.registry.get_plugin_list() + self.efeatures = self.registry.get_feature_list(gst.TYPE_ELEMENT_FACTORY) + self.tfeatures = self.registry.get_feature_list(gst.TYPE_TYPE_FIND_FACTORY) + self.ifeatures = self.registry.get_feature_list(gst.TYPE_INDEX_FACTORY) + TestCase.setUp(self) + + def testFeatureList(self): + self.assertRaises(TypeError, self.registry.get_feature_list, "kaka") + + elements = map(lambda f: f.get_name(), self.efeatures) + self.failUnless('fakesink' in elements) + + typefinds = map(lambda f: f.get_name(), self.tfeatures) + + indexers = map(lambda f: f.get_name(), self.ifeatures) + self.failUnless('memindex' in indexers) + + +if __name__ == "__main__": + unittest.main() diff --git a/testsuite/old/test_segment.py b/testsuite/old/test_segment.py new file mode 100644 index 0000000..951ccf4 --- /dev/null +++ b/testsuite/old/test_segment.py @@ -0,0 +1,62 @@ +# -*- Mode: Python -*- +# vi:si:et:sw=4:sts=4:ts=4 +# +# gst-python - Python bindings for GStreamer +# Copyright (C) 2006 Edward Hervey +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +from common import gst, unittest, TestCase + +class SegmentTest(TestCase): + def testSeekNoSize(self): + segment = gst.Segment() + segment.init(gst.FORMAT_BYTES) + + # configure segment to start at 100 with no defined stop position + update = segment.set_seek(1.0, gst.FORMAT_BYTES, gst.SEEK_FLAG_NONE, + gst.SEEK_TYPE_SET, 100, + gst.SEEK_TYPE_NONE, -1) + self.assertEquals(update, True) + self.assertEquals(segment.start, 100) + self.assertEquals(segment.stop, -1) + + # configure segment to stop relative, should not do anything since + # size is unknown + update = segment.set_seek(1.0, gst.FORMAT_BYTES, gst.SEEK_FLAG_NONE, + gst.SEEK_TYPE_NONE, 200, + gst.SEEK_TYPE_CUR, -100) + + # the update flag is deprecated, we cannot check for proper behaviour. + #self.assertEquals(update, False) + self.assertEquals(segment.start, 100) + self.assertEquals(segment.stop, -1) + + # clipping on outside range, always returns False + res, cstart, cstop = segment.clip(gst.FORMAT_BYTES, 0, 50) + self.assertEquals(res, False) + + # touching lower bound but outside + res, cstart, cstop = segment.clip(gst.FORMAT_BYTES, 50, 100) + self.assertEquals(res, False) + + # partially inside + res, cstart, cstop = segment.clip(gst.FORMAT_BYTES, 50, 150) + self.assertEquals(res, True) + self.assertEquals(cstart, 100) + self.assertEquals(cstop, 150) + +if __name__ == "__main__": + unittest.main() diff --git a/testsuite/old/test_struct.py b/testsuite/old/test_struct.py new file mode 100644 index 0000000..d2cacdc --- /dev/null +++ b/testsuite/old/test_struct.py @@ -0,0 +1,123 @@ +# -*- Mode: Python -*- +# vi:si:et:sw=4:sts=4:ts=4 +# +# gst-python - Python bindings for GStreamer +# Copyright (C) 2002 David I. Lehn +# Copyright (C) 2004 Johan Dahlin +# Copyright (C) 2005 Edward Hervey +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +import sys +from common import gst, unittest, TestCase + +class StructureTest(TestCase): + def setUp(self): + TestCase.setUp(self) + self.struct = gst.structure_from_string('video/x-raw-yuv,width=10,foo="bar",pixel-aspect-ratio=1/2,framerate=5/1,boolean=(boolean)true') + + def testName(self): + assert self.struct.get_name() == 'video/x-raw-yuv' + self.struct.set_name('foobar') + assert self.struct.get_name() == 'foobar' + + def testInt(self): + assert self.struct.has_key('width') + assert isinstance(self.struct['width'], int) + assert self.struct['width'] == 10, self.struct['width'] + self.struct['width'] = 5 + assert self.struct.has_key('width') + assert isinstance(self.struct['width'], int) + assert self.struct['width'] == 5, self.struct['width'] + + def testString(self): + assert self.struct.has_key('foo') + assert isinstance(self.struct['foo'], unicode) + assert self.struct['foo'] == 'bar', self.struct['foo'] + self.struct['foo'] = 'baz' + assert self.struct.has_key('foo') + assert isinstance(self.struct['foo'], unicode) + assert self.struct['foo'] == 'baz', self.struct['foo'] + + def testBoolean(self): + assert self.struct.has_key('boolean') + assert isinstance(self.struct['boolean'], bool) + assert self.struct['boolean'] == True, self.struct['boolean'] + self.struct['boolean'] = False + assert self.struct.has_key('boolean') + assert isinstance(self.struct['boolean'], bool) + assert self.struct['boolean'] == False, self.struct['boolean'] + + def testCreateInt(self): + self.struct['integer'] = 5 + assert self.struct.has_key('integer') + assert isinstance(self.struct['integer'], int) + assert self.struct['integer'] == 5, self.struct['integer'] + + def testGstValue(self): + s = self.struct + s['fourcc'] = gst.Fourcc('XVID') + assert s['fourcc'].fourcc == 'XVID' + s['frac'] = gst.Fraction(3,4) + assert s['frac'].num == 3 + assert s['frac'].denom == 4 + s['fracrange'] = gst.FractionRange(gst.Fraction(0,1), + gst.Fraction(25,3)) + assert s['fracrange'].low.num == 0 + assert s['fracrange'].low.denom == 1 + assert s['fracrange'].high.num == 25 + assert s['fracrange'].high.denom == 3 + s['intrange'] = gst.IntRange(5,21) + assert s['intrange'].low == 5 + assert s['intrange'].high == 21 + s['doublerange'] = gst.DoubleRange(6.,21.) + assert s['doublerange'].low == 6. + assert s['doublerange'].high == 21. + s['fixedlist'] = (4, 5, 6) + assert isinstance(s['fixedlist'], tuple) + assert s['fixedlist'] == (4, 5, 6) + s['list'] = [4, 5, 6] + assert isinstance(s['list'], list) + assert s['list'] == [4, 5, 6] + s['boolean'] = True + assert isinstance(s['boolean'], bool) + assert s['boolean'] == True + + # finally, some recursive tests + s['rflist'] = ([(['a', 'b'], ['c', 'd']),'e'], ['f', 'g']) + assert s['rflist'] == ([(['a', 'b'], ['c', 'd']),'e'], ['f', 'g']) + s['rlist'] = [([(['a', 'b'], ['c', 'd']),'e'], ['f', 'g']), 'h'] + assert s['rlist'] == [([(['a', 'b'], ['c', 'd']),'e'], ['f', 'g']), 'h'] + + def testStructureChange(self): + assert self.struct['framerate'] == gst.Fraction(5, 1) + self.struct['framerate'] = gst.Fraction(10, 1) + assert self.struct['framerate'] == gst.Fraction(10, 1) + self.struct['pixel-aspect-ratio'] = gst.Fraction(4, 2) + assert self.struct['pixel-aspect-ratio'].num == 2 + assert self.struct['pixel-aspect-ratio'].denom == 1 + + def testKeys(self): + k = self.struct.keys() + self.failUnless(k) + self.assertEquals(len(k), 5) + self.failUnless("width" in k) + self.failUnless("foo" in k) + self.failUnless("framerate" in k) + self.failUnless("pixel-aspect-ratio" in k) + self.failUnless("boolean" in k) + +if __name__ == "__main__": + unittest.main() diff --git a/testsuite/old/test_taglist.py b/testsuite/old/test_taglist.py new file mode 100644 index 0000000..4789813 --- /dev/null +++ b/testsuite/old/test_taglist.py @@ -0,0 +1,71 @@ +# -*- Mode: Python -*- +# vi:si:et:sw=4:sts=4:ts=4 +# +# gst-python - Python bindings for GStreamer +# Copyright (C) 2007 Johan Dahlin +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +from common import gst, TestCase + + +class TestTagList(TestCase): + def testContains(self): + taglist = gst.TagList() + self.failIf('key' in taglist) + taglist['key'] = 'value' + self.failUnless('key' in taglist) + + def testLength(self): + taglist = gst.TagList() + self.assertEqual(len(taglist), 0) + taglist['key1'] = 'value' + taglist['key2'] = 'value' + self.assertEqual(len(taglist), 2) + + def testKeys(self): + taglist = gst.TagList() + self.assertEqual(taglist.keys(), []) + taglist['key1'] = 'value' + taglist['key2'] = 'value' + keys = taglist.keys() + keys.sort() + self.assertEqual(keys, ['key1', 'key2']) + + def testUnicode(self): + taglist = gst.TagList() + + # normal ASCII text + taglist[gst.TAG_ARTIST] = 'Artist' + self.failUnless(isinstance(taglist[gst.TAG_ARTIST], unicode)) + self.assertEquals(taglist[gst.TAG_ARTIST], u'Artist') + self.assertEquals(taglist[gst.TAG_ARTIST], 'Artist') + + # normal ASCII text as unicode + taglist[gst.TAG_ARTIST] = u'Artist' + self.failUnless(isinstance(taglist[gst.TAG_ARTIST], unicode)) + self.assertEquals(taglist[gst.TAG_ARTIST], u'Artist') + self.assertEquals(taglist[gst.TAG_ARTIST], 'Artist') + + # real unicode + taglist[gst.TAG_ARTIST] = u'S\xc3\xadgur R\xc3\xb3s' + self.failUnless(isinstance(taglist[gst.TAG_ARTIST], unicode)) + self.assertEquals(taglist[gst.TAG_ARTIST], u'S\xc3\xadgur R\xc3\xb3s') + + def testUnsignedInt(self): + taglist = gst.TagList() + taglist[gst.TAG_TRACK_NUMBER] = 1 + vorbis = gst.tag.to_vorbis_comments(taglist, gst.TAG_TRACK_NUMBER) + self.assertEquals(vorbis, ['TRACKNUMBER=1']) diff --git a/testsuite/old/test_typefind.py b/testsuite/old/test_typefind.py new file mode 100644 index 0000000..d194f47 --- /dev/null +++ b/testsuite/old/test_typefind.py @@ -0,0 +1,65 @@ +# -*- Mode: Python -*- +# vi:si:et:sw=4:sts=4:ts=4 +# +# gst-python - Python bindings for GStreamer +# Copyright (C) 2008 Alessandro Decina +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +from common import gst, unittest, TestCase, pygobject_2_13 + +import sys +import time + +class TypeFindTest(TestCase): + def testTypeFind(self): + def application_awesome_type_find(typefind, arg1, arg2): + self.failUnlessEqual(arg1, 'arg1') + self.failUnlessEqual(arg2, 'arg2') + + data = typefind.peek(0, 5) + self.failUnless(data == '', 'peek out of length??') + + data = typefind.peek(0, 0) + self.failUnless(data == '', '0 peek??') + + data = typefind.peek(3, 1) + self.failUnless(data == 'M') + + data = typefind.peek(0, 4) + self.failUnless(data == 'AWSM') + + typefind.suggest(gst.TYPE_FIND_MAXIMUM, + gst.Caps('application/awesome')) + + res = gst.type_find_register('application/awesome', gst.RANK_PRIMARY, + application_awesome_type_find, ['.twi'], + gst.Caps('application/awesome'), 'arg1', 'arg2') + self.failUnless(res, 'type_find_register failed') + + factory = None + factories = gst.type_find_factory_get_list() + for typefind_factory in factories: + if typefind_factory.get_name() == 'application/awesome': + factory = typefind_factory + break + self.failUnless(factory is not None) + + obj = gst.Pad('src', gst.PAD_SRC) + buffer = gst.Buffer('AWSM') + caps, probability = gst.type_find_helper_for_buffer(obj, buffer) + + self.failUnlessEqual(str(caps), 'application/awesome') + self.failUnlessEqual(probability, gst.TYPE_FIND_MAXIMUM) diff --git a/testsuite/old/test_xml.py b/testsuite/old/test_xml.py new file mode 100644 index 0000000..9e94a58 --- /dev/null +++ b/testsuite/old/test_xml.py @@ -0,0 +1,53 @@ +# -*- Mode: Python -*- +# vi:si:et:sw=4:sts=4:ts=4 +# +# gst-python - Python bindings for GStreamer +# Copyright (C) 2002 David I. Lehn +# Copyright (C) 2004 Johan Dahlin +# Copyright (C) 2005 Edward Hervey +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +from common import gst, unittest, TestCase + +class PadTest(TestCase): + + def testQuery(self): + # don't run this test if we don't have the libxml2 module + try: + import libxml2 + except: + return + xml = gst.XML() + xml.parse_memory(""" + + + test-pipeline + pipeline + + name + test-pipeline + + +""") + elements = xml.get_topelements() + assert len(elements) == 1 + element = elements[0] + assert isinstance(element, gst.Pipeline) + assert element.get_name() == 'test-pipeline' + +if __name__ == "__main__": + unittest.main() + diff --git a/testsuite/old/testhelpermodule.c b/testsuite/old/testhelpermodule.c new file mode 100644 index 0000000..1325262 --- /dev/null +++ b/testsuite/old/testhelpermodule.c @@ -0,0 +1,56 @@ +#include "pygobject.h" +#include "test-object.h" + +#include +#include + +static PyObject * +_wrap_get_object (PyObject * self) +{ + GObject *obj; + obj = g_object_new (TEST_TYPE_OBJECT, NULL); + if (!obj) { + return NULL; + } + + return pygobject_new(obj); +} + +static PyObject * +_wrap_emit_event (PyObject * self, PyObject *args) +{ + PyGObject *obj; + GstEventType event_type = GST_EVENT_UNKNOWN; + GstEvent *event; + + if (!PyArg_ParseTuple(args, "O|i", &obj, &event_type)) + return NULL; + + event = gst_event_new_custom(event_type, NULL); + + g_signal_emit_by_name(G_OBJECT(obj->obj), "event", event); + + gst_mini_object_unref(GST_MINI_OBJECT(event)); + + Py_INCREF(Py_None); + return Py_None; +} + +static PyMethodDef testhelper_methods[] = { + { "get_object", (PyCFunction)_wrap_get_object, METH_NOARGS }, + { "emit_event", (PyCFunction)_wrap_emit_event, METH_VARARGS }, + { NULL, NULL } +}; + +void +inittesthelper () +{ + PyObject *m, *d; + + init_pygobject(); + gst_init(NULL, NULL); + + m = Py_InitModule ("testhelper", testhelper_methods); + + d = PyModule_GetDict(m); +} diff --git a/testsuite/overrides_hack.py b/testsuite/overrides_hack.py new file mode 100644 index 0000000..f8e15ce --- /dev/null +++ b/testsuite/overrides_hack.py @@ -0,0 +1,16 @@ +import os +import gi.overrides + +if not gi.overrides.__path__[0].endswith("gst-python/gi/overrides"): + local_overrides = None + # our overrides don't take precedence, let's fix it + for i, path in enumerate(gi.overrides.__path__): + if path.endswith("gst-python/gi/overrides"): + local_overrides = path + + if local_overrides: + gi.overrides.__path__.remove(local_overrides) + else: + local_overrides = os.path.abspath(os.path.join(__file__, "../", "../", "gi", "overrides")) + + gi.overrides.__path__.insert(0, local_overrides) diff --git a/testsuite/python.supp b/testsuite/python.supp new file mode 100644 index 0000000..87fd226 --- /dev/null +++ b/testsuite/python.supp @@ -0,0 +1,520 @@ +# +# This is a valgrind suppression file that should be used when using valgrind. +# +# Here's an example of running valgrind: +# +# cd python/dist/src +# valgrind --tool=memcheck --suppressions=Misc/valgrind-python.supp \ +# ./python -E -tt ./Lib/test/regrtest.py -u bsddb,network +# +# You must edit Objects/obmalloc.c and uncomment Py_USING_MEMORY_DEBUGGER +# to use the preferred suppressions with Py_ADDRESS_IN_RANGE. +# +# If you do not want to recompile Python, you can uncomment +# suppressions for PyObject_Free and PyObject_Realloc. +# +# See Misc/README.valgrind for more information. + +# all tool names: Addrcheck,Memcheck,cachegrind,helgrind,massif +{ + ADDRESS_IN_RANGE/Invalid read of size 4 + Memcheck:Addr4 + fun:Py_ADDRESS_IN_RANGE +} + +{ + ADDRESS_IN_RANGE/Invalid read of size 4 + Memcheck:Value4 + fun:Py_ADDRESS_IN_RANGE +} + +{ + ADDRESS_IN_RANGE/Invalid read of size 8 (x86_64) + Memcheck:Value8 + fun:Py_ADDRESS_IN_RANGE +} + +{ + ADDRESS_IN_RANGE/Conditional jump or move depends on uninitialised value + Memcheck:Cond + fun:Py_ADDRESS_IN_RANGE +} + +{ + ADDRESS_IN_RANGE/Invalid read of size 4 + Memcheck:Addr4 + fun:PyObject_Free +} + +{ + ADDRESS_IN_RANGE/Invalid read of size 8 (x86_64) + Memcheck:Addr8 + fun:PyObject_Free +} + +{ + ADDRESS_IN_RANGE/Invalid read of size 4 + Memcheck:Value4 + fun:PyObject_Free +} + +{ + ADDRESS_IN_RANGE/Invalid read of size 8 (x86_64) + Memcheck:Value8 + fun:PyObject_Free +} + +{ + ADDRESS_IN_RANGE/Conditional jump or move depends on uninitialised value + Memcheck:Cond + fun:PyObject_Free +} + +{ + ADDRESS_IN_RANGE/Invalid read of size 4 + Memcheck:Addr4 + fun:PyObject_Realloc +} + +{ + ADDRESS_IN_RANGE/Invalid read of size 8 (x86_64) + Memcheck:Addr8 + fun:PyObject_Realloc +} + +{ + ADDRESS_IN_RANGE/Invalid read of size 4 + Memcheck:Value4 + fun:PyObject_Realloc +} + +{ + ADDRESS_IN_RANGE/Invalid read of size 8 (x86_64) + Memcheck:Value8 + fun:PyObject_Realloc +} + +{ + ADDRESS_IN_RANGE/Conditional jump or move depends on uninitialised value + Memcheck:Cond + fun:PyObject_Realloc +} + +### +### All the suppressions below are for errors that occur within libraries +### that Python uses. The problems to not appear to be related to Python's +### use of the libraries. +### +{ + GDBM problems, see test_gdbm + Memcheck:Param + write(buf) + fun:write + fun:gdbm_open + +} + +{ + Avoid problem in libc on gentoo + Memcheck:Cond + obj:/lib/ld-2.3.4.so + obj:/lib/ld-2.3.4.so + obj:/lib/ld-2.3.4.so + obj:/lib/ld-2.3.4.so + obj:/lib/ld-2.3.4.so +} + +{ + Avoid problem in glibc on gentoo + Memcheck:Addr8 + obj:/lib/ld-2.3.4.so + obj:/lib/ld-2.3.4.so + obj:/lib/ld-2.3.4.so + obj:/lib/ld-2.3.4.so + obj:/lib/libc-2.3.4.so + obj:/lib/ld-2.3.4.so + fun:_dl_open + obj:/lib/libdl-2.3.4.so + obj:/lib/ld-2.3.4.so + obj:/lib/libdl-2.3.4.so + fun:dlopen +} + +{ + Avoid problem in glibc on gentoo + Memcheck:Addr8 + obj:/lib/ld-2.3.4.so + obj:/lib/ld-2.3.4.so + obj:/lib/ld-2.3.4.so + obj:/lib/ld-2.3.4.so + obj:/lib/ld-2.3.4.so + obj:/lib/ld-2.3.4.so + obj:/lib/ld-2.3.4.so + obj:/lib/libc-2.3.4.so + obj:/lib/ld-2.3.4.so + fun:_dl_open + obj:/lib/libdl-2.3.4.so + obj:/lib/ld-2.3.4.so + obj:/lib/libdl-2.3.4.so + fun:dlopen +} + +{ + Avoid problem in glibc on gentoo + Memcheck:Cond + obj:/lib/ld-2.3.4.so + obj:/lib/libc-2.3.4.so + obj:/lib/ld-2.3.4.so + fun:_dl_open + obj:/lib/libdl-2.3.4.so + obj:/lib/ld-2.3.4.so + obj:/lib/libdl-2.3.4.so + fun:dlopen +} + +{ + Avoid problem in glibc on gentoo + Memcheck:Cond + obj:/lib/ld-2.3.4.so + obj:/lib/ld-2.3.4.so + obj:/lib/ld-2.3.4.so + obj:/lib/libc-2.3.4.so + obj:/lib/ld-2.3.4.so + fun:_dl_open + obj:/lib/libdl-2.3.4.so + obj:/lib/ld-2.3.4.so + obj:/lib/libdl-2.3.4.so + fun:dlopen +} + +{ + Avoid problems w/readline doing a putenv and leaking on exit + Memcheck:Leak + fun:malloc + fun:xmalloc + fun:sh_set_lines_and_columns + fun:_rl_get_screen_size + fun:_rl_init_terminal_io + obj:/lib/libreadline.so.4.3 + fun:rl_initialize + fun:setup_readline + fun:initreadline + fun:_PyImport_LoadDynamicModule + fun:load_module + fun:import_submodule + fun:load_next + fun:import_module_ex + fun:PyImport_ImportModuleEx +} + +{ + Mysterious leak that seems to deal w/pthreads + Memcheck:Leak + fun:calloc + obj:/lib/ld-2.3.4.so + obj:/lib/ld-2.3.4.so + fun:_dl_allocate_tls + fun:__pthread_initialize_minimal +} + +{ + Mysterious leak that seems to deal w/pthreads + Memcheck:Leak + fun:memalign + obj:/lib/ld-2.3.4.so + fun:_dl_allocate_tls + fun:__pthread_initialize_minimal +} + +### +### These occur from somewhere within the SSL, when running +### test_socket_sll. They are too general to leave on by default. +### +###{ +### somewhere in SSL stuff +### Memcheck:Cond +### fun:memset +###} +###{ +### somewhere in SSL stuff +### Memcheck:Value4 +### fun:memset +###} +### +###{ +### somewhere in SSL stuff +### Memcheck:Cond +### fun:MD5_Update +###} +### +###{ +### somewhere in SSL stuff +### Memcheck:Value4 +### fun:MD5_Update +###} + +# +# All of these problems come from using test_socket_ssl +# +{ + from test_socket_ssl + Memcheck:Cond + fun:BN_bin2bn +} + +{ + from test_socket_ssl + Memcheck:Cond + fun:BN_num_bits_word +} + +{ + from test_socket_ssl + Memcheck:Value4 + fun:BN_num_bits_word +} + +{ + from test_socket_ssl + Memcheck:Cond + fun:BN_mod_exp_mont_word +} + +{ + from test_socket_ssl + Memcheck:Cond + fun:BN_mod_exp_mont +} + +{ + from test_socket_ssl + Memcheck:Param + write(buf) + fun:write + obj:/usr/lib/libcrypto.so.0.9.7 +} + +{ + from test_socket_ssl + Memcheck:Cond + fun:RSA_verify +} + +{ + from test_socket_ssl + Memcheck:Value4 + fun:RSA_verify +} + +{ + from test_socket_ssl + Memcheck:Value4 + fun:DES_set_key_unchecked +} + +{ + from test_socket_ssl + Memcheck:Value4 + fun:DES_encrypt2 +} + +{ + from test_socket_ssl + Memcheck:Cond + obj:/usr/lib/libssl.so.0.9.7 +} + +{ + from test_socket_ssl + Memcheck:Value4 + obj:/usr/lib/libssl.so.0.9.7 +} + +{ + from test_socket_ssl + Memcheck:Cond + fun:BUF_MEM_grow_clean +} + +{ + from test_socket_ssl + Memcheck:Cond + fun:memcpy + fun:ssl3_read_bytes +} + +{ + from test_socket_ssl + Memcheck:Cond + fun:SHA1_Update +} + +{ + from test_socket_ssl + Memcheck:Value4 + fun:SHA1_Update +} + + +# python init memleak +{ + Py_Main memleak + Memcheck:Leak + fun:malloc + fun:PyObject_Malloc + fun:_PyObject_GC_Malloc + fun:_PyObject_GC_* + fun:* + fun:* + fun:* + fun:* + fun:Py_InitializeEx +} + +{ + Py_Main memleak + Memcheck:Leak + fun:malloc + fun:PyObject_Malloc + fun:_PyObject_GC_Malloc + fun:_PyObject_GC_* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:Py_InitializeEx +} + +{ + Py_Main memleak v2 + Memcheck:Leak + fun:malloc + fun:_PyObject_GC_Malloc + fun:_PyObject_GC_New + fun:* + fun:* + fun:* + fun:* + fun:* + fun:Py_InitializeEx +} + +{ + Read compiled module memleak + Memcheck:Leak + fun:malloc + fun:PyObject_Malloc + fun:_PyObject_GC_Malloc + fun:_PyObject_GC_NewVar + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:read_compiled_module +} + +{ + PyRun_SimpleFileExFlags memleak + Memcheck:Leak + fun:malloc + fun:_PyObject_GC_Malloc + fun:_PyObject_GC_New* + fun:* + fun:* + fun:* + fun:PyRun_SimpleFileExFlags +} + +# memleak in update_keyword_args +{ + update_keyword_args + Memcheck:Leak + fun:malloc + fun:_PyObject_GC_Malloc + fun:* + fun:* + fun:update_keyword_args +} + +# memleaks/conds in import_submodule +{ + memleak in import_submodule + Memcheck:Cond + fun:strcpy + fun:find_module +} + +{ + wrong jump in import_submodule + Memcheck:Cond + fun:find_module + fun:import_submodule +} + +{ + wrong jump in import_submodule + Memcheck:Cond + fun:find_module + fun:load_package + fun:load_module + fun:import_submodule +} + +{ + Use of uninitialised value of size 4 + Memcheck:Value4 + fun:strcpy + fun:find_module +} + +## KNOWN MEMORY LEAK in gst_element_state_get_name +## See gstreamer/gst/gstutils.c +{ + Known leak in gst_element_state_get_name + Memcheck:Leak + fun:* + fun:* + fun:* + fun:* + fun:g_strdup_printf + fun:gst_element_state_get_name +} + +## Suppressions for FC5 64bit + +{ + Wrong jump in PyImport_ImportModuleEx + Memcheck:Cond + fun:__strcpy_chk + obj:/usr/lib64/libpython2.4.so.1.0 + obj:/usr/lib64/libpython2.4.so.1.0 + obj:/usr/lib64/libpython2.4.so.1.0 + fun:PyImport_ImportModuleEx +} + +{ + Wrong jump in PyImport_ImportModuleEx + Memcheck:Cond + fun:__strcpy_chk + fun:PyImport_ImportModuleEx +} + +{ + Wrong jump in PyImport_ImportModuleEx + Memcheck:Cond + fun:__strcpy_chk + obj:/usr/lib64/libpython2.4.so.1.0 + obj:/usr/lib64/libpython2.4.so.1.0 + fun:PyObject_Call + fun:PyObject_CallFunction + obj:/usr/lib64/libpython2.4.so.1.0 + obj:/usr/lib64/libpython2.4.so.1.0 + obj:/usr/lib64/libpython2.4.so.1.0 + fun:PyImport_ImportModuleEx +} diff --git a/testsuite/runtests.py b/testsuite/runtests.py new file mode 100644 index 0000000..452311f --- /dev/null +++ b/testsuite/runtests.py @@ -0,0 +1,70 @@ +#!/usr/bin/env python +# -*- Mode: Python -*- +# vi:si:et:sw=4:sts=4:ts=4 +# +# gst-python - Python bindings for GStreamer +# Copyright (C) 2002 David I. Lehn +# Copyright (C) 2004 Johan Dahlin +# Copyright (C) 2005 Edward Hervey +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +import os +import sys +import unittest + + +def _testcases(filenames): + """Yield testcases out of filenames.""" + for filename in filenames: + if filename.endswith(".py"): + yield filename[:-3] + + +def _tests_suite(): + """Pick which tests to run.""" + testcase = os.getenv("TESTCASE") + if testcase: + testcases = [testcase] + else: + testcases = _testcases(sys.argv[1:]) + loader = unittest.TestLoader() + return loader.loadTestsFromNames(testcases) + + +def setup(): + return + + +if __name__ == "__main__": + setup() + + # Set verbosity. + descriptions = 1 + verbosity = 1 + if 'VERBOSE' in os.environ: + descriptions = 2 + verbosity = 2 + + suite = _tests_suite() + if not list(suite): + raise Exception("No tests found") + + # Run the tests. + testRunner = unittest.TextTestRunner(descriptions=descriptions, + verbosity=verbosity) + result = testRunner.run(suite) + if result.failures or result.errors: + sys.exit(1) diff --git a/testsuite/test_fraction.py b/testsuite/test_fraction.py new file mode 100644 index 0000000..0a779d6 --- /dev/null +++ b/testsuite/test_fraction.py @@ -0,0 +1,131 @@ +# -*- Mode: Python -*- +# vi:si:et:sw=4:sts=4:ts=4 +# +# gst-python - Python bindings for GStreamer +# Copyright (C) 2007 Johan Dahlin +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +import overrides_hack +overrides_hack + +from common import TestCase + +from gi.repository import Gst +Gst.init(None) + +F = Gst.Fraction + +class TestFraction(TestCase): + def testConstructor(self): + Gst.init(None) + + frac = F(1, 2) + self.assertEquals(frac.num, 1) + self.assertEquals(frac.denom, 2) + + frac = F(1) + self.assertEquals(frac.num, 1) + self.assertEquals(frac.denom, 1) + + self.assertRaises(TypeError, F) + + def testRepr(self): + Gst.init(None) + + self.assertEquals(repr(F(1, 2)), '') + + def testEqNe(self): + Gst.init(None) + + frac = F(1, 2) + self.assertEquals(frac, frac) + self.assertEquals(F(1, 2), F(1, 2)) + self.assertEquals(F(2, 4), F(1, 2)) + + self.assertNotEquals(F(1, 3), F(1, 2)) + self.assertNotEquals(F(2, 1), F(1, 2)) + + def testMul(self): + Gst.init(None) + + self.assertEquals(F(1, 2) * F(1, 2), F(1, 4)) + self.assertEquals(F(2, 3) * F(4, 5), F(8, 15)) + self.assertEquals(F(1, 3) * F(4), F(4, 3)) + self.assertEquals(F(1, 3) * 4, F(4, 3)) + + def testRMul(self): + Gst.init(None) + + self.assertEquals(2 * F(1, 2), F(1)) + self.assertEquals(4 * F(1, 2), F(2)) + self.assertEquals(-10 * F(1, 2), F(-5)) + + def testDiv(self): + Gst.init(None) + + self.assertEquals(F(1, 3) / F(1, 4), F(4, 3)) + self.assertEquals(F(2, 3) / F(4, 5), F(10, 12)) + + self.assertEquals(F(1, 3) / F(4), F(1, 12)) + self.assertEquals(F(1, 3) / 4, F(1, 12)) + self.assertEquals(F(1, 3) / 2, F(1, 6)) + self.assertEquals(F(1, 5) / -4, F(1, -20)) + + def testRDiv(self): + Gst.init(None) + + self.assertEquals(2 / F(1, 3), F(6, 1)) + self.assertEquals(-4 / F(1, 5), F(-20, 1)) + + def testFloat(self): + Gst.init(None) + + self.assertEquals(float(F(1, 2)), 0.5) + + def testPropertyMarshalling(self): + Gst.init(None) + + obj = Gst.ElementFactory.make("videoparse") + if not obj: + # no videoparse and I don't know of any elements in core or -base using + # fraction properties. Skip this test. + return + + value = obj.props.framerate + self.failUnlessEqual(value.num, 25) + self.failUnlessEqual(value.denom, 1) + + obj.props.framerate = Gst.Fraction(2, 1) + value = obj.props.framerate + self.failUnlessEqual(value.num, 2) + self.failUnlessEqual(value.denom, 1) + + def bad(): + obj.props.framerate = 1 + self.failUnlessRaises(TypeError, bad) + + value = obj.props.framerate + self.failUnlessEqual(value.num, 2) + self.failUnlessEqual(value.denom, 1) + + def testGetFractionValue(self): + Gst.init(None) + + st = Gst.Structure.from_string("video/x-raw,framerate=10/1")[0] + value = st["framerate"] + + self.failUnlessEqual(value.num, 10) + self.failUnlessEqual(value.denom, 1) diff --git a/testsuite/test_gst.py b/testsuite/test_gst.py new file mode 100644 index 0000000..e04b38f --- /dev/null +++ b/testsuite/test_gst.py @@ -0,0 +1,80 @@ +# -*- Mode: Python -*- +# vi:si:et:sw=4:sts=4:ts=4 +# +# Copyright (C) 2009 Thomas Vander Stichele +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +import sys +import overrides_hack +overrides_hack +from common import TestCase, unittest + +from gi.repository import Gst + +class TimeArgsTest(TestCase): + def testNoneTime(self): + self.assertRaises(TypeError, Gst.TIME_ARGS, None) + + def testStringTime(self): + self.assertRaises(TypeError, Gst.TIME_ARGS, "String") + + def testClockTimeNone(self): + self.assertEquals(Gst.TIME_ARGS(Gst.CLOCK_TIME_NONE), 'CLOCK_TIME_NONE') + + def testOneSecond(self): + self.assertEquals(Gst.TIME_ARGS(Gst.SECOND), '0:00:01.000000000') + +class TestNotInitialized(TestCase): + def testNotInitialized(self): + if sys.version_info >= (3, 0): + assert_type = Gst.NotInitialized + else: + assert_type = TypeError + + with self.assertRaises(assert_type): + Gst.Caps.from_string("audio/x-raw") + + with self.assertRaises(assert_type): + Gst.Structure.from_string("audio/x-raw") + + with self.assertRaises(assert_type): + Gst.ElementFactory.make("identity", None) + + def testNotDeinitialized(self): + Gst.init(None) + + assert(Gst.Caps.from_string("audio/x-raw")) + assert(Gst.Structure.from_string("audio/x-raw")) + assert(Gst.ElementFactory.make("identity", None)) + + Gst.deinit() + if sys.version_info >= (3, 0): + assert_type = Gst.NotInitialized + else: + assert_type = TypeError + + with self.assertRaises(assert_type): + Gst.Caps.from_string("audio/x-raw") + + with self.assertRaises(assert_type): + Gst.Structure.from_string("audio/x-raw") + + with self.assertRaises(assert_type): + Gst.ElementFactory.make("identity", None) + + +if __name__ == "__main__": + unittest.main() diff --git a/win32/MANIFEST b/win32/MANIFEST new file mode 100644 index 0000000..295ff5c --- /dev/null +++ b/win32/MANIFEST @@ -0,0 +1,6 @@ +win32/MANIFEST +win32/common/config.h +win32/common/config.h.in +win32/vs6/gst_python.dsw +win32/vs6/libgstpython.dsp +win32/vs6/pygenfiles.dsp \ No newline at end of file diff --git a/win32/common/.gitignore b/win32/common/.gitignore new file mode 100644 index 0000000..0e56cf2 --- /dev/null +++ b/win32/common/.gitignore @@ -0,0 +1 @@ +config.h diff --git a/win32/common/config.h.in b/win32/common/config.h.in new file mode 100644 index 0000000..6407204 --- /dev/null +++ b/win32/common/config.h.in @@ -0,0 +1,88 @@ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Defined if gcov is enabled to force a rebuild due to config.h changing */ +#undef GST_GCOV_ENABLED + +/* Define to 1 if you have the header file. */ +#undef HAVE_DLFCN_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H + +/* We can use the plugins-install methods */ +#define HAVE_PLUGINS_INSTALL 1 + +/* Defined if we have a 2.12 series pygobject */ +#undef HAVE_PYGOBJECT_2_12 + +/* Defined if we have a 2.16 series pygobject */ +#undef HAVE_PYGOBJECT_2_16 + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Define if valgrind should be used */ +#undef HAVE_VALGRIND + +/* We can use the videoorientation interface */ +#define HAVE_VIDEO_ORIENTATION_INTERFACE 1 + +/* Define to 1 if your C compiler doesn't accept -c and -o together. */ +#undef NO_MINUS_C_MINUS_O + +/* Name of package */ +#define PACKAGE "@PACKAGE@" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "@PACKAGE_BUGREPORT@" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "@PACKAGE_NAME@" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "@PACKAGE_STRING@" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "@PACKAGE_TARNAME@" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "@PACKAGE_VERSION@" + +/* PyGst major version */ +#define PYGST_MAJOR_VERSION @PACKAGE_VERSION_MAJOR@ + +/* PyGst micro version */ +#define PYGST_MICRO_VERSION @PACKAGE_VERSION_MICRO@ + +/* PyGst minor version */ +#define PYGST_MINOR_VERSION @PACKAGE_VERSION_MINOR@ + +/* PyGst nano version */ +#define PYGST_NANO_VERSION @PACKAGE_VERSION_NANO@ + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Version number of package */ +#define VERSION "@VERSION@" diff --git a/win32/vs6/gst_python.dsw b/win32/vs6/gst_python.dsw new file mode 100644 index 0000000..16b4194 --- /dev/null +++ b/win32/vs6/gst_python.dsw @@ -0,0 +1,41 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "libgstpython"=".\libgstpython.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "pygenfiles"=".\pygenfiles.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/win32/vs6/libgstpython.dsp b/win32/vs6/libgstpython.dsp new file mode 100644 index 0000000..e010dd8 --- /dev/null +++ b/win32/vs6/libgstpython.dsp @@ -0,0 +1,205 @@ +# Microsoft Developer Studio Project File - Name="libgstpython" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +CFG=libgstpython - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "libgstpython.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "libgstpython.mak" CFG="libgstpython - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "libgstpython - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "libgstpython - Win32 Release python24" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "libgstpython - Win32 Release python25" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "libgstpython - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBGSTPYTHON_EXPORTS" /YX /FD /GZ /c +# ADD CPP /nologo /MDd /W3 /Gm /ZI /Od /I "../../../gst-plugins-base/" /I "../../../gstreamer" /I "../../../gstreamer/libs" /I "../common" /I "../../../gst-plugins-base/gst-libs" /I "C:\Python24\include" /I "C:\Python24\include\pygtk-2.0" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBGSTPYTHON_EXPORTS" /D "HAVE_CONFIG_H" /D "HAVE_VIDEO_ORIENTATION_INTERFACE" /FD /GZ /c +# SUBTRACT CPP /YX +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x40c /d "_DEBUG" +# ADD RSC /l 0x40c /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept +# ADD LINK32 glib-2.0D.lib gobject-2.0D.lib libgstreamer-0.10.lib libgstbase-0.10.lib libgstinterfaces-0.10.lib libgstdataprotocol-0.10.lib libgstcontroller-0.10.lib libxml2.lib libgstnet-0.10.lib /nologo /dll /debug /machine:I386 /pdbtype:sept /libpath:"../../../gstreamer/win32/vs6/debug" /libpath:"../../../gst-plugins-base/win32/vs6/debug" /libpath:"C:\Python24\libs\\" +# Begin Special Build Tool +TargetPath=.\Debug\libgstpython.dll +SOURCE="$(InputPath)" +PostBuild_Cmds=copy /Y $(TargetPath) c:\gstreamer\debug\lib\gstreamer-0.10 +# End Special Build Tool + +!ELSEIF "$(CFG)" == "libgstpython - Win32 Release python24" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "libgstpython___Win32_Release_python24" +# PROP BASE Intermediate_Dir "libgstpython___Win32_Release_python24" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_python24" +# PROP Intermediate_Dir "Release_python24" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /O1 /I "../../../gstreamer" /I "../../../gstreamer/libs" /I "../common" /I "../../../gst-plugins-base/gst-libs" /I "C:\Python24\include\pygtk-2.0" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBGSTPYTHON_EXPORTS" /D "HAVE_CONFIG_H" /D "HAVE_VIDEO_ORIENTATION_INTERFACE" /FR /FD /c +# SUBTRACT BASE CPP /YX +# ADD CPP /nologo /MD /W3 /O1 /I "../../../gstreamer" /I "../../../gstreamer/libs" /I "../common" /I "../../../gst-plugins-base/gst-libs" /I "C:\Python24\include\pygtk-2.0" /I "C:\Python24\include\\" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBGSTPYTHON_EXPORTS" /D "HAVE_CONFIG_H" /D "HAVE_VIDEO_ORIENTATION_INTERFACE" /FR /FD /c +# SUBTRACT CPP /YX +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x40c /d "NDEBUG" +# ADD RSC /l 0x40c /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libgstreamer-0.10.lib libgstbase-0.10.lib libgstinterfaces-0.10.lib libgstdataprotocol-0.10.lib libgstcontroller-0.10.lib glib-2.0.lib gobject-2.0.lib libxml2.lib /nologo /dll /machine:I386 /libpath:"../../../gstreamer/win32/vs6/release" /libpath:"../../../gst-plugins-base/win32/vs6/release" +# ADD LINK32 glib-2.0.lib gobject-2.0.lib libgstreamer-0.10.lib libgstbase-0.10.lib libgstinterfaces-0.10.lib libgstdataprotocol-0.10.lib libgstcontroller-0.10.lib libxml2.lib libgstnet-0.10.lib /nologo /dll /machine:I386 /libpath:"../../../gstreamer/win32/vs6/release" /libpath:"../../../gst-plugins-base/win32/vs6/release" /libpath:"C:\Python24\libs\\" +# Begin Special Build Tool +TargetPath=.\Release_python24\libgstpython.dll +SOURCE="$(InputPath)" +PostBuild_Cmds=copy /Y $(TargetPath) c:\gstreamer\lib\gstreamer-0.10 +# End Special Build Tool + +!ELSEIF "$(CFG)" == "libgstpython - Win32 Release python25" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "libgstpython___Win32_Release_python25" +# PROP BASE Intermediate_Dir "libgstpython___Win32_Release_python25" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_python25" +# PROP Intermediate_Dir "Release_python25" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /O1 /I "../../../gstreamer" /I "../../../gstreamer/libs" /I "../common" /I "../../../gst-plugins-base/gst-libs" /I "C:\Python24\include\pygtk-2.0" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBGSTPYTHON_EXPORTS" /D "HAVE_CONFIG_H" /D "HAVE_VIDEO_ORIENTATION_INTERFACE" /FR /FD /c +# SUBTRACT BASE CPP /YX +# ADD CPP /nologo /MD /W3 /O1 /I "../../../gstreamer" /I "../../../gstreamer/libs" /I "../common" /I "../../../gst-plugins-base/gst-libs" /I "C:\Python25\include\pygtk-2.0" /I "C:\Python25\include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBGSTPYTHON_EXPORTS" /D "HAVE_CONFIG_H" /D "HAVE_VIDEO_ORIENTATION_INTERFACE" /FR /FD /c +# SUBTRACT CPP /YX +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x40c /d "NDEBUG" +# ADD RSC /l 0x40c /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libgstreamer-0.10.lib libgstbase-0.10.lib libgstinterfaces-0.10.lib libgstdataprotocol-0.10.lib libgstcontroller-0.10.lib glib-2.0.lib gobject-2.0.lib libxml2.lib /nologo /dll /machine:I386 /libpath:"../../../gstreamer/win32/vs6/release" /libpath:"../../../gst-plugins-base/win32/vs6/release" +# ADD LINK32 glib-2.0.lib gobject-2.0.lib libgstreamer-0.10.lib libgstbase-0.10.lib libgstinterfaces-0.10.lib libgstdataprotocol-0.10.lib libgstcontroller-0.10.lib libxml2.lib libgstnet-0.10.lib /nologo /dll /machine:I386 /libpath:"../../../gstreamer/win32/vs6/release" /libpath:"../../../gst-plugins-base/win32/vs6/release" /libpath:"C:\Python25\libs" +# Begin Special Build Tool +TargetPath=.\Release_python25\libgstpython.dll +SOURCE="$(InputPath)" +PostBuild_Cmds=copy /Y $(TargetPath) c:\gstreamer\lib\gstreamer-0.10 +# End Special Build Tool + +!ENDIF + +# Begin Target + +# Name "libgstpython - Win32 Debug" +# Name "libgstpython - Win32 Release python24" +# Name "libgstpython - Win32 Release python25" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE="..\..\gst\gst-argtypes.c" +# End Source File +# Begin Source File + +SOURCE=..\..\gst\gst.c +# End Source File +# Begin Source File + +SOURCE=..\..\gst\gstmodule.c +# End Source File +# Begin Source File + +SOURCE=..\..\gst\interfaces.c +# End Source File +# Begin Source File + +SOURCE=..\..\gst\interfacesmodule.c +# End Source File +# Begin Source File + +SOURCE=..\..\gst\pygstexception.c +# End Source File +# Begin Source File + +SOURCE=..\..\gst\pygstiterator.c +# End Source File +# Begin Source File + +SOURCE=..\..\gst\pygstminiobject.c +# End Source File +# Begin Source File + +SOURCE=..\..\gst\pygstvalue.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=..\..\gst\common.h +# End Source File +# Begin Source File + +SOURCE=..\..\gst\pygstexception.h +# End Source File +# Begin Source File + +SOURCE=..\..\gst\pygstminiobject.h +# End Source File +# Begin Source File + +SOURCE=..\..\gst\pygstvalue.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# End Target +# End Project diff --git a/win32/vs6/pygenfiles.dsp b/win32/vs6/pygenfiles.dsp new file mode 100644 index 0000000..af295ca --- /dev/null +++ b/win32/vs6/pygenfiles.dsp @@ -0,0 +1,123 @@ +# Microsoft Developer Studio Project File - Name="pygenfiles" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Generic Project" 0x010a + +CFG=pygenfiles - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "pygenfiles.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "pygenfiles.mak" CFG="pygenfiles - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "pygenfiles - Win32 Release" (based on "Win32 (x86) Generic Project") +!MESSAGE "pygenfiles - Win32 Debug" (based on "Win32 (x86) Generic Project") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +MTL=midl.exe + +!IF "$(CFG)" == "pygenfiles - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Target_Dir "" + +!ELSEIF "$(CFG)" == "pygenfiles - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Target_Dir "" + +!ENDIF + +# Begin Target + +# Name "pygenfiles - Win32 Release" +# Name "pygenfiles - Win32 Debug" +# Begin Source File + +SOURCE=..\..\gst\gst.override + +!IF "$(CFG)" == "pygenfiles - Win32 Release" + +# Begin Custom Build +InputPath=..\..\gst\gst.override + +"gst_output" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + C:\Python24\python.exe ..\..\codegen/codegen.py --load-types ..\..\gst\arg-types.py --register ..\..\gst\gst-types.defs --override ..\..\gst\gst.override --extendpath ..\..\gst\ --extendpath ..\..\gst\ --prefix pygst ..\..\gst\gst.defs > ..\..\gst\gen-gst.c + move ..\..\gst\gen-gst.c ..\..\gst\gst.c + +# End Custom Build + +!ELSEIF "$(CFG)" == "pygenfiles - Win32 Debug" + +# Begin Custom Build +InputPath=..\..\gst\gst.override + +"gst_output" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + C:\Python24\python.exe ..\..\codegen/codegen.py --load-types ..\..\gst\arg-types.py --register ..\..\gst\gst-types.defs --override ..\..\gst\gst.override --extendpath ..\..\gst\ --extendpath ..\..\gst\ --prefix pygst ..\..\gst\gst.defs > ..\..\gst\gen-gst.c + move ..\..\gst\gen-gst.c ..\..\gst\gst.c + +# End Custom Build + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\..\gst\interfaces.override + +!IF "$(CFG)" == "pygenfiles - Win32 Release" + +# Begin Custom Build +InputPath=..\..\gst\interfaces.override + +"interfaces_output" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + C:\Python24\python.exe ..\..\codegen/codegen.py --load-types ..\..\gst\arg-types.py --register ..\..\gst\gst-types.defs --override ..\..\gst\interfaces.override --extendpath ..\..\gst\ --extendpath ..\..\gst\ --prefix pyinterfaces ..\..\gst\interfaces.defs > ..\..\gst\gen-interfaces.c + move ..\..\gst\gen-interfaces.c ..\..\gst\interfaces.c + + +# End Custom Build + +!ELSEIF "$(CFG)" == "pygenfiles - Win32 Debug" + +# Begin Custom Build +InputPath=..\..\gst\interfaces.override + +"interfaces_output" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + C:\Python24\python.exe ..\..\codegen/codegen.py --load-types ..\..\gst\arg-types.py --register ..\..\gst\gst-types.defs --override ..\..\gst\interfaces.override --extendpath ..\..\gst\ --extendpath ..\..\gst\ --prefix pyinterfaces ..\..\gst\interfaces.defs > ..\..\gst\gen-interfaces.c + move ..\..\gst\gen-interfaces.c ..\..\gst\interfaces.c + + +# End Custom Build + +!ENDIF + +# End Source File +# End Target +# End Project