gst/arg-types.py: Caps used as arguments of virtual methods should keep their initial...
authorEdward Hervey <bilboed@bilboed.com>
Fri, 28 Apr 2006 17:35:26 +0000 (17:35 +0000)
committerEdward Hervey <bilboed@bilboed.com>
Fri, 28 Apr 2006 17:35:26 +0000 (17:35 +0000)
Original commit message from CVS:
* gst/arg-types.py:
Caps used as arguments of virtual methods should keep their initial
refcount when calling the python methods.
This is similar to the patch done for GstMiniObjects.
* gst/gstbase.override:
Adjust the gst.BaseTransform.get_unit_size() virtual method for above
fix.

ChangeLog
gst/arg-types.py
gst/gstbase.override

index 33001ea..12136ca 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2006-04-28  Edward Hervey  <edward@fluendo.com>
+
+       * gst/arg-types.py:
+       Caps used as arguments of virtual methods should keep their initial
+       refcount when calling the python methods.
+       This is similar to the patch done for GstMiniObjects.
+       * gst/gstbase.override:
+       Adjust the gst.BaseTransform.get_unit_size() virtual method for above
+       fix.
+
 2006-04-28  Артём Попов  <artfwo@gmail.com>
 
        reviewed by: Edward Hervey  <edward@fluendo.com>
index b9dbf41..4fea63b 100644 (file)
@@ -192,7 +192,7 @@ class GstCapsParam(Parameter):
                                              "    py_%s = Py_None;\n"
                                              "}"
                                              % (self.name, self.name, self.name, self.name)),
-                                       cleanup=("Py_DECREF(py_%s);" % self.name))
+                                       cleanup=("gst_caps_ref(%s);\nPy_DECREF(py_%s);" % (self.name, self.name)))
                self.wrapper.add_pyargv_item("py_%s" % self.name)
 
 matcher.register_reverse('GstCaps*', GstCapsParam)
index ec70675..ff5d079 100644 (file)
@@ -472,7 +472,7 @@ _wrap_GstBaseTransform__proxy_do_get_unit_size (GstBaseTransform * self,
     }
 
     if (caps)
-        py_caps = pyg_boxed_new(GST_TYPE_CAPS, caps, FALSE, TRUE); // should copyval be TRUE instead?
+        py_caps = pyg_boxed_new(GST_TYPE_CAPS, caps, FALSE, FALSE); // should copyval be TRUE instead?
     else {
         Py_INCREF (Py_None);
         py_caps = Py_None;