From 70e40f95513374008d3cb6bb3361d6951bf41d20 Mon Sep 17 00:00:00 2001 From: Théo de la Hogue Date: Wed, 6 Dec 2023 23:00:08 +0100 Subject: Locking ArCamera frame image exploitation. --- src/argaze/ArFeatures.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/argaze/ArFeatures.py b/src/argaze/ArFeatures.py index 5ec6b7e..4e05764 100644 --- a/src/argaze/ArFeatures.py +++ b/src/argaze/ArFeatures.py @@ -1565,7 +1565,19 @@ class ArCamera(ArFrame): kwargs: ArFrame.image parameters """ - return super().image(**kwargs) + # Can't use camera frame when it is locked + if self._frame_lock.locked(): + return + + # Lock camera frame exploitation + self._frame_lock.acquire() + + _image = super().image(**kwargs) + + # Unlock camera frame exploitation + self._frame_lock.release() + + return _image def to_json(self, json_filepath): """Save camera to .json file.""" -- cgit v1.1