When channels are activated before Connect they will be added to ActiveChannels and ActivateChannelImpl will be called for them by Connect.
For the Orbbec cameras this will cause a malfunction of both ZImage and Point3DImage are activated before Connect. As a result none of these channels will actually be activated.
Possible actions to solve this:
- Drop support for the
Point3DImage channel in the Orbbec.
The channel is broken anyways and only computed by the driver.
This would fix the problem for the Orbbec camera only.
- Replace the
IsChannelActive checks in ActivateChannel by DepthStream.isValid().
This would fix the problem for the Orbbec camera only.
- Modify the
ActivateChannelImpl behaviour:
Return true if the channel was activated and no further action is needed.
Return false if channel activation was not possible, and ActivateChannelImpl should be called again for this channel after ConnectImpl.
Based on the return value, the channel would be added to ActiveChannels or a new list, e.g. ChannelsToActivateAfterConnect (naming suggestions welcome).
I would then also rename ActivateChannelImpl to TryActivateChannelImpl.
The behaviour of DeactivateChannel must be changed accordingly (e.g. activating and deactivating a channel before Connect should result in that channel not being in any list.
This would be a larger change to the internal interface and solve it for all cameras.
Originally posted by @sisiplac in #194
When channels are activated before
Connectthey will be added toActiveChannelsandActivateChannelImplwill be called for them byConnect.For the Orbbec cameras this will cause a malfunction of both
ZImageandPoint3DImageare activated beforeConnect. As a result none of these channels will actually be activated.Possible actions to solve this:
Point3DImagechannel in the Orbbec.The channel is broken anyways and only computed by the driver.
This would fix the problem for the Orbbec camera only.
IsChannelActivechecks inActivateChannelbyDepthStream.isValid().This would fix the problem for the Orbbec camera only.
ActivateChannelImplbehaviour:Return
trueif the channel was activated and no further action is needed.Return
falseif channel activation was not possible, andActivateChannelImplshould be called again for this channel afterConnectImpl.Based on the return value, the channel would be added to
ActiveChannelsor a new list, e.g.ChannelsToActivateAfterConnect(naming suggestions welcome).I would then also rename
ActivateChannelImpltoTryActivateChannelImpl.The behaviour of
DeactivateChannelmust be changed accordingly (e.g. activating and deactivating a channel beforeConnectshould result in that channel not being in any list.This would be a larger change to the internal interface and solve it for all cameras.
Originally posted by @sisiplac in #194