mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
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).
This commit is contained in:
parent
c4d785bc7b
commit
d66033a19c
1 changed files with 12 additions and 0 deletions
|
@ -1622,3 +1622,15 @@ _wrap_gst_pad_start_task(PyGObject *self, PyObject *args)
|
||||||
Py_INCREF(py_ret);
|
Py_INCREF(py_ret);
|
||||||
return py_ret;
|
return py_ret;
|
||||||
}
|
}
|
||||||
|
%%
|
||||||
|
override gst_static_pad_template_get_caps noargs
|
||||||
|
static PyObject *
|
||||||
|
_wrap_gst_static_pad_template_get_caps(PyObject *self)
|
||||||
|
{
|
||||||
|
GstCaps *ret;
|
||||||
|
|
||||||
|
ret = gst_static_pad_template_get_caps(pyg_pointer_get(self, GstStaticPadTemplate));
|
||||||
|
/* We take a copy of the caps so they don't disappear */
|
||||||
|
ret = gst_caps_copy(ret);
|
||||||
|
return pyg_boxed_new (GST_TYPE_CAPS, ret, FALSE, TRUE);
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue