mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-27 02:30:35 +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")
|
||||
(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()
|
||||
|
|
Loading…
Reference in a new issue