diff --git a/gst/gst.defs b/gst/gst.defs index 4b06c1dabd..d16b038037 100644 --- a/gst/gst.defs +++ b/gst/gst.defs @@ -2529,7 +2529,7 @@ (c-name "gst_ghost_pad_set_target") (return-type "gboolean") (parameters - '("GstPad*" "newtarget") + '("GstPad*" "newtarget" (null-ok)) ) ) diff --git a/testsuite/test_ghostpad.py b/testsuite/test_ghostpad.py index 21104c20a8..8a390df9dc 100644 --- a/testsuite/test_ghostpad.py +++ b/testsuite/test_ghostpad.py @@ -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()