diff --git a/python/ftl/ftlstream.py b/python/ftl/ftlstream.py index 1697812020bb3c8fa0f488b4776cb38a427eb21a..e57279197aec3610c9f6b37696000aa8eb25403a 100644 --- a/python/ftl/ftlstream.py +++ b/python/ftl/ftlstream.py @@ -262,7 +262,7 @@ class FTLStreamReader: Reads data for until the next timestamp. Returns False if there is no more data to read, otherwise returns True. - todo: make decoding optional + todo: make (frame) decoding optional ''' self._frame = None @@ -276,22 +276,28 @@ class FTLStreamReader: if self._p.block_total != 1 or self._p.block_number != 0: raise Exception("Unsupported block format (todo)") + # calibration/pose cached + # todo: should be done by user instead? + if self._sp.channel == ftl.Channel.Calibration: self._update_calib(self._sp, self._p) elif self._sp.channel == ftl.Channel.Pose: self._update_pose(self._sp, self._p) - elif self._sp.channel in (ftl.Channel.Left,ftl.Channel.Left): - # Decode Left/Right - if self._p.codec == ftl.codec_t.HEVC: - self._decode_hevc(self._sp, self._p) + # decode if codec supported + if self._p.codec == ftl.codec_t.HEVC: + self._decode_hevc(self._sp, self._p) + + elif self._p.codec == ftl.codec_t.PNG: + self._decode_opencv(self._sp, self._p) - elif self._p.codec == ftl.codec_t.PNG: - self._decode_opencv(self._sp, self._p) + elif self._p.codec == ftl.codec_t.JPG: + self._decode_opencv(self._sp, self._p) - elif self._p.codec == ftl.codec_t.JPG: - self._decode_opencv(self._sp, self._p) + else: + # todo (unsupported codec) + pass return True