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).
Py_INCREF(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);
+}