aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThéo de la Hogue2024-07-23 10:08:36 +0200
committerThéo de la Hogue2024-07-23 10:08:36 +0200
commit9ac9b1acef0acdd82f17b400c3d41faffe0ac422 (patch)
tree3c6a73892673ace1696af128b764f7d510f1353f /src
parented215e841a41735e483abbcbc6f6e9a4c5cafb77 (diff)
downloadargaze-9ac9b1acef0acdd82f17b400c3d41faffe0ac422.zip
argaze-9ac9b1acef0acdd82f17b400c3d41faffe0ac422.tar.gz
argaze-9ac9b1acef0acdd82f17b400c3d41faffe0ac422.tar.bz2
argaze-9ac9b1acef0acdd82f17b400c3d41faffe0ac422.tar.xz
reducing waiting times in TobiiProGlasses2.LiveStream context.
Diffstat (limited to 'src')
-rw-r--r--src/argaze/utils/contexts/TobiiProGlasses2.py16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/argaze/utils/contexts/TobiiProGlasses2.py b/src/argaze/utils/contexts/TobiiProGlasses2.py
index b8810ae..75cd0ff 100644
--- a/src/argaze/utils/contexts/TobiiProGlasses2.py
+++ b/src/argaze/utils/contexts/TobiiProGlasses2.py
@@ -629,7 +629,6 @@ class LiveStream(ArFeatures.DataCaptureContext):
threading.Thread.join(self.__video_thread)
-
def __make_socket(self):
"""Create a socket to enable network communication."""
@@ -742,15 +741,15 @@ class LiveStream(ArFeatures.DataCaptureContext):
# Check image validity
if image is None:
- # Wait for half frame time
- time.sleep(0.5 / self.__video_fps)
+ # Wait 1ms
+ time.sleep(1e-3)
continue
# Check image time validity
if image.time is None:
- # Wait for half frame time
- time.sleep(0.5 / self.__video_fps)
+ # Wait 1ms
+ time.sleep(1e-3)
continue
# Store first timestamp
@@ -786,10 +785,6 @@ class LiveStream(ArFeatures.DataCaptureContext):
while not self._stop_event.is_set():
- # Wait for half frame time
- # TODO: Consider camera image processing time to adapt waiting time
- time.sleep(0.5 / self.__video_fps)
-
# Lock buffer access
with self.__video_buffer_lock:
@@ -813,6 +808,9 @@ class LiveStream(ArFeatures.DataCaptureContext):
# Clear buffer
self.__video_buffer = None
+ # Wait 1ms
+ time.sleep(1e-3)
+
def __keep_alive(self):
"""Maintain network connection."""