Commit 56a72587 authored by Alessandro Decina's avatar Alessandro Decina

gst.GhostPad: allow set_target(None) to unset the target. Fixes #590735.

parent 35fe0f41
......@@ -2529,7 +2529,7 @@
(c-name "gst_ghost_pad_set_target")
(return-type "gboolean")
(parameters
'("GstPad*" "newtarget")
'("GstPad*" "newtarget" (null-ok))
)
)
......
......@@ -177,5 +177,18 @@ class PipeTest(TestCase):
gst.debug('received handoff on pad %r' % pad)
self._handoffs += 1
class TargetTest(TestCase):
def test_target(self):
src = gst.Pad("src", gst.PAD_SRC)
ghost = gst.GhostPad("ghost_src", src)
self.failUnless(ghost.get_target() is src)
ghost.set_target(None)
self.failUnless(ghost.get_target() is None)
ghost.set_target(src)
self.failUnless(ghost.get_target() is src)
if __name__ == "__main__":
unittest.main()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment