mirror of
https://github.com/EyeTrackVR/EyeTrackVR.git
synced 2025-11-04 14:39:42 +08:00
fix: close serial cams and wireless cams separate
This commit is contained in:
parent
3cb5e727a1
commit
ee7a19fb9c
@ -129,10 +129,13 @@ class Camera:
|
|||||||
print(f"{Fore.CYAN}[INFO] Exiting Capture thread{Fore.RESET}")
|
print(f"{Fore.CYAN}[INFO] Exiting Capture thread{Fore.RESET}")
|
||||||
# openCV won't switch to a new source if provided with one
|
# openCV won't switch to a new source if provided with one
|
||||||
# so, we have to manually release the camera on exit
|
# so, we have to manually release the camera on exit
|
||||||
try:
|
|
||||||
|
addr = str(self.current_capture_source)
|
||||||
|
if is_serial_capture_source(addr):
|
||||||
|
self.serial_connection.close()
|
||||||
|
else:
|
||||||
self.cv2_camera.release()
|
self.cv2_camera.release()
|
||||||
except:
|
|
||||||
pass
|
|
||||||
return
|
return
|
||||||
should_push = True
|
should_push = True
|
||||||
# If things aren't open, retry until they are. Don't let read requests come in any earlier
|
# If things aren't open, retry until they are. Don't let read requests come in any earlier
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user