def start(self, dev=1): try: self.cam = vc.Device(dev) self.currentdevice = dev except vidcap.error: if dev == 0: utils.error("Could not start camera") return self.start(dev=0) return self.timer.start()
def start(self, dev=1): try: self.cam = vc.Device(dev) try: width, height = self.camera_res self.cam.setResolution(int(width), int(height)) except KeyError: pass self.currentdevice = dev except vidcap.error: if dev == 0: utils.error("Could not start camera") raise CameraError("Could not start camera") self.start(dev=0) return roam.config.settings['camera'] = self.currentdevice self.timer.start()