From 3b20dd082df5a250990b8af7e558b07875a0bbb4 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Tue, 26 Aug 2008 15:58:15 +0000 Subject: [PATCH] gst/gstcaps.override: Override gst_caps_append_structure() and make a copy of the structure given as argument. Original commit message from CVS: * gst/gstcaps.override: Override gst_caps_append_structure() and make a copy of the structure given as argument. Fixes #549450 --- ChangeLog | 7 +++++++ common | 2 +- gst/gstcaps.override | 23 +++++++++++++++++++++++ 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 3b2a695ad2..04a30aa6a1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-08-26 Edward Hervey + + * gst/gstcaps.override: + Override gst_caps_append_structure() and make a copy of the structure + given as argument. + Fixes #549450 + 2008-08-11 Edward Hervey * gst/gst-0.10.15.ignore: diff --git a/common b/common index d70ca17ae6..8d494854a6 160000 --- a/common +++ b/common @@ -1 +1 @@ -Subproject commit d70ca17ae6fbe6020996e4567275d5e14972ed45 +Subproject commit 8d494854a6018336a80ece82ceb3df0033e2da9c diff --git a/gst/gstcaps.override b/gst/gstcaps.override index 7ff3e3f757..28ddedbd7a 100644 --- a/gst/gstcaps.override +++ b/gst/gstcaps.override @@ -451,3 +451,26 @@ _wrap_gst_caps__get___refcount__(PyGObject *self, void *closure) return PyInt_FromLong(GST_CAPS_REFCOUNT(self->obj)); } +%% +override gst_caps_append_structure kwargs +static PyObject * +_wrap_gst_caps_append_structure(PyObject *self, PyObject *args, PyObject *kwargs) +{ + static char *kwlist[] = { "structure", NULL }; + PyObject *py_structure; + GstStructure *structure = NULL; + + if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O:GstCaps.append_structure", kwlist, &py_structure)) + return NULL; + if (pyg_boxed_check(py_structure, GST_TYPE_STRUCTURE)) + structure = gst_structure_copy(pyg_boxed_get(py_structure, GstStructure)); + else { + PyErr_SetString(PyExc_TypeError, "structure should be a GstStructure"); + return NULL; + } + pyg_begin_allow_threads; + gst_caps_append_structure(pyg_boxed_get(self, GstCaps), structure); + pyg_end_allow_threads; + Py_INCREF(Py_None); + return Py_None; +}