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

This commit is contained in:
Alessandro Decina 2010-07-14 12:33:58 +02:00
parent 35fe0f419d
commit 56a725879d
2 changed files with 14 additions and 1 deletions

View file

@ -2529,7 +2529,7 @@
(c-name "gst_ghost_pad_set_target")
(return-type "gboolean")
(parameters
'("GstPad*" "newtarget")
'("GstPad*" "newtarget" (null-ok))
)
)

View file

@ -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()