def handle_capture_done(): global dev print(" Stop capture ...") dmcam.cap_stop(dev) print(" Close dmcam device ..") dmcam.dev_close(dev) dmcam.uninit()
def handle_capture_done(): global dev, cap_thread print(" Stop cap_thread ...") cap_thread.stop_me() cap_thread.wait() print(" Stop capture ...") dmcam.cap_stop(dev) print(" Close dmcam device ..") dmcam.dev_close(dev) dev = None dmcam.uninit()
pygame.draw.rect(screen, BLUE, [5, (SCREEN_HEIGHT >> 1) + 5, 70, 25]) pygame.draw.rect(screen, BLUE, [(SCREEN_WIDTH >> 1) + 5, (SCREEN_HEIGHT >> 1) + 5, 70, 25]) screen.blit(h_text.render("GRAY", 1, WHITE), (10, 10)) screen.blit(h_text.render("DISTANCE", 1, WHITE), ((SCREEN_WIDTH >> 1) + 10, 10)) screen.blit(h_text.render("AMBIENT", 1, WHITE), (10, (SCREEN_HEIGHT >> 1) + 10)) screen.blit(h_text.render("HIST", 1, WHITE), ((SCREEN_WIDTH >> 1) + 10, (SCREEN_HEIGHT >> 1) + 10)) pygame.display.update() elif ret < 0: break for event in pygame.event.get(): if event.type == QUIT: pygame.quit() run = False # print("wait 3000ms") # dmcam.cap_wait(dev, 3000) print(" Stop capture ...") dmcam.cap_stop(dev) print(" Close dmcam device ..") dmcam.dev_close(dev) dmcam.uninit() sys.exit(-1)
def stop(self): print('[INF] dmcam_dev_c.stop()') dmcam.cap_stop(self.dev)
def _stop_dmcam(self): if self.status: log.info("Stop capture ...") dmcam.cap_stop(self.dev) self.status = False