mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
add gst.Caps.__refcount__
Original commit message from CVS: * gst/gst-types.defs: * gst/gstcaps.override: * testsuite/test_caps.py: add gst.Caps.__refcount__
This commit is contained in:
parent
ead5c45836
commit
2dc54c0954
4 changed files with 25 additions and 0 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
2005-10-05 Thomas Vander Stichele <thomas at apestaart dot org>
|
||||||
|
|
||||||
|
* gst/gst-types.defs:
|
||||||
|
* gst/gstcaps.override:
|
||||||
|
* testsuite/test_caps.py:
|
||||||
|
add gst.Caps.__refcount__
|
||||||
|
|
||||||
2005-10-05 Thomas Vander Stichele <thomas at apestaart dot org>
|
2005-10-05 Thomas Vander Stichele <thomas at apestaart dot org>
|
||||||
|
|
||||||
* testsuite/test_pad.py:
|
* testsuite/test_pad.py:
|
||||||
|
|
|
@ -203,6 +203,9 @@
|
||||||
(in-module "Gst")
|
(in-module "Gst")
|
||||||
(c-name "GstCaps")
|
(c-name "GstCaps")
|
||||||
(gtype-id "GST_TYPE_CAPS")
|
(gtype-id "GST_TYPE_CAPS")
|
||||||
|
(fields
|
||||||
|
'("int" "__refcount__")
|
||||||
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
(define-object Plugin
|
(define-object Plugin
|
||||||
|
|
|
@ -419,6 +419,8 @@ _wrap_gst_caps_tp_dealloc (PyObject *self)
|
||||||
|
|
||||||
if (boxed->free_on_dealloc && boxed->boxed) {
|
if (boxed->free_on_dealloc && boxed->boxed) {
|
||||||
pygst_caps_map_modified (self);
|
pygst_caps_map_modified (self);
|
||||||
|
GST_DEBUG ("unreffing caps %" GST_PTR_FORMAT "with refcount %d",
|
||||||
|
boxed->boxed, GST_CAPS_REFCOUNT (boxed->boxed));
|
||||||
gst_caps_unref (boxed->boxed);
|
gst_caps_unref (boxed->boxed);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -438,3 +440,13 @@ _wrap_gst_caps_tp_str(PyGObject *self)
|
||||||
|
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
%%
|
||||||
|
override-attr GstCaps.__refcount__
|
||||||
|
|
||||||
|
static PyObject *
|
||||||
|
_wrap_gst_caps__get___refcount__(PyGObject *self, void *closure)
|
||||||
|
{
|
||||||
|
return PyInt_FromLong(GST_CAPS_REFCOUNT(self->obj));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,9 +26,12 @@ from common import gst, unittest
|
||||||
class CapsTest(unittest.TestCase):
|
class CapsTest(unittest.TestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
self.caps = gst.caps_from_string('video/x-raw-yuv,width=10,framerate=5.0;video/x-raw-rgb,width=15,framerate=10.0')
|
self.caps = gst.caps_from_string('video/x-raw-yuv,width=10,framerate=5.0;video/x-raw-rgb,width=15,framerate=10.0')
|
||||||
|
self.assertEquals(self.caps.__refcount__, 1)
|
||||||
self.structure = self.caps[0]
|
self.structure = self.caps[0]
|
||||||
self.any = gst.Caps("ANY")
|
self.any = gst.Caps("ANY")
|
||||||
|
self.assertEquals(self.any.__refcount__, 1)
|
||||||
self.empty = gst.Caps()
|
self.empty = gst.Caps()
|
||||||
|
self.assertEquals(self.empty.__refcount__, 1)
|
||||||
|
|
||||||
def testCapsMime(self):
|
def testCapsMime(self):
|
||||||
mime = self.structure.get_name()
|
mime = self.structure.get_name()
|
||||||
|
|
Loading…
Reference in a new issue