def close(self): MediaStreaming.close(self) self.thread_image = False # TODO add semaphore? self.video.stop() self._is_opened = False return True
def close(self): MediaStreaming.close(self) self.thread_image = False # TODO add semaphore? self.video.stop() self._is_opened = False return True
def close(self): MediaStreaming.close(self) # TODO need to debug, closing socket create errors and \ # context.term freeze # self.subscriber.close() # self.context.term() self.subscriber = None return True
def close(self): # Only the manager can call this close or the reload on media.py MediaStreaming.close(self) self.call_stop = True self.loop_try_open_camera = False self.is_streaming = False if self.camera: self.param_transmission.set(False) self.camera.stop() self.camera.initEvent.removeObserver(self.camera_init) self.camera.grabEvent.removeObserver(self.camera_observer) # self.camera.stopEvent.removeObserver(self.camera_closed) self.camera.safe_clean() self.camera = None return True else: logger.warning("Camera %s already close." % self.get_name()) return False
def open(self): self.subscriber = self.context.socket(zmq.SUB) self.subscriber.setsockopt(zmq.SUBSCRIBE, b'') device_name = self.param_ipc_name.get() logger.info("Open media device %s" % device_name) self.subscriber.connect(device_name) thread.start_new_thread(self.fill_message, tuple()) # call open when video is ready return MediaStreaming.open(self)
def open(self): try: shape = self.dct_resolution[self.param_resolution.get()] fps = self.dct_fps[self.param_fps.get()] self.video = pygame.camera.Camera(self.own_config.path, shape) self.video.start() self.thread_image = True thread.start_new_thread(self.update_image, ()) except BaseException as e: log.printerror_stacktrace( logger, "Open camera %s: %s" % (self.get_name(), e)) return False # call open when video is ready return MediaStreaming.open(self)
def open(self): try: shape = self.dct_resolution[self.param_resolution.get()] fps = self.dct_fps[self.param_fps.get()] # TODO check argument video capture self.video = cv2.VideoCapture(self.own_config.no) self.video.set(cv2.cv.CV_CAP_PROP_FRAME_WIDTH, shape[0]) self.video.set(cv2.cv.CV_CAP_PROP_FRAME_HEIGHT, shape[1]) self.video.set(cv2.cv.CV_CAP_PROP_FPS, fps) except BaseException as e: log.printerror_stacktrace( logger, "Open camera %s: %s" % (self.get_name(), e)) return False # call open when video is ready return MediaStreaming.open(self)
def open(self): try: shape = self.dct_resolution[ self.param_resolution.get()] fps = self.dct_fps[self.param_fps.get()] self.video = pygame.camera.Camera(self.own_config.path, shape) self.video.start() self.thread_image = True thread.start_new_thread(self.update_image, ()) except BaseException as e: log.printerror_stacktrace( logger, "Open camera %s: %s" % (self.get_name(), e)) return False # call open when video is ready return MediaStreaming.open(self)
def open(self): try: shape = self.dct_resolution[self.param_resolution.get()] fps = self.dct_fps[self.param_fps.get()] # TODO check argument video capture self.video = cv2.VideoCapture(self.own_config.no) self.video.set(cv2.cv.CV_CAP_PROP_FRAME_WIDTH, shape[0]) self.video.set(cv2.cv.CV_CAP_PROP_FRAME_HEIGHT, shape[1]) self.video.set(cv2.cv.CV_CAP_PROP_FPS, fps) except BaseException as e: log.printerror_stacktrace( logger, "Open camera %s: %s" % (self.get_name(), e)) return False # call open when video is ready return MediaStreaming.open(self)
def close(self): MediaStreaming.close(self) if self.video: self.video.release() self._is_opened = False return True
def camera_init(self): MediaStreaming.open(self) self.is_streaming = True
def close(self): MediaStreaming.close(self) if self.video: self.video.release() self._is_opened = False return True