Thibault Saunier [Fri, 14 Aug 2020 23:43:41 +0000 (19:43 -0400)]
overrides: Fix buffer API break
When introducing zero copy buffers/memory mapping we broke the API,
this brings back the exact same API as before for all the previously
handled cases but still raises an exception when using a context
to map buffers.
Fixes https://gitlab.freedesktop.org/gstreamer/gst-python/-/issues/40
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-python/-/merge_requests/39>
Jose Quaresma [Fri, 8 May 2020 21:01:50 +0000 (22:01 +0100)]
overrides: memory and buffer unmap code can be shared
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-python/-/merge_requests/35>
Jose Quaresma [Fri, 8 May 2020 20:25:03 +0000 (21:25 +0100)]
overrides: _remap: refactor to avoid memory leaks with PyObject
- unref PyObject on exit with Py_XDECREF
- better error handling
- free memory view in case of erros
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-python/-/merge_requests/34>
Jose Quaresma [Sun, 14 Jun 2020 15:54:28 +0000 (16:54 +0100)]
Gst.py: raise an error if we can't unmap the memory
Jose Quaresma [Sun, 14 Jun 2020 15:48:45 +0000 (16:48 +0100)]
Gst.py: unref __parent__ on unmap otherwise it cause a memory leak
Jose Quaresma [Sun, 14 Jun 2020 15:34:50 +0000 (16:34 +0100)]
overrides: fix memory leak in pyg_boxed_new
pyg_boxed_new cause a memory leak if it hold a copy of the boxed wrapper and freed when the wrapper is deallocated.
use the boxed wrapper value itself and don't hold a copy of the value.
Tim-Philipp Müller [Fri, 3 Jul 2020 01:04:10 +0000 (02:04 +0100)]
Back to development
Tim-Philipp Müller [Thu, 2 Jul 2020 23:36:19 +0000 (00:36 +0100)]
Release 1.17.2
Tim-Philipp Müller [Fri, 19 Jun 2020 23:28:33 +0000 (00:28 +0100)]
Back to development
Tim-Philipp Müller [Fri, 19 Jun 2020 18:26:52 +0000 (19:26 +0100)]
Release 1.17.1
Thibault Saunier [Mon, 16 Mar 2020 17:04:35 +0000 (14:04 -0300)]
Add an example to record audio
Andoni Morales Alastruey [Tue, 12 Nov 2019 23:52:04 +0000 (00:52 +0100)]
Fix configure python lib detection in macOS
pylib_loc = python.get_variable('LIBPL', '') alreay returns
the correct path for python's library dir
Mathieu Duponchelle [Wed, 26 Feb 2020 12:53:17 +0000 (13:53 +0100)]
gstmodule: Fix reference counts of Py_True and Py_False
When returning those values, extensions must take a new reference.
Fixes #33
Guillaume Desmottes [Tue, 7 Jan 2020 12:46:51 +0000 (18:16 +0530)]
testsuite: remove cleanup
It's no longer used.
Olivier Crête [Sun, 21 May 2017 15:03:48 +0000 (17:03 +0200)]
test: Add test for the plugin loader
Fix #8
Olivier Crête [Sun, 21 May 2017 14:56:16 +0000 (16:56 +0200)]
plugin: Also look at GST_PLUGIN_PATH_1_0
Thibault Saunier [Tue, 10 Dec 2019 19:59:16 +0000 (16:59 -0300)]
Do not declare mix declaration and code
Sebastian Dröge [Fri, 13 Dec 2019 08:46:20 +0000 (10:46 +0200)]
Fix build with Python 3.8 by also checking for python-3.X-embed.pc
Since Python 3.8 the normal checks don't include the Python libraries
anymore and linking of the gst-python module would fail.
See also https://github.com/mesonbuild/meson/issues/5629
Fixes https://gitlab.freedesktop.org/gstreamer/gst-python/issues/28
Thibault Saunier [Wed, 11 Dec 2019 11:14:16 +0000 (08:14 -0300)]
example: Use do_fill in AudioTestSrc instead of do_create
With the new mapping API we can efficiently use the ->fill vmethod
which is sensibly better.
Thibault Saunier [Tue, 10 Dec 2019 14:58:01 +0000 (11:58 -0300)]
Subclass Exception for mapping and unmapping errors
And minor cleanup in the way errors are handled
Philipp Zabel [Thu, 17 Oct 2019 15:31:41 +0000 (17:31 +0200)]
tests: Add buffer map/unmap tests
Daniel Klamt [Fri, 5 Apr 2019 13:58:38 +0000 (15:58 +0200)]
Changes the mapinfo so that the mapped data is writable
The Problem is, that in the current state it is not easily possible to
edit the buffer data in a gstreamer python element since you get a copy
of the real buffer.
This patch overrides the mapinfo and the function generating it in a way
so that mapinfo.data is now a memoryview pointing to the real buffer.
Depending on the flags given for this buffer the memoryview is r/w.
Thibault Saunier [Thu, 28 Nov 2019 13:18:44 +0000 (10:18 -0300)]
python: Fix type type qualifiers issues
Thibault Saunier [Tue, 19 Nov 2019 13:07:09 +0000 (10:07 -0300)]
Remove python2 support
We have notified application developers this would happen a long time
ago and python2 is going to be deprecated very soon now, before 1.18
is going to be released.
Tim-Philipp Müller [Mon, 14 Oct 2019 18:08:47 +0000 (19:08 +0100)]
Remove autotools build
Mathieu Duponchelle [Mon, 2 Sep 2019 16:11:56 +0000 (18:11 +0200)]
overrides: fix callback setter overrides (bis)
The previous commit broke those by trying to pass weak refs
through pygobject, but we should probably have tested the elements
beyond instantiation: weakref.WeakMethod returns a callable, but
that callable when called only returns the ephemeral bound method,
which is the object we want to call, but pygobject has no support
for that.
Instead, fix the memory leaks we were going after by decoupling the
lifecycle of the callback and that of the pad, by passing functors
to pygobject.
Mathieu Duponchelle [Thu, 8 Aug 2019 23:03:17 +0000 (01:03 +0200)]
overrides: fix callback setter overrides
Use weakref to avoid leaks, and remove refcount hack as the actual
issue has been fixed in pygobject
Thibault Saunier [Wed, 7 Aug 2019 22:23:50 +0000 (18:23 -0400)]
suppr: Add a supression on wrong jump in python from fedora 30
Mathieu Duponchelle [Sun, 26 May 2019 14:20:08 +0000 (16:20 +0200)]
meson: expose plugins variable
Thibault Saunier [Mon, 6 May 2019 15:29:53 +0000 (11:29 -0400)]
override Element before Bin so we can access element fields of bins
And add a test
See https://gitlab.gnome.org/GNOME/pygobject/issues/325
Mathieu Duponchelle [Wed, 10 Apr 2019 22:42:49 +0000 (00:42 +0200)]
Gst.py: add high-level helpers
Tim-Philipp Müller [Fri, 19 Apr 2019 09:42:45 +0000 (10:42 +0100)]
Back to development
Tim-Philipp Müller [Thu, 18 Apr 2019 23:37:16 +0000 (00:37 +0100)]
Release 1.16.0
Luis de Bethencourt [Thu, 11 Apr 2019 19:00:15 +0000 (15:00 -0400)]
Update TODO
Tim-Philipp Müller [Wed, 10 Apr 2019 23:38:39 +0000 (00:38 +0100)]
Release 1.15.90
Tim-Philipp Müller [Mon, 4 Mar 2019 09:15:26 +0000 (09:15 +0000)]
Back to development
Tim-Philipp Müller [Tue, 26 Feb 2019 12:00:58 +0000 (12:00 +0000)]
Release 1.15.2
Thibault Saunier [Wed, 30 Jan 2019 18:45:21 +0000 (15:45 -0300)]
Gst.init() has to be called before GstPbutils is imported
This makes sure that we do not try to use GstPbutils before Gst is init
and in case GstPbutils is imported while Gst is not imported, use the
`GstPbutils.pb_utils_init()` function to have the oportunity to
initialize the overrides.
Not that we also introduce a `GstPbutils.init()` variant because
`GstPbutils.pb_utils_init()` is an ugly name.
Thibault Saunier [Tue, 22 Jan 2019 19:59:02 +0000 (16:59 -0300)]
meson: Re add workarounds to detect libpython path
This was removed all together in
af4ade37435fcc31c8489f4d7c7496fef5f74b05
"meson: use new python module".
And add `-Dlibpython-dir` option for the cases the logic fails.
Tim-Philipp Müller [Thu, 17 Jan 2019 02:33:52 +0000 (02:33 +0000)]
Release 1.15.1
Antonio Ospite [Wed, 9 Jan 2019 10:39:19 +0000 (11:39 +0100)]
overrides: add a set_caps() method to the Pad override
The C API provides the gst_pad_set_caps() helper which makes it easier
to set caps on pads (see gst/gstcompat.h in gstreamer core).
Add such handy helper to the python bindings too.
The implementation follows as close as possible the one in gstcompat.h
with two changes:
1. the type check on the pad has been removed because self is
guaranteed to be a Gst.Pad in python.
2. the null check on the caps has been extended to be a type check.
Fixes https://gitlab.freedesktop.org/gstreamer/gst-python/issues/19
Tim-Philipp Müller [Sun, 30 Dec 2018 23:53:03 +0000 (23:53 +0000)]
autogen.sh: update to match updated common submodule
Unbreaks the autotools build and fixes #15.
Tim-Philipp Müller [Sat, 15 Dec 2018 13:55:07 +0000 (13:55 +0000)]
Fix indentation of .c files
Required to make gst-indent linter on CI happy.
Thibault Saunier [Wed, 5 Dec 2018 21:43:06 +0000 (18:43 -0300)]
Update common submodule
Jordan Petridis [Mon, 12 Nov 2018 11:26:58 +0000 (13:26 +0200)]
Add Gitlab CI configuration
This commit adds a .gitlab-ci.yml file, which uses a feature
to fetch the config from a centralized repository. The intent is
to have all the gstreamer modules use the same configuration.
The configuration is currently hosted at the gst-ci repository
under the gitlab/ci_template.yml path.
Part of https://gitlab.freedesktop.org/gstreamer/gstreamer-project/issues/29
Matthew Waters [Mon, 5 Nov 2018 05:51:05 +0000 (05:51 +0000)]
Update git locations to gitlab
Mathieu Duponchelle [Wed, 31 Oct 2018 16:02:24 +0000 (17:02 +0100)]
Tests: the sys.meta_path trick does not work for python2
Instead, for python2 revert to manipulating gi.overrides.__path__
Mathieu Duponchelle [Tue, 30 Oct 2018 23:41:31 +0000 (00:41 +0100)]
Tests: refactor testing approach
Instead of fiddling with sys.path, we instead use a custom
sys.meta_path importer
Mathieu Duponchelle [Sun, 28 Oct 2018 16:52:33 +0000 (17:52 +0100)]
meson: address python module port comments
Havard Graff [Mon, 14 May 2018 08:05:15 +0000 (10:05 +0200)]
meson: use new python module
This patch makes the tests pass running uninstalled and installed, with
python2 and python3 on linux, windows and osx.
The main gist is to use the new python-module to do the lifting done
by pythondetector, and with that add support for python2 and windows.
Mathieu Duponchelle [Sun, 28 Oct 2018 16:51:44 +0000 (17:51 +0100)]
automake: remove __init__.py's
Mathieu Duponchelle [Sun, 28 Oct 2018 13:14:09 +0000 (14:14 +0100)]
Remove __init__.py files
They were not installed, and were simply used for our
uninstalled setup, which we now implement differently.
Mathieu Duponchelle [Sat, 27 Oct 2018 16:04:11 +0000 (18:04 +0200)]
meson: add pygobject fallback
Mathieu Duponchelle [Sun, 29 Jul 2018 18:06:09 +0000 (20:06 +0200)]
Examples: add audiotestsrc plugin example
Mathieu Duponchelle [Sun, 29 Jul 2018 18:00:43 +0000 (20:00 +0200)]
Examples: add audioplot plugin example
Mathieu Duponchelle [Sun, 29 Jul 2018 17:51:34 +0000 (19:51 +0200)]
Examples: add mixer plugin example
Mathieu Duponchelle [Fri, 20 Jul 2018 15:00:22 +0000 (17:00 +0200)]
examples: add a dynamic pipeline example
Mathieu Duponchelle [Fri, 20 Jul 2018 13:58:35 +0000 (15:58 +0200)]
helloworld: fix typo
Havard Graff [Tue, 20 Mar 2018 07:54:24 +0000 (08:54 +0100)]
gstmodule: fix warning when building against python2
PyMapping_GetItemString’ discards ‘const’ qualifier from pointer target type
https://bugzilla.gnome.org/show_bug.cgi?id=796093
Tim-Philipp Müller [Tue, 1 May 2018 14:01:11 +0000 (15:01 +0100)]
Fix distcheck
Tim-Philipp Müller [Tue, 1 May 2018 11:08:54 +0000 (12:08 +0100)]
meson: drop config.h.meson template
Thibault Saunier [Wed, 25 Apr 2018 18:11:31 +0000 (15:11 -0300)]
Bump pygobject dependency to 3.8
Emilio Pozuelo Monfort [Wed, 25 Apr 2018 17:47:19 +0000 (19:47 +0200)]
overrides: use get_introspection_module
https://bugzilla.gnome.org/show_bug.cgi?id=795555
Thibault Saunier [Sun, 8 Apr 2018 00:46:07 +0000 (21:46 -0300)]
overrides: Fix mixup between query function and chain one
Tim-Philipp Müller [Tue, 3 Apr 2018 12:28:16 +0000 (13:28 +0100)]
Dist autogen.sh and configure.ac
Tim-Philipp Müller [Tue, 20 Mar 2018 10:27:38 +0000 (10:27 +0000)]
Back to development
Tim-Philipp Müller [Mon, 19 Mar 2018 20:29:28 +0000 (20:29 +0000)]
Release 1.14.0
Tim-Philipp Müller [Tue, 13 Mar 2018 19:31:04 +0000 (19:31 +0000)]
Release 1.13.91
Tim-Philipp Müller [Sat, 3 Mar 2018 22:55:56 +0000 (22:55 +0000)]
Release 1.13.90
Edward Hervey [Fri, 23 Feb 2018 13:40:37 +0000 (14:40 +0100)]
configure.ac: Don't use runtime location of overrides by default
If someone wants to put the overrides in a non-standard location,
they can use the --with-pygi-overrides-dir option.
The default is to put them in ${pyexecdir}/gi/overrides
Fixes make distcheck
https://bugzilla.gnome.org/show_bug.cgi?id=793756
Nicolas Dufresne [Sun, 18 Feb 2018 15:00:48 +0000 (10:00 -0500)]
makefiles: Add missing dist files
https://bugzilla.gnome.org/show_bug.cgi?id=793560
Thibault Saunier [Thu, 22 Feb 2018 11:05:24 +0000 (08:05 -0300)]
bitmask: Do not use long() directly with python3
It doesn't exist anymore there
Thibault Saunier [Mon, 25 Sep 2017 00:43:49 +0000 (21:43 -0300)]
gi: Check Gst has not been initialized before loading bindings
It can have been initialized by some C code (in a C app with plugins
for example).
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=788088
Sebastian Dröge [Thu, 22 Feb 2018 09:58:48 +0000 (10:58 +0100)]
Allow Bitmask to be created from ints and longs but always store as long
We need a 64 bit integer, and previously the test failed because it was
already created from longs in various cases (e.g. when reading from a
GstStructure).
Tim-Philipp Müller [Thu, 15 Feb 2018 19:44:33 +0000 (19:44 +0000)]
Back to development
Mathieu Duponchelle [Thu, 15 Feb 2018 19:08:38 +0000 (20:08 +0100)]
overrides: accept Gst.Structure in Caps.__new__
Also rename misleading parameter (*kwargs -> *args)
https://bugzilla.gnome.org/show_bug.cgi?id=793493
Tim-Philipp Müller [Thu, 15 Feb 2018 17:24:36 +0000 (17:24 +0000)]
Release 1.13.1
Sebastian Dröge [Wed, 14 Feb 2018 08:13:36 +0000 (10:13 +0200)]
Print Python version after initialization
Sebastian Dröge [Wed, 14 Feb 2018 08:10:39 +0000 (10:10 +0200)]
pluginloader: Print Python library path that is tried to be loaded
Sebastian Dröge [Tue, 23 Jan 2018 17:32:18 +0000 (19:32 +0200)]
Ship meson build system in autotools generated tarballs
Thibault Saunier [Tue, 1 Aug 2017 13:57:57 +0000 (09:57 -0400)]
meson: Fix detection of overrides path in some cases
Thibault Saunier [Sun, 30 Jul 2017 03:05:22 +0000 (23:05 -0400)]
plugin: Always initialize GIL state
gcc warns about possibly unintialized use of it
(even if it can't actually happen)
Thibault Saunier [Tue, 25 Jul 2017 20:18:26 +0000 (16:18 -0400)]
Fix simply running testsuite in meson
- Make sure to never have root folder in sys.path when running meson,
as pythondetector won't be able to access gi._overridesdir
- Generate a mesonconfig.py file that will be used by the testsuite to
know where meson generated files, making `python -m unittest` working.
Thibault Saunier [Tue, 25 Jul 2017 20:17:54 +0000 (16:17 -0400)]
Add support for Gst.Bitmask
Thibault Saunier [Tue, 25 Jul 2017 18:35:01 +0000 (14:35 -0400)]
tests: Stop using deprecated assertion methods
Thibault Saunier [Tue, 25 Jul 2017 18:29:19 +0000 (14:29 -0400)]
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.
Thibault Saunier [Tue, 25 Jul 2017 17:00:08 +0000 (13:00 -0400)]
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.
Thibault Saunier [Mon, 24 Jul 2017 21:06:06 +0000 (17:06 -0400)]
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.
Thibault Saunier [Mon, 24 Jul 2017 16:13:13 +0000 (12:13 -0400)]
structures: Override __new__ to make it more pythonic
Olivier Crête [Sun, 21 May 2017 16:06:25 +0000 (18:06 +0200)]
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
Olivier Crête [Sun, 21 May 2017 11:16:02 +0000 (13:16 +0200)]
pythonplugin: Rename plugin file to match plugin name
This is required by the new loader macro.
Sebastian Dröge [Thu, 4 May 2017 16:00:37 +0000 (19:00 +0300)]
Back to development
Sebastian Dröge [Thu, 4 May 2017 12:40:29 +0000 (15:40 +0300)]
Release 1.12.0
Sebastian Dröge [Thu, 27 Apr 2017 14:37:36 +0000 (17:37 +0300)]
Release 1.11.91
Sebastian Dröge [Fri, 7 Apr 2017 13:35:42 +0000 (16:35 +0300)]
Release 1.11.90
Nicolas Dufresne [Mon, 27 Mar 2017 18:59:24 +0000 (14:59 -0400)]
array/list: Make gvalue conversion symmetric
This is needed to support matrix. Otherwise, getting
a matrix would remove the rows envelopess, which would
make the "cast" fails, since it would not know if the
internal rows are ValueArray or ValueList. I think reading,
modifying and setting back the matrix is an important use
case.
Nicolas Dufresne [Mon, 27 Mar 2017 18:52:24 +0000 (14:52 -0400)]
gstmodule: Factor out gst type creation
This reduces a lot the boiler plate all over. At the same
time, use N instead of O when passing PyObject to fix
the objects leaks.
Nicolas Dufresne [Fri, 24 Mar 2017 17:28:35 +0000 (13:28 -0400)]
Add /build and install to the gitignore
Nicolas Dufresne [Thu, 23 Mar 2017 16:21:32 +0000 (12:21 -0400)]
overrides: Add more GstValue overrides
This patch adds overrides to support IntRange, Int64Range, DoubleRange,
FractionRange, Array and List. For integer ranges, it maps this
to python 'range'. Gst.IntRange() and Gst.Int64Range() are simple cast
to let the underlying code know which GType to use. To set such range in
python you will do:
structure["range"] = Gst.IntRange(range(0,10,2)))
Same for the 64 bit variant. And when you do:
r = structure.get_value("range")
A range will be returned directly, without the wrapper. For DoubleRange
and FractionRange, there is no native support in python. So the usage
will be:
structure["range"] = Gst.DoubleRange(0,10.0)
structure["range"] =
Gst.FractionRange(Gst.Fraction(1/30), Gst.Fraction(1/5)
When getting this value, Gst.DoubleRange and Gst.FractionRange class are
returned. They both have start/stop members. The naming was taken from
range type.
For Array and List, both uses the native list type, though they can be
constructed from any python sequence. So again, the class is just like
a cast, to let it pick the right GType and python list are being
returned.
structure["list"] = Gst.ValueList([1,2,3,4])
structure["array"] = Gst.ValueArray([1,2,3,4)
Using string and tuple could also work. Since Gst.ValueList/Array are
sequence, you can convert one to the other with:
list = Gst.ValueList([1,2,3,4])
array = Gst.ValueArray (list)
https://bugzilla.gnome.org/show_bug.cgi?id=753754
Thibault Saunier [Thu, 23 Mar 2017 15:09:05 +0000 (12:09 -0300)]
meson: Install in gi._overidesdir only if we are installing in right prefix
And make sure python detector did not fail
https://bugzilla.gnome.org/show_bug.cgi?id=780369