From faf4a277880b483f9a5ab2607b1b7cf824426d83 Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Mon, 4 May 2020 15:56:25 +1000 Subject: [PATCH 01/13] Expect hardware floating point on Arm systems --- ThirdParty/PSCommon/BuildSystem/Platform.Arm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ThirdParty/PSCommon/BuildSystem/Platform.Arm b/ThirdParty/PSCommon/BuildSystem/Platform.Arm index c4a112df8..e03c09221 100644 --- a/ThirdParty/PSCommon/BuildSystem/Platform.Arm +++ b/ThirdParty/PSCommon/BuildSystem/Platform.Arm @@ -1,7 +1,7 @@ ifeq "$(CFG)" "Release" # Hardware specifying flags - CFLAGS += -march=armv7-a -mtune=cortex-a9 -mfpu=neon -mfloat-abi=softfp #-mcpu=cortex-a8 + CFLAGS += -march=armv7-a -mtune=cortex-a9 -mfpu=neon -mfloat-abi=hard #-mcpu=cortex-a8 # Optimization level, minus currently buggy optimizing methods (which break bit-exact) CFLAGS += -O3 -fno-tree-pre -fno-strict-aliasing From d0bc54b8005dd1786a7d91ad227416c831b8e893 Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Mon, 4 May 2020 16:54:57 +1000 Subject: [PATCH 02/13] Convert python to version 3 syntax --- Packaging/Harvest.py | 2 +- ThirdParty/PSCommon/BuildSystem/BuildJavaWindows.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Packaging/Harvest.py b/Packaging/Harvest.py index 4ce9ed269..978f7ce4b 100755 --- a/Packaging/Harvest.py +++ b/Packaging/Harvest.py @@ -54,7 +54,7 @@ def copySharedObject(self, sourceDir, name, targetDir): elif self.osName == 'Darwin': shutil.copy(os.path.join(sourceDir, 'lib' + name + '.dylib'), targetDir) else: - raise 'Unsupported platform!' + raise Execption('Unsupported platform!') def copyExecutable(self, sourceDir, name, targetDir): if self.osName == 'Windows': diff --git a/ThirdParty/PSCommon/BuildSystem/BuildJavaWindows.py b/ThirdParty/PSCommon/BuildSystem/BuildJavaWindows.py index f58e5f2e9..fbd011a93 100644 --- a/ThirdParty/PSCommon/BuildSystem/BuildJavaWindows.py +++ b/ThirdParty/PSCommon/BuildSystem/BuildJavaWindows.py @@ -5,7 +5,7 @@ # parse command line if len(sys.argv) < 5: - print "usage: " + sys.argv[0] + " [NeededJarFiles] [MainClass]" + print("usage: " + sys.argv[0] + " [NeededJarFiles] [MainClass]") exit(1) platform_string = "" @@ -14,7 +14,7 @@ elif sys.argv[1] == "x64": platform_string = "x64" else: - print 'First argument must be "x86", "x64" or empty (x86)' + print('First argument must be "x86", "x64" or empty (x86)') exit(1) bin_dir = os.path.abspath(sys.argv[2]) @@ -37,7 +37,7 @@ # make sure JAVA_HOME is set JAVA_HOME = os.path.expandvars("$JAVA_HOME") if JAVA_HOME == "": - print "JAVA_HOME is not set!" + print("JAVA_HOME is not set!") exit(1) CLASS_PATH = os.path.expandvars("$CLASSPATH") @@ -106,7 +106,7 @@ # create batch file (by default, windows does not open a console when double-clicking jar files) if main_class != "": - print "Creating batch file..." + print("Creating batch file...") batch = open(BATCH_FILE, 'w') batch.write('java -Xmx768m -jar ' + proj_name + '.jar\n') batch.close() From 18ced16808287960fe75ad2e8f7716eb17e4cb7b Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Sat, 27 Aug 2022 12:45:36 +1000 Subject: [PATCH 03/13] Upgrade Visual Studio projects to VS 2019 --- Include/OpenNI.h | 8 ++++---- Samples/ClosestPointViewer/ClosestPointViewer.vcxproj | 4 ++++ Samples/EventBasedRead/EventBasedRead.vcxproj | 4 ++++ Samples/MWClosestPoint/MWClosestPoint.vcxproj | 4 ++++ Samples/MWClosestPointApp/MWClosestPointApp.vcxproj | 4 ++++ Samples/MultiDepthViewer/MultiDepthViewer.vcxproj | 4 ++++ Samples/MultipleStreamRead/MultipleStreamRead.vcxproj | 4 ++++ Samples/SimpleRead/SimpleRead.vcxproj | 4 ++++ Samples/SimpleViewer/SimpleViewer.vcxproj | 4 ++++ Source/Core/OniContext.cpp | 6 +++--- Source/Core/OniDevice.cpp | 2 +- Source/Core/OniRecorder.cpp | 10 +++++----- Source/Core/OniStream.cpp | 4 ++-- Source/Core/OpenNI.vcxproj | 4 ++++ Source/DepthUtils/DepthUtils.vcxproj | 4 ++++ Source/Drivers/DummyDevice/DummyDevice.vcxproj | 4 ++++ Source/Drivers/Kinect/Kinect.vcxproj | 4 ++++ Source/Drivers/OniFile/OniFile.vcxproj | 4 ++++ Source/Drivers/OniFile/PlayerCodecFactory.cpp | 9 ++++----- Source/Drivers/OniFile/PlayerNode.cpp | 5 ++--- Source/Drivers/PS1080/PS1080.vcxproj | 4 ++++ .../Drivers/PS1080/PS1080Console/PS1080Console.vcxproj | 4 ++++ .../PSLink/LinkProtoLib/XnLinkControlEndpoint.cpp | 2 +- Source/Drivers/PSLink/PSLink.vcxproj | 4 ++++ .../Drivers/PSLink/PSLinkConsole/PSLinkConsole.vcxproj | 4 ++++ Source/Drivers/TestDevice/TestDevice.cpp | 6 +++--- Source/Drivers/TestDevice/TestDevice.vcxproj | 4 ++++ Source/Tools/NiViewer/Device.cpp | 4 ++-- Source/Tools/NiViewer/Draw.cpp | 1 - Source/Tools/NiViewer/NiViewer.vcxproj | 4 ++++ ThirdParty/PSCommon/XnLib/Include/XnCallback.h | 4 ++-- ThirdParty/PSCommon/XnLib/Include/XnMath.h | 6 +++--- ThirdParty/PSCommon/XnLib/Include/XnVector3D.h | 2 +- ThirdParty/PSCommon/XnLib/Source/Win32/XnUSBWin32.cpp | 4 ++-- ThirdParty/PSCommon/XnLib/Source/XnLib.vcxproj | 4 ++++ .../PSCommon/XnLib/Source/XnSytmmetricMatrix3x3.cpp | 8 ++++---- Wrappers/java/OpenNI.jni/OpenNI.jni.vcxproj | 4 ++++ 37 files changed, 123 insertions(+), 42 deletions(-) diff --git a/Include/OpenNI.h b/Include/OpenNI.h index 52324b4eb..64261fbd4 100644 --- a/Include/OpenNI.h +++ b/Include/OpenNI.h @@ -275,10 +275,10 @@ class VideoMode : private OniVideoMode @param [in] resolutionX Desired new horizontal resolution in pixels. @param [in] resolutionY Desired new vertical resolution in pixels. */ - void setResolution(int resolutionX, int resolutionY) + void setResolution(int _resolutionX, int _resolutionY) { - this->resolutionX = resolutionX; - this->resolutionY = resolutionY; + this->resolutionX = _resolutionX; + this->resolutionY = _resolutionY; } /** @@ -287,7 +287,7 @@ class VideoMode : private OniVideoMode video modes. @param [in] fps Desired new frame rate, measured in frames per second. */ - void setFps(int fps) { this->fps = fps; } + void setFps(int _fps) { this->fps = _fps; } friend class SensorInfo; friend class VideoStream; diff --git a/Samples/ClosestPointViewer/ClosestPointViewer.vcxproj b/Samples/ClosestPointViewer/ClosestPointViewer.vcxproj index fe63dbfc5..01c10b702 100644 --- a/Samples/ClosestPointViewer/ClosestPointViewer.vcxproj +++ b/Samples/ClosestPointViewer/ClosestPointViewer.vcxproj @@ -27,23 +27,27 @@ Application true MultiByte + v142 Application true MultiByte + v142 Application false true MultiByte + v142 Application false true MultiByte + v142 diff --git a/Samples/EventBasedRead/EventBasedRead.vcxproj b/Samples/EventBasedRead/EventBasedRead.vcxproj index f67db7a33..23f1d3764 100644 --- a/Samples/EventBasedRead/EventBasedRead.vcxproj +++ b/Samples/EventBasedRead/EventBasedRead.vcxproj @@ -27,23 +27,27 @@ Application true MultiByte + v142 Application true MultiByte + v142 Application false true MultiByte + v142 Application false true MultiByte + v142 diff --git a/Samples/MWClosestPoint/MWClosestPoint.vcxproj b/Samples/MWClosestPoint/MWClosestPoint.vcxproj index 74cafe76d..0468e966d 100644 --- a/Samples/MWClosestPoint/MWClosestPoint.vcxproj +++ b/Samples/MWClosestPoint/MWClosestPoint.vcxproj @@ -27,23 +27,27 @@ DynamicLibrary true MultiByte + v142 DynamicLibrary true MultiByte + v142 DynamicLibrary false true MultiByte + v142 DynamicLibrary false true MultiByte + v142 diff --git a/Samples/MWClosestPointApp/MWClosestPointApp.vcxproj b/Samples/MWClosestPointApp/MWClosestPointApp.vcxproj index 063ec3771..feb34533c 100644 --- a/Samples/MWClosestPointApp/MWClosestPointApp.vcxproj +++ b/Samples/MWClosestPointApp/MWClosestPointApp.vcxproj @@ -27,23 +27,27 @@ Application true MultiByte + v142 Application true MultiByte + v142 Application false true MultiByte + v142 Application false true MultiByte + v142 diff --git a/Samples/MultiDepthViewer/MultiDepthViewer.vcxproj b/Samples/MultiDepthViewer/MultiDepthViewer.vcxproj index d021c0d05..8ef7839ed 100644 --- a/Samples/MultiDepthViewer/MultiDepthViewer.vcxproj +++ b/Samples/MultiDepthViewer/MultiDepthViewer.vcxproj @@ -27,23 +27,27 @@ Application true MultiByte + v142 Application true MultiByte + v142 Application false true MultiByte + v142 Application false true MultiByte + v142 diff --git a/Samples/MultipleStreamRead/MultipleStreamRead.vcxproj b/Samples/MultipleStreamRead/MultipleStreamRead.vcxproj index 15887ec68..3ac748ea4 100644 --- a/Samples/MultipleStreamRead/MultipleStreamRead.vcxproj +++ b/Samples/MultipleStreamRead/MultipleStreamRead.vcxproj @@ -27,23 +27,27 @@ Application true MultiByte + v142 Application true MultiByte + v142 Application false true MultiByte + v142 Application false true MultiByte + v142 diff --git a/Samples/SimpleRead/SimpleRead.vcxproj b/Samples/SimpleRead/SimpleRead.vcxproj index de3942f1d..a6c6a4827 100644 --- a/Samples/SimpleRead/SimpleRead.vcxproj +++ b/Samples/SimpleRead/SimpleRead.vcxproj @@ -27,23 +27,27 @@ Application true MultiByte + v142 Application true MultiByte + v142 Application false true MultiByte + v142 Application false true MultiByte + v142 diff --git a/Samples/SimpleViewer/SimpleViewer.vcxproj b/Samples/SimpleViewer/SimpleViewer.vcxproj index d693a1d2f..29b177e12 100644 --- a/Samples/SimpleViewer/SimpleViewer.vcxproj +++ b/Samples/SimpleViewer/SimpleViewer.vcxproj @@ -27,23 +27,27 @@ Application true MultiByte + v142 Application true MultiByte + v142 Application false true MultiByte + v142 Application false true MultiByte + v142 diff --git a/Source/Core/OniContext.cpp b/Source/Core/OniContext.cpp index 153c7c6e7..f130b429f 100644 --- a/Source/Core/OniContext.cpp +++ b/Source/Core/OniContext.cpp @@ -420,11 +420,11 @@ OniStatus Context::deviceOpen(const char* uri, const char* mode, OniDeviceHandle { if ((*iter)->tryDevice(deviceURI)) { - for (xnl::List::Iterator iter = m_devices.Begin(); iter != m_devices.End(); ++iter) + for (xnl::List::Iterator devIter = m_devices.Begin(); devIter != m_devices.End(); ++devIter) { - if (xnOSStrCmp((*iter)->getInfo()->uri, deviceURI) == 0) + if (xnOSStrCmp((*devIter)->getInfo()->uri, deviceURI) == 0) { - pMyDevice = *iter; + pMyDevice = *devIter; break; } } diff --git a/Source/Core/OniDevice.cpp b/Source/Core/OniDevice.cpp index 24511f0b3..185e4666a 100644 --- a/Source/Core/OniDevice.cpp +++ b/Source/Core/OniDevice.cpp @@ -147,7 +147,7 @@ VideoStream* Device::createStream(OniSensorType sensorType) { // check if stream already exists. Do this in a lock to make it thread-safe - xnl::AutoCSLocker lock(m_sensors[sensorType]->m_refCountCS); + xnl::AutoCSLocker sensor_lock(m_sensors[sensorType]->m_refCountCS); if (m_sensors[sensorType]->m_streamCount == 0) { void* streamHandle = m_driverHandler.deviceCreateStream(m_deviceHandle, sensorType); diff --git a/Source/Core/OniRecorder.cpp b/Source/Core/OniRecorder.cpp index 1a70a7fa4..056852b78 100644 --- a/Source/Core/OniRecorder.cpp +++ b/Source/Core/OniRecorder.cpp @@ -586,11 +586,11 @@ typedef enum XnPixelFormat typedef struct XnSupportedPixelFormats { - XnBool m_bRGB24 : 1; - XnBool m_bYUV422 : 1; - XnBool m_bGrayscale8Bit : 1; - XnBool m_bGrayscale16Bit : 1; - XnBool m_bMJPEG : 1; + XnUInt m_bRGB24 : 1; + XnUInt m_bYUV422 : 1; + XnUInt m_bGrayscale8Bit : 1; + XnUInt m_bGrayscale16Bit : 1; + XnUInt m_bMJPEG : 1; XnUInt m_nPadding : 3; XnUInt m_nReserved : 24; } XnSupportedPixelFormats; diff --git a/Source/Core/OniStream.cpp b/Source/Core/OniStream.cpp index 096c158a2..f73293df5 100644 --- a/Source/Core/OniStream.cpp +++ b/Source/Core/OniStream.cpp @@ -442,8 +442,8 @@ void VideoStream::refreshWorldConversionCache() getProperty(ONI_STREAM_PROPERTY_HORIZONTAL_FOV, &horizontalFov, &size); getProperty(ONI_STREAM_PROPERTY_VERTICAL_FOV, &verticalFov, &size); - m_worldConvertCache.xzFactor = tan(horizontalFov / 2) * 2; - m_worldConvertCache.yzFactor = tan(verticalFov / 2) * 2; + m_worldConvertCache.xzFactor = (XnFloat)tan(horizontalFov / 2) * 2; + m_worldConvertCache.yzFactor = (XnFloat)tan(verticalFov / 2) * 2; m_worldConvertCache.resolutionX = videoMode.resolutionX; m_worldConvertCache.resolutionY = videoMode.resolutionY; m_worldConvertCache.halfResX = m_worldConvertCache.resolutionX / 2; diff --git a/Source/Core/OpenNI.vcxproj b/Source/Core/OpenNI.vcxproj index 12189decf..654ab4e08 100644 --- a/Source/Core/OpenNI.vcxproj +++ b/Source/Core/OpenNI.vcxproj @@ -27,23 +27,27 @@ DynamicLibrary true MultiByte + v142 DynamicLibrary true MultiByte + v142 DynamicLibrary false true MultiByte + v142 DynamicLibrary false true MultiByte + v142 diff --git a/Source/DepthUtils/DepthUtils.vcxproj b/Source/DepthUtils/DepthUtils.vcxproj index dcab0b76c..263e3d906 100644 --- a/Source/DepthUtils/DepthUtils.vcxproj +++ b/Source/DepthUtils/DepthUtils.vcxproj @@ -35,23 +35,27 @@ StaticLibrary true MultiByte + v142 StaticLibrary true MultiByte + v142 StaticLibrary false true MultiByte + v142 StaticLibrary false true MultiByte + v142 diff --git a/Source/Drivers/DummyDevice/DummyDevice.vcxproj b/Source/Drivers/DummyDevice/DummyDevice.vcxproj index 56c594436..3ca1ac338 100644 --- a/Source/Drivers/DummyDevice/DummyDevice.vcxproj +++ b/Source/Drivers/DummyDevice/DummyDevice.vcxproj @@ -27,23 +27,27 @@ DynamicLibrary true MultiByte + v142 DynamicLibrary true MultiByte + v142 DynamicLibrary false true MultiByte + v142 DynamicLibrary false true MultiByte + v142 diff --git a/Source/Drivers/Kinect/Kinect.vcxproj b/Source/Drivers/Kinect/Kinect.vcxproj index cb29d9ff6..ed4112779 100644 --- a/Source/Drivers/Kinect/Kinect.vcxproj +++ b/Source/Drivers/Kinect/Kinect.vcxproj @@ -28,12 +28,14 @@ true Unicode true + v142 DynamicLibrary true Unicode true + v142 DynamicLibrary @@ -41,6 +43,7 @@ true MultiByte true + v142 DynamicLibrary @@ -48,6 +51,7 @@ true MultiByte true + v142 diff --git a/Source/Drivers/OniFile/OniFile.vcxproj b/Source/Drivers/OniFile/OniFile.vcxproj index 9b173f7d8..fb6952f97 100644 --- a/Source/Drivers/OniFile/OniFile.vcxproj +++ b/Source/Drivers/OniFile/OniFile.vcxproj @@ -28,23 +28,27 @@ DynamicLibrary true MultiByte + v142 DynamicLibrary true MultiByte + v142 DynamicLibrary false true MultiByte + v142 DynamicLibrary false true MultiByte + v142 diff --git a/Source/Drivers/OniFile/PlayerCodecFactory.cpp b/Source/Drivers/OniFile/PlayerCodecFactory.cpp index dc6116465..31a5b4088 100644 --- a/Source/Drivers/OniFile/PlayerCodecFactory.cpp +++ b/Source/Drivers/OniFile/PlayerCodecFactory.cpp @@ -37,7 +37,6 @@ namespace oni_file { //--------------------------------------------------------------------------- XnStatus PlayerCodecFactory::Create(XnCodecID nCodecID, PlayerSource* pSource, XnCodec** ppCodec) { - OniStatus rc; XnCodec* pCodec = NULL; switch (nCodecID) @@ -57,8 +56,8 @@ XnStatus PlayerCodecFactory::Create(XnCodecID nCodecID, PlayerSource* pSource, X // first we need to find max depth int nMaxDepth; int dataSize = sizeof(nMaxDepth); - rc = pSource->GetProperty(ONI_STREAM_PROPERTY_MAX_VALUE, &nMaxDepth, &dataSize); - if (rc != ONI_STATUS_OK) + OniStatus rc1 = pSource->GetProperty(ONI_STREAM_PROPERTY_MAX_VALUE, &nMaxDepth, &dataSize); + if (rc1 != ONI_STATUS_OK) { return XN_STATUS_ERROR; } @@ -76,8 +75,8 @@ XnStatus PlayerCodecFactory::Create(XnCodecID nCodecID, PlayerSource* pSource, X // check what is the output format OniVideoMode videoMode; int dataSize = sizeof(videoMode); - rc = pSource->GetProperty(ONI_STREAM_PROPERTY_VIDEO_MODE, &videoMode, &dataSize); - if (rc != ONI_STATUS_OK) + OniStatus rc1 = pSource->GetProperty(ONI_STREAM_PROPERTY_VIDEO_MODE, &videoMode, &dataSize); + if (rc1 != ONI_STATUS_OK) { return XN_STATUS_ERROR; } diff --git a/Source/Drivers/OniFile/PlayerNode.cpp b/Source/Drivers/OniFile/PlayerNode.cpp index 540b55e57..3dc37a90e 100644 --- a/Source/Drivers/OniFile/PlayerNode.cpp +++ b/Source/Drivers/OniFile/PlayerNode.cpp @@ -394,7 +394,6 @@ XnStatus PlayerNode::SeekToFrameAbsolute(XnUInt32 nNodeID, XnUInt32 nDestFrame) // perform old seek (no data indexes) XnUInt64 nStartPos = TellStream(); XnUInt32 nNextFrame = pPlayerNodeInfo->nCurFrame + 1; - XnStatus nRetVal = XN_STATUS_OK; if (nDestFrame < nNextFrame) { @@ -1700,8 +1699,8 @@ XnStatus PlayerNode::SeekToTimeStampAbsolute(XnUInt64 nDestTimeStamp) //Read rest of record and handle it normally nRetVal = Read(m_pRecordBuffer + record.HEADER_SIZE, record.GetSize() - record.HEADER_SIZE, nBytesRead); XN_IS_STATUS_OK(nRetVal); - Record record(m_pRecordBuffer, RECORD_MAX_SIZE, m_bIs32bitFileFormat); - nRetVal = HandleRecord(record, TRUE); + Record record2(m_pRecordBuffer, RECORD_MAX_SIZE, m_bIs32bitFileFormat); + nRetVal = HandleRecord(record2, TRUE); XN_IS_STATUS_OK(nRetVal); break; } diff --git a/Source/Drivers/PS1080/PS1080.vcxproj b/Source/Drivers/PS1080/PS1080.vcxproj index 2a1154d5a..09023ea1f 100644 --- a/Source/Drivers/PS1080/PS1080.vcxproj +++ b/Source/Drivers/PS1080/PS1080.vcxproj @@ -525,23 +525,27 @@ DynamicLibrary true Unicode + v142 DynamicLibrary true Unicode + v142 DynamicLibrary false true Unicode + v142 DynamicLibrary false true Unicode + v142 diff --git a/Source/Drivers/PS1080/PS1080Console/PS1080Console.vcxproj b/Source/Drivers/PS1080/PS1080Console/PS1080Console.vcxproj index b9adfeab8..947ecbdb5 100644 --- a/Source/Drivers/PS1080/PS1080Console/PS1080Console.vcxproj +++ b/Source/Drivers/PS1080/PS1080Console/PS1080Console.vcxproj @@ -28,19 +28,23 @@ Application MultiByte true + v142 Application MultiByte + v142 Application MultiByte true + v142 Application MultiByte + v142 diff --git a/Source/Drivers/PSLink/LinkProtoLib/XnLinkControlEndpoint.cpp b/Source/Drivers/PSLink/LinkProtoLib/XnLinkControlEndpoint.cpp index 6d61c54e4..4519c3049 100644 --- a/Source/Drivers/PSLink/LinkProtoLib/XnLinkControlEndpoint.cpp +++ b/Source/Drivers/PSLink/LinkProtoLib/XnLinkControlEndpoint.cpp @@ -517,7 +517,7 @@ XnStatus LinkControlEndpoint::DownloadFile(XnUInt16 zone, const XnChar* fwFileNa while (!isLast) { - XnUInt32 nResponseSize = m_nMaxResponseSize; + nResponseSize = m_nMaxResponseSize; nRetVal = ContinueResponseImpl(XN_LINK_MSG_DOWNLOAD_FILE, 0, m_pIncomingResponse, nResponseSize, isLast); if (nRetVal != XN_STATUS_OK) { diff --git a/Source/Drivers/PSLink/PSLink.vcxproj b/Source/Drivers/PSLink/PSLink.vcxproj index 8915163a5..b0e79193f 100644 --- a/Source/Drivers/PSLink/PSLink.vcxproj +++ b/Source/Drivers/PSLink/PSLink.vcxproj @@ -28,19 +28,23 @@ DynamicLibrary Unicode true + v142 DynamicLibrary Unicode + v142 DynamicLibrary Unicode true + v142 DynamicLibrary Unicode + v142 diff --git a/Source/Drivers/PSLink/PSLinkConsole/PSLinkConsole.vcxproj b/Source/Drivers/PSLink/PSLinkConsole/PSLinkConsole.vcxproj index e6c7c8cb5..dc1d0c316 100644 --- a/Source/Drivers/PSLink/PSLinkConsole/PSLinkConsole.vcxproj +++ b/Source/Drivers/PSLink/PSLinkConsole/PSLinkConsole.vcxproj @@ -28,19 +28,23 @@ Application MultiByte true + v142 Application MultiByte + v142 Application MultiByte true + v142 Application MultiByte + v142 diff --git a/Source/Drivers/TestDevice/TestDevice.cpp b/Source/Drivers/TestDevice/TestDevice.cpp index e1832bfb7..e304cdbe1 100644 --- a/Source/Drivers/TestDevice/TestDevice.cpp +++ b/Source/Drivers/TestDevice/TestDevice.cpp @@ -61,7 +61,7 @@ class TestStream : public oni::driver::StreamBase { if (*pDataSize != sizeof(OniVideoMode)) { - printf("Unexpected size: %d != %d\n", *pDataSize, sizeof(OniVideoMode)); + printf("Unexpected size: %d != %d\n", *pDataSize, int(sizeof(OniVideoMode))); return ONI_STATUS_ERROR; } return GetVideoMode((OniVideoMode*)data); @@ -76,7 +76,7 @@ class TestStream : public oni::driver::StreamBase { if (dataSize != sizeof(OniVideoMode)) { - printf("Unexpected size: %d != %d\n", dataSize, sizeof(OniVideoMode)); + printf("Unexpected size: %d != %d\n", dataSize, int(sizeof(OniVideoMode))); return ONI_STATUS_ERROR; } return SetVideoMode((OniVideoMode*)data); @@ -85,7 +85,7 @@ class TestStream : public oni::driver::StreamBase { if (dataSize != sizeof(int)) { - printf("Unexpected size: %d != %d\n", dataSize, sizeof(int)); + printf("Unexpected size: %d != %d\n", dataSize, int(sizeof(int))); return ONI_STATUS_ERROR; } diff --git a/Source/Drivers/TestDevice/TestDevice.vcxproj b/Source/Drivers/TestDevice/TestDevice.vcxproj index e20a074d5..868b3641a 100644 --- a/Source/Drivers/TestDevice/TestDevice.vcxproj +++ b/Source/Drivers/TestDevice/TestDevice.vcxproj @@ -27,23 +27,27 @@ DynamicLibrary true MultiByte + v142 DynamicLibrary true MultiByte + v142 DynamicLibrary false true MultiByte + v142 DynamicLibrary false true MultiByte + v142 diff --git a/Source/Tools/NiViewer/Device.cpp b/Source/Tools/NiViewer/Device.cpp index 28cbfeec1..27f50d849 100644 --- a/Source/Tools/NiViewer/Device.cpp +++ b/Source/Tools/NiViewer/Device.cpp @@ -275,9 +275,9 @@ openni::Status openDeviceFromList(DeviceConfig config) { printf("Choose device to open (1) [0 to exit]: "); - int rc = scanf("%d", &chosen); + int rc2 = scanf("%p", (void**)&chosen); - if (rc <= 0 || chosen == 0) + if (rc2 <= 0 || chosen == 0) { return openni::STATUS_ERROR; } diff --git a/Source/Tools/NiViewer/Draw.cpp b/Source/Tools/NiViewer/Draw.cpp index 9bc75b15d..129858866 100644 --- a/Source/Tools/NiViewer/Draw.cpp +++ b/Source/Tools/NiViewer/Draw.cpp @@ -1286,7 +1286,6 @@ void drawPointerMode(IntPair* pPointer) glEnd(); // place a label under, and in the middle of, that line. - XnUInt32 chars; xnOSStrFormat(buf, sizeof(buf), &chars, "%d", i); glColor3f(1,0,0); glRasterPos2i(xPos - chars*nCharWidth/2, WIN_SIZE_Y - 40); diff --git a/Source/Tools/NiViewer/NiViewer.vcxproj b/Source/Tools/NiViewer/NiViewer.vcxproj index 0a4c3920a..d311a8cf0 100644 --- a/Source/Tools/NiViewer/NiViewer.vcxproj +++ b/Source/Tools/NiViewer/NiViewer.vcxproj @@ -27,23 +27,27 @@ Application true MultiByte + v142 Application true MultiByte + v142 Application false true MultiByte + v142 Application false true MultiByte + v142 diff --git a/ThirdParty/PSCommon/XnLib/Include/XnCallback.h b/ThirdParty/PSCommon/XnLib/Include/XnCallback.h index 36fe4277d..983e7d9d4 100644 --- a/ThirdParty/PSCommon/XnLib/Include/XnCallback.h +++ b/ThirdParty/PSCommon/XnLib/Include/XnCallback.h @@ -30,8 +30,8 @@ struct XnCallback { XnCallback() : pFuncPtr(NULL), pCookie(NULL) {} - XnCallback(XnFuncPtr pFuncPtr, void* pCookie) : pFuncPtr(pFuncPtr), pCookie(pCookie) {} - void Set(XnFuncPtr pFuncPtr, void* pCookie) { this->pFuncPtr = pFuncPtr; this->pCookie = pCookie; } + XnCallback(XnFuncPtr _pFuncPtr, void* _pCookie) : pFuncPtr(_pFuncPtr), pCookie(_pCookie) {} + void Set(XnFuncPtr _pFuncPtr, void* _pCookie) { this->pFuncPtr = _pFuncPtr; this->pCookie = _pCookie; } XnFuncPtr pFuncPtr; void* pCookie; diff --git a/ThirdParty/PSCommon/XnLib/Include/XnMath.h b/ThirdParty/PSCommon/XnLib/Include/XnMath.h index df6044d97..6a7846454 100644 --- a/ThirdParty/PSCommon/XnLib/Include/XnMath.h +++ b/ThirdParty/PSCommon/XnLib/Include/XnMath.h @@ -35,7 +35,7 @@ namespace xnl } inline XnFloat Abs(XnFloat f) { - return fabs(f); + return (XnFloat)fabs(f); } template XnBool IsZero(T value, T tolerance) @@ -48,11 +48,11 @@ namespace xnl } inline XnFloat Sqrt(XnFloat f) { - return sqrt(f); + return (XnFloat)sqrt(f); } inline XnDouble Sqrt(XnDouble f) { - return sqrt(f); + return (XnFloat)sqrt(f); } template T Min(T value1, T value2) diff --git a/ThirdParty/PSCommon/XnLib/Include/XnVector3D.h b/ThirdParty/PSCommon/XnLib/Include/XnVector3D.h index 21728739d..5511becee 100644 --- a/ThirdParty/PSCommon/XnLib/Include/XnVector3D.h +++ b/ThirdParty/PSCommon/XnLib/Include/XnVector3D.h @@ -171,7 +171,7 @@ XnFloat &Vector3D::operator[](XnUInt32 index) Vector3D& Vector3D::Set(const Vector3D& other) {*this = other; return *this;} Vector3D& Vector3D::Set(const Point3D& point) {*this = point; return *this;} -Vector3D& Vector3D::Set(XnFloat x, XnFloat y, XnFloat z) {this->x = x; this->y = y; this->z = z; return *this;} +Vector3D& Vector3D::Set(XnFloat _x, XnFloat _y, XnFloat _z) {this->x = _x; this->y = _y; this->z = _z; return *this;} Vector3D& Vector3D::SetZero() {return Set(Zero());} XnBool Vector3D::IsZero() const {return *this==Zero();} diff --git a/ThirdParty/PSCommon/XnLib/Source/Win32/XnUSBWin32.cpp b/ThirdParty/PSCommon/XnLib/Source/Win32/XnUSBWin32.cpp index 68f3ec464..024a7e344 100644 --- a/ThirdParty/PSCommon/XnLib/Source/Win32/XnUSBWin32.cpp +++ b/ThirdParty/PSCommon/XnLib/Source/Win32/XnUSBWin32.cpp @@ -63,7 +63,7 @@ XnUSBEventCallbackList g_connectivityEvent; DWORD __stdcall DevDetectThread(LPVOID Arg) { char className[MAX_PATH]; - sprintf_s(className, "xnUsbDeviceDetector%x", &g_xnUsbhModule); + sprintf_s(className, "xnUsbDeviceDetector%p", &g_xnUsbhModule); g_xnUsbhDevDetectWnd = CreateWindow(className, "", WS_POPUP, 0, 0, 0, 0, NULL, NULL, NULL, NULL); @@ -302,7 +302,7 @@ XnStatus xnUSBPlatformSpecificInit() // give a unique class name (there might be multiple instances of this code in multiple DLLs) char className[MAX_PATH]; - sprintf_s(className, "xnUsbDeviceDetector%x", &g_xnUsbhModule); + sprintf_s(className, "xnUsbDeviceDetector%p", &g_xnUsbhModule); WNDCLASS wc; wc.style = 0; diff --git a/ThirdParty/PSCommon/XnLib/Source/XnLib.vcxproj b/ThirdParty/PSCommon/XnLib/Source/XnLib.vcxproj index 276122252..01c4d6910 100644 --- a/ThirdParty/PSCommon/XnLib/Source/XnLib.vcxproj +++ b/ThirdParty/PSCommon/XnLib/Source/XnLib.vcxproj @@ -116,23 +116,27 @@ StaticLibrary true MultiByte + v142 StaticLibrary true MultiByte + v142 StaticLibrary false true MultiByte + v142 StaticLibrary false true MultiByte + v142 diff --git a/ThirdParty/PSCommon/XnLib/Source/XnSytmmetricMatrix3x3.cpp b/ThirdParty/PSCommon/XnLib/Source/XnSytmmetricMatrix3x3.cpp index b2329a38f..175ebf166 100644 --- a/ThirdParty/PSCommon/XnLib/Source/XnSytmmetricMatrix3x3.cpp +++ b/ThirdParty/PSCommon/XnLib/Source/XnSytmmetricMatrix3x3.cpp @@ -48,11 +48,11 @@ Vector3D SymmetricMatrix3x3::GetEigenValuesNoScaling() const XnFloat a02_sqr = Math::Sqr(m_x02); XnFloat a12_sqr = Math::Sqr(m_x12); XnFloat p = (XnFloat)Math::ONE_SIXTH * (a00*a00+a11*a11+a22*a22 + 2*(a01_sqr+a02_sqr+a12_sqr)); - XnFloat q = (XnFloat).5*(a00*(a11*a22-a12_sqr)-a11*a02_sqr-a22*a01_sqr) + m_x01*m_x02*m_x12; + XnFloat q = XnFloat(0.5)*(a00*(a11*a22-a12_sqr)-a11*a02_sqr-a22*a01_sqr) + m_x01*m_x02*m_x12; XnFloat sqrt_p = Math::Sqrt(p), disc = p*p*p-q*q; - XnFloat phi = (XnFloat)Math::ONE_THIRD*atan2(Math::Sqrt(Math::Max((XnFloat)0,disc)),q); - XnFloat c=cos(phi) , s=sin(phi); - XnFloat sqrt_p_cos = sqrt_p*c, root_three_sqrt_p_sin = (XnFloat)Math::ROOT_THREE*sqrt_p*s; + XnFloat phi = XnFloat(Math::ONE_THIRD)*(XnFloat)atan2(Math::Sqrt(Math::Max((XnFloat)0,disc)),q); + XnFloat c= (XnFloat)cos(phi) , s= (XnFloat)sin(phi); + XnFloat sqrt_p_cos = sqrt_p*c, root_three_sqrt_p_sin = XnFloat(Math::ROOT_THREE)*sqrt_p*s; Vector3D lambda(m+2*sqrt_p_cos, m-sqrt_p_cos-root_three_sqrt_p_sin, m-sqrt_p_cos+root_three_sqrt_p_sin); Math::ExchangeSort(lambda.z, lambda.y, lambda.x); return lambda; diff --git a/Wrappers/java/OpenNI.jni/OpenNI.jni.vcxproj b/Wrappers/java/OpenNI.jni/OpenNI.jni.vcxproj index b95c484c8..cae24eb56 100644 --- a/Wrappers/java/OpenNI.jni/OpenNI.jni.vcxproj +++ b/Wrappers/java/OpenNI.jni/OpenNI.jni.vcxproj @@ -28,18 +28,22 @@ true Unicode true + v142 DynamicLibrary false true Unicode + v142 DynamicLibrary + v142 DynamicLibrary + v142 From 684ac44dc056487c5a3702a66da0f78b5b1cc55c Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Sat, 27 Aug 2022 14:42:18 +1000 Subject: [PATCH 04/13] Ensure waitForStream returns when a frame is received by not waking a thread that is not waiting on a stream --- Source/Core/OniContext.cpp | 22 ++++++++++++++++++++-- Source/Core/OniContext.h | 2 ++ 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/Source/Core/OniContext.cpp b/Source/Core/OniContext.cpp index f130b429f..47475a18d 100644 --- a/Source/Core/OniContext.cpp +++ b/Source/Core/OniContext.cpp @@ -670,6 +670,7 @@ OniStatus Context::waitForStreams(OniStreamHandle* pStreams, int streamCount, in { if (pStreams[i] == NULL) { + streamsList[i] = NULL; continue; } @@ -744,6 +745,7 @@ OniStatus Context::waitForStreams(OniStreamHandle* pStreams, int streamCount, in } while (XN_STATUS_OK == xnOSWaitEvent(hEvent, timeToWait)); xnOSStopTimer(&workTimer); + releaseThreadEvent(); if (oldestIndex != -1) { @@ -1049,15 +1051,31 @@ XN_EVENT_HANDLE Context::getThreadEvent() m_cs.Lock(); - if (XN_STATUS_OK != m_waitingThreads.Get(tid, hEvent)) + if (XN_STATUS_OK != m_knownThreads.Get(tid, hEvent)) { xnOSCreateEvent(&hEvent, FALSE); - m_waitingThreads.Set(tid, hEvent); + m_knownThreads.Set(tid, hEvent); } + m_waitingThreads.Set(tid, hEvent); m_cs.Unlock(); return hEvent; } +void Context::releaseThreadEvent() +{ + XN_THREAD_ID tid; + xnOSGetCurrentThreadID(&tid); + + m_cs.Lock(); + auto pEntry = m_waitingThreads.Find(tid); + if (m_waitingThreads.End() != pEntry) + { + m_waitingThreads.Remove(pEntry); + } + + m_cs.Unlock(); +} + ONI_NAMESPACE_IMPLEMENTATION_END diff --git a/Source/Core/OniContext.h b/Source/Core/OniContext.h index d9ee2afbf..4527ae053 100644 --- a/Source/Core/OniContext.h +++ b/Source/Core/OniContext.h @@ -115,6 +115,7 @@ class Context XnStatus loadLibraries(const char* directoryName); void onNewFrame(); XN_EVENT_HANDLE getThreadEvent(); + void releaseThreadEvent(); static void XN_CALLBACK_TYPE newFrameCallback(void* pCookie); FrameManager m_frameManager; @@ -131,6 +132,7 @@ class Context xnl::List m_recorders; xnl::Hash m_waitingThreads; + xnl::Hash m_knownThreads; xnl::CriticalSection m_cs; From 2ba92c79891c6caf2b7781ec352d0b44a26da322 Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Mon, 29 Aug 2022 14:41:55 +1000 Subject: [PATCH 05/13] Include thread id in messgages logged to a file. Add logging to waitForFrame function --- Source/Core/OniContext.cpp | 6 ++++++ ThirdParty/PSCommon/XnLib/Source/XnLogFileWriter.cpp | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Source/Core/OniContext.cpp b/Source/Core/OniContext.cpp index 47475a18d..f430c7803 100644 --- a/Source/Core/OniContext.cpp +++ b/Source/Core/OniContext.cpp @@ -741,7 +741,10 @@ OniStatus Context::waitForStreams(OniStreamHandle* pStreams, int streamCount, in timeToWait = timeout - (int)passedTime; else timeToWait = 0; + xnLogVerbose(XN_MASK_ONI_CONTEXT, "Wait %d for event %lx", timeToWait, (XnUInt32)hEvent); } + else + xnLogVerbose(XN_MASK_ONI_CONTEXT, "Wait for event %lx", (XnUInt32)hEvent); } while (XN_STATUS_OK == xnOSWaitEvent(hEvent, timeToWait)); xnOSStopTimer(&workTimer); @@ -749,9 +752,11 @@ OniStatus Context::waitForStreams(OniStreamHandle* pStreams, int streamCount, in if (oldestIndex != -1) { + xnLogVerbose(XN_MASK_ONI_CONTEXT, "Stream index %d", oldestIndex); return ONI_STATUS_OK; } + xnLogVerbose(XN_MASK_ONI_CONTEXT, "Timeout"); m_errorLogger.Append("waitForStreams: timeout reached"); return ONI_STATUS_TIME_OUT; } @@ -1032,6 +1037,7 @@ void Context::onNewFrame() m_cs.Lock(); for (xnl::Hash::Iterator it = m_waitingThreads.Begin(); it != m_waitingThreads.End(); ++it) { + xnLogVerbose(XN_MASK_ONI_CONTEXT, "Set event %lx", (XnUInt32)it->Value()); xnOSSetEvent(it->Value()); } m_cs.Unlock(); diff --git a/ThirdParty/PSCommon/XnLib/Source/XnLogFileWriter.cpp b/ThirdParty/PSCommon/XnLib/Source/XnLogFileWriter.cpp index 767512fcc..ea3eca5fd 100644 --- a/ThirdParty/PSCommon/XnLib/Source/XnLogFileWriter.cpp +++ b/ThirdParty/PSCommon/XnLib/Source/XnLogFileWriter.cpp @@ -49,10 +49,12 @@ void XnLogFileWriter::WriteEntry(const XnLogEntry* pEntry) // write timestamp and severity const XnUInt32 nMaxMessageSize = 2047; XnChar strBuffer[nMaxMessageSize + 1]; + XN_THREAD_ID tid; + xnOSGetCurrentThreadID(&tid); XnUInt32 nMessageLen = 0; XnUInt32 nChars = 0; - xnOSStrFormat(strBuffer + nMessageLen, nMaxMessageSize - nMessageLen, &nChars, "%9llu\t%-10s\t%s\t", pEntry->nTimestamp, pEntry->strSeverity, pEntry->strMask); + xnOSStrFormat(strBuffer + nMessageLen, nMaxMessageSize - nMessageLen, &nChars, "%9llu\t[0x%x]\t%-10s\t%s\t", pEntry->nTimestamp, (unsigned)tid, pEntry->strSeverity, pEntry->strMask); nMessageLen += nChars; if (m_bWriteLineInfo) From ae521ddc2ac2fe77e18ebf3567221706ad7d3100 Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Tue, 30 Aug 2022 10:19:58 +1000 Subject: [PATCH 06/13] Convert python to version 3 syntax --- Packaging/Harvest.py | 2 +- Packaging/ReleaseVersion.py | 14 +++++++------- Packaging/UpdateVersion.py | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Packaging/Harvest.py b/Packaging/Harvest.py index 978f7ce4b..e4856594f 100755 --- a/Packaging/Harvest.py +++ b/Packaging/Harvest.py @@ -335,7 +335,7 @@ def run(self): shutil.copy(os.path.join(self.rootDir, 'Packaging', 'Linux', 'primesense-usb.rules'), self.outDir) if len(sys.argv) < 3: - print 'Usage: ' + sys.argv[0] + ' ' + print('Usage: ' + sys.argv[0] + ' ') exit(1) rootDir = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), '..')) diff --git a/Packaging/ReleaseVersion.py b/Packaging/ReleaseVersion.py index e2fdf5fbe..3075e7e82 100755 --- a/Packaging/ReleaseVersion.py +++ b/Packaging/ReleaseVersion.py @@ -32,7 +32,7 @@ import UpdateVersion if len(sys.argv) < 2 or sys.argv[1] in ('-h','--help'): - print "usage: " + sys.argv[0] + " [UpdateVersion]" + print("usage: " + sys.argv[0] + " [UpdateVersion]") sys.exit(1) plat = sys.argv[1] @@ -89,14 +89,14 @@ def calc_jobs_number(): # Create installer strVersion = UpdateVersion.getVersionName() -print "Creating installer for OpenNI " + strVersion + " " + plat +print("Creating installer for OpenNI " + strVersion + " " + plat) finalDir = "Final" if not os.path.isdir(finalDir): os.mkdir(finalDir) if plat == 'android': if not 'NDK_ROOT' in os.environ: - print 'Please define NDK_ROOT!' + print('Please define NDK_ROOT!') sys.exit(2) ndkDir = os.environ['NDK_ROOT'] @@ -115,7 +115,7 @@ def calc_jobs_number(): shutil.copy('../Application.mk', buildDir + '/jni') rc = subprocess.call([ ndkDir + '/ndk-build', '-C', buildDir, '-j8' ]) if rc != 0: - print 'Build failed!' + print('Build failed!') sys.exit(3) finalFile = finalDir + '/' + outputDir + '.tar' @@ -174,12 +174,12 @@ def calc_jobs_number(): os.remove(origDir + '/build.release.' + plat + '.log') else: - print "Unknown OS" + print("Unknown OS") sys.exit(2) # also copy Release Notes and CHANGES documents shutil.copy('../ReleaseNotes.txt', finalDir) shutil.copy('../CHANGES.txt', finalDir) -print "Installer can be found under: " + finalDir -print "Done" +print("Installer can be found under: " + finalDir) +print("Done") diff --git a/Packaging/UpdateVersion.py b/Packaging/UpdateVersion.py index 87358c4c6..5ed67599f 100755 --- a/Packaging/UpdateVersion.py +++ b/Packaging/UpdateVersion.py @@ -58,7 +58,7 @@ def update(): print ("Illegal build version") sys.exit() - print "Going to update files to version: " + getVersionString() + print ("Going to update files to version: " + getVersionString()) update_self_defs("./UpdateVersion.py") update_src_ver_defs("../Include/OniVersion.h") From 344b2ca0dcbf6094d8dffc919fae2778d0d3d3ce Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Tue, 30 Aug 2022 10:27:47 +1000 Subject: [PATCH 07/13] Add 'peekFrame' to the API to prevent dropped frames when current frame attributes are accessed from multiple threads --- Include/OniCAPI.h | 3 +++ Include/OniVersion.h | 4 ++-- Include/OpenNI.h | 26 ++++++++++++++++++++-- Packaging/Install/Includes/Variables.wxi | 6 ++--- Packaging/Install/Install.wixproj | 2 +- Packaging/UpdateVersion.py | 4 ++-- ReleaseNotes.txt | 4 ++-- Source/Core/OniContext.cpp | 15 ++++++++++--- Source/Core/OniContext.h | 1 + Source/Core/OpenNI.cpp | 11 +++++++++ Source/Drivers/Kinect/BaseKinectStream.cpp | 8 +++---- 11 files changed, 65 insertions(+), 19 deletions(-) diff --git a/Include/OniCAPI.h b/Include/OniCAPI.h index aea426d49..2329c41d2 100644 --- a/Include/OniCAPI.h +++ b/Include/OniCAPI.h @@ -106,6 +106,9 @@ ONI_C_API OniStatus oniStreamStart(OniStreamHandle stream); /** Stop generating data from the stream. */ ONI_C_API void oniStreamStop(OniStreamHandle stream); +/** Get the current frame held by the stream without any side effect or blocking. For use in an onNewFrame() callback and after a successful oniWaitForStreams(). */ +ONI_C_API OniStatus oniStreamPeekFrame(OniStreamHandle stream, OniFrame** pFrame); + /** Get the next frame from the stream. This function is blocking until there is a new frame from the stream. For timeout, use oniWaitForStreams() first */ ONI_C_API OniStatus oniStreamReadFrame(OniStreamHandle stream, OniFrame** pFrame); diff --git a/Include/OniVersion.h b/Include/OniVersion.h index 7aa13ed58..9d1e349c0 100644 --- a/Include/OniVersion.h +++ b/Include/OniVersion.h @@ -21,9 +21,9 @@ #include "OniPlatform.h" #define ONI_VERSION_MAJOR 2 -#define ONI_VERSION_MINOR 2 +#define ONI_VERSION_MINOR 3 #define ONI_VERSION_MAINTENANCE 0 -#define ONI_VERSION_BUILD 33 +#define ONI_VERSION_BUILD 2 /** OpenNI version (in brief string format): "Major.Minor.Maintenance (Build)" */ #define ONI_BRIEF_VERSION_STRING \ diff --git a/Include/OpenNI.h b/Include/OpenNI.h index 64261fbd4..42060c584 100644 --- a/Include/OpenNI.h +++ b/Include/OpenNI.h @@ -800,8 +800,30 @@ class VideoStream } /** - Read the next frame from this video stream, delivered as a @ref VideoFrameRef. This is the primary - method for manually obtaining frames of video data. + Get the current frame from this video stream without any side effect or blocking, delivered as a @ref VideoFrameRef. + Call this after using @ref OpenNI::waitForAnyStream() to wait for new frames from several streams. + Alternatively, use @ref VideoStream::Listener to implement an event driven architecture + and call this in the callback method to get the frame from the stream. + + @param [out] pFrame Pointer to a @ref VideoFrameRef object to hold the reference to the new frame. + @returns Status code to indicated success or failure of this function. + */ + Status peekFrame(VideoFrameRef* pFrame) + { + if (!isValid()) + { + return STATUS_ERROR; + } + + OniFrame* pOniFrame; + Status rc = (Status)oniStreamPeekFrame(m_stream, &pOniFrame); + + pFrame->setReference(pOniFrame); + return rc; + } + + /** + Read the next frame from this video stream, delivered as a @ref VideoFrameRef. If no new frame is available, the call will block until one is available. To avoid blocking, use @ref VideoStream::Listener to implement an event driven architecture. Another alternative is to use @ref OpenNI::waitForAnyStream() to wait for new frames from several streams. diff --git a/Packaging/Install/Includes/Variables.wxi b/Packaging/Install/Includes/Variables.wxi index 06d017416..b76dcdf07 100644 --- a/Packaging/Install/Includes/Variables.wxi +++ b/Packaging/Install/Includes/Variables.wxi @@ -5,13 +5,13 @@ It's not enough to just include newer files. --> - + - + - +