supported returning a list from a callback for multiple windows again.

This commit is contained in:
simleek
2020-04-29 11:42:46 -07:00
parent 0fc9280b3c
commit 18335d6260
2 changed files with 7 additions and 2 deletions

View File

@ -54,7 +54,11 @@ class FrameUpdater(threading.Thread):
frame_c = c(frame)
if frame_c is not None:
frame = frame_c
if frame.shape[-1] not in [1, 3] and len(frame.shape) != 2:
if (
isinstance(frame, np.ndarray)
and frame.shape[-1] not in [1, 3]
and len(frame.shape) != 2
):
print(
f"Too many channels in output. (Got {frame.shape[-1]} instead of 1 or 3.) "
f"Frame selection callback added."

View File

@ -146,7 +146,8 @@ class SubscriberWindows(object):
if isinstance(self.frames[f], Exception):
raise self.frames[f]
if (
self.frames[f].shape[-1] not in [1, 3]
isinstance(self.frames[f], np.ndarray)
and self.frames[f].shape[-1] not in [1, 3]
and len(self.frames[f].shape) != 2
):
print(