From 45596b2e603e1ccb7cb271cc9834ede6293dd700 Mon Sep 17 00:00:00 2001 From: MaZderMind Date: Mon, 25 Aug 2014 16:36:06 +0200 Subject: create a local ghostpad before linking --- voctocore/experiments/binlinktest.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'voctocore/experiments') diff --git a/voctocore/experiments/binlinktest.py b/voctocore/experiments/binlinktest.py index 690daaa..69d24ee 100755 --- a/voctocore/experiments/binlinktest.py +++ b/voctocore/experiments/binlinktest.py @@ -37,6 +37,11 @@ class MixBin(Gst.Bin): Gst.GhostPad.new('src', self.mix.get_static_pad('src')) ) + def create_ghostpad(self, pad): + ghostpad = Gst.GhostPad.new(pad.get_name(), pad) + self.add_pad(ghostpad) + return ghostpad + def add_src(self, src): sinkpad = self.mix.get_request_pad('sink_%u') sinkpad.set_property('alpha', 0.75) @@ -46,7 +51,11 @@ class MixBin(Gst.Bin): #print(src.link(self.mix)) # True # doesn't - print(srcpad.link(sinkpad)) # Error => GST_PAD_LINK_WRONG_HIERARCHY + #print(srcpad.link(sinkpad)) # Error => GST_PAD_LINK_WRONG_HIERARCHY + + # but this does + sinkghostpad = self.create_ghostpad(sinkpad) + print(srcpad.link(sinkghostpad)) # True class Example: def __init__(self): -- cgit v1.2.3