[packages/OpenNI2] Rel 6; build fixes etc

arekm arekm at pld-linux.org
Sat Sep 26 22:05:10 CEST 2026


commit a6bc13bbd1ba1503ecd67a5865d957d724091fbc
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Sat Sep 26 21:56:48 2026 +0200

    Rel 6; build fixes etc

 OpenNI2-aliasing.patch |  46 +++++++++++++++++
 OpenNI2-doxygen.patch  |  12 +++++
 OpenNI2-gcc15.patch    | 135 +++++++++++++++++++++++++++++++++++++++++++++++++
 OpenNI2-javadoc.patch  |  44 ++++++++++++++++
 OpenNI2-seek.patch     | 118 ++++++++++++++++++++++++++++++++++++++++++
 OpenNI2-soname.patch   |   2 +-
 OpenNI2.spec           |  67 +++++++++++++++++++-----
 7 files changed, 410 insertions(+), 14 deletions(-)
---
diff --git a/OpenNI2.spec b/OpenNI2.spec
index efd32fa..123257c 100644
--- a/OpenNI2.spec
+++ b/OpenNI2.spec
@@ -9,12 +9,13 @@
 %if %{with ssse3}
 %define	with_sse3	1
 %endif
+%{?with_java:%{?use_default_jdk}}
 Summary:	OpenNI2 framework for Natural Interaction devices
 Summary(pl.UTF-8):	Szkielet OpenNI2 do urządzeń służących interakcji z naturą
 Name:		OpenNI2
 Version:	2.2.0.33
 %define	subver	beta2
-%define	rel	5
+%define	rel	6
 Release:	0.%{subver}.%{rel}
 License:	Apache v2.0
 Group:		Libraries
@@ -30,19 +31,23 @@ Patch5:		%{name}-norpath.patch
 Patch6:		%{name}-defines.patch
 Patch7:		%{name}-nowarn.patch
 Patch8:		%{name}-c++.patch
-URL:		http://structure.io/openni
+Patch9:		%{name}-seek.patch
+Patch10:	%{name}-aliasing.patch
+Patch11:	%{name}-gcc15.patch
+Patch12:	%{name}-javadoc.patch
+Patch13:	%{name}-doxygen.patch
+URL:		https://structure.io/openni
 BuildRequires:	OpenGL-devel
 BuildRequires:	OpenGL-glut-devel >= 3
 %{?with_apidocs:BuildRequires:	doxygen}
 %{?with_apidocs:BuildRequires:	graphviz}
-%{?with_java:BuildRequires:	jdk >= 1.6.0}
+%{?with_java:%buildrequires_jdk}
 BuildRequires:	libjpeg-devel
 BuildRequires:	libstdc++-devel >= 6:4.0
 BuildRequires:	libusb-devel >= 1.0.8
-BuildRequires:	python >= 1:2.6
 BuildRequires:	rpm-build >= 4.6
-BuildRequires:	rpmbuild(macros) >= 1.566
-BuildRequires:	sed >= 4.0
+%{?with_java:BuildRequires:	rpm-javaprov}
+BuildRequires:	rpmbuild(macros) >= 2.021
 BuildRequires:	udev-devel
 # NOTE: other platforms need adding a dozen of defines in Include/Linux-*/*.h
 ExclusiveArch:	%{ix86} %{x8664} x32 %{arm}
@@ -114,7 +119,7 @@ Summary(pl.UTF-8):	Interfejs Javy do OpenNI2
 Group:		Libraries/Java
 Requires:	%{name} = %{version}-%{release}
 Requires:	jpackage-utils
-Requires:	jre >= 1.6.0
+Requires:	jre
 
 %description -n java-OpenNI2
 Java wrapper for OpenNI2.
@@ -122,6 +127,19 @@ Java wrapper for OpenNI2.
 %description -n java-OpenNI2 -l pl.UTF-8
 Interfejs Javy do OpenNI2.
 
+%package -n java-OpenNI2-javadoc
+Summary:	Javadoc documentation for OpenNI2 Java wrapper
+Summary(pl.UTF-8):	Dokumentacja javadoc interfejsu Javy do OpenNI2
+Group:		Documentation
+Requires:	jpackage-utils
+BuildArch:	noarch
+
+%description -n java-OpenNI2-javadoc
+Javadoc documentation for OpenNI2 Java wrapper.
+
+%description -n java-OpenNI2-javadoc -l pl.UTF-8
+Dokumentacja javadoc interfejsu Javy do OpenNI2.
+
 %prep
 %setup -q -n %{name}-2.2-%{subver}
 %patch -P0 -p1
@@ -133,10 +151,19 @@ Interfejs Javy do OpenNI2.
 %patch -P6 -p1
 %patch -P7 -p1
 %patch -P8 -p1
+%patch -P9 -p1
+%patch -P10 -p1
+%patch -P11 -p1
+%patch -P12 -p1
+%patch -P13 -p1
 
 %build
-export CFLAGS="%{rpmcflags} -Wno-unused-local-typedefs -Wno-enum-compare -Wno-unused-local-typedefs -Wno-misleading-indentation"
-export CXXFLAGS="%{rpmcxxflags} -Wno-unused-local-typedefs -Wno-enum-compare -Wno-unused-local-typedefs -Wno-misleading-indentation"
+%if %{with java}
+export PATH="%{java_home}/bin:$PATH"
+%endif
+# all sources are compiled with $(CXX) $(CFLAGS); bundled glh and Bayer.cpp use register, removed in C++17
+export CFLAGS="%{rpmcxxflags} -std=gnu++14"
+export LDFLAGS="%{rpmldflags}"
 %{__make} \
 	CFG=Release \
 	CXX="%{__cxx}" \
@@ -147,10 +174,13 @@ export CXXFLAGS="%{rpmcxxflags} -Wno-unused-local-typedefs -Wno-enum-compare -Wn
 
 %if %{with apidocs}
 cd Source/Documentation
+# pages MainPage.txt links to; generated the way upstream's Runme.py does
+install -d Temp
+{ echo '/** @page legal Legal Stuff & Acknowledgments'; cat ../../NOTICE; echo '*/'; } > Temp/NOTICE.txt
+{ echo '/** @page release_notes Release Notes'; cat ../../ReleaseNotes.txt; echo '*/'; } > Temp/ReleaseNotes.txt.txt
 doxygen Doxyfile
 %if %{with java}
-# fails with "unknown tag" errors since Java 8
-#javadoc -d java $(find ../../Wrappers/java/OpenNI.java/src/org/openni -type f)
+%{javadoc} -d java ../../Wrappers/java/OpenNI.java/src/org/openni/*.java
 %endif
 %endif
 
@@ -195,6 +225,11 @@ install -p ${BDIR}/libOpenNI2.jni.so $RPM_BUILD_ROOT%{_libdir}
 cp -p ${BDIR}/org.openni.jar $RPM_BUILD_ROOT%{_javadir}
 %endif
 
+%if %{with apidocs} && %{with java}
+install -d $RPM_BUILD_ROOT%{_javadocdir}
+cp -pr Source/Documentation/java $RPM_BUILD_ROOT%{_javadocdir}/%{name}
+%endif
+
 %clean
 rm -rf $RPM_BUILD_ROOT
 
@@ -224,14 +259,14 @@ rm -rf $RPM_BUILD_ROOT
 
 %files devel
 %defattr(644,root,root,755)
-%attr(755,root,root) %{_libdir}/libOpenNI2.so
+%{_libdir}/libOpenNI2.so
 %{_includedir}/openni2
 %{_pkgconfigdir}/libopenni2.pc
 
 %if %{with apidocs}
 %files apidocs
 %defattr(644,root,root,755)
-%doc Source/Documentation/html/*.{bmp,css,html,js,png}
+%doc Source/Documentation/html/*.{bmp,css,html,js,png,svg}
 %endif
 
 %if %{with java}
@@ -240,3 +275,9 @@ rm -rf $RPM_BUILD_ROOT
 %attr(755,root,root) %{_libdir}/libOpenNI2.jni.so
 %{_javadir}/org.openni.jar
 %endif
+
+%if %{with apidocs} && %{with java}
+%files -n java-OpenNI2-javadoc
+%defattr(644,root,root,755)
+%{_javadocdir}/%{name}
+%endif
diff --git a/OpenNI2-aliasing.patch b/OpenNI2-aliasing.patch
new file mode 100644
index 0000000..2e6acd8
--- /dev/null
+++ b/OpenNI2-aliasing.patch
@@ -0,0 +1,46 @@
+Typed GetProperty() overloads stored through (XnProperty**) casts of XnXxxProperty** - strict aliasing
+violation; at -O2 GCC reports callers reading pProp uninitialized (-Wmaybe-uninitialized).
+--- OpenNI2-2.2-beta2/Source/Drivers/PS1080/DDK/XnDeviceModule.cpp.orig
++++ OpenNI2-2.2-beta2/Source/Drivers/PS1080/DDK/XnDeviceModule.cpp
+@@ -546,24 +546,37 @@
+ 	return (XN_STATUS_OK);
+ }
+ 
++// storing through (XnProperty**)ppXxxProperty violates strict aliasing - the caller may never see the value
+ XnStatus XnDeviceModule::GetProperty(XnUInt32 propertyId, XnIntProperty **ppIntProperty) const
+ {
+-	return GetPropertyImpl(propertyId, XN_PROPERTY_TYPE_INTEGER, (XnProperty**)ppIntProperty);
++	XnProperty* pProperty;
++	XnStatus nRetVal = GetPropertyImpl(propertyId, XN_PROPERTY_TYPE_INTEGER, &pProperty);
++	*ppIntProperty = (XnIntProperty*)pProperty;
++	return nRetVal;
+ }
+ 
+ XnStatus XnDeviceModule::GetProperty(XnUInt32 propertyId, XnRealProperty **ppRealProperty) const
+ {
+-	return GetPropertyImpl(propertyId, XN_PROPERTY_TYPE_REAL, (XnProperty**)ppRealProperty);
++	XnProperty* pProperty;
++	XnStatus nRetVal = GetPropertyImpl(propertyId, XN_PROPERTY_TYPE_REAL, &pProperty);
++	*ppRealProperty = (XnRealProperty*)pProperty;
++	return nRetVal;
+ }
+ 
+ XnStatus XnDeviceModule::GetProperty(XnUInt32 propertyId, XnStringProperty **ppStringProperty) const
+ {
+-	return GetPropertyImpl(propertyId, XN_PROPERTY_TYPE_STRING, (XnProperty**)ppStringProperty);
++	XnProperty* pProperty;
++	XnStatus nRetVal = GetPropertyImpl(propertyId, XN_PROPERTY_TYPE_STRING, &pProperty);
++	*ppStringProperty = (XnStringProperty*)pProperty;
++	return nRetVal;
+ }
+ 
+ XnStatus XnDeviceModule::GetProperty(XnUInt32 propertyId, XnGeneralProperty **ppPtrProperty) const
+ {
+-	return GetPropertyImpl(propertyId, XN_PROPERTY_TYPE_GENERAL, (XnProperty**)ppPtrProperty);
++	XnProperty* pProperty;
++	XnStatus nRetVal = GetPropertyImpl(propertyId, XN_PROPERTY_TYPE_GENERAL, &pProperty);
++	*ppPtrProperty = (XnGeneralProperty*)pProperty;
++	return nRetVal;
+ }
+ 
+ XnStatus XnDeviceModule::GetAllProperties(XnPropertySet* pSet) const
diff --git a/OpenNI2-doxygen.patch b/OpenNI2-doxygen.patch
new file mode 100644
index 0000000..9ab6fe6
--- /dev/null
+++ b/OpenNI2-doxygen.patch
@@ -0,0 +1,12 @@
+CHM output needs the Windows HTML Help compiler (HHC_LOCATION) and makes doxygen turn off the tree view.
+--- OpenNI2-2.2-beta2/Source/Documentation/Doxyfile.orig
++++ OpenNI2-2.2-beta2/Source/Documentation/Doxyfile
+@@ -1030,7 +1030,7 @@
+ # Microsoft HTML help workshop to generate a compiled HTML help file (.chm) 
+ # of the generated HTML documentation.
+ 
+-GENERATE_HTMLHELP      = YES
++GENERATE_HTMLHELP      = NO
+ 
+ # If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can 
+ # be used to specify the file name of the resulting .chm file. You 
diff --git a/OpenNI2-gcc15.patch b/OpenNI2-gcc15.patch
new file mode 100644
index 0000000..4853213
--- /dev/null
+++ b/OpenNI2-gcc15.patch
@@ -0,0 +1,135 @@
+GCC 15 -Werror fixes: terminate truncated strncpy, memcpy in XnString::Resize (bogus -Wstringop-truncation),
+mark compile-assert typedef unused; glh -Wmisleading-indentation hunks from Debian 0013-Fix-GCC6-compilation
+--- OpenNI2-2.2-beta2/Source/Drivers/PS1080/DDK/XnActualPropertiesHash.cpp.orig
++++ OpenNI2-2.2-beta2/Source/Drivers/PS1080/DDK/XnActualPropertiesHash.cpp
+@@ -28,7 +28,8 @@
+ 
+ XnActualPropertiesHash::XnActualPropertiesHash(const XnChar* strName)
+ {
+-	strncpy(m_strName, strName, XN_DEVICE_MAX_STRING_LENGTH);
++	strncpy(m_strName, strName, XN_DEVICE_MAX_STRING_LENGTH-1);
++	m_strName[XN_DEVICE_MAX_STRING_LENGTH-1] = 0;
+ }
+ 
+ XnActualPropertiesHash::~XnActualPropertiesHash()
+--- OpenNI2-2.2-beta2/Source/Drivers/PS1080/DDK/XnActualStringProperty.cpp.orig
++++ OpenNI2-2.2-beta2/Source/Drivers/PS1080/DDK/XnActualStringProperty.cpp
+@@ -29,7 +29,8 @@
+ XnActualStringProperty::XnActualStringProperty(XnUInt32 propertyId, const XnChar* strName, const XnChar* strInitialValue /* = "" */, const XnChar* strModule /* = "" */ ) :
+ 	XnStringProperty(propertyId, strName, m_strValue, strModule)
+ {
+-	strncpy(m_strValue, strInitialValue, XN_DEVICE_MAX_STRING_LENGTH);
++	strncpy(m_strValue, strInitialValue, XN_DEVICE_MAX_STRING_LENGTH-1);
++	m_strValue[XN_DEVICE_MAX_STRING_LENGTH-1] = 0;
+ 	// set a callback for get operations
+ 	UpdateGetCallback(GetCallback, this);
+ }
+--- OpenNI2-2.2-beta2/Source/Drivers/PSLink/LinkProtoLib/XnLinkProtoUtils.h.orig
++++ OpenNI2-2.2-beta2/Source/Drivers/PSLink/LinkProtoLib/XnLinkProtoUtils.h
+@@ -15,7 +15,7 @@
+ #define XN_MASK_LINK "xnLink"
+ 
+ #ifndef XN_COMPILER_ASSERT
+-#define XN_COMPILER_ASSERT(x) typedef int compileAssert[x ? 1 : -1]
++#define XN_COMPILER_ASSERT(x) typedef int compileAssert[x ? 1 : -1] __attribute__((unused))
+ #endif
+ 
+ template <typename T>
+--- OpenNI2-2.2-beta2/ThirdParty/GL/glh/glh_glut2.h.orig
++++ OpenNI2-2.2-beta2/ThirdParty/GL/glh/glh_glut2.h
+@@ -190,7 +190,7 @@
+   {
+       if (interactors.empty())
+ 	  return;
+-	  std::list<glut_interactor *>::iterator it = 
++      std::list<glut_interactor *>::iterator it = 
+ 		  std::find(interactors.begin(), interactors.end(), gi);
+ 	if(it != interactors.end())
+ 	  interactors.erase(it);
+--- OpenNI2-2.2-beta2/ThirdParty/GL/glh/glh_linear.h.orig
++++ OpenNI2-2.2-beta2/ThirdParty/GL/glh/glh_linear.h
+@@ -225,7 +225,7 @@
+ 		for(int i = 0; i < N; i++)
+ 			if(v1.v[i] != v2.v[i])
+ 				return false;
+-			return true;
++		return true;
+ 	}
+ 	
+ 	template <int N, class T> inline
+@@ -633,7 +633,7 @@
+ 			scp[i] = real(fabs(s[i][0]));
+ 			for(j=1;j<4;j++)
+ 				if(real(fabs(s[i][j])) > scp[i]) scp[i] = real(fabs(s[i][j]));
+-				if(scp[i] == 0.0) return minv; // singular matrix!
++			if(scp[i] == 0.0) return minv; // singular matrix!
+ 		}
+ 		
+ 		int pivot_to;
+@@ -647,26 +647,26 @@
+ 			for(p=i+1;p<4;p++)
+ 				if(real(fabs(s[p][i]/scp[p])) > scp_max)
+ 				{ scp_max = real(fabs(s[p][i]/scp[p])); pivot_to = p; }
+-				// Pivot if necessary
+-				if(pivot_to != i)
+-				{
+-					tmprow = s[i];
+-					s[i] = s[pivot_to];
+-					s[pivot_to] = tmprow;
+-					real tmpscp;
+-					tmpscp = scp[i];
+-					scp[i] = scp[pivot_to];
+-					scp[pivot_to] = tmpscp;
+-				}
+-				
+-				real mji;
+-				// perform gaussian elimination
+-				for(j=i+1;j<4;j++)
+-				{
+-					mji = s[j][i]/s[i][i];
+-					s[j][i] = 0.0;
+-					for(jj=i+1;jj<8;jj++)
+-						s[j][jj] -= mji*s[i][jj];
++			// Pivot if necessary
++			if(pivot_to != i)
++			{
++				tmprow = s[i];
++				s[i] = s[pivot_to];
++				s[pivot_to] = tmprow;
++				real tmpscp;
++				tmpscp = scp[i];
++				scp[i] = scp[pivot_to];
++				scp[pivot_to] = tmpscp;
++			}
++
++			real mji;
++			// perform gaussian elimination
++			for(j=i+1;j<4;j++)
++			{
++				mji = s[j][i]/s[i][i];
++				s[j][i] = 0.0;
++				for(jj=i+1;jj<8;jj++)
++					s[j][jj] -= mji*s[i][jj];
+ 				}
+ 		}
+ 		if(s[3][3] == 0.0) return minv; // singular matrix!
+@@ -702,7 +702,7 @@
+ 			for(j=0;j<4;j++)
+ 				minv(i,j) = s[i][j+4] / s[i][i];
+ 			
+-			return minv;
++		return minv;
+ 	}
+     
+     
+--- OpenNI2-2.2-beta2/ThirdParty/PSCommon/XnLib/Include/XnString.h.orig
++++ OpenNI2-2.2-beta2/ThirdParty/PSCommon/XnLib/Include/XnString.h
+@@ -115,7 +115,7 @@
+ 		XnChar* newData = XN_NEW_ARR(XnChar, newSize);
+ 		if (m_str != NULL)
+ 		{
+-			strncpy(newData, m_str, m_capacity);
++			memcpy(newData, m_str, m_capacity);
+ 			XN_DELETE_ARR(m_str);
+ 		}
+ 		m_str = newData;
diff --git a/OpenNI2-javadoc.patch b/OpenNI2-javadoc.patch
new file mode 100644
index 0000000..66a0088
--- /dev/null
+++ b/OpenNI2-javadoc.patch
@@ -0,0 +1,44 @@
+javadoc 9+ rejects generics and <t> in doc comments as unknown tags.
+From Debian 0018-Fix-javadoc-with-Java-17.patch (Jochen Sprickerhof).
+--- OpenNI2-2.2-beta2.orig/Wrappers/java/OpenNI.java/src/org/openni/CoordinateConverter.java
++++ OpenNI2-2.2-beta2/Wrappers/java/OpenNI.java/src/org/openni/CoordinateConverter.java
+@@ -54,7 +54,7 @@ public class CoordinateConverter {
+    *        coordinates
+    * @param worldZ The Z coordinate of the point to be converted, measured in millimeters in World
+    *        coordinates
+-   * @return Point3D<Integer> Coordinate of the output value, and depth measured in the
++   * @return Point3D Coordinate of the output value, and depth measured in the
+    *         {@link PixelFormat} of depthStream
+    */
+   public static Point3D<Integer> convertWorldToDepthInt(final VideoStream depthStream,
+@@ -85,10 +85,10 @@ public class CoordinateConverter {
+    * @return Point3DPoint to a place to store: the X coordinate of the output value, measured in
+    *         pixels with 0.0 at far left of the image
+    *         <p>
+-   *         <t> the Y coordinate of the output value, measured in pixels with 0.0 at the top of the
++   *         the Y coordinate of the output value, measured in pixels with 0.0 at the top of the
+    *         image
+    *         <p>
+-   *         <t> the Z(depth) coordinate of the output value, measured in millimeters with 0.0 at
++   *         the Z(depth) coordinate of the output value, measured in millimeters with 0.0 at
+    *         the camera lens
+    */
+   public static Point3D<Float> convertWorldToDepthFloat(final VideoStream depthStream,
+@@ -115,7 +115,7 @@ public class CoordinateConverter {
+    *        top of the image
+    * @param depthZ the Z(depth) coordinate of the point to be converted, measured in the
+    *        {@link PixelFormat} of depthStream
+-   * @return Point3D<Float> to a place to store the X,Y,Z coordinate of the output value, measured
++   * @return Point3D to a place to store the X,Y,Z coordinate of the output value, measured
+    *         in millimeters in World coordinates
+    */
+   public static Point3D<Float> convertDepthToWorld(final VideoStream depthStream, int depthX,
+@@ -143,7 +143,7 @@ public class CoordinateConverter {
+    *        top of the image
+    * @param depthZ Z(depth) coordinate of the point to be converted, measured in the
+    *        {@link PixelFormat}of depthStream
+-   * @return Point3D<Float> to a place to store the X coordinate of the output value, measured in
++   * @return Point3D to a place to store the X coordinate of the output value, measured in
+    *         millimeters in World coordinates
+    */
+   public static Point3D<Float> convertDepthToWorld(final VideoStream depthStream, float depthX,
diff --git a/OpenNI2-seek.patch b/OpenNI2-seek.patch
new file mode 100644
index 0000000..c02142a
--- /dev/null
+++ b/OpenNI2-seek.patch
@@ -0,0 +1,118 @@
+Seek fixes. Device::invoke: Seek struct handed on via data went out of scope (upstream bec66c0e instead passes it for every command).
+From upstream develop: 7f384612 + 3f776fba (failed seek deadlocked the caller), 64a0433a (NULL source), 2125ea61 (NiViewer invalid frame).
+--- OpenNI2-2.2-beta2/Source/Core/OniDevice.cpp.orig
++++ OpenNI2-2.2-beta2/Source/Core/OniDevice.cpp
+@@ -202,6 +202,9 @@
+ }
+ OniStatus Device::invoke(int commandId, void* data, int dataSize)
+ {
++	// data may point here, so it must outlive the call below
++	Device::Seek seek;
++
+ 	if (commandId == ONI_DEVICE_COMMAND_SEEK)
+ 	{
+ 		if (dataSize != sizeof(OniSeek))
+@@ -210,7 +213,6 @@
+ 		}
+ 
+ 		// Change seek's stream handle.
+-		Device::Seek seek;
+ 		OniSeek* pSeek = (OniSeek*)data;
+ 		seek.frameId = pSeek->frameIndex;
+ 		seek.pStream = ((_OniStream*)pSeek->stream)->pStream->getHandle();
+--- OpenNI2-2.2-beta2/Source/Drivers/OniFile/PlayerDevice.cpp.orig
++++ OpenNI2-2.2-beta2/Source/Drivers/OniFile/PlayerDevice.cpp
+@@ -91,7 +91,7 @@
+ };
+ 
+ PlayerDevice::PlayerDevice(const xnl::String& filePath) : 
+-	m_filePath(filePath), m_fileHandle(0), m_threadHandle(NULL), m_running(FALSE), m_isSeeking(FALSE),
++	m_filePath(filePath), m_fileHandle(0), m_threadHandle(NULL), m_running(FALSE), m_isSeeking(FALSE), m_seekingFailed(FALSE),
+ 	m_dPlaybackSpeed(1.0), m_nStartTimestamp(0), m_nStartTime(0), m_bHasTimeReference(FALSE), 
+ 	m_bRepeat(TRUE), m_player(filePath.Data()), m_driverEOFCallback(NULL), m_driverCookie(NULL)
+ {
+@@ -438,6 +438,7 @@
+ 		m_seek.frameId = pSeek->frameId;
+ 		m_seek.pStream = pSeek->pStream;
+ 		m_isSeeking = TRUE;
++        m_seekingFailed = FALSE;
+ 
+ 		// Set the ready for data and manual trigger events, to make sure player thread wakes up.
+ 		m_readyForDataInternalEvent.Set();
+@@ -445,6 +446,9 @@
+ 
+ 		// Wait for seek to complete.
+ 		m_SeekCompleteInternalEvent.Wait(XN_WAIT_INFINITE);
++        
++        if (m_seekingFailed)
++            return ONI_STATUS_ERROR;
+ 	}
+ 	else
+ 	{
+@@ -555,12 +559,18 @@
+ 
+ 			// Seek the frame ID for first source (seek to (frame ID-1) so next read frame is frameId).
+ 			PlayerSource* pSource = m_seek.pStream->GetSource();
+-			XnStatus xnrc = m_player.SeekToFrame(pSource->GetNodeName(), m_seek.frameId, XN_PLAYER_SEEK_SET);
++
++			XnStatus xnrc;
++			if(pSource) {
++				xnrc = m_player.SeekToFrame(pSource->GetNodeName(), m_seek.frameId, XN_PLAYER_SEEK_SET);
++			}else{
++				xnrc = XN_STATUS_ERROR;
++			}
++
+ 			if (xnrc != XN_STATUS_OK)
+ 			{
+ 				// Failure to seek.
+-				m_isSeeking = FALSE;
+-				continue;
++				m_seekingFailed = TRUE;
+ 			}
+ 
+ 			// Return playback speed to normal.
+@@ -573,11 +583,11 @@
+ 			// Reset the time reference.
+ 			m_bHasTimeReference = FALSE;
+ 
+-			// Raise the seek complete event.
+-			m_SeekCompleteInternalEvent.Set();
+-
+ 			// Mark the seeking flag as false.
+ 			m_isSeeking = FALSE;
++			
++			// Raise the seek complete event.
++			m_SeekCompleteInternalEvent.Set();
+ 		}
+ 		else
+ 		{
+--- OpenNI2-2.2-beta2/Source/Drivers/OniFile/PlayerDevice.h.orig
++++ OpenNI2-2.2-beta2/Source/Drivers/OniFile/PlayerDevice.h
+@@ -147,6 +147,7 @@
+ 	// Seek frame.
+ 	Seek m_seek;
+ 	OniBool m_isSeeking;
++    OniBool m_seekingFailed;
+ 
+ 	// Speed of playback.
+ 	XnDouble m_dPlaybackSpeed;
+--- OpenNI2-2.2-beta2/Source/Tools/NiViewer/Device.cpp.orig
++++ OpenNI2-2.2-beta2/Source/Tools/NiViewer/Device.cpp
+@@ -449,7 +449,7 @@
+ 		}
+ 
+ 		// the new frameId might be different than expected (due to clipping to edges)
+-		frameId = pCurFrame->getFrameIndex();
++		frameId = pCurFrame->isValid()? pCurFrame->getFrameIndex() : 0;
+ 
+ 		displayMessage("Current frame: %u/%u", frameId, numberOfFrames);
+ 	}
+@@ -478,7 +478,7 @@
+ 	if (pStream == NULL)
+ 		return;
+ 
+-	int frameId = pCurFrame->getFrameIndex();
++	int frameId = pCurFrame->isValid() ? pCurFrame->getFrameIndex() : 0;
+ 	// Calculate the new frame ID
+ 	frameId = (frameId + nDiff < 1) ? 1 : frameId + nDiff;
+ 
diff --git a/OpenNI2-soname.patch b/OpenNI2-soname.patch
index 0e6f4d9..7befe5c 100644
--- a/OpenNI2-soname.patch
+++ b/OpenNI2-soname.patch
@@ -59,7 +59,7 @@
 +LIB_NAME = OpenNI2
 +LIB_NAME_SOVERSION=$(MAJOR_VERSION).$(MINOR_VERSION)
  LIB_DIRS = ../../ThirdParty/PSCommon/XnLib/Bin/$(PLATFORM)-$(CFG)
- USED_LIBS = XnLib dl pthread
+ USED_LIBS = XnLib jpeg dl pthread
  ifneq ("$(OSTYPE)","Darwin")
 #--- a/Wrappers/java/OpenNI.jni/Makefile
 #+++ b/Wrappers/java/OpenNI.jni/Makefile
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/OpenNI2.git/commitdiff/a6bc13bbd1ba1503ecd67a5865d957d724091fbc



More information about the pld-cvs-commit mailing list