def gst_init(): from twisted.internet import gireactor as reactor reactor.install() import gi gi.require_version('Gst', '1.0') from gi.repository import GObject, Gst GObject.threads_init() Gst.init(None)
#!/usr/bin/env python __copyright__ = "Copyright (c) 2006-2012 David Ripton" __license__ = "GNU GPL v2" import logging from twisted.internet import gireactor try: gireactor.install() except AssertionError: pass from twisted.internet import defer, reactor from gi.repository import Gtk from slugathon.gui import Chit, Marker, icon CONCEDE = 0 MAKE_PROPOSAL = 1 DONE_PROPOSING = 2 FIGHT = 3 def new(playername, attacker_legion, defender_legion, parent): """Create a Negotiate dialog and return it and a Deferred.""" def1 = defer.Deferred() negotiate = Negotiate(playername, attacker_legion, defender_legion, def1, parent) return negotiate, def1
import gi gi.require_version('Gst', '1.0') from gi.repository import GObject, Gst, GstVideo #GObject.threads_init() from twisted.internet import gireactor # for non-GUI apps gireactor.install() Gst.init(None) from twisted.internet import reactor, interfaces, defer from twisted.internet.protocol import ReconnectingClientFactory from zope.interface import implementer from autobahn.twisted.websocket import WebSocketClientProtocol, \ WebSocketClientFactory, connectWS import requests, json, Cookie, sys from requests.auth import HTTPDigestAuth from twisted.python.filepath import FilePath camid = 'mushak0001' tokenURL = b"http://www.packetservo.com/ps/register" wsurl = "ws://www.packetservo.com/hls/live/" + camid @implementer(interfaces.IPushProducer) class HLSProducer: def __init__(self, proto): self.proto = proto self.started = False