Refractored GStreamer element linking

This commit is contained in:
Joar Wandborg 2011-11-21 21:47:00 +01:00
parent a63b640f12
commit c875bb74a8

View File

@ -17,7 +17,6 @@
from __future__ import division from __future__ import division
import os import os
os.environ["GST_DEBUG_DUMP_DOT_DIR"] = "/tmp"
os.putenv('GST_DEBUG_DUMP_DOT_DIR', '/tmp') os.putenv('GST_DEBUG_DUMP_DOT_DIR', '/tmp')
import sys import sys
@ -498,28 +497,30 @@ class VideoTranscoder:
# or audio sink # or audio sink
self.filesrc.link(self.decoder) self.filesrc.link(self.decoder)
# Link all the video elements in a link to webmux # Link all the video elements in a row to webmmux
self.videoqueue.link(self.videorate) gst.element_link_many(
self.videorate.link(self.ffmpegcolorspace) self.videoqueue,
self.ffmpegcolorspace.link(self.videoscale) self.videorate,
self.videoscale.link(self.capsfilter) self.ffmpegcolorspace,
#self.capsfilter.link(self.xvimagesink) self.videoscale,
self.capsfilter.link(self.vp8enc) self.capsfilter,
self.vp8enc.link(self.webmmux) self.vp8enc,
self.webmmux)
if self.data.is_audio: if self.data.is_audio:
# Link all the audio elements in a line to webmux # Link all the audio elements in a row to webmux
#self.audioconvert.link(self.alsasink) gst.element_link_many(
self.audioqueue.link(self.audiorate) self.audioqueue,
self.audiorate.link(self.audioconvert) self.audiorate,
self.audioconvert.link(self.audiocapsfilter) self.audioconvert,
self.audiocapsfilter.link(self.vorbisenc) self.audiocapsfilter,
#self.audiocapsfilter.link(self.level) self.vorbisenc,
#self.level.link(self.vorbisenc) self.webmmux)
self.vorbisenc.link(self.webmmux)
self.webmmux.link(self.progressreport) gst.element_link_many(
self.progressreport.link(self.filesink) self.webmmux,
self.progressreport,
self.filesink)
# Setup the message bus and connect _on_message to the pipeline # Setup the message bus and connect _on_message to the pipeline
self._setup_bus() self._setup_bus()