diff options
author | Théo de la Hogue | 2023-12-06 23:00:08 +0100 |
---|---|---|
committer | Théo de la Hogue | 2023-12-06 23:00:08 +0100 |
commit | 70e40f95513374008d3cb6bb3361d6951bf41d20 (patch) | |
tree | 390e50efc74f12cd632473ae09ce2b4a3536ce65 | |
parent | 710d73e2afcc422f371a018628ac04684d8d88fd (diff) | |
download | argaze-70e40f95513374008d3cb6bb3361d6951bf41d20.zip argaze-70e40f95513374008d3cb6bb3361d6951bf41d20.tar.gz argaze-70e40f95513374008d3cb6bb3361d6951bf41d20.tar.bz2 argaze-70e40f95513374008d3cb6bb3361d6951bf41d20.tar.xz |
Locking ArCamera frame image exploitation.
-rw-r--r-- | src/argaze/ArFeatures.py | 14 |
1 files changed, 13 insertions, 1 deletions
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.""" |