def __init__(self, connection, channel): self.conn = connection self.channel = channel self.tfchannel = None channel.connect("state-changed", self.state_changed_cb) self.pipeline = Gst.Pipeline(None) self.pipeline.get_bus().add_signal_watch() self.pipeline.get_bus().connect("message", self.async_handler) self.notifier = notifier = Farstream.ElementAddedNotifier() notifier.set_properties_from_file("element-properties") notifier.add(self.pipeline) TelepathyFarstream.Channel.new_async(channel, self.tpfs_created)
def __init__(self, elementname="fsrtpconference"): GObject.GObject.__init__(self) self.pipeline = Gst.Pipeline() GLib.unix_signal_add_full(0, signal.SIGINT, self.g_int_handler, None,) signal.signal(signal.SIGINT, self.int_handler) #self.pipeline.get_bus().set_sync_handler(self.sync_handler, None) self.pipeline.get_bus().add_watch(0, self.async_handler, None) self.conf = Gst.ElementFactory.make(elementname, None) self.notifier = Farstream.ElementAddedNotifier() self.notifier.add(self.pipeline) self.notifier.set_default_properties(self.conf) self.pipeline.add(self.conf) if VIDEO: self.videosource = FsUIVideoSource(self.pipeline) self.videosession = FsUISession(self.conf, self.videosource) if AUDIO: self.audiosource = FsUIAudioSource(self.pipeline) self.audiosession = FsUISession(self.conf, self.audiosource) #self.adder = None self.pipeline.set_state(Gst.State.PLAYING)