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.
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.
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.
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.
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
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
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.