def __init__(self, p2p, conversation, session, sender, ourwebcam, controller): '''Constructor''' if not HAVE_WEBCAM: self.NO_WEBCAM = True return self.NO_WEBCAM = False self.p2p = p2p self.conversation = conversation self.session = int(session) self.sender = sender self.ourwebcam = ourwebcam self.controller=controller self.signals = [] sap = self.signals.append sap(self.p2p.connect('webcam-frame-received', self.on_webcam_frame)) sap(self.p2p.connect('webcam-failed', self.on_webcam_failed)) sap(self.p2p.connect('webcam-ack', self.on_accept)) self.decoder = libmimic.new_decoder() self.encoder = libmimic.new_encoder(1) # 1 = hi-res, 0 = low res self.init = False self.webcam = None self.errors = 0 self.image = None self.win = None self.win_send = None self.daarea = None
def __init__(self, p2p, conversation, session, sender): '''Constructor''' self.p2p = p2p self.conversation = conversation self.session = int(session) self.sender = sender self.timeAccepted = None self.signals = [] sap = self.signals.append sap(self.p2p.connect('webcam-frame-received', self.on_webcam_frame)) sap(self.p2p.connect('webcam-failed', self.on_webcam_failed)) self.decoder = libmimic.new_decoder() self.init = False self.gc = None self.frames = 0 self.win = gtk.Window() self.win.set_double_buffered(False) self.win.set_app_paintable(True) self.win.set_resizable(False) sap(self.win.connect('delete-event', self.on_close)) self.pixmap = None