aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaZderMind <peter@mazdermind.de>2014-08-25 16:36:06 +0200
committerMaZderMind <peter@mazdermind.de>2014-08-25 16:36:06 +0200
commit45596b2e603e1ccb7cb271cc9834ede6293dd700 (patch)
treea3111807531646c7f073f016db178ffeb754d099
parentc069dba94d98e44634bbc9b4a67c93dfeab249af (diff)
create a local ghostpad before linking
-rwxr-xr-xvoctocore/experiments/binlinktest.py11
1 files changed, 10 insertions, 1 deletions
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):