mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-07 07:58:51 +00:00
use new gst_element_connect() api.
Original commit message from CVS: use new gst_element_connect() api. looks more fragile than being explicit via _connect_pads()
This commit is contained in:
parent
cb96d5a69f
commit
dae8809ed5
10 changed files with 26 additions and 24 deletions
|
@ -59,7 +59,7 @@ def filter(filters):
|
||||||
previous = None
|
previous = None
|
||||||
for e in elements:
|
for e in elements:
|
||||||
if previous:
|
if previous:
|
||||||
previous.connect('src', e, 'sink')
|
previous.connect(e)
|
||||||
previous = e
|
previous = e
|
||||||
|
|
||||||
# start playing
|
# start playing
|
||||||
|
@ -74,7 +74,8 @@ def filter(filters):
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
"A GStreamer based cp(1) with stats"
|
"A GStreamer based cp(1) with stats"
|
||||||
gst_debug_set_categories(0)
|
#gst_info_set_categories(-1)
|
||||||
|
#gst_debug_set_categories(-1)
|
||||||
|
|
||||||
stats = gst_element_factory_make ('statistics', 'stats');
|
stats = gst_element_factory_make ('statistics', 'stats');
|
||||||
if not stats:
|
if not stats:
|
||||||
|
|
|
@ -62,7 +62,7 @@ class DVDPlay(object):
|
||||||
|
|
||||||
def main(self):
|
def main(self):
|
||||||
if len(sys.argv) < 5:
|
if len(sys.argv) < 5:
|
||||||
print 'usage: %s dvdlocation title chapter angle' % argv[0]
|
print 'usage: %s dvdlocation title chapter angle' % sys.argv[0]
|
||||||
return -1
|
return -1
|
||||||
|
|
||||||
self.location = sys.argv[1]
|
self.location = sys.argv[1]
|
||||||
|
@ -100,9 +100,9 @@ class DVDPlay(object):
|
||||||
for e in (self.v_queue, self.v_decode, self.color, self.show):
|
for e in (self.v_queue, self.v_decode, self.color, self.show):
|
||||||
self.v_thread.add(e)
|
self.v_thread.add(e)
|
||||||
|
|
||||||
self.v_queue.connect('src',self.v_decode,'sink')
|
self.v_queue.connect(self.v_decode)
|
||||||
self.v_decode.connect('src',self.color,'sink')
|
self.v_decode.connect(self.color)
|
||||||
self.color.connect('src',self.show,'sink')
|
self.color.connect(self.show)
|
||||||
|
|
||||||
def build_audio_thread(self):
|
def build_audio_thread(self):
|
||||||
# ***** pre-construct the audio thread *****
|
# ***** pre-construct the audio thread *****
|
||||||
|
@ -121,8 +121,8 @@ class DVDPlay(object):
|
||||||
for e in (self.a_queue, self.a_decode, self.osssink):
|
for e in (self.a_queue, self.a_decode, self.osssink):
|
||||||
self.a_thread.add(e)
|
self.a_thread.add(e)
|
||||||
|
|
||||||
self.a_queue.connect('src',self.a_decode,'sink')
|
self.a_queue.connect(self.a_decode)
|
||||||
self.a_decode.connect('src',self.osssink,'sink')
|
self.a_decode.connect(self.osssink)
|
||||||
|
|
||||||
def build(self):
|
def build(self):
|
||||||
# ***** construct the main pipeline *****
|
# ***** construct the main pipeline *****
|
||||||
|
@ -143,7 +143,7 @@ class DVDPlay(object):
|
||||||
self.pipeline.add(self.src)
|
self.pipeline.add(self.src)
|
||||||
self.pipeline.add(self.parse)
|
self.pipeline.add(self.parse)
|
||||||
|
|
||||||
self.src.connect('src',self.parse,'sink')
|
self.src.connect(self.parse)
|
||||||
|
|
||||||
# pre-construct the audio/video threads
|
# pre-construct the audio/video threads
|
||||||
self.build_video_thread()
|
self.build_video_thread()
|
||||||
|
|
|
@ -49,7 +49,7 @@ def main():
|
||||||
bin.add(e)
|
bin.add(e)
|
||||||
|
|
||||||
# connect the elements
|
# connect the elements
|
||||||
res = src.connect('src', sink, 'sink')
|
res = src.connect(sink)
|
||||||
assert res
|
assert res
|
||||||
|
|
||||||
# start playing
|
# start playing
|
||||||
|
|
|
@ -52,7 +52,7 @@ def build(filters, b):
|
||||||
previous = None
|
previous = None
|
||||||
for e in elements:
|
for e in elements:
|
||||||
if previous:
|
if previous:
|
||||||
previous.connect('src', e, 'sink')
|
previous.connect(e)
|
||||||
previous = e
|
previous = e
|
||||||
|
|
||||||
return bin
|
return bin
|
||||||
|
|
|
@ -62,7 +62,7 @@ def main():
|
||||||
previous = None
|
previous = None
|
||||||
for e in (filesrc, decoder, osssink):
|
for e in (filesrc, decoder, osssink):
|
||||||
if previous:
|
if previous:
|
||||||
previous.connect('src', e, 'sink')
|
previous.connect(e)
|
||||||
previous = e
|
previous = e
|
||||||
|
|
||||||
# start playing
|
# start playing
|
||||||
|
|
|
@ -59,7 +59,7 @@ def filter(filters):
|
||||||
previous = None
|
previous = None
|
||||||
for e in elements:
|
for e in elements:
|
||||||
if previous:
|
if previous:
|
||||||
previous.connect('src', e, 'sink')
|
previous.connect(e)
|
||||||
previous = e
|
previous = e
|
||||||
|
|
||||||
# start playing
|
# start playing
|
||||||
|
@ -74,7 +74,8 @@ def filter(filters):
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
"A GStreamer based cp(1) with stats"
|
"A GStreamer based cp(1) with stats"
|
||||||
gst_debug_set_categories(0)
|
#gst_info_set_categories(-1)
|
||||||
|
#gst_debug_set_categories(-1)
|
||||||
|
|
||||||
stats = gst_element_factory_make ('statistics', 'stats');
|
stats = gst_element_factory_make ('statistics', 'stats');
|
||||||
if not stats:
|
if not stats:
|
||||||
|
|
|
@ -62,7 +62,7 @@ class DVDPlay(object):
|
||||||
|
|
||||||
def main(self):
|
def main(self):
|
||||||
if len(sys.argv) < 5:
|
if len(sys.argv) < 5:
|
||||||
print 'usage: %s dvdlocation title chapter angle' % argv[0]
|
print 'usage: %s dvdlocation title chapter angle' % sys.argv[0]
|
||||||
return -1
|
return -1
|
||||||
|
|
||||||
self.location = sys.argv[1]
|
self.location = sys.argv[1]
|
||||||
|
@ -100,9 +100,9 @@ class DVDPlay(object):
|
||||||
for e in (self.v_queue, self.v_decode, self.color, self.show):
|
for e in (self.v_queue, self.v_decode, self.color, self.show):
|
||||||
self.v_thread.add(e)
|
self.v_thread.add(e)
|
||||||
|
|
||||||
self.v_queue.connect('src',self.v_decode,'sink')
|
self.v_queue.connect(self.v_decode)
|
||||||
self.v_decode.connect('src',self.color,'sink')
|
self.v_decode.connect(self.color)
|
||||||
self.color.connect('src',self.show,'sink')
|
self.color.connect(self.show)
|
||||||
|
|
||||||
def build_audio_thread(self):
|
def build_audio_thread(self):
|
||||||
# ***** pre-construct the audio thread *****
|
# ***** pre-construct the audio thread *****
|
||||||
|
@ -121,8 +121,8 @@ class DVDPlay(object):
|
||||||
for e in (self.a_queue, self.a_decode, self.osssink):
|
for e in (self.a_queue, self.a_decode, self.osssink):
|
||||||
self.a_thread.add(e)
|
self.a_thread.add(e)
|
||||||
|
|
||||||
self.a_queue.connect('src',self.a_decode,'sink')
|
self.a_queue.connect(self.a_decode)
|
||||||
self.a_decode.connect('src',self.osssink,'sink')
|
self.a_decode.connect(self.osssink)
|
||||||
|
|
||||||
def build(self):
|
def build(self):
|
||||||
# ***** construct the main pipeline *****
|
# ***** construct the main pipeline *****
|
||||||
|
@ -143,7 +143,7 @@ class DVDPlay(object):
|
||||||
self.pipeline.add(self.src)
|
self.pipeline.add(self.src)
|
||||||
self.pipeline.add(self.parse)
|
self.pipeline.add(self.parse)
|
||||||
|
|
||||||
self.src.connect('src',self.parse,'sink')
|
self.src.connect(self.parse)
|
||||||
|
|
||||||
# pre-construct the audio/video threads
|
# pre-construct the audio/video threads
|
||||||
self.build_video_thread()
|
self.build_video_thread()
|
||||||
|
|
|
@ -49,7 +49,7 @@ def main():
|
||||||
bin.add(e)
|
bin.add(e)
|
||||||
|
|
||||||
# connect the elements
|
# connect the elements
|
||||||
res = src.connect('src', sink, 'sink')
|
res = src.connect(sink)
|
||||||
assert res
|
assert res
|
||||||
|
|
||||||
# start playing
|
# start playing
|
||||||
|
|
|
@ -52,7 +52,7 @@ def build(filters, b):
|
||||||
previous = None
|
previous = None
|
||||||
for e in elements:
|
for e in elements:
|
||||||
if previous:
|
if previous:
|
||||||
previous.connect('src', e, 'sink')
|
previous.connect(e)
|
||||||
previous = e
|
previous = e
|
||||||
|
|
||||||
return bin
|
return bin
|
||||||
|
|
|
@ -62,7 +62,7 @@ def main():
|
||||||
previous = None
|
previous = None
|
||||||
for e in (filesrc, decoder, osssink):
|
for e in (filesrc, decoder, osssink):
|
||||||
if previous:
|
if previous:
|
||||||
previous.connect('src', e, 'sink')
|
previous.connect(e)
|
||||||
previous = e
|
previous = e
|
||||||
|
|
||||||
# start playing
|
# start playing
|
||||||
|
|
Loading…
Reference in a new issue