diff --git a/pyk4a/playback.py b/pyk4a/playback.py index e969c83..424324d 100644 --- a/pyk4a/playback.py +++ b/pyk4a/playback.py @@ -155,7 +155,7 @@ def get_next_capture(self): result, capture_handle = k4a_module.playback_get_next_capture(self._handle, self.thread_safe) self._verify_stream_error(result) return PyK4ACapture( - calibration=self._calibration, + calibration=self.calibration, capture_handle=capture_handle, color_format=self.configuration["color_format"], thread_safe=self.thread_safe, @@ -166,7 +166,7 @@ def get_previouse_capture(self): result, capture_handle = k4a_module.playback_get_previous_capture(self._handle, self.thread_safe) self._verify_stream_error(result) return PyK4ACapture( - calibration=self._calibration, + calibration=self.calibration, capture_handle=capture_handle, color_format=self.configuration["color_format"], thread_safe=self.thread_safe, diff --git a/tests/functional/test_playback.py b/tests/functional/test_playback.py index e1cef48..13af5d1 100644 --- a/tests/functional/test_playback.py +++ b/tests/functional/test_playback.py @@ -103,3 +103,24 @@ def test_seek_by_device_time(playback: PyK4APlayback): playback.seek(1, origin=SeekOrigin.DEVICE_TIME) # TODO add correct timestamp from datablock here capture = playback.get_next_capture() assert capture.color is not None + + +class TestGetCapture: + @staticmethod + def test_get_next_capture(playback: PyK4APlayback): + playback.open() + capture = playback.get_next_capture() + assert capture is not None + assert capture.depth is not None + assert capture.color is not None + assert capture._calibration is not None # Issue #81 + + @staticmethod + def test_get_previouse_capture(playback: PyK4APlayback): + playback.open() + playback.seek(0, origin=SeekOrigin.END) + capture = playback.get_previouse_capture() + assert capture is not None + assert capture.depth is not None + assert capture.color is not None + assert capture._calibration is not None # Issue #81