diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/argaze/utils/contexts/TobiiProGlasses2.py | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/argaze/utils/contexts/TobiiProGlasses2.py b/src/argaze/utils/contexts/TobiiProGlasses2.py index d9dbdea..13dcf4a 100644 --- a/src/argaze/utils/contexts/TobiiProGlasses2.py +++ b/src/argaze/utils/contexts/TobiiProGlasses2.py @@ -1303,8 +1303,19 @@ class SegmentPlayback(ArFeatures.DataPlaybackContext): logging.debug('> read image at %i timestamp', video_ts) - # Process camera image - self._process_camera_image(timestamp=video_ts, image=video_image) + # Don't process images if sync is required but sync event not happened yet + if self.__sync_event is not None and self.__sync_ts is not None: + + sync_video_ts = int(self.__sync_ts + video_ts - self.__sync_data_ts) + + # Process camera image + self._process_camera_image(timestamp=sync_video_ts, image=video_image) + + # Otherwise, always process images + elif self.__sync_event is None: + + # Process camera image + self._process_camera_image(timestamp=video_ts, image=video_image) height, width, _ = video_image.shape |