summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuciana Fujii Pontello <luciana@holoscopio.com>2010-07-07 20:59:56 (GMT)
committerLuciana Fujii Pontello <luciana@fujii.eti.br>2010-07-16 21:02:36 (GMT)
commit118818f6ea8eff7cf304aef4bbf601ea79b139d7 (patch)
tree60da803ce1713a5fdfa454391e3c0364de941f52
parentdc348652d3bd5d6bbb31587e777d9c2295d7cbb2 (diff)
downloadsltv-118818f6ea8eff7cf304aef4bbf601ea79b139d7.tar.gz
sltv-118818f6ea8eff7cf304aef4bbf601ea79b139d7.tar.xz
dvinput: Removing decodebin2 and using multiqueue
Instead of using decodebin2, which uses the demuxer with higher rank, we use ffdemux_dv and ffdec_dvvideo as before, but now using a multiqueue instead of two separate queues as decodebin2 does internally to prevent locks.
-rw-r--r--sltv/input/dvinput.py29
-rw-r--r--sltv/sltv.py2
2 files changed, 23 insertions, 8 deletions
diff --git a/sltv/input/dvinput.py b/sltv/input/dvinput.py
index 83f1123..fb513bd 100644
--- a/sltv/input/dvinput.py
+++ b/sltv/input/dvinput.py
@@ -38,9 +38,13 @@ class DVInput(Input):
self.add(self.tee)
self.queue_src = gst.element_factory_make("queue", "dv_src_queue")
self.add(self.queue_src)
- self.decodebin = gst.element_factory_make("decodebin2", "decodebin2")
- self.add(self.decodebin)
- self.decodebin.connect("new-decoded-pad", self.on_pad_added)
+ self.dvdemux = gst.element_factory_make("ffdemux_dv", "dvdemux")
+ self.add(self.dvdemux)
+ self.dvdemux.connect("pad-added", self.on_pad_added)
+ self.video_queue = gst.element_factory_make(
+ "multiqueue", "video_demux_queue"
+ )
+ self.add(self.video_queue)
self.colorspc = gst.element_factory_make(
"ffmpegcolorspace", "video_dv_colorspace"
@@ -48,27 +52,36 @@ class DVInput(Input):
self.add(self.colorspc)
+ self.dvdec = gst.element_factory_make("dvdec", "dvdec")
+ self.add(self.dvdec)
self.videoscale = gst.element_factory_make(
"videoscale", "dv_videoscale"
)
self.add(self.videoscale)
gst.element_link_many(
self.dv_src, self.capsfilter, self.tee, self.queue_src,
- self.decodebin
+ self.dvdemux
)
gst.element_link_many(
- self.colorspc, self.videoscale
+ self.dvdec, self.colorspc, self.videoscale
)
self.video_pad.set_target(self.videoscale.src_pads().next())
+ index = 1
- def on_pad_added(self, dbin, pad, islast):
+ def on_pad_added(self, element, pad):
name = pad.get_caps()[0].get_name()
if "video" in name:
- pad.link(self.colorspc.get_static_pad("sink"))
+ request_pad = self.video_queue.get_request_pad("sink%d")
+ pad.link(request_pad)
+ src_pad = request_pad.iterate_internal_links().next()
+ src_pad.link(self.dvdec.get_static_pad("sink"))
if "audio" in name:
- self.audio_pad.set_target(pad)
+ request_pad = self.video_queue.get_request_pad("sink%d")
+ pad.link(request_pad)
+ src_pad = request_pad.iterate_internal_links().next()
+ self.audio_pad.set_target(src_pad)
def config(self, dict):
self.dv_src.set_property("channel", int(dict["channel"]))
diff --git a/sltv/sltv.py b/sltv/sltv.py
index 5c0e754..aee3dd4 100644
--- a/sltv/sltv.py
+++ b/sltv/sltv.py
@@ -476,6 +476,8 @@ class Sltv(gobject.GObject):
self.emit("pipeline-ready")
+ gst.DEBUG_BIN_TO_DOT_FILE_WITH_TS(self.player, gst.DEBUG_GRAPH_SHOW_MEDIA_TYPE, "debug")
+
bus = self.player.get_bus()
bus.add_signal_watch()
bus.enable_sync_message_emission()