librealsense icon indicating copy to clipboard operation
librealsense copied to clipboard

OpenNI2 Stream Mirroring Compatibility Hack

Open starmaid opened this issue 1 year ago • 0 comments

See Issue #12363 reported last week. Thanks to @MartyG-RealSense for extra info.

All these comments apply to the file /wrappers/openni2/src/Rs2StreamProps.cpp

Where I started looking at this, librealsense does not support stream mirroring, and the getProperty(ONI_STREAM_PROPERTY_MIRRORING) always returns false.

OpenNI2 Viewer will crash if isPropertySupported(ONI_STREAM_PROPERTY_MIRRORING) returns true, but then when attempting to set the property it recieves ONI_STATUS_NOT_SUPPORTED. This was the behavior before my change.

Some Closed-source OpenNI2 Scanning apps call setProperty(ONI_STREAM_PROPERTY_MIRRORING) without checking if its supported first. By returning OK, we can allow these programs (Skanect, ReconstructMe, probably others) to function normally.

The downside is that some OpenNI2 developer may attempt to mirror the video (without checking if the property is supported), the wrapper will return OK, and the video will not be mirrored. This may not be intuitive. However, if they then check getProperty(ONI_STREAM_PROPERTY_MIRRORING) they will still receive false, so this is consistent.

starmaid avatar Nov 15 '23 13:11 starmaid