mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
gst.GhostPad: allow set_target(None) to unset the target. Fixes #590735.
This commit is contained in:
parent
35fe0f419d
commit
56a725879d
2 changed files with 14 additions and 1 deletions
|
@ -2529,7 +2529,7 @@
|
||||||
(c-name "gst_ghost_pad_set_target")
|
(c-name "gst_ghost_pad_set_target")
|
||||||
(return-type "gboolean")
|
(return-type "gboolean")
|
||||||
(parameters
|
(parameters
|
||||||
'("GstPad*" "newtarget")
|
'("GstPad*" "newtarget" (null-ok))
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -177,5 +177,18 @@ class PipeTest(TestCase):
|
||||||
gst.debug('received handoff on pad %r' % pad)
|
gst.debug('received handoff on pad %r' % pad)
|
||||||
self._handoffs += 1
|
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__":
|
if __name__ == "__main__":
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|
Loading…
Reference in a new issue