summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuciana Fujii Pontello <luciana@fujii.eti.br>2010-07-14 15:16:01 (GMT)
committerLuciana Fujii Pontello <luciana@fujii.eti.br>2010-07-14 15:26:20 (GMT)
commitc917bef908c24213eb42e7ae7845c27aba173e52 (patch)
tree47adc464fad66e5b07518730378f3e2ec80d1dc6
parent8d7e15a06e8553665d11551a3d48662e16db2e61 (diff)
downloadsltv-c917bef908c24213eb42e7ae7845c27aba173e52.tar.gz
sltv-c917bef908c24213eb42e7ae7845c27aba173e52.tar.xz
dvinput: Using decodebin2 to decode DV
We use decodebin2 instead of dvdemux and dvdec. This allows GStreamer to use the elements with higher ranks and uses multiqueue instead of normal queue which can prevent some locks.
-rw-r--r--sltv/input/dvinput.py14
1 files changed, 6 insertions, 8 deletions
diff --git a/sltv/input/dvinput.py b/sltv/input/dvinput.py
index b5ac666..93c56e6 100644
--- a/sltv/input/dvinput.py
+++ b/sltv/input/dvinput.py
@@ -38,9 +38,9 @@ class DVInput(Input):
self.add(self.tee)
self.queue_src = gst.element_factory_make("queue", "dv_src_queue")
self.add(self.queue_src)
- self.dvdemux = gst.element_factory_make("ffdemux_dv", "ffdemux_dv")
- self.add(self.dvdemux)
- self.dvdemux.connect("pad-added", self.on_pad_added)
+ self.decodebin = gst.element_factory_make("decodebin2", "decodebin2")
+ self.add(self.decodebin)
+ self.decodebin.connect("new-decoded-pad", self.on_pad_added)
self.video_queue = gst.element_factory_make(
"queue", "video_demux_queue"
)
@@ -51,23 +51,21 @@ class DVInput(Input):
self.add(self.video_queue, self.colorspc)
- self.dvdec = gst.element_factory_make("ffdec_dvvideo", "ffdec_dvvideo")
- 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.dvdemux
+ self.decodebin
)
gst.element_link_many(
- self.video_queue, self.dvdec, self.colorspc, self.videoscale
+ self.video_queue, self.colorspc, self.videoscale
)
self.video_pad.set_target(self.videoscale.src_pads().next())
- def on_pad_added(self, element, pad):
+ def on_pad_added(self, dbin, pad, islast):
name = pad.get_caps()[0].get_name()
if "video" in name: