MCPcopy Create free account
hub / github.com/GStreamer/gst-python / testRemovingProbe

Method testRemovingProbe

testsuite/old/test_pad.py:461–485  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

459 return True
460
461 def testRemovingProbe(self):
462 self.fakesrc.set_property('num-buffers', 10)
463
464 handle = None
465 self._num_times_called = 0
466 def buffer_probe(pad, buffer, data):
467 self._num_times_called += 1
468 pad.remove_buffer_probe(handle)
469 return True
470
471 pad = self.fakesrc.get_pad('src')
472 data = []
473 handle = pad.add_buffer_probe(buffer_probe, data)
474 self.pipeline.set_state(gst.STATE_PLAYING)
475 m = self.pipeline.get_bus().poll(gst.MESSAGE_EOS, -1)
476 assert m
477 assert self._num_times_called == 1
478 self.pipeline.set_state(gst.STATE_NULL)
479 assert sys.getrefcount(buffer_probe) == 2
480 assert sys.getrefcount(data) == 2
481 # FIXME: having m going out of scope doesn't seem to be enough
482 # to get it gc collected, and it keeps a ref to the pipeline.
483 # Look for a way to not have to do this explicitly
484 del m
485 self.gccollect()
486
487class PadRefCountTest(TestCase):
488 def testAddPad(self):

Callers

nothing calls this directly

Calls 2

set_propertyMethod · 0.80
gccollectMethod · 0.80

Tested by

no test coverage detected