Original commit message from CVS:
* gst/gstpad.override:
* testsuite/test_pad.py:
Revert 2008-02-10  Alessandro Decina  <alessandro@nnva.org>
Re-opens #514717
This commit is contained in:
Edward Hervey 2008-06-12 11:11:49 +00:00
parent 98c131e13d
commit 7e06ad12c6
4 changed files with 33 additions and 25 deletions

View file

@ -1,3 +1,10 @@
2008-06-12 Edward Hervey <edward.hervey@collabora.co.uk>
* gst/gstpad.override:
* testsuite/test_pad.py:
Revert 2008-02-10 Alessandro Decina <alessandro@nnva.org>
Re-opens #514717
2008-06-05 Jan Schmidt <jan.schmidt@sun.com> 2008-06-05 Jan Schmidt <jan.schmidt@sun.com>
* configure.ac: * configure.ac:

2
common

@ -1 +1 @@
Subproject commit 68fb019d4044b9878aef4ca223fc13c19ffc7d0c Subproject commit 46ec7dfc1c09ff550ed6b7a4e0d3f2b2ac7d3ee8

View file

@ -1343,7 +1343,6 @@ pad_block_callback_marshal(GstPad *pad, gboolean blocked, gpointer user_data)
ret = PyObject_CallObject(callback, args); ret = PyObject_CallObject(callback, args);
Py_DECREF(args); Py_DECREF(args);
Py_DECREF(py_user_data);
if (!ret) if (!ret)
PyErr_Print(); PyErr_Print();

View file

@ -516,37 +516,39 @@ class PadRefCountTest(TestCase):
self.assertEquals(self.gccollect(), 1) # collected the pad self.assertEquals(self.gccollect(), 1) # collected the pad
gst.debug('going into teardown') gst.debug('going into teardown')
class PadBlockRefcountTest(TestCase): # re-enable this test once #514717 is fixed
def testCallbackRefcount(self):
def blocked_cb(pad, blocked):
self.assertTrue(pad.set_blocked_async(False, unblocked_cb))
def unblocked_cb(pad, blocked): # class PadBlockRefcountTest(TestCase):
pass # def testCallbackRefcount(self):
# def blocked_cb(pad, blocked):
# self.assertTrue(pad.set_blocked_async(False, unblocked_cb))
cb_refcount = sys.getrefcount(blocked_cb) # def unblocked_cb(pad, blocked):
# sys.getrefcount() returns refcount + 1 # pass
self.assertEquals(cb_refcount, 2)
fakesrc = gst.element_factory_make('fakesrc') # cb_refcount = sys.getrefcount(blocked_cb)
fakesrc.props.num_buffers = 2 # # sys.getrefcount() returns refcount + 1
fakesink = gst.element_factory_make('fakesink') # self.assertEquals(cb_refcount, 2)
pipeline = gst.Pipeline() # fakesrc = gst.element_factory_make('fakesrc')
pipeline.add(fakesrc, fakesink) # fakesrc.props.num_buffers = 2
# fakesink = gst.element_factory_make('fakesink')
fakesrc.link(fakesink) # pipeline = gst.Pipeline()
# pipeline.add(fakesrc, fakesink)
pad = fakesrc.get_pad('src') # fakesrc.link(fakesink)
pad.set_blocked_async(True, blocked_cb)
pipeline.set_state(gst.STATE_PLAYING) # pad = fakesrc.get_pad('src')
pipeline.get_bus().poll(gst.MESSAGE_EOS, -1) # pad.set_blocked_async(True, blocked_cb)
pipeline.set_state(gst.STATE_NULL)
# check that we don't leak a ref to the callback # pipeline.set_state(gst.STATE_PLAYING)
cb_refcount_after = sys.getrefcount(blocked_cb) # pipeline.get_bus().poll(gst.MESSAGE_EOS, -1)
self.assertEquals(cb_refcount_after, cb_refcount) # pipeline.set_state(gst.STATE_NULL)
# # check that we don't leak a ref to the callback
# cb_refcount_after = sys.getrefcount(blocked_cb)
# self.assertEquals(cb_refcount_after, cb_refcount)
if __name__ == "__main__": if __name__ == "__main__":