Hello community, here is the log from the commit of package python-gst for openSUSE:Factory checked in at 2017-09-25 13:58:59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-gst (Old) and /work/SRC/openSUSE:Factory/.python-gst.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-gst" Mon Sep 25 13:58:59 2017 rev:17 rq:528117 version:1.12.3 Changes: -------- --- /work/SRC/openSUSE:Factory/python-gst/python-gst.changes 2017-09-11 16:17:31.349095705 +0200 +++ /work/SRC/openSUSE:Factory/.python-gst.new/python-gst.changes 2017-09-25 13:59:00.974213028 +0200 @@ -1,0 +2,14 @@ +Mon Sep 18 22:16:39 UTC 2017 - [email protected] + +- Update to version 1.12.3: + + plugin: Always initialize GIL state. + + Add support for Gst.Bitmask. + + tests: Stop using deprecated assertion methods. + + tests: Move all Fundamental types tests in a file. + + structure: Add a .keys() method and implement __str__. + + Return a Gst.*Range instead of a python range converting from + GValue to python. + + structures: Override __new__ to make it more pythonic. + + overrides: Remove IntRange And Int64Range on Python2. + +------------------------------------------------------------------- Old: ---- gst-python-1.12.2.tar.xz New: ---- gst-python-1.12.3.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-gst.spec ++++++ --- /var/tmp/diff_new_pack.qoVVxI/_old 2017-09-25 13:59:01.662116243 +0200 +++ /var/tmp/diff_new_pack.qoVVxI/_new 2017-09-25 13:59:01.666115680 +0200 @@ -18,13 +18,13 @@ Name: python-gst %define _name gst-python -Version: 1.12.2 +Version: 1.12.3 Release: 0 Summary: Python Bindings for GStreamer License: LGPL-2.1+ Group: Development/Languages/Python Url: http://www.gstreamer.net/ -Source: http://gstreamer.freedesktop.org/src/gst-python/%{_name}-%{version}.tar.xz +Source: https://gstreamer.freedesktop.org/src/gst-python/%{_name}-%{version}.tar.xz BuildRequires: %{python_module devel} BuildRequires: gobject-introspection BuildRequires: python-rpm-macros ++++++ gst-python-1.12.2.tar.xz -> gst-python-1.12.3.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gst-python-1.12.2/ChangeLog new/gst-python-1.12.3/ChangeLog --- old/gst-python-1.12.2/ChangeLog 2017-07-14 12:40:07.000000000 +0200 +++ new/gst-python-1.12.3/ChangeLog 2017-09-18 15:56:24.000000000 +0200 @@ -1,9 +1,86 @@ +=== release 1.12.3 === + +2017-09-18 Sebastian Dröge <[email protected]> + + * configure.ac: + releasing 1.12.3 + +2017-07-29 23:05:22 -0400 Thibault Saunier <[email protected]> + + * plugin/gstpythonplugin.c: + plugin: Always initialize GIL state + gcc warns about possibly unintialized use of it + (even if it can't actually happen) + +2017-07-25 16:17:54 -0400 Thibault Saunier <[email protected]> + + * gi/overrides/Gst.py: + * gi/overrides/gstmodule.c: + * testsuite/test_types.py: + Add support for Gst.Bitmask + +2017-07-25 14:35:01 -0400 Thibault Saunier <[email protected]> + + * testsuite/test_types.py: + tests: Stop using deprecated assertion methods + +2017-07-25 14:29:19 -0400 Thibault Saunier <[email protected]> + + * testsuite/Makefile.am: + * testsuite/meson.build: + * testsuite/test_doublerange.py: + * testsuite/test_fraction.py: + * testsuite/test_fractionrange.py: + * testsuite/test_int64range.py: + * testsuite/test_intrange.py: + * testsuite/test_types.py: + * testsuite/test_valuearray.py: + * testsuite/test_valuelist.py: + tests: Move all Fundamental types tests in a file + No reason to have one file per type and it makes it more complicated + to handle. + +2017-07-25 13:00:08 -0400 Thibault Saunier <[email protected]> + + * gi/overrides/Gst.py: + structure: Add a .keys() method and implement __str__ + We are making it behave like a dict, so we should provide the + same kind of utilities. + +2017-07-24 17:06:06 -0400 Thibault Saunier <[email protected]> + + * gi/overrides/Gst.py: + * gi/overrides/gstmodule.c: + Return a Gst.*Range instead of a python range converting from GValue to python + Otherwise we lose the information about what type of range it is, which + is mandatory, especially when dealing with Structure and Caps. + +2017-07-24 12:13:13 -0400 Thibault Saunier <[email protected]> + + * gi/overrides/Gst.py: + * testsuite/test_gst.py: + structures: Override __new__ to make it more pythonic + +2017-05-21 18:06:25 +0200 Olivier Crête <[email protected]> + + * gi/overrides/Gst.py: + * testsuite/test_int64range.py: + * testsuite/test_intrange.py: + overrides: Remove IntRange And Int64Range on Python2 + They use the range() built-in type which is a Python 3 change. + https://bugzilla.gnome.org/show_bug.cgi?id=782927 + === release 1.12.2 === -2017-07-14 Sebastian Dröge <[email protected]> +2017-07-14 14:04:07 +0300 Sebastian Dröge <[email protected]> + * ChangeLog: + * NEWS: + * RELEASE: * configure.ac: - releasing 1.12.2 + * gst-python.doap: + * meson.build: + Release 1.12.2 === release 1.12.1 === diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gst-python-1.12.2/NEWS new/gst-python-1.12.3/NEWS --- old/gst-python-1.12.2/NEWS 2017-07-14 12:40:54.000000000 +0200 +++ new/gst-python-1.12.3/NEWS 2017-09-18 15:57:10.000000000 +0200 @@ -1,8 +1,8 @@ # GStreamer 1.12 Release Notes GStreamer 1.12.0 was originally released on 4th May 2017. -The latest bug-fix release in the 1.12 series is [1.12.2](#1.12.2) and was -released on 14 July 2017. +The latest bug-fix release in the 1.12 series is [1.12.3](#1.12.3) and was +released on 18 September 2017. The GStreamer team is proud to announce a new major feature release in the stable 1.x API series of your favourite cross-platform multimedia framework! @@ -13,7 +13,7 @@ See [https://gstreamer.freedesktop.org/releases/1.12/][latest] for the latest version of this document. -*Last updated: Friday 14 July 2017, 10:00 UTC [(log)][gitlog]* +*Last updated: Monday 19 September 2017, 12:30 UTC [(log)][gitlog]* [latest]: https://gstreamer.freedesktop.org/releases/1.12/ [gitlog]: https://cgit.freedesktop.org/gstreamer/www/log/src/htdocs/releases/1.12/release-notes-1.12.md @@ -779,6 +779,37 @@ [buglist-1.12.2]: https://bugzilla.gnome.org/buglist.cgi?bug_status=RESOLVED&bug_status=VERIFIED&classification=Platform&limit=0&list_id=225693&order=bug_id&product=GStreamer&query_format=advanced&resolution=FIXED&target_milestone=1.12.2 +<a name="1.12.3"></a> + +### 1.12.3 + +The second 1.12 bug-fix release (1.12.3) was released on 14 July 2017. +This release only contains bugfixes and it should be safe to update from 1.12.x. + +#### Major bugfixes in 1.12.3 + + - Fix for infinite recursion on buffer free in v4l2 + - Fix for glimagesink crash on macOS when used via autovideosink + - Fix for huge overhead in matroskamux caused by writing one Cluster per + audio-frame in audio-only streams. Also use SimpleBlocks for Opus and other + audio codecs, which works around a bug in VLC that prevented Opus streams + to be played and decreases overhead even more + - Fix for flushing seeks in rtpmsrc always causing an error + - Fix for timestamp overflows in calculations in audio encoder base class + - Fix for RTP h265 depayloader marking P-frames as I-frames + - Fix for long connection delays of clients in RTSP server + - Fixes for event handling in queue and queue2 elements, and updates to + buffering levels on NOT_LINKED streams + - Various fixes to event and buffering handling in decodebin3/playbin3 + - Various fixes for memory leaks, deadlocks and crashes in all modules + - ... and many, many more! + +For a full list of bugfixes see [Bugzilla][buglist-1.12.3]. Note that this is +not the full list of changes. For the full list of changes please refer to the +GIT logs or ChangeLogs of the particular modules. + +[buglist-1.12.3]: https://bugzilla.gnome.org/buglist.cgi?bug_status=RESOLVED&bug_status=VERIFIED&classification=Platform&limit=0&list_id=248880&order=bug_id&product=GStreamer&query_format=advanced&resolution=FIXED&target_milestone=1.12.3 + ## Known Issues - The `webrtcdsp` element is currently not shipped as part of the Windows @@ -793,7 +824,7 @@ of 1.13/1.14 will happen in the git master branch. The plan for the 1.14 development cycle is yet to be confirmed, but it is -expected that feature freeze will be around September 2017 +expected that feature freeze will be around October 2017 followed by several 1.13 pre-releases and the new 1.14 stable release in October. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gst-python-1.12.2/configure new/gst-python-1.12.3/configure --- old/gst-python-1.12.2/configure 2017-07-14 12:09:23.000000000 +0200 +++ new/gst-python-1.12.3/configure 2017-09-18 15:56:21.000000000 +0200 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for GStreamer GObject Introspection overrides for Python 1.12.2. +# Generated by GNU Autoconf 2.69 for GStreamer GObject Introspection overrides for Python 1.12.3. # # Report bugs to <http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer>. # @@ -591,8 +591,8 @@ # Identity of this package. PACKAGE_NAME='GStreamer GObject Introspection overrides for Python ' PACKAGE_TARNAME='gst-python' -PACKAGE_VERSION='1.12.2' -PACKAGE_STRING='GStreamer GObject Introspection overrides for Python 1.12.2' +PACKAGE_VERSION='1.12.3' +PACKAGE_STRING='GStreamer GObject Introspection overrides for Python 1.12.3' PACKAGE_BUGREPORT='http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer' PACKAGE_URL='' @@ -1383,7 +1383,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures GStreamer GObject Introspection overrides for Python 1.12.2 to adapt to many kinds of systems. +\`configure' configures GStreamer GObject Introspection overrides for Python 1.12.3 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1455,7 +1455,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of GStreamer GObject Introspection overrides for Python 1.12.2:";; + short | recursive ) echo "Configuration of GStreamer GObject Introspection overrides for Python 1.12.3:";; esac cat <<\_ACEOF @@ -1584,7 +1584,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -GStreamer GObject Introspection overrides for Python configure 1.12.2 +GStreamer GObject Introspection overrides for Python configure 1.12.3 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1862,7 +1862,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by GStreamer GObject Introspection overrides for Python $as_me 1.12.2, which was +It was created by GStreamer GObject Introspection overrides for Python $as_me 1.12.3, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2840,7 +2840,7 @@ # Define the identity of the package. PACKAGE='gst-python' - VERSION='1.12.2' + VERSION='1.12.3' cat >>confdefs.h <<_ACEOF @@ -3051,9 +3051,9 @@ - PACKAGE_VERSION_MAJOR=$(echo 1.12.2 | cut -d'.' -f1) - PACKAGE_VERSION_MINOR=$(echo 1.12.2 | cut -d'.' -f2) - PACKAGE_VERSION_MICRO=$(echo 1.12.2 | cut -d'.' -f3) + PACKAGE_VERSION_MAJOR=$(echo 1.12.3 | cut -d'.' -f1) + PACKAGE_VERSION_MINOR=$(echo 1.12.3 | cut -d'.' -f2) + PACKAGE_VERSION_MICRO=$(echo 1.12.3 | cut -d'.' -f3) @@ -3064,7 +3064,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking nano version" >&5 $as_echo_n "checking nano version... " >&6; } - NANO=$(echo 1.12.2 | cut -d'.' -f4) + NANO=$(echo 1.12.3 | cut -d'.' -f4) if test x"$NANO" = x || test "x$NANO" = "x0" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: 0 (release)" >&5 @@ -15249,7 +15249,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by GStreamer GObject Introspection overrides for Python $as_me 1.12.2, which was +This file was extended by GStreamer GObject Introspection overrides for Python $as_me 1.12.3, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -15315,7 +15315,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -GStreamer GObject Introspection overrides for Python config.status 1.12.2 +GStreamer GObject Introspection overrides for Python config.status 1.12.3 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gst-python-1.12.2/configure.ac new/gst-python-1.12.3/configure.ac --- old/gst-python-1.12.2/configure.ac 2017-07-14 10:15:52.000000000 +0200 +++ new/gst-python-1.12.3/configure.ac 2017-09-18 13:16:29.000000000 +0200 @@ -3,7 +3,7 @@ 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.12.2, +AC_INIT(GStreamer GObject Introspection overrides for Python , 1.12.3, http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer, gst-python) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gst-python-1.12.2/gi/overrides/Gst.py new/gst-python-1.12.3/gi/overrides/Gst.py --- old/gst-python-1.12.2/gi/overrides/Gst.py 2017-06-20 08:39:36.000000000 +0200 +++ new/gst-python-1.12.3/gi/overrides/Gst.py 2017-09-18 15:52:39.000000000 +0200 @@ -29,6 +29,8 @@ from ..overrides import override from ..importer import modules +from gi.repository import GLib + if sys.version_info >= (3, 0): _basestring = str @@ -224,12 +226,48 @@ __all__.append('Pipeline') class Structure(Gst.Structure): + def __new__(cls, *args, **kwargs): + if not args: + if kwargs: + raise TypeError("wrong arguments when creating GstStructure, first argument" + " must be the structure name.") + return Structure.new_empty() + elif len(args) > 1: + raise TypeError("wrong arguments when creating GstStructure object") + elif isinstance(args[0], str): + if not kwargs: + return Structure.from_string(args[0])[0] + struct = Structure.new_empty(args[0]) + for k, v in kwargs.items(): + struct[k] = v + + return struct + elif isinstance(args[0], Structure): + return args[0].copy() + + raise TypeError("wrong arguments when creating GstStructure object") + + def __init__(self, *args, **kwargs): + pass + def __getitem__(self, key): return self.get_value(key) + def keys(self): + keys = set() + def foreach(fid, value, unused1, udata): + keys.add(GLib.quark_to_string(fid)) + return True + + self.foreach(foreach, None, None) + return keys + def __setitem__(self, key, value): return self.set_value(key, value) + def __str__(self): + return self.to_string() + Structure = override(Structure) __all__.append('Structure') @@ -348,8 +386,16 @@ return '[%d,%d,%d]' % (self.range.start, self.range.stop, self.range.step) -IntRange = override(IntRange) -__all__.append('IntRange') + def __eq__(self, other): + if isinstance(other, range): + return self.range == other + elif isinstance(other, IntRange): + return self.range == other.range + return False + +if sys.version_info >= (3, 0): + IntRange = override(IntRange) + __all__.append('IntRange') class Int64Range(Gst.Int64Range): @@ -379,9 +425,34 @@ return '(int64)[%d,%d,%d]' % (self.range.start, self.range.stop, self.range.step) + def __eq__(self, other): + if isinstance(other, range): + return self.range == other + elif isinstance(other, IntRange): + return self.range == other.range + return False + +class Bitmask(Gst.Bitmask): + def __init__(self, v): + if not isinstance(v, int): + raise TypeError("%s is not an int." % (type(v))) + + self.v = v + + def __str__(self): + return hex(self.v) -Int64Range = override(Int64Range) -__all__.append('Int64Range') + def __eq__(self, other): + return self.v == other + + +Bitmask = override(Bitmask) +__all__.append('Bitmask') + + +if sys.version_info >= (3, 0): + Int64Range = override(Int64Range) + __all__.append('Int64Range') class DoubleRange(Gst.DoubleRange): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gst-python-1.12.2/gi/overrides/gstmodule.c new/gst-python-1.12.3/gi/overrides/gstmodule.c --- old/gst-python-1.12.2/gi/overrides/gstmodule.c 2017-06-20 08:39:26.000000000 +0200 +++ new/gst-python-1.12.3/gi/overrides/gstmodule.c 2017-09-18 15:52:39.000000000 +0200 @@ -137,13 +137,21 @@ gi_gst_int_range_from_value (const GValue * value) { gint min, max, step; + PyObject *int_range_type, *int_range, *range; min = gst_value_get_int_range_min (value); max = gst_value_get_int_range_max (value); step = gst_value_get_int_range_step (value); - return PyObject_CallFunction ((PyObject *) & PyRange_Type, "iii", + int_range_type = gi_gst_get_type ("IntRange"); + range = PyObject_CallFunction ((PyObject *) & PyRange_Type, "iii", min, max, step); + int_range = PyObject_CallFunction (int_range_type, "O", range); + + Py_DECREF (int_range_type); + Py_DECREF (range); + + return int_range; } static int @@ -182,13 +190,21 @@ gi_gst_int64_range_from_value (const GValue * value) { gint64 min, max, step; + PyObject *int64_range_type, *int64_range, *range; min = gst_value_get_int64_range_min (value); max = gst_value_get_int64_range_max (value); step = gst_value_get_int64_range_step (value); - return PyObject_CallFunction ((PyObject *) & PyRange_Type, "LLL", + range = PyObject_CallFunction ((PyObject *) & PyRange_Type, "LLL", min, max, step); + int64_range_type = gi_gst_get_type ("Int64Range"); + int64_range = PyObject_CallFunction (int64_range_type, "O", range); + + Py_DECREF (int64_range_type); + Py_DECREF (range); + + return int64_range; } static int @@ -385,6 +401,35 @@ } static PyObject * +gi_gst_bitmask_from_value (const GValue * value) +{ + PyObject *val, *bitmask_type; + + bitmask_type = gi_gst_get_type ("Bitmask"); + val = PyObject_CallFunction (bitmask_type, "L", + gst_value_get_bitmask (value)); + Py_DECREF (bitmask_type); + + return val; +} + +static int +gi_gst_bitmask_to_value (GValue * value, PyObject * object) +{ + PyObject *v = PyObject_GetAttrString (object, "v"); + if (v == NULL) + goto fail; + + gst_value_set_bitmask (value, PyLong_AsLong (v)); + + return 0; + +fail: + PyErr_SetString (PyExc_KeyError, "Object is not compatible with Gst.Bitmask"); + return -1; +} + +static PyObject * gi_gst_list_from_value (const GValue * value) { PyObject *list, *value_list_type, *value_list; @@ -471,9 +516,9 @@ gi_gst_date_time_from_value, gi_gst_date_time_to_value); pyg_register_gtype_custom (GST_TYPE_FLAG_SET, gi_gst_flag_set_from_value, gi_gst_flag_set_to_value); +#endif pyg_register_gtype_custom (GST_TYPE_BITMASK, gi_gst_bitmask_from_value, gi_gst_bitmask_to_value); -#endif } static int diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gst-python-1.12.2/plugin/gstpythonplugin.c new/gst-python-1.12.3/plugin/gstpythonplugin.c --- old/gst-python-1.12.2/plugin/gstpythonplugin.c 2017-06-20 08:39:26.000000000 +0200 +++ new/gst-python-1.12.3/plugin/gstpythonplugin.c 2017-09-18 15:52:39.000000000 +0200 @@ -208,7 +208,7 @@ static gboolean plugin_init (GstPlugin * plugin) { - PyGILState_STATE state; + PyGILState_STATE state = 0; PyObject *gi, *require_version, *args, *gst, *dict, *pyplugin; gboolean we_initialized = FALSE; GModule *libpython; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gst-python-1.12.2/testsuite/Makefile.am new/gst-python-1.12.3/testsuite/Makefile.am --- old/gst-python-1.12.2/testsuite/Makefile.am 2017-06-20 08:39:26.000000000 +0200 +++ new/gst-python-1.12.3/testsuite/Makefile.am 2017-09-18 15:52:39.000000000 +0200 @@ -3,13 +3,7 @@ # Keep this list sorted! tests = \ test_gst.py \ - test_fraction.py \ - test_intrange.py \ - test_int64range.py \ - test_doublerange.py \ - test_fractionrange.py \ - test_valuearray.py \ - test_valuelist.py + test_types.py EXTRA_DIST = \ __init__.py \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gst-python-1.12.2/testsuite/Makefile.in new/gst-python-1.12.3/testsuite/Makefile.in --- old/gst-python-1.12.2/testsuite/Makefile.in 2017-07-14 12:09:23.000000000 +0200 +++ new/gst-python-1.12.3/testsuite/Makefile.in 2017-09-18 15:56:21.000000000 +0200 @@ -293,13 +293,7 @@ # Keep this list sorted! tests = \ test_gst.py \ - test_fraction.py \ - test_intrange.py \ - test_int64range.py \ - test_doublerange.py \ - test_fractionrange.py \ - test_valuearray.py \ - test_valuelist.py + test_types.py EXTRA_DIST = \ __init__.py \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gst-python-1.12.2/testsuite/test_doublerange.py new/gst-python-1.12.3/testsuite/test_doublerange.py --- old/gst-python-1.12.2/testsuite/test_doublerange.py 2017-06-20 08:39:26.000000000 +0200 +++ new/gst-python-1.12.3/testsuite/test_doublerange.py 1970-01-01 01:00:00.000000000 +0100 @@ -1,58 +0,0 @@ -# -*- 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 - -import gi -gi.require_version("Gst", "1.0") -from gi.repository import Gst -Gst.init(None) - -R = Gst.DoubleRange - -class TestDoubleRange(TestCase): - def testConstructor(self): - Gst.init(None) - - r = R(1.2, 3.4) - self.assertEquals(r.start, 1.2) - self.assertEquals(r.stop, 3.4) - self.assertRaises(TypeError, R, {}, 2) - self.assertRaises(TypeError, R, 2, ()) - self.assertRaises(TypeError, R, 2, 1) - self.assertRaises(TypeError, R) - - def testRepr(self): - Gst.init(None) - - self.assertEquals(repr(R(1,2)), '<Gst.DoubleRange [1.0,2.0]>') - - def testGetValue(self): - Gst.init(None) - - st = Gst.Structure.new_empty("video/x-raw") - st["range"] = R(1,2) - value = st["range"] - - self.failUnlessEqual(value.start, 1.0) - self.failUnlessEqual(value.stop, 2.0) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gst-python-1.12.2/testsuite/test_fraction.py new/gst-python-1.12.3/testsuite/test_fraction.py --- old/gst-python-1.12.2/testsuite/test_fraction.py 2017-06-20 08:39:26.000000000 +0200 +++ new/gst-python-1.12.3/testsuite/test_fraction.py 1970-01-01 01:00:00.000000000 +0100 @@ -1,134 +0,0 @@ -# -*- 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)), '<Gst.Fraction 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("rawvideoparse") - if not obj: - obj = Gst.ElementFactory.make("rawvideoparse") - - if not obj: - # no (raw)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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gst-python-1.12.2/testsuite/test_fractionrange.py new/gst-python-1.12.3/testsuite/test_fractionrange.py --- old/gst-python-1.12.2/testsuite/test_fractionrange.py 2017-06-20 08:39:26.000000000 +0200 +++ new/gst-python-1.12.3/testsuite/test_fractionrange.py 1970-01-01 01:00:00.000000000 +0100 @@ -1,59 +0,0 @@ -# -*- 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 - -import gi -gi.require_version("Gst", "1.0") -from gi.repository import Gst -Gst.init(None) - -R = Gst.FractionRange - -class TestFractionRange(TestCase): - def testConstructor(self): - Gst.init(None) - - r = R(Gst.Fraction(1, 30), Gst.Fraction(1, 2)) - self.assertEquals(r.start, Gst.Fraction(1, 30)) - self.assertEquals(r.stop, Gst.Fraction(1, 2)) - self.assertRaises(TypeError, R, Gst.Fraction(1, 2), Gst.Fraction(1, 30)) - self.assertRaises(TypeError, R, 2, Gst.Fraction(1, 2)) - self.assertRaises(TypeError, R, Gst.Fraction(1, 2), 2) - self.assertRaises(TypeError, R) - - def testRepr(self): - Gst.init(None) - - self.assertEquals(repr(R(Gst.Fraction(1,30), Gst.Fraction(1,2))), - '<Gst.FractionRange [1/30,1/2]>') - - def testGetValue(self): - Gst.init(None) - - st = Gst.Structure.new_empty("video/x-raw") - st["range"] = R(Gst.Fraction(1, 30), Gst.Fraction(1, 2)) - value = st["range"] - - self.failUnlessEqual(value.start, Gst.Fraction(1, 30)) - self.failUnlessEqual(value.stop, Gst.Fraction(1, 2)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gst-python-1.12.2/testsuite/test_gst.py new/gst-python-1.12.3/testsuite/test_gst.py --- old/gst-python-1.12.2/testsuite/test_gst.py 2017-06-20 08:39:26.000000000 +0200 +++ new/gst-python-1.12.3/testsuite/test_gst.py 2017-09-18 15:52:39.000000000 +0200 @@ -76,5 +76,15 @@ Gst.ElementFactory.make("identity", None) +class TestStructure(TestCase): + + def test_new(self): + Gst.init(None) + test = Gst.Structure('test', test=1) + self.assertEqual(test['test'], 1) + + test = Gst.Structure('test,test=1') + self.assertEqual(test['test'], 1) + if __name__ == "__main__": unittest.main() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gst-python-1.12.2/testsuite/test_int64range.py new/gst-python-1.12.3/testsuite/test_int64range.py --- old/gst-python-1.12.2/testsuite/test_int64range.py 2017-06-20 08:39:36.000000000 +0200 +++ new/gst-python-1.12.3/testsuite/test_int64range.py 1970-01-01 01:00:00.000000000 +0100 @@ -1,57 +0,0 @@ -# -*- 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 - -import gi -gi.require_version("Gst", "1.0") -from gi.repository import Gst -Gst.init(None) - -R = Gst.Int64Range - -class TestInt64Range(TestCase): - def testConstructor(self): - Gst.init(None) - - r = R(range(0, 10, 2)) - self.assertEquals(r.range, range(0, 10, 2)) - self.assertRaises(TypeError, R, range(1, 10, 2)) - self.assertRaises(TypeError, R, range(0, 9, 2)) - self.assertRaises(TypeError, R, range(10, 0)) - self.assertRaises(TypeError, R, 1) - self.assertRaises(TypeError, R) - - def testRepr(self): - Gst.init(None) - - self.assertEquals(repr(R(range(0, 10, 2))), '<Gst.Int64Range [0,10,2]>') - - def testGetValue(self): - Gst.init(None) - - st = Gst.Structure.new_empty("video/x-raw") - st["range"] = R(range(0, 10, 2)) - value = st["range"] - - self.failUnlessEqual(value, range(0, 10, 2)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gst-python-1.12.2/testsuite/test_intrange.py new/gst-python-1.12.3/testsuite/test_intrange.py --- old/gst-python-1.12.2/testsuite/test_intrange.py 2017-06-20 08:39:36.000000000 +0200 +++ new/gst-python-1.12.3/testsuite/test_intrange.py 1970-01-01 01:00:00.000000000 +0100 @@ -1,57 +0,0 @@ -# -*- 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 - -import gi -gi.require_version("Gst", "1.0") -from gi.repository import Gst -Gst.init(None) - -R = Gst.IntRange - -class TestIntRange(TestCase): - def testConstructor(self): - Gst.init(None) - - r = R(range(0, 10, 2)) - self.assertEquals(r.range, range(0, 10, 2)) - self.assertRaises(TypeError, R, range(1, 10, 2)) - self.assertRaises(TypeError, R, range(0, 9, 2)) - self.assertRaises(TypeError, R, range(10, 0)) - self.assertRaises(TypeError, R, 1) - self.assertRaises(TypeError, R) - - def testRepr(self): - Gst.init(None) - - self.assertEquals(repr(R(range(0, 10, 2))), '<Gst.IntRange [0,10,2]>') - - def testGetValue(self): - Gst.init(None) - - st = Gst.Structure.new_empty("video/x-raw") - st["range"] = R(range(0, 10, 2)) - value = st["range"] - - self.failUnlessEqual(value, range(0, 10, 2)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gst-python-1.12.2/testsuite/test_types.py new/gst-python-1.12.3/testsuite/test_types.py --- old/gst-python-1.12.2/testsuite/test_types.py 1970-01-01 01:00:00.000000000 +0100 +++ new/gst-python-1.12.3/testsuite/test_types.py 2017-09-18 15:52:39.000000000 +0200 @@ -0,0 +1,399 @@ +# -*- 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 +import unittest, sys + +import gi +gi.require_version("Gst", "1.0") +from gi.repository import Gst +Gst.init(None) + +Gst.DoubleRange = Gst.DoubleRange + +class TestDoubleRange(TestCase): + def testConstructor(self): + Gst.init(None) + + Gst.DoubleRange = Gst.DoubleRange(1.2, 3.4) + self.assertEqual(r.start, 1.2) + self.assertEqual(r.stop, 3.4) + self.assertRaises(TypeError, Gst.DoubleRange, {}, 2) + self.assertRaises(TypeError, Gst.DoubleRange, 2, ()) + self.assertRaises(TypeError, Gst.DoubleRange, 2, 1) + self.assertRaises(TypeError, Gst.DoubleRange) + + def testRepr(self): + Gst.init(None) + + self.assertEqual(repr(Gst.DoubleRange(1,2)), '<Gst.DoubleRange [1.0,2.0]>') + + def testGetValue(self): + Gst.init(None) + + st = Gst.Structure.new_empty("video/x-raw") + st["range"] = Gst.DoubleRange(1,2) + value = st["range"] + + self.assertEqual(value.start, 1.0) + self.assertEqual(value.stop, 2.0) + + +class TestFraction(TestCase): + def testConstructor(self): + Gst.init(None) + + frac = Gst.Fraction(1, 2) + self.assertEqual(frac.num, 1) + self.assertEqual(frac.denom, 2) + + frac = Gst.Fraction(1) + self.assertEqual(frac.num, 1) + self.assertEqual(frac.denom, 1) + + self.assertRaises(TypeError, Gst.Fraction) + + def testRepr(self): + Gst.init(None) + + self.assertEqual(repr(Gst.Fraction(1, 2)), '<Gst.Fraction 1/2>') + + def testEqNe(self): + Gst.init(None) + + frac = Gst.Fraction(1, 2) + self.assertEqual(frac, frac) + self.assertEqual(Gst.Fraction(1, 2), Gst.Fraction(1, 2)) + self.assertEqual(Gst.Fraction(2, 4), Gst.Fraction(1, 2)) + + self.assertNotEqual(Gst.Fraction(1, 3), Gst.Fraction(1, 2)) + self.assertNotEqual(Gst.Fraction(2, 1), Gst.Fraction(1, 2)) + + def testMul(self): + Gst.init(None) + + self.assertEqual(Gst.Fraction(1, 2) * Gst.Fraction(1, 2), Gst.Fraction(1, 4)) + self.assertEqual(Gst.Fraction(2, 3) * Gst.Fraction(4, 5), Gst.Fraction(8, 15)) + self.assertEqual(Gst.Fraction(1, 3) * Gst.Fraction(4), Gst.Fraction(4, 3)) + self.assertEqual(Gst.Fraction(1, 3) * 4, Gst.Fraction(4, 3)) + + def testRMul(self): + Gst.init(None) + + self.assertEqual(2 * Gst.Fraction(1, 2), Gst.Fraction(1)) + self.assertEqual(4 * Gst.Fraction(1, 2), Gst.Fraction(2)) + self.assertEqual(-10 * Gst.Fraction(1, 2), Gst.Fraction(-5)) + + def testDiv(self): + Gst.init(None) + + self.assertEqual(Gst.Fraction(1, 3) / Gst.Fraction(1, 4), Gst.Fraction(4, 3)) + self.assertEqual(Gst.Fraction(2, 3) / Gst.Fraction(4, 5), Gst.Fraction(10, 12)) + + self.assertEqual(Gst.Fraction(1, 3) / Gst.Fraction(4), Gst.Fraction(1, 12)) + self.assertEqual(Gst.Fraction(1, 3) / 4, Gst.Fraction(1, 12)) + self.assertEqual(Gst.Fraction(1, 3) / 2, Gst.Fraction(1, 6)) + self.assertEqual(Gst.Fraction(1, 5) / -4, Gst.Fraction(1, -20)) + + def testRDiv(self): + Gst.init(None) + + self.assertEqual(2 / Gst.Fraction(1, 3), Gst.Fraction(6, 1)) + self.assertEqual(-4 / Gst.Fraction(1, 5), Gst.Fraction(-20, 1)) + + def testFloat(self): + Gst.init(None) + + self.assertEqual(float(Gst.Fraction(1, 2)), 0.5) + + def testPropertyMarshalling(self): + Gst.init(None) + + obj = Gst.ElementFactory.make("rawvideoparse") + if not obj: + obj = Gst.ElementFactory.make("rawvideoparse") + + if not obj: + # no (raw)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.assertEqual(value.num, 25) + self.assertEqual(value.denom, 1) + + obj.props.framerate = Gst.Fraction(2, 1) + value = obj.props.framerate + self.assertEqual(value.num, 2) + self.assertEqual(value.denom, 1) + + def bad(): + obj.props.framerate = 1 + self.assertRaises(TypeError, bad) + + value = obj.props.framerate + self.assertEqual(value.num, 2) + self.assertEqual(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.assertEqual(value.num, 10) + self.assertEqual(value.denom, 1) + + +class TestFractionRange(TestCase): + def testConstructor(self): + Gst.init(None) + + r = Gst.FractionRange(Gst.Fraction(1, 30), Gst.Fraction(1, 2)) + self.assertEqual(r.start, Gst.Fraction(1, 30)) + self.assertEqual(r.stop, Gst.Fraction(1, 2)) + self.assertRaises(TypeError, Gst.FractionRange, Gst.Fraction(1, 2), Gst.Fraction(1, 30)) + self.assertRaises(TypeError, Gst.FractionRange, 2, Gst.Fraction(1, 2)) + self.assertRaises(TypeError, Gst.FractionRange, Gst.Fraction(1, 2), 2) + self.assertRaises(TypeError, Gst.FractionRange) + + def testRepr(self): + Gst.init(None) + + self.assertEqual(repr(Gst.FractionRange(Gst.Fraction(1,30), Gst.Fraction(1,2))), + '<Gst.FractionRange [1/30,1/2]>') + + def testGetValue(self): + Gst.init(None) + + st = Gst.Structure.new_empty("video/x-raw") + st["range"] = Gst.FractionRange(Gst.Fraction(1, 30), Gst.Fraction(1, 2)) + value = st["range"] + + self.assertEqual(value.start, Gst.Fraction(1, 30)) + self.assertEqual(value.stop, Gst.Fraction(1, 2)) + +class TestDoubleRange(TestCase): + def testConstructor(self): + Gst.init(None) + + r = Gst.DoubleRange(1.2, 3.4) + self.assertEqual(r.start, 1.2) + self.assertEqual(r.stop, 3.4) + self.assertRaises(TypeError, Gst.DoubleRange, {}, 2) + self.assertRaises(TypeError, Gst.DoubleRange, 2, ()) + self.assertRaises(TypeError, Gst.DoubleRange, 2, 1) + self.assertRaises(TypeError, Gst.DoubleRange) + + def testRepr(self): + Gst.init(None) + + self.assertEqual(repr(Gst.DoubleRange(1,2)), '<Gst.DoubleRange [1.0,2.0]>') + + def testGetValue(self): + Gst.init(None) + + st = Gst.Structure.new_empty("video/x-raw") + st["range"] = Gst.DoubleRange(1,2) + value = st["range"] + + self.assertEqual(value.start, 1.0) + self.assertEqual(value.stop, 2.0) + + +class TestInt64Range(TestCase): + @unittest.skipUnless(sys.version_info >= (3, 0), "requires Python 3") + def testConstructor(self): + Gst.init(None) + + r = Gst.Int64Range(range(0, 10, 2)) + self.assertEqual(r.range, range(0, 10, 2)) + self.assertRaises(TypeError, Gst.Int64Range, range(1, 10, 2)) + self.assertRaises(TypeError, Gst.Int64Range, range(0, 9, 2)) + self.assertRaises(TypeError, Gst.Int64Range, range(10, 0)) + self.assertRaises(TypeError, Gst.Int64Range, 1) + self.assertRaises(TypeError, Gst.Int64Range) + + @unittest.skipUnless(sys.version_info >= (3, 0), "requires Python 3") + def testRepr(self): + Gst.init(None) + + self.assertEqual(repr(Gst.Int64Range(range(0, 10, 2))), '<Gst.Int64Range [0,10,2]>') + + @unittest.skipUnless(sys.version_info >= (3, 0), "requires Python 3") + def testGetValue(self): + Gst.init(None) + + st = Gst.Structure.new_empty("video/x-raw") + st["range"] = Gst.Int64Range(range(0, 10, 2)) + value = st["range"] + + self.assertEqual(value, range(0, 10, 2)) + + +class TestValueArray(TestCase): + def testConstructor(self): + Gst.init(None) + + a = Gst.ValueArray((1,2,3)) + self.assertEqual(a.array, [1,2,3]) + + self.assertRaises(TypeError, Gst.ValueArray, 1) + self.assertRaises(TypeError, Gst.ValueArray) + + def testRepr(self): + Gst.init(None) + + self.assertEqual(repr(Gst.ValueArray([1,2,3])), '<Gst.ValueArray <1,2,3>>') + + def testPropertyMarshalling(self): + Gst.init(None) + + obj = Gst.ElementFactory.make("rawvideoparse") + + if not obj: + # no rawvideoparse and I don't know of any elements in core or -base using + # fraction properties. Skip this test. + return + + value = obj.props.plane_strides + self.assertEqual(value[0], 320) + self.assertEqual(value[1], 160) + self.assertEqual(value[2], 160) + + obj.props.plane_strides = Gst.ValueArray([640,320,320]) + + value = obj.props.plane_strides + self.assertEqual(value[0], 640) + self.assertEqual(value[1], 320) + self.assertEqual(value[2], 320) + + def bad(): + obj.props.plane_strides = 1 + self.assertRaises(TypeError, bad) + + value = obj.props.plane_strides + self.assertEqual(value[0], 640) + self.assertEqual(value[1], 320) + self.assertEqual(value[2], 320) + + def testGetValue(self): + Gst.init(None) + + st = Gst.Structure.new_empty("video/x-raw") + st["array"] = Gst.ValueArray([Gst.Fraction(1, 30), Gst.Fraction(1, 2)]) + value = st["array"] + st["array"] = Gst.ValueArray(value) + + self.assertEqual(value[0], Gst.Fraction(1, 30)) + self.assertEqual(value[1], Gst.Fraction(1, 2)) + + st["matrix"] = Gst.ValueArray([Gst.ValueArray([0, 1]), Gst.ValueArray([-1, 0])]) + value = st["matrix"] + + self.assertEqual(value[0][0], 0) + self.assertEqual(value[0][1], 1) + self.assertEqual(value[1][0], -1) + self.assertEqual(value[1][1], 0) + + +class TestValueList(TestCase): + def testConstructor(self): + Gst.init(None) + + a = Gst.ValueList((1,2,3)) + self.assertEqual(a.array, [1,2,3]) + + self.assertRaises(TypeError, Gst.ValueList, 1) + self.assertRaises(TypeError, Gst.ValueList) + + def testRepr(self): + Gst.init(None) + + self.assertEqual(repr(Gst.ValueList([1,2,3])), '<Gst.ValueList {1,2,3}>') + + def testGetValue(self): + Gst.init(None) + + st = Gst.Structure.new_empty("video/x-raw") + st["framerate"] = Gst.ValueList([Gst.Fraction(1, 30), Gst.Fraction(1, 2)]) + value = st["framerate"] + + self.assertEqual(value[0], Gst.Fraction(1, 30)) + self.assertEqual(value[1], Gst.Fraction(1, 2)) + + st["matrix"] = Gst.ValueList([Gst.ValueList([0, 1]), Gst.ValueList([-1 ,0])]) + value = st["matrix"] + + self.assertEqual(value[0][0], 0) + self.assertEqual(value[0][1], 1) + self.assertEqual(value[1][0], -1) + self.assertEqual(value[1][1], 0) + +class TestIntRange(TestCase): + @unittest.skipUnless(sys.version_info >= (3, 0), "requires Python 3") + def testConstructor(self): + Gst.init(None) + + r = Gst.IntRange(range(0, 10, 2)) + self.assertEqual(r.range, range(0, 10, 2)) + self.assertRaises(TypeError, Gst.IntRange, range(1, 10, 2)) + self.assertRaises(TypeError, Gst.IntRange, range(0, 9, 2)) + self.assertRaises(TypeError, Gst.IntRange, range(10, 0)) + self.assertRaises(TypeError, Gst.IntRange, 1) + self.assertRaises(TypeError, Gst.IntRange) + + @unittest.skipUnless(sys.version_info >= (3, 0), "requires Python 3") + def testRepr(self): + Gst.init(None) + + self.assertEqual(repr(Gst.IntRange(range(0, 10, 2))), '<Gst.IntRange [0,10,2]>') + + @unittest.skipUnless(sys.version_info >= (3, 0), "requires Python 3") + def testGetValue(self): + Gst.init(None) + + st = Gst.Structure.new_empty("video/x-raw") + st["range"] = Gst.IntRange(range(0, 10, 2)) + value = st["range"] + + self.assertEqual(value, range(0, 10, 2)) + + +class TestBitmask(TestCase): + def testConstructor(self): + Gst.init(None) + + r = Gst.Bitmask(1 << 5) + self.assertEqual(r, 1 << 5) + + def testGetValue(self): + Gst.init(None) + + self.assertEqual(Gst.Structure('test,test=(bitmask)0x20')['test'], 1 << 5) + + def testStr(self): + Gst.init(None) + + r = Gst.Bitmask(1 << 5) + self.assertEqual(str(r), '0x20') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gst-python-1.12.2/testsuite/test_valuearray.py new/gst-python-1.12.3/testsuite/test_valuearray.py --- old/gst-python-1.12.2/testsuite/test_valuearray.py 2017-06-20 08:39:26.000000000 +0200 +++ new/gst-python-1.12.3/testsuite/test_valuearray.py 1970-01-01 01:00:00.000000000 +0100 @@ -1,99 +0,0 @@ -# -*- 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 - -import gi -gi.require_version("Gst", "1.0") -from gi.repository import Gst -Gst.init(None) - -A = Gst.ValueArray - -class TestFraction(TestCase): - def testConstructor(self): - Gst.init(None) - - a = A((1,2,3)) - self.assertEquals(a.array, [1,2,3]) - - self.assertRaises(TypeError, A, 1) - self.assertRaises(TypeError, A) - - def testRepr(self): - Gst.init(None) - - self.assertEquals(repr(A([1,2,3])), '<Gst.ValueArray <1,2,3>>') - - def testPropertyMarshalling(self): - Gst.init(None) - - obj = Gst.ElementFactory.make("rawvideoparse") - - if not obj: - # no rawvideoparse and I don't know of any elements in core or -base using - # fraction properties. Skip this test. - return - - value = obj.props.plane_strides - self.failUnlessEqual(value[0], 320) - self.failUnlessEqual(value[1], 160) - self.failUnlessEqual(value[2], 160) - - obj.props.plane_strides = A([640,320,320]) - - value = obj.props.plane_strides - self.failUnlessEqual(value[0], 640) - self.failUnlessEqual(value[1], 320) - self.failUnlessEqual(value[2], 320) - - def bad(): - obj.props.plane_strides = 1 - self.failUnlessRaises(TypeError, bad) - - value = obj.props.plane_strides - self.failUnlessEqual(value[0], 640) - self.failUnlessEqual(value[1], 320) - self.failUnlessEqual(value[2], 320) - - def testGetValue(self): - Gst.init(None) - - st = Gst.Structure.new_empty("video/x-raw") - st["array"] = A([Gst.Fraction(1, 30), Gst.Fraction(1, 2)]) - value = st["array"] - st["array"] = A(value) - - self.failUnlessEqual(value[0], Gst.Fraction(1, 30)) - self.failUnlessEqual(value[1], Gst.Fraction(1, 2)) - - st["matrix"] = A([A([0, 1]), A([-1, 0])]) - value = st["matrix"] - - self.failUnlessEqual(value[0][0], 0) - self.failUnlessEqual(value[0][1], 1) - self.failUnlessEqual(value[1][0], -1) - self.failUnlessEqual(value[1][1], 0) - - - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gst-python-1.12.2/testsuite/test_valuelist.py new/gst-python-1.12.3/testsuite/test_valuelist.py --- old/gst-python-1.12.2/testsuite/test_valuelist.py 2017-06-20 08:39:26.000000000 +0200 +++ new/gst-python-1.12.3/testsuite/test_valuelist.py 1970-01-01 01:00:00.000000000 +0100 @@ -1,64 +0,0 @@ -# -*- 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 - -import gi -gi.require_version("Gst", "1.0") -from gi.repository import Gst -Gst.init(None) - -L = Gst.ValueList - -class TestFraction(TestCase): - def testConstructor(self): - Gst.init(None) - - a = L((1,2,3)) - self.assertEquals(a.array, [1,2,3]) - - self.assertRaises(TypeError, L, 1) - self.assertRaises(TypeError, L) - - def testRepr(self): - Gst.init(None) - - self.assertEquals(repr(L([1,2,3])), '<Gst.ValueList {1,2,3}>') - - def testGetValue(self): - Gst.init(None) - - st = Gst.Structure.new_empty("video/x-raw") - st["framerate"] = L([Gst.Fraction(1, 30), Gst.Fraction(1, 2)]) - value = st["framerate"] - - self.failUnlessEqual(value[0], Gst.Fraction(1, 30)) - self.failUnlessEqual(value[1], Gst.Fraction(1, 2)) - - st["matrix"] = L([L([0, 1]), L([-1 ,0])]) - value = st["matrix"] - - self.failUnlessEqual(value[0][0], 0) - self.failUnlessEqual(value[0][1], 1) - self.failUnlessEqual(value[1][0], -1) - self.failUnlessEqual(value[1][1], 0)
