diff --git a/ChangeLog b/ChangeLog index 6c89875b26..7bdf5df30e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2006-06-14 Edward Hervey + + * gst/gst-types.defs: + Added fields for GstPadTemplate. + * gst/gst.defs: + Made gst_element_class_get_template_list a GstElement method. + * gst/gstelement.override: + Override for gst.Element.get_template_list() + * gst/gstpad.override: + Override getter for GstStaticPadTemplate.static_caps so that it uses + the correct pointer. + 2006-06-13 Edward Hervey * testsuite/gstpython.supp: diff --git a/gst/gst-types.defs b/gst/gst-types.defs index 1ac899410f..3d51f2e338 100644 --- a/gst/gst-types.defs +++ b/gst/gst-types.defs @@ -66,6 +66,12 @@ (parent "GstObject") (c-name "GstPadTemplate") (gtype-id "GST_TYPE_PAD_TEMPLATE") + (fields + '("const-gchar*" "name_template") + '("GstPadDirection" "direction") + '("GstPadPresence" "presence") + '("GstCaps*" "caps") + ) ) (define-object Pipeline diff --git a/gst/gst.defs b/gst/gst.defs index eebbbeef36..0521f16cb0 100644 --- a/gst/gst.defs +++ b/gst/gst.defs @@ -968,9 +968,10 @@ ) ) +; 14 Jun 06 - Changed to be a method on elements and not classes - bilboed (define-method get_pad_template_list - (of-object "GstElementClass") - (c-name "gst_element_class_get_pad_template_list") + (of-object "GstElement") + (c-name "gst_element_get_pad_template_list") (return-type "GList*") ) diff --git a/gst/gstelement.override b/gst/gstelement.override index ec8a219cbf..41a51aa0ce 100644 --- a/gst/gstelement.override +++ b/gst/gstelement.override @@ -490,3 +490,29 @@ _wrap_gst_element_tp_iter(PyGObject *self) { return _wrap_gst_element_iterate_pads(self); } +%% +override gst_element_get_pad_template_list noargs +static PyObject * +_wrap_gst_element_get_pad_template_list(PyGObject *self) +{ + PyObject *ret; + GList *res = NULL; + guint i; + + res = gst_element_class_get_pad_template_list + (GST_ELEMENT_GET_CLASS (self->obj)); + + if (res) { + i = g_list_length (res); + ret = PyList_New (i); + for (i = 0 ; res ; res = g_list_next (res), i++) { + GstPadTemplate * tmpl = (GstPadTemplate *) res->data; + PyList_SetItem (ret, i, pygstobject_new (G_OBJECT (tmpl))); + } + } else { + ret = Py_None; + Py_INCREF (ret); + } + + return ret; +} diff --git a/gst/gstpad.override b/gst/gstpad.override index d6cfc29255..5064677aad 100644 --- a/gst/gstpad.override +++ b/gst/gstpad.override @@ -143,6 +143,7 @@ probe_handler_marshal(GstPad *pad, GstMiniObject *data, gpointer user_data) repr = PyObject_Repr (callback); GST_LOG_OBJECT (pad, "calling callback %s", PyString_AsString (repr)); Py_DECREF (repr); + ret = PyObject_CallObject(callback, args); if (!ret) { @@ -1151,3 +1152,15 @@ _wrap_gst_pad_query_peer_convert (PyGObject *self, PyObject *args, PyObject *kwa return ret; } +%% +override-attr GstStaticPadTemplate.static_caps +static PyObject * +_wrap_gst_static_pad_template__get_static_caps(PyObject *self, void *closure) +{ + GstStaticPadTemplate *templ; + + + templ = pyg_pointer_get(self, GstStaticPadTemplate); + return pyg_pointer_new(GST_TYPE_STATIC_CAPS, &(templ->static_caps)); +} +