Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Updated to version 1.5.2.23.

commit 15160748a400c6089e7732d805f74992331193fa 1 parent d07a88a
@OpenNI authored
Showing with 41,175 additions and 3,541 deletions.
  1. +101 −0 CHANGES
  2. +37 −10 Data/SamplesConfig.xml
  3. BIN  Documentation/OpenNI.chm
  4. +6 −2 Include/ARC/XnPlatformARC.h
  5. +19 −12 Include/Linux-x86/XnPlatformLinux-x86.h
  6. +27 −14 Include/Win32/XnPlatformWin32.h
  7. +5 −5 Include/XnArray.h
  8. +15 −0 Include/XnBitSet.h
  9. +71 −1 Include/XnCppWrapper.h
  10. +3 −0  Include/XnDataTypes.h
  11. +110 −57 Include/XnDump.h
  12. +127 −0 Include/XnDumpWriters.h
  13. +6 −11 Include/XnEvent.h
  14. +322 −70 Include/XnLog.h
  15. +12 −12 Include/XnLogTypes.h
  16. +1 −1  Include/XnLogWriterBase.h
  17. +10 −0 Include/XnMacros.h
  18. +10 −0 Include/XnModuleCFunctions.h
  19. +1 −0  Include/XnModuleCppInterface.h
  20. +2 −0  Include/XnModuleInterface.h
  21. +37 −24 Include/XnOS.h
  22. +6 −8 Include/XnOSCpp.h
  23. +1 −1  Include/XnPlatform.h
  24. +43 −0 Include/XnPrdNode.h
  25. +2 −2 Include/XnStatus.h
  26. +1 −9 Include/XnStringsHash.h
  27. +63 −11 Include/XnTypes.h
  28. +3 −3 Include/XnVersion.h
  29. +6 −3 Platform/Android/Samples/SamplesAssistant/jni/Application.mk
  30. +0 −2  Platform/Android/Samples/SamplesAssistant/jni/org_OpenNI_Samples_Assistant_NativeMethods.cpp
  31. +7 −3 Platform/Android/Samples/SamplesAssistant/src/org/OpenNI/Samples/Assistant/OpenNIBaseActivity.java
  32. +259 −246 Platform/Android/Samples/UserTracker/src/org/OpenNI/Samples/UserTracker/UserTracker.java
  33. +21 −21 Platform/Android/Samples/UserTracker/src/org/OpenNI/Samples/UserTracker/UserTrackerActivity.java
  34. +7 −3 Platform/Android/jni/Application.mk
  35. +1 −1  Platform/Android/jni/OpenNI/Android.mk
  36. +18 −0 Platform/Android/jni/Samples/NiSimpleSkeleton/Android.mk
  37. +0 −154 Platform/Linux-Arm/Build/CommonMakefile
  38. +0 −2  Platform/Linux-Arm/Build/MakeInstallBeagleboard
  39. +0 −112 Platform/Linux-Arm/Build/Makefile
  40. +0 −18 Platform/Linux-Arm/Build/Modules/nimCodecs/Makefile
  41. +0 −69 Platform/Linux-Arm/Build/Modules/nimCodecs/nimCodecs.vpj
  42. +0 −14 Platform/Linux-Arm/Build/Modules/nimMockNodes/Makefile
  43. +0 −69 Platform/Linux-Arm/Build/Modules/nimMockNodes/nimMockNodes.vpj
  44. +0 −17 Platform/Linux-Arm/Build/Modules/nimRecorder/Makefile
  45. +0 −80 Platform/Linux-Arm/Build/Modules/nimRecorder/nimRecorder.vpj
  46. +0 −12 Platform/Linux-Arm/Build/OpenNI.vpw
  47. +0 −21 Platform/Linux-Arm/Build/OpenNI/Makefile
  48. +0 −98 Platform/Linux-Arm/Build/OpenNI/OpenNI.vpj
  49. BIN  Platform/Linux-Arm/Build/Prerequisites/libusb-1.0.8.tar.bz2
  50. +0 −12 Platform/Linux-Arm/Build/Samples/NiAudioSample/Makefile
  51. +0 −12 Platform/Linux-Arm/Build/Samples/NiBackRecorder/Makefile
  52. +0 −12 Platform/Linux-Arm/Build/Samples/NiCRead/Makefile
  53. +0 −12 Platform/Linux-Arm/Build/Samples/NiConvertXToONI/Makefile
  54. +0 −12 Platform/Linux-Arm/Build/Samples/NiRecordSynthetic/Makefile
  55. +0 −12 Platform/Linux-Arm/Build/Samples/NiSampleModule/Makefile
  56. +0 −12 Platform/Linux-Arm/Build/Samples/NiSimpleCreate/Makefile
  57. +0 −12 Platform/Linux-Arm/Build/Samples/NiSimpleRead/Makefile
  58. +0 −18 Platform/Linux-Arm/Build/Utils/niLicense/Makefile
  59. +0 −18 Platform/Linux-Arm/Build/Utils/niReg/Makefile
  60. +0 −77 Platform/Linux-Arm/Build/Utils/niReg/niReg.vpj
  61. +0 −54 Platform/Linux-Arm/CreateRedist/Output/BuildOpenNI.txt
  62. +0 −8 Platform/Linux-Arm/CreateRedist/Output/BuildSmpRelease.txt
  63. +0 −788 Platform/Linux-Arm/CreateRedist/Output/EngineDoxy.txt
  64. +0 −16 Platform/Linux-Arm/CreateRedist/Output/Nightly.log
  65. +0 −3  Platform/Linux-Arm/CreateRedist/RedistMaker
  66. +0 −366 Platform/Linux-Arm/CreateRedist/Redist_OpenNi.py
  67. +0 −110 Platform/Linux-Arm/CreateRedist/install.sh
  68. +0 −40 Platform/Linux-x86/Build/Common/CommonDefs.mak
  69. +0 −6 Platform/Linux-x86/Build/Common/Platform.Arm
  70. +0 −3  Platform/Linux-x86/Build/Common/Platform.CE4100
  71. +0 −27 Platform/Linux-x86/Build/Common/Platform.x86
  72. +0 −1  Platform/Linux-x86/Build/Make.Arm
  73. +0 −1  Platform/Linux-x86/Build/Make.CE4100
  74. +0 −12 Platform/Linux-x86/Build/OpenNI.vpw
  75. +0 −28 Platform/Linux-x86/Build/Samples/NiUserTracker/Makefile
  76. +0 −3  Platform/Linux-x86/CreateRedist/RedistMaker
  77. +0 −1  Platform/Linux-x86/CreateRedist/RedistMaker.Arm
  78. +0 −1  Platform/Linux-x86/CreateRedist/RedistMaker.CE4100
  79. 0  Platform/{Linux-x86 → Linux}/Build/Common/CommonCSMakefile
  80. +8 −9 Platform/{Linux-x86 → Linux}/Build/Common/CommonCppMakefile
  81. +57 −0 Platform/Linux/Build/Common/CommonDefs.mak
  82. 0  Platform/{Linux-x86 → Linux}/Build/Common/CommonJavaMakefile
  83. 0  Platform/{Linux-x86 → Linux}/Build/Common/CommonTargets.mak
  84. +12 −0 Platform/Linux/Build/Common/Platform.Arm
  85. +5 −0 Platform/Linux/Build/Common/Platform.x64
  86. +25 −0 Platform/Linux/Build/Common/Platform.x86
  87. +4 −0 Platform/Linux/Build/MakeCross.Arm
  88. +76 −61 Platform/{Linux-x86 → Linux}/Build/Makefile
  89. 0  Platform/{Linux-x86 → Linux}/Build/Modules/nimCodecs/Makefile
  90. 0  Platform/{Linux-x86 → Linux}/Build/Modules/nimCodecs/nimCodecs.vpj
  91. 0  Platform/{Linux-x86 → Linux}/Build/Modules/nimMockNodes/Makefile
  92. 0  Platform/{Linux-x86 → Linux}/Build/Modules/nimMockNodes/nimMockNodes.vpj
  93. 0  Platform/{Linux-x86 → Linux}/Build/Modules/nimRecorder/Makefile
  94. 0  Platform/{Linux-x86 → Linux}/Build/Modules/nimRecorder/nimRecorder.vpj
  95. +1 −1  Platform/{Linux-x86 → Linux}/Build/OpenNI/Makefile
  96. 0  Platform/{Linux-x86 → Linux}/Build/OpenNI/OpenNI.vpj
  97. 0  Platform/{Linux-x86 → Linux}/Build/Prerequisites/libusb-1.0.8-osx.tar.bz2
  98. 0  Platform/{Linux-x86 → Linux}/Build/Prerequisites/libusb-1.0.8.tar.bz2
  99. +2 −2 Platform/{Linux-x86 → Linux}/Build/Res/AssemblyInfo-OpenNI.cs
  100. 0  Platform/{Linux-x86 → Linux}/Build/Res/mainicon.ico
  101. 0  Platform/{Linux-x86 → Linux}/Build/Samples/NiAudioSample/Makefile
  102. 0  Platform/{Linux-x86 → Linux}/Build/Samples/NiBackRecorder/Makefile
  103. 0  Platform/{Linux-x86 → Linux}/Build/Samples/NiCRead/Makefile
  104. 0  Platform/{Linux-x86 → Linux}/Build/Samples/NiConvertXToONI/Makefile
  105. +22 −0 Platform/Linux/Build/Samples/NiHandTracker/Makefile
  106. 0  Platform/{Linux-x86 → Linux}/Build/Samples/NiRecordSynthetic/Makefile
  107. 0  Platform/{Linux-x86 → Linux}/Build/Samples/NiSampleModule/Makefile
  108. 0  Platform/{Linux-x86 → Linux}/Build/Samples/NiSimpleCreate/Makefile
  109. 0  Platform/{Linux-x86 → Linux}/Build/Samples/NiSimpleRead/Makefile
  110. 0  Platform/{Linux-x86 → Linux}/Build/Samples/NiSimpleRead/NiSimpleRead.vpj
  111. +11 −0 Platform/Linux/Build/Samples/NiSimpleSkeleton/Makefile
  112. +1 −1  ...ild/Samples/NiSimpleRead/NiSimpleRead.vpj → Linux/Build/Samples/NiSimpleSkeleton/NiSimpleSkeleton.vpj}
  113. 0  Platform/{Linux-x86 → Linux}/Build/Samples/NiSimpleViewer/Makefile
  114. +29 −0 Platform/Linux/Build/Samples/NiUserSelection/Makefile
  115. +29 −0 Platform/Linux/Build/Samples/NiUserTracker/Makefile
  116. 0  Platform/{Linux-x86 → Linux}/Build/Samples/NiViewer/Makefile
  117. 0  Platform/{Linux-x86 → Linux}/Build/Samples/NiViewer/NiViewer.vpj
  118. 0  Platform/{Linux-x86 → Linux}/Build/Samples/SimpleRead.java/Makefile
  119. 0  Platform/{Linux-x86 → Linux}/Build/Samples/SimpleRead.net/Makefile
  120. 0  Platform/{Linux-x86 → Linux}/Build/Samples/SimpleViewer.java/Makefile
  121. 0  Platform/{Linux-x86 → Linux}/Build/Samples/SimpleViewer.net/Makefile
  122. 0  Platform/{Linux-x86 → Linux}/Build/Samples/UserTracker.java/Makefile
  123. 0  Platform/{Linux-x86 → Linux}/Build/Samples/UserTracker.net/Makefile
  124. 0  Platform/{Linux-x86 → Linux}/Build/Utils/niLicense/Makefile
  125. 0  Platform/{Linux-x86 → Linux}/Build/Utils/niReg/Makefile
  126. 0  Platform/{Linux-x86 → Linux}/Build/Utils/niReg/niReg.vpj
  127. 0  Platform/{Linux-x86 → Linux}/Build/Wrappers/OpenNI.java/Makefile
  128. 0  Platform/{Linux-x86 → Linux}/Build/Wrappers/OpenNI.jni/Makefile
  129. 0  Platform/{Linux-x86 → Linux}/Build/Wrappers/OpenNI.net/Makefile
  130. 0  Platform/{Linux-x86 → Linux}/Build/Wrappers/OpenNI.net/OpenNI.snk
  131. +3 −0  Platform/Linux/CreateRedist/RedistMaker
  132. +2 −0  Platform/Linux/CreateRedist/RedistMaker.Arm
  133. +113 −146 Platform/{Linux-x86 → Linux}/CreateRedist/Redist_OpenNi.py
  134. 0  Platform/{Linux-x86 → Linux}/CreateRedist/install.sh
  135. +5 −5 Platform/Win32/Build/BuildJava.py
  136. +1,480 −4 Platform/Win32/Build/Modules/nimCodecs/nimCodecs.vcproj
  137. +8 −8 Platform/Win32/Build/Modules/nimMockNodes/nimMockNodes.vcproj
  138. +8 −4 Platform/Win32/Build/Modules/nimRecorder/nimRecorder.vcproj
  139. +42 −0 Platform/Win32/Build/OpenNI.sln
  140. +24 −5 Platform/Win32/Build/OpenNI/OpenNI.vcproj
  141. +2 −2 Platform/Win32/Build/Res/AssemblyInfo-OpenNI.cs
  142. +403 −0 Platform/Win32/Build/Samples/NiHandTracker/NiHandTracker.vcproj
  143. +381 −0 Platform/Win32/Build/Samples/NiSimpleSkeleton/NiSimpleSkeleton.vcproj
  144. +487 −0 Platform/Win32/Build/Samples/NiUserSelection/NiUserSelection.vcproj
  145. +1 −2  Platform/Win32/Build/Utils/OpenNIFilter/Setup.cpp
  146. +7 −9 Platform/Win32/Build/Utils/OpenNIFilter/XnVideoSource.cpp
  147. +6 −6 Platform/Win32/Build/Utils/OpenNIFilter/XnVideoSource.h
  148. +16 −9 Platform/Win32/Build/Utils/OpenNIFilter/XnVideoStream.cpp
  149. +1 −1  Platform/Win32/Build/Utils/OpenNIFilter/XnVideoStream.h
  150. +4 −1 Platform/Win32/Build/Wrappers/OpenNI.net/OpenNI.net.csproj
  151. +1 −1  Platform/Win32/CreateRedist/OpenNi_Config.xml
  152. +8 −8 Platform/Win32/CreateRedist/RedistMaker.bat
  153. +91 −70 Platform/Win32/CreateRedist/Redist_OpenNi.py
  154. +145 −117 Platform/Win32/CreateRedist/UpdateVersion.py
  155. 0  Platform/Win32/CreateRedist/__init__.py
  156. +78 −0 Platform/Win32/CreateRedist/common/CopyToRepository.py
  157. +38 −39 Platform/Win32/CreateRedist/common/redist_base.py
  158. BIN  Platform/Win32/Driver/Bin/amd64/psdrv3.sys
  159. BIN  Platform/Win32/Driver/Bin/psdrv3.cat
  160. +4 −1 Platform/Win32/Driver/Bin/psdrv3.inf
  161. BIN  Platform/Win32/Driver/Bin/x86/psdrv3.sys
  162. +2 −2 Platform/Win32/Driver/Build/UpdateVersion.py
  163. +4 −1 Platform/Win32/Driver/Build/inf/psdrv3.inf
  164. +2 −2 Platform/Win32/Driver/Build/sys/PSDrvVersion.h
  165. BIN  Platform/Win32/Driver/PDBs/objfre_win7_amd64/amd64/psdrv3.pdb
  166. BIN  Platform/Win32/Driver/PDBs/objfre_win7_x86/i386/psdrv3.pdb
  167. +4 −4 Platform/Win32/Install/OpenNI/Includes/OpenNIVariables.wxi
  168. +4 −0 Platform/Win32/Install/OpenNI/OpenNI.wixproj
  169. +274 −118 Platform/Win32/Install/OpenNI/OpenNI.wxs
  170. +6 −0 Platform/Win32/Install/OpenNI/UI/CustomeInstallUI.wxs
  171. +33 −9 README
  172. +4 −6 Samples/NiBackRecorder/main.cpp
  173. +1 −3 Samples/NiConvertXToONI/NiConvertXToONI.cpp
  174. +1,637 −0 Samples/NiHandTracker/GL/gl.h
  175. +6,569 −0 Samples/NiHandTracker/GL/glext.h
  176. +596 −0 Samples/NiHandTracker/GL/glut.h
  177. +662 −0 Samples/NiHandTracker/GL/wglext.h
  178. BIN  Samples/NiHandTracker/Libs/glut32.lib
  179. BIN  Samples/NiHandTracker/Libs/glut64.lib
  180. +226 −0 Samples/NiHandTracker/NiHandTracker.cpp
  181. +77 −0 Samples/NiHandTracker/NiHandTracker.h
  182. +144 −0 Samples/NiHandTracker/NiHandViewer.cpp
  183. +48 −0 Samples/NiHandTracker/NiHandViewer.h
  184. +369 −0 Samples/NiHandTracker/NiSimpleViewer.cpp
  185. +85 −0 Samples/NiHandTracker/NiSimpleViewer.h
  186. +160 −0 Samples/NiHandTracker/NiTrailHistory.cpp
  187. +114 −0 Samples/NiHandTracker/NiTrailHistory.h
  188. +274 −0 Samples/NiHandTracker/glh/glh_array.h
  189. +209 −0 Samples/NiHandTracker/glh/glh_convenience.h
  190. +347 −0 Samples/NiHandTracker/glh/glh_cube_map.h
  191. +290 −0 Samples/NiHandTracker/glh/glh_extensions.h
  192. +5,379 −0 Samples/NiHandTracker/glh/glh_genext.h
  193. +861 −0 Samples/NiHandTracker/glh/glh_glut.h
  194. +667 −0 Samples/NiHandTracker/glh/glh_glut2.h
  195. +85 −0 Samples/NiHandTracker/glh/glh_glut_callfunc.h
  196. +292 −0 Samples/NiHandTracker/glh/glh_glut_replay.h
  197. +195 −0 Samples/NiHandTracker/glh/glh_glut_text.h
  198. +213 −0 Samples/NiHandTracker/glh/glh_interactors.h
  199. +1,617 −0 Samples/NiHandTracker/glh/glh_linear.h
  200. +157 −0 Samples/NiHandTracker/glh/glh_mipmaps.h
  201. +636 −0 Samples/NiHandTracker/glh/glh_obs.h
  202. +197 −0 Samples/NiHandTracker/glh/glh_text.h
  203. +78 −0 Samples/NiHandTracker/main.cpp
  204. +0 −3  Samples/NiRecordRaw/NiRecordRaw.cpp
  205. +0 −5 Samples/NiRecordSynthetic/NiRecordSynthetic.cpp
  206. +1 −0  Samples/NiSampleExtensionModule/RotatingDeviceExtension.h
  207. +239 −0 Samples/NiSimpleSkeleton/NiSimpleSkeleton.cpp
  208. +12 −1 Samples/NiUseExtension/NiUseExtension.cpp
  209. +243 −0 Samples/NiUserSelection/ClosestUserSelector.cpp
  210. +99 −0 Samples/NiUserSelection/ClosestUserSelector.h
  211. +171 −0 Samples/NiUserSelection/DefaultTrackingInitializer.cpp
  212. +98 −0 Samples/NiUserSelection/DefaultTrackingInitializer.h
  213. +199 −0 Samples/NiUserSelection/Documentation.h
  214. +151 −0 Samples/NiUserSelection/ExitPoseDetector.cpp
  215. +106 −0 Samples/NiUserSelection/ExitPoseDetector.h
  216. +1,637 −0 Samples/NiUserSelection/GL/gl.h
  217. +6,569 −0 Samples/NiUserSelection/GL/glext.h
  218. +596 −0 Samples/NiUserSelection/GL/glut.h
  219. +662 −0 Samples/NiUserSelection/GL/wglext.h
  220. +239 −0 Samples/NiUserSelection/GLES/egl.h
  221. +229 −0 Samples/NiUserSelection/GLES/egl_1_0.h
  222. +55 −0 Samples/NiUserSelection/GLES/egltypes.h
  223. +851 −0 Samples/NiUserSelection/GLES/gl.h
  224. +584 −0 Samples/NiUserSelection/GLES/gl_1_0.h
  225. BIN  Samples/NiUserSelection/Libs/glut32.lib
  226. BIN  Samples/NiUserSelection/Libs/glut64.lib
  227. +181 −0 Samples/NiUserSelection/PoseToggleUserSelector.cpp
  228. +96 −0 Samples/NiUserSelection/PoseToggleUserSelector.h
  229. +197 −0 Samples/NiUserSelection/PoseUserSelector.cpp
  230. +101 −0 Samples/NiUserSelection/PoseUserSelector.h
  231. +214 −0 Samples/NiUserSelection/SampleManager.cpp
  232. +127 −0 Samples/NiUserSelection/SampleManager.h
Sorry, we could not display the entire diff because too many files (401) changed.
View
101 CHANGES
@@ -1,6 +1,107 @@
Detailed Change log:
--------------------
+Version 1.5.2.23 (Stable version - Dec 28th 2011)
+-------------------------------------------------
+ * C++: IRMetaData didn't have operator() and operator[], which is inconsistent with depth and scene.
+ * Fixed some memory deallocation mismatches.
+ * Remove redundant USB warning message on Linux (this is normal behavior).
+ * Java wrappers: adding getDataPtr(), createDataByteBuffer() and copyDataToBuffer() to Generator class.
+ * NiViewer: did not check if StartGenerating was successful.
+
+Version 1.5.2.7 (Unstable version - Dec 18th 2011)
+--------------------------------------------------
+ * Java UserTracker sample will now draw the limbs only when both joints have a non-zero confidence.
+ * .NET samples will now show their source files in the visual studio project.
+ * NiUserSelection - Enhanced the documentation.
+ * PoseDetectionCapability::StopPoseDetection will now return proper errors.
+ * .Net Wrappers: Disposing a device node now also destroys the node.
+ * xnNodeInfoGetTreeStringRepresentation was added to all wrappers.
+ * Linux: keep ref count for the libusb events thread, so it will be shutdown automatically when all read threads have stopped.
+ * Added option to show low confidence limbs as dotted lines in the user selection sample.
+ * Recordings playbacks: make sure seek is also performed in a lock, so it wouldn't collide with the reader thread.
+ * Bug Fix: The samples cannot be copied to another folder and be compiled.
+ * Data Dump: Adding frame sync information checks.
+ * NiUseExtension sample: added a clear message about the need to register the extension module.
+ * .Net Wrappers: Added the DataPtr property to Generator class.
+ * .Net wrappers: Fixed a bug where MapGenerator.BytesPerPixel was missing.
+ * .Net Wrappers: FindExistingNode now returns null instead of throwing an exception if no node exists.
+ * Java Wrappers: StartPoseDetection and StopPoseDetection are declared deprecated, and were replaced by startPoseDetection and stopPoseDetection.
+ * Linux: Cross compilation is now based on environment variables.
+ * .Net Wrappers: Projective/RealWorld conversion - added a version which accepts a preallocated array.
+ * USB Driver version was updated to 3.1.3.1.
+ * NiBackRecorder: removed unneeded calls to Release().
+ * NiConvertXToONI: removed unused seekNode.
+ * Android: makefiles are now compatible to ndk v7.
+ * .Net Wrapper: Added the missing DeviceIdentificationCapability class.
+ * New API: xnStopSinglePoseDetection.
+ * Bug Fix: Seeking before the first WaitXUpdateAll() caused undetermined behavior.
+ * Android: Added the NiSimpleSkeleton sample.
+ * Java Wrappers: Added missing enum values.
+ * .NET Wrappers: Added missing enum values.
+ * Android UserTracker sample: Adjusted to work without a calibration pose.
+ * USB Driver: adding support for PrimeSense's 0601 product ID.
+ * Log: initializing from INI file would reset the output directory.
+ * Bug fix: Seeking to the current frame did no re-read it, while seeking to another frame did read it. This caused a bug where seeking to the same frame twice would cause it to return twice.
+
+Version 1.4.0.2 (Unstable version - Nov 17th 2011)
+--------------------------------------------------
+ * Linux bug fix: The USB read thread was using memcpy with overlapping source and dest addresses which caused newer libc libraries to fail. The solution is to use memmove.
+ * Log: fix BC methods behavior to be backwards-compatible to old one.
+ * Added GetNumberOfAvailableGestures() method to GestureGenerator.
+ * .NET BugFix: GetPoseStatus() did not work.
+ * JNI: fix a typo that prevents creating joint orientations.
+ * NiUserSelection: Update to support N closest users and N waves.
+ * Fixed python scripts to also support python 3.
+ * Java Wrapper: Added a new method copyToBuffer for copying data to a preallocated buffer to improve performance (community request).
+ * Mac: Fixed a bug in the linux set thread priority where the struct wasn't zero'd before usage (caused warning on mac osx).
+ * Linux redist bug: .net wrappers were skipped on 64-bit machines by mistake.
+ * Windows Bug Fix: shared memory was always created under the Global namespace (Failed to work with UAC turned on).
+ * Added APIs xnIsPoseSupported, xnGetPoseStatus, through PoseDetectionCapability.
+ * Java Wrappers: added createByteBuffer() to AudioMetaData to access data.
+ * NiRecordRaw: Removed duplicate call to GetProductionNodeByName.
+ * Added NiHandTracker C++ sample.
+ * Added NO_TRACKING to the list of pose detection statuses.
+ * Added NiSimpleSkeleton sample which shows the head movement of skeleton with no graphics.
+ * Added NiUserSelection sample which shows the exit pose (cross hands) and user selection.
+ * Added a new dump, "OpenNIDataFlow", to track data frames.
+ * WaitNoneUpdateAll now doesn't actually read from file (might cause some sleeping), but only triggers another thread to read in the background.
+
+Version 1.3.4.6 (Unstable version - Nov 7th 2011)
+-------------------------------------------------
+ * In MockGenerator::SetData, change the node to Generating state so it would be recorded properly.
+ * Added new calibration error messages to the XnCalibrationStatus enum.
+ * XnArray: Allow passing base size in the ctor (to save double allocation).
+ * NiViewer: Removed an unnecessary line from file dialog init
+ * Bug fix: When recording from mock node, the first frame is no longer lost.
+ * XnOS: Added the option to create named objects in a way that will be accessible to other sessions.
+ * Renamed Linux-x86* files to Linux*
+ * Linux Bug Fix: xnOSSeekFile64 did not return OK. This caused problems in playback and recording of ONI files.
+ * Added some error log prints to the codecs and players.
+ * C# wrappers: fixed the marshaling of license struct.
+ * Added the function SetDataBytes to XnBitSet so it now accepts a byte buffer of any size. Note: byte order is different when reading from byte array or dword array in little endian platforms.
+ * C# wrappers: fixed a bug related to ProductionNodeDescription. Might break API, but this API would usually crash, so its OK.
+ * Linux: Switched to newer makefiles. SSE is enabled in debug, always declare sysroot (even for /) so that -I=/usr/include/ni could work properly.
+ * Linux: fix cross compilation and add separate scripts to cross compile on specific machine. Also, binary folders are now named according to platform and configuration.
+ * Documentation: Added a section about creating modules.
+ * Backwards Compatibility Workaround: some old recordings marked nodes as not generating though they contained frames. This resulted in "node is locked" error if trying to start generating them.
+
+Version 1.3.4.3 (Unstable version - Oct 10th 2011)
+--------------------------------------------------
+ * Update to newer version of CommonCppMakefile (without the -malign-double flag).
+ * Changed dump API to use void pointer instead of char pointer
+ * Added xnOSDeleteEmptyDirectory and xnOSDeleteDirectoryTree methods.
+ * Adding ScriptNode.Create() to C++ wrappers.
+ * Dumps: New, cleaner interface.
+ * Dumps: Adding dump writers mechanisms, so one can implement a new writer, other than files.
+ * Recordings: Support files bigger than 2 GB.
+ * Samples: default SamplesConfig is now better documented. Global mirror is turned on, instead of every generator.
+ * Java Wrappers: some methods were private by mistake.
+ * Samples Bug Fix: trying to create the rotating device extension would cause a crash if extension sample is not registered with OpenNI.
+ * Bug Fix: StartGenerating would fail on locked nodes even if node is already generating (this caused a bug where declaring a node in the XML which already existed in the recording would fail).
+ * Logs: New, better performance API.
+ * XnPlatform min/max values were wrong.
+
Version 1.3.3.6 (Stable version - Sep 18th 2011)
------------------------------------------------
* Fixed memory leak in Queue and ThreadSafeQueue.
View
47 Data/SamplesConfig.xml
@@ -1,6 +1,6 @@
<OpenNI>
<Licenses>
- <!-- Add licenses here
+ <!-- Add application-specific licenses here
<License vendor="vendor" key="key"/>
-->
</Licenses>
@@ -14,18 +14,45 @@
</Dumps>
</Log>
<ProductionNodes>
- <Node type="Depth" name="Depth1">
- <Configuration>
- <Mirror on="true"/>
- </Configuration>
- </Node>
- <Node type="Image" name="Image1" stopOnError="false">
+ <!-- Uncomment following line, in order to run from a recording
+ <Recording file="sampleRec.oni" />
+ -->
+
+ <!-- Set global mirror -->
+ <GlobalMirror on="true"/>
+
+ <!-- Create a depth node and give it a name alias (useful if referenced ahead in this script) -->
+ <Node type="Depth" name="MyDepth">
+ <Query>
+ <!-- Uncomment to filter by vendor name, product name, etc.
+ <Vendor>MyVendor inc.</Vendor>
+ <Name>MyProduct</Name>
+ <MinVersion>1.2.3.4</MinVersion>
+ <Capabilities>
+ <Capability>Cropping</Capability>
+ </Capabilities>
+ -->
+ </Query>
<Configuration>
- <Mirror on="true"/>
+ <!-- Uncomment to set requested mode
+ <MapOutputMode xRes="640" yRes="480" FPS="30"/>
+ -->
+
+ <!-- Uncomment to override global mirror
+ <Mirror on="false" />
+ -->
</Configuration>
</Node>
- <!--
- <Node type="Audio" name="Audio1"/>
+
+ <!-- Create an image node. If it fails, continue anyway. -->
+ <Node type="Image" stopOnError="false" />
+
+ <!-- Uncomment nodes from here if you need them.
+ <Node type="Audio" />
+ <Node type="User" />
+ <Node type="Hands" />
+ <Node type="Gesture" />
+ <Node type="Scene" />
-->
</ProductionNodes>
</OpenNI>
View
BIN  Documentation/OpenNI.chm
Binary file not shown
View
8 Include/ARC/XnPlatformARC.h
@@ -177,10 +177,14 @@ typedef size_t XnSizeT;
/** Indicates a deprecated function */
#define XN_API_DEPRECATED(msg)
+#define XN_DEPRECATED_WARNING_IDS
+#define XN_HIDES_PARENT_METHOD_WARNING_ID
+#define XN_CONDITION_IS_CONST_WARNING_ID
+#define XN_PRAGMA_START_DISABLED_WARNING_SECTION(warnings)
+#define XN_PRAGMA_STOP_DISABLED_WARNING_SECTION
+
/** Declares a global shared library export function. */
#define XN_API_EXPORT_INIT()
-#define XN_DEPRECATED_WARNING_IDS 1
-
#endif //_XN_PLATFORM_ARC_H_
View
31 Include/Linux-x86/XnPlatformLinux-x86.h
@@ -34,6 +34,7 @@
#include <stdio.h>
#include <string.h>
#include <assert.h>
+#include <limits.h>
//---------------------------------------------------------------------------
// Platform Basic Definition
@@ -99,31 +100,31 @@ typedef void (*XnFarProc)(void *);
typedef size_t XnSizeT;
/** Max unsigned 8-bit value */
-#define XN_MAX_UINT8 255
+#define XN_MAX_UINT8 UCHAR_MAX
/** Max unsigned 16-bit value */
-#define XN_MAX_UINT16 65535
+#define XN_MAX_UINT16 USHRT_MAX
/** Max unsigned 32-bit value */
-#define XN_MAX_UINT32 4294967295UL
+#define XN_MAX_UINT32 UINT_MAX
/** Max unsigned 64-bit value */
-#define XN_MAX_UINT64 18446744073709551615ULL
+#define XN_MAX_UINT64 ULLONG_MAX
/** Min signed 8-bit value */
-#define XN_MIN_INT8 -128
+#define XN_MIN_INT8 SCHAR_MIN
/** Min signed 16-bit value */
-#define XN_MIN_INT16 -32768
+#define XN_MIN_INT16 SHRT_MIN
/** Min signed 32-bit value */
-#define XN_MIN_INT32 -2147483648
+#define XN_MIN_INT32 INT_MIN
/** Min signed 64-bit value */
-#define XN_MIN_INT64 -9223372036854775808LL
+#define XN_MIN_INT64 LLONG_MIN
/** Max signed 8-bit value */
-#define XN_MAX_INT8 127
+#define XN_MAX_INT8 SCHAR_MAX
/** Max signed 16-bit value */
-#define XN_MAX_INT16 32767
+#define XN_MAX_INT16 SHRT_MAX
/** Max signed 32-bit value */
-#define XN_MAX_INT32 2147483647
+#define XN_MAX_INT32 INT_MAX
/** Max signed 64-bit value */
-#define XN_MAX_INT64 9223372036854775807LL
+#define XN_MAX_INT64 LLONG_MAX
//---------------------------------------------------------------------------
// Memory
@@ -177,6 +178,12 @@ typedef size_t XnSizeT;
/** Indicates a deprecated function */
#define XN_API_DEPRECATED(msg) __attribute__((warning("This function is deprecated: " msg)))
+#define XN_DEPRECATED_WARNING_IDS
+#define XN_HIDES_PARENT_METHOD_WARNING_ID
+#define XN_CONDITION_IS_CONST_WARNING_ID
+#define XN_PRAGMA_START_DISABLED_WARNING_SECTION(warnings)
+#define XN_PRAGMA_STOP_DISABLED_WARNING_SECTION
+
/** Declares a global shared library export function. */
#define XN_API_EXPORT_INIT()
View
41 Include/Win32/XnPlatformWin32.h
@@ -127,31 +127,31 @@ typedef FARPROC XnFarProc;
typedef size_t XnSizeT;
/** Max unsigned 8-bit value */
-#define XN_MAX_UINT8 255
+#define XN_MAX_UINT8 _UI8_MAX
/** Max unsigned 16-bit value */
-#define XN_MAX_UINT16 65535
+#define XN_MAX_UINT16 _UI16_MAX
/** Max unsigned 32-bit value */
-#define XN_MAX_UINT32 4294967295
+#define XN_MAX_UINT32 _UI32_MAX
/** Max unsigned 64-bit value */
-#define XN_MAX_UINT64 18446744073709551615
+#define XN_MAX_UINT64 _UI64_MAX
/** Min signed 8-bit value */
-#define XN_MIN_INT8 -127
+#define XN_MIN_INT8 _I8_MIN
/** Min signed 16-bit value */
-#define XN_MIN_INT16 -32767
+#define XN_MIN_INT16 _I16_MIN
/** Min signed 32-bit value */
-#define XN_MIN_INT32 -2147483647
+#define XN_MIN_INT32 _I32_MIN
/** Min signed 64-bit value */
-#define XN_MIN_INT64 -9223372036854775807
+#define XN_MIN_INT64 _I64_MIN
/** Max signed 8-bit value */
-#define XN_MAX_INT8 127
+#define XN_MAX_INT8 _I8_MAX
/** Max signed 16-bit value */
-#define XN_MAX_INT16 32767
+#define XN_MAX_INT16 _I16_MAX
/** Max signed 32-bit value */
-#define XN_MAX_INT32 2147483647
+#define XN_MAX_INT32 _I32_MAX
/** Max signed 64-bit value */
-#define XN_MAX_INT64 9223372036854775807
+#define XN_MAX_INT64 _I64_MAX
/** Min double value */
#define XN_MIN_DOUBLE DBL_MIN
@@ -215,11 +215,24 @@ typedef size_t XnSizeT;
#endif
#ifdef __INTEL_COMPILER
- #define XN_DEPRECATED_WARNING_IDS 1786
+ #define XN_DEPRECATED_WARNING_IDS 1786
+ #define XN_HIDES_PARENT_METHOD_WARNING_ID 1125
+ #define XN_CONDITION_IS_CONST_WARNING_ID
#else
- #define XN_DEPRECATED_WARNING_IDS 4995 4996
+ #define XN_DEPRECATED_WARNING_IDS 4995 4996
+ #define XN_HIDES_PARENT_METHOD_WARNING_ID
+ #define XN_CONDITION_IS_CONST_WARNING_ID 4127
#endif
+#define XN_PRAGMA_START_DISABLED_WARNING_SECTION(warnings) \
+ __pragma(warning(push)) \
+ __pragma(warning(disable:XN_HIDES_PARENT_METHOD_WARNING_ID))
+
+#define XN_PRAGMA_STOP_DISABLED_WARNING_SECTION \
+ __pragma(warning(pop))
+
+
+
/** Declares a global shared library export function. */
#define XN_API_EXPORT_INIT() \
BOOL APIENTRY DllMain (HMODULE /*hModule*/, DWORD nReasonForCall, LPVOID /*lpReserved*/) \
View
10 Include/XnArray.h
@@ -43,9 +43,9 @@ class XnArray
typedef const T* ConstIterator;
/** Default constructor. Initializes the array to BASE_SIZE. **/
- XnArray()
+ XnArray(XnUInt32 nBaseSize = BASE_SIZE)
{
- Init();
+ Init(nBaseSize);
}
/** Copy constructor. Initializes this array from another array of the same type. **/
@@ -298,10 +298,10 @@ class XnArray
}
private:
- void Init()
+ void Init(XnUInt32 nBaseSize = BASE_SIZE)
{
- m_pData = XN_NEW_ARR(T, BASE_SIZE);
- m_nAllocatedSize = BASE_SIZE;
+ m_pData = XN_NEW_ARR(T, nBaseSize);
+ m_nAllocatedSize = nBaseSize;
m_nSize = 0;
}
View
15 Include/XnBitSet.h
@@ -75,6 +75,21 @@ class XnBitSet
return XN_STATUS_OK;
}
+ /** Copies raw data from a buffer of bytes to this bitset. **/
+ XnStatus SetDataBytes(const XnUInt8* pData, XnUInt32 nSizeInBytes)
+ {
+ //XnStatus nRetVal = m_array.SetData(reinterpret_cast<const XnUInt32*>(pData), XN_MAX(1, nSizeInBytes >> 2));
+ XnUInt32 nSizeInDwords = XN_MAX(1, nSizeInBytes >> 2);
+ XnStatus nRetVal = m_array.SetSize(nSizeInDwords);
+ XN_IS_STATUS_OK(nRetVal);
+ for (XnUInt32 nDwordIdx = 0, nByteIdx = 0; nDwordIdx < nSizeInDwords; nDwordIdx++, nByteIdx += 4)
+ {
+ m_array[nDwordIdx] = ((pData[nByteIdx] << 24) | (pData[nByteIdx + 1] << 16) | (pData[nByteIdx + 2] << 8) | pData[nByteIdx + 3] );
+ }
+ m_nSize = (nSizeInBytes << 3);
+ return XN_STATUS_OK;
+ }
+
/** @returns The raw data of this bitset as a buffer of dwords. **/
const XnUInt32* GetData() const
{
View
72 Include/XnCppWrapper.h
@@ -810,6 +810,29 @@ namespace xn
/// @copydoc OutputMetaData::WritableData
inline XnIRPixel* WritableData() { return (XnIRPixel*)MapMetaData::WritableData(); }
+ /**
+ * Gets the value of the pixel
+ *
+ * @param nIndex [in] The index of the pixel in the buffer.
+ */
+ inline const XnIRPixel& operator[](XnUInt32 nIndex) const
+ {
+ XN_ASSERT(nIndex < (XRes()*YRes()));
+ return Data()[nIndex];
+ }
+
+ /**
+ * Gets the value of the pixel
+ *
+ * @param x [in] X-coordinate of the pixel in the map
+ * @param y [in] Y-coordinate of the pixel in the map
+ */
+ inline const XnIRPixel& operator()(XnUInt32 x, XnUInt32 y) const
+ {
+ XN_ASSERT(x < XRes() && y < YRes());
+ return Data()[y*XRes() + x];
+ }
+
/// Gets a light object wrapping the IR map
inline const xn::IRMap& IRMap() const { return m_irMap; }
/// Gets a light object wrapping the writable IR map
@@ -1206,7 +1229,8 @@ namespace xn
/** @copybrief xnNodeInfoGetCreationInfo
* For full details and usage, see @ref xnNodeInfoGetCreationInfo
- */ inline const XnChar* GetCreationInfo() const
+ */
+ inline const XnChar* GetCreationInfo() const
{
return xnNodeInfoGetCreationInfo(m_pInfo);
}
@@ -1233,6 +1257,14 @@ namespace xn
return xnNodeInfoGetAdditionalData(m_pInfo);
}
+ /** @copybrief xnNodeInfoGetTreeStringRepresentation
+ * For full details and usage, see @ref xnNodeInfoGetTreeStringRepresentation
+ */
+ inline XnStatus GetTreeStringRepresentation(XnChar* csResultBuffer, XnUInt32 nBufferSize) const
+ {
+ return xnNodeInfoGetTreeStringRepresentation(m_pInfo, csResultBuffer, nBufferSize);
+ }
+
private:
inline void SetUnderlyingObject(XnNodeInfo* pInfo);
@@ -3469,6 +3501,15 @@ namespace xn
{
return xnEnumerateGestures(GetHandle(), &astrGestures, &nGestures);
}
+
+ /** @copybrief xnGetNumberOfAvailableGestures
+ * For full details and usage, see @ref xnGetNumberOfAvailableGestures
+ */
+ inline XnUInt16 GetNumberOfAvailableGestures() const
+ {
+ return xnGetNumberOfAvailableGestures(GetHandle());
+ }
+
/** @copybrief xnEnumerateAllGestures
* For full details and usage, see @ref xnEnumerateAllGestures
*/
@@ -4568,6 +4609,16 @@ namespace xn
return xnGetAllAvailablePoses(GetHandle(), pstrPoses, nNameLength, &nPoses);
}
+ inline XnBool IsPoseSupported(const XnChar* strPose)
+ {
+ return xnIsPoseSupported(GetHandle(), strPose);
+ }
+
+ inline XnStatus GetPoseStatus(XnUserID userID, const XnChar* poseName, XnUInt64& poseTime, XnPoseDetectionStatus& eStatus, XnPoseDetectionState& eState)
+ {
+ return xnGetPoseStatus(GetHandle(), userID, poseName, &poseTime, &eStatus, &eState);
+ }
+
/** @copybrief xnStartPoseDetection
* For full details and usage, see @ref xnStartPoseDetection
*/
@@ -4584,6 +4635,14 @@ namespace xn
return xnStopPoseDetection(GetHandle(), user);
}
+ /** @copybrief xnStopSinglePoseDetection
+ * For full details and usage, see @ref xnStopSinglePoseDetection
+ */
+ inline XnStatus StopSinglePoseDetection(XnUserID user, const XnChar* strPose)
+ {
+ return xnStopSinglePoseDetection(GetHandle(), user, strPose);
+ }
+
/** @copybrief xnRegisterToPoseCallbacks
* For full details and usage, see @ref xnRegisterToPoseCallbacks
*/
@@ -5256,6 +5315,8 @@ namespace xn
inline ScriptNode(XnNodeHandle hNode = NULL) : ProductionNode(hNode) {}
inline ScriptNode(const NodeWrapper& other) : ProductionNode(other) {}
+ inline XnStatus Create(Context& context, const XnChar* strFormat);
+
inline const XnChar* GetSupportedFormat()
{
return xnScriptNodeGetSupportedFormat(GetHandle());
@@ -6319,6 +6380,15 @@ namespace xn
return xnScriptNodeRun(GetHandle(), pErrors == NULL ? NULL : pErrors->GetUnderlying());
}
+ inline XnStatus ScriptNode::Create(Context& context, const XnChar* strFormat)
+ {
+ XnNodeHandle hNode;
+ XnStatus nRetVal = xnCreateScriptNode(context.GetUnderlyingObject(), strFormat, &hNode);
+ XN_IS_STATUS_OK(nRetVal);
+ TakeOwnership(hNode);
+ return (XN_STATUS_OK);
+ }
+
//---------------------------------------------------------------------------
// Global Helper Functions
//---------------------------------------------------------------------------
View
3  Include/XnDataTypes.h
@@ -43,6 +43,8 @@ typedef void* XnValue;
class decl ClassName \
{ \
public: \
+ XN_PRAGMA_START_DISABLED_WARNING_SECTION(XN_CONDITION_IS_CONST_WARNING_ID) \
+ \
static XnValue CreateValueCopy(Type const& orig) \
{ \
if (sizeof(Type) > sizeof(XnValue)) \
@@ -104,6 +106,7 @@ typedef void* XnValue;
return *p; \
} \
} \
+ XN_PRAGMA_STOP_DISABLED_WARNING_SECTION \
};
/**
View
167 Include/XnDump.h
@@ -25,17 +25,14 @@
//---------------------------------------------------------------------------
// Includes
//---------------------------------------------------------------------------
-#include "XnOS.h"
+#include "XnPlatform.h"
+#include "XnStatus.h"
//---------------------------------------------------------------------------
// Types
//---------------------------------------------------------------------------
-typedef struct XnDump
-{
- XN_FILE_HANDLE hFile;
-} XnDump;
-
-const XnDump XN_DUMP_CLOSED = { XN_INVALID_FILE_HANDLE };
+struct XnDumpFile;
+typedef struct XnDumpFile XnDumpFile;
//---------------------------------------------------------------------------
// Functions
@@ -44,61 +41,131 @@ const XnDump XN_DUMP_CLOSED = { XN_INVALID_FILE_HANDLE };
/**
* Configures if a specific dump mask is enabled.
*
-* @param csMask [in] The mask to set.
-* @param bEnabled [in] TRUE to enable this mask, FALSE otherwise.
+* @param strMask [in] The mask to set.
+* @param bEnabled [in] TRUE to enable this dump, FALSE otherwise.
*/
-XN_C_API XnStatus XN_C_DECL xnDumpSetMaskState(const XnChar* csMask, XnBool bEnabled);
+XN_C_API XnStatus XN_C_DECL xnDumpSetMaskState(const XnChar* strMask, XnBool bEnabled);
/**
* This function checks if a dump mask is enabled
*
-* @param csDumpMask [in] The mask that should be checked.
+* @param strDumpMask [in] The mask that should be checked.
*/
-XN_C_API XnBool XN_C_DECL xnLogIsDumpMaskEnabled(const XnChar* csDumpMask);
+XN_C_API XnBool XN_C_DECL xnLogIsDumpMaskEnabled(const XnChar* strDumpMask);
/**
-* This function creates an XnDump object through which dumps can be written. Dump will only be
-* created if the mask is enabled.
+* Opens a file for writing dump.
*
-* @param pDump [in] A handle to the dump.
-* @param csDumpMask [in] The mask under which this dump should be written.
-* @param csHeader [in] A header line to be written to the file. When this param is NULL, file will
-* be opened as a binary file. When param is not NULL, the string will be written
-* to the file once it is open.
-* @param csFileNameFormat [in] Format of the name to give the file.
-* @param ... [in] Arguments for the file name format string.
+* @param strDumpName [in] Name of the dump mask this file belongs to.
+* @param strNameFormat [in] A format string for the name of the file.
+*
+* @returns a file handle for writing data. The file should be closed using @ref xnDumpFileClose().
*/
-XN_C_API void XN_C_DECL xnDumpInit(XnDump* pDump, const XnChar* csDumpMask, const XnChar* csHeader, const XnChar* csFileNameFormat, ...);
+XN_C_API XnDumpFile* XN_C_DECL xnDumpFileOpen(const XnChar* strDumpName, const XnChar* strNameFormat, ...);
/**
-* This function creates an XnDump object through which dumps can be written. This dump will be created
-* anyway, and does not depend on log configuration.
+* Opens a file for writing dump using some advanced options.
+*
+* You would usually prefer to use @ref xnDumpFileOpen().
*
-* @param pDump [in] A handle to the dump.
-* @param csHeader [in] A header line to be written to the file. When this param is NULL, file will
-* be opened as a binary file. When param is not NULL, the string will be written
-* to the file once it is open.
-* @param csFileNameFormat [in] Format of the name to give the file.
-* @param ... [in] Arguments for the file name format string.
+* @param strDumpName [in] Name of the dump mask this file belongs to.
+* @param bForce [in] When TRUE, file will be created even if dump is currently off.
+* @param bSessionDump [in] When TRUE, file will be created with current session timestamp as a prefix to its name.
+* @param strNameFormat [in] A format string for the name of the file.
+*
+* @returns a file handle for writing data. The file should be closed using @ref xnDumpFileClose().
*/
-XN_C_API void XN_C_DECL xnDumpForceInit(XnDump* pDump, const XnChar* csHeader, const XnChar* csFileNameFormat, ...);
+XN_C_API XnDumpFile* XN_C_DECL xnDumpFileOpenEx(const XnChar* strDumpName, XnBool bForce, XnBool bSessionDump, const XnChar* strNameFormat, ...);
/**
-* This function closes a dump file (use it once file is no longer needed).
-* You can later use xnDumpWriteString and xnDumpWriteBuffer to write to this file.
+* Writes a buffer to a dump file.
*
-* @param pDump [in] A pointer to an XnDump struct returned from a call to xnDumpInit.
+* @param pFile [in] Dump file to write to. A pointer retrieved from @ref xnDumpFileOpen.
+* @param pBuffer [in] Data to be written to file.
+* @param nBufferSize [in] Size of the buffer.
*/
-XN_C_API void XN_C_DECL xnDumpClose(XnDump* pDump);
+XN_C_API void XN_C_DECL _xnDumpFileWriteBuffer(XnDumpFile* pFile, const void* pBuffer, XnUInt32 nBufferSize);
/**
-* Writes a buffer to the dump.
-*
-* @param dump [in] The dump to write to.
-* @param pBuffer [in] A pointer to the buffer to write.
-* @param nBufferSize [in] The number of bytes to write from the buffer.
+* Writes a formatted string to a dump file.
+*
+* @param pFile [in] Dump file to write to. A pointer retrieved from @ref xnDumpFileOpen.
+* @param strFormat [in] Format string.
+*
+* NOTE: the total length of the string must not exceed 8 KB. If it does, it will be truncated.
+*/
+XN_C_API void XN_C_DECL _xnDumpFileWriteString(XnDumpFile* pFile, const XnChar* strFormat, ...);
+
+/**
+* Closes a dump file.
+*
+* @param hFile [in] Dump file to close. A pointer retrieved from @ref xnDumpFileOpen.
*/
-XN_C_API void XN_C_DECL xnDumpWriteBufferImpl(XnDump dump, const void* pBuffer, XnUInt32 nBufferSize);
+XN_C_API void XN_C_DECL _xnDumpFileClose(XnDumpFile* pFile);
+
+#define xnDumpFileWriteBuffer(pFile, pBuffer, nBufferSize) \
+ if ((pFile) != NULL) \
+ { \
+ _xnDumpFileWriteBuffer(pFile, pBuffer, nBufferSize); \
+ } \
+
+#define xnDumpFileClose(pFile) \
+ if ((pFile) != NULL) \
+ { \
+ _xnDumpFileClose(pFile); \
+ pFile = NULL; \
+ } \
+
+#if XN_PLATFORM_VAARGS_TYPE == XN_PLATFORM_USE_WIN32_VAARGS_STYLE
+ #define xnDumpFileWriteString(pFile, strFormat, ...) \
+ if ((pFile) != NULL) \
+ { \
+ _xnDumpFileWriteString(pFile, strFormat, __VA_ARGS__); \
+ }
+#elif XN_PLATFORM_VAARGS_TYPE == XN_PLATFORM_USE_GCC_VAARGS_STYLE
+ #define xnDumpFileWriteString(pFile, strFormat, ...) \
+ if ((pFile) != NULL) \
+ { \
+ _xnDumpFileWriteString(pFile, strFormat, ##__VA_ARGS__);\
+ }
+#elif XN_PLATFORM_VAARGS_TYPE == XN_PLATFORM_USE_ARC_VAARGS_STYLE
+ #define xnDumpFileWriteString(pFile, strFormat, ...) \
+ if ((pFile) != NULL) \
+ { \
+ _xnDumpFileWriteString(pFile, strFormat); \
+ }
+#elif XN_PLATFORM_VAARGS_TYPE == XN_PLATFORM_USE_NO_VAARGS
+ #define xnDumpFileWriteString(pFile, strFormat, arg) \
+ if ((pFile) != NULL) \
+ { \
+ _xnDumpFileWriteString(pFile, strFormat,arg); \
+ }
+#else
+ #error Xiron Log - Unknown VAARGS type!
+#endif
+
+
+//---------------------------------------------------------------------------
+// Backwards Compatibility Stuff
+//---------------------------------------------------------------------------
+
+#ifndef __XN_NO_BC__
+
+#include "XnOS.h"
+
+typedef struct XnDump
+{
+ XN_FILE_HANDLE hFile;
+} XnDump;
+
+const XnDump XN_DUMP_CLOSED = { XN_INVALID_FILE_HANDLE };
+
+XN_C_API void XN_API_DEPRECATED("Use xnDumpFileX methods instead") XN_C_DECL xnDumpInit(XnDump* pDump, const XnChar* csDumpMask, const XnChar* csHeader, const XnChar* csFileNameFormat, ...);
+XN_C_API void XN_API_DEPRECATED("Use xnDumpFileX methods instead") XN_C_DECL xnDumpForceInit(XnDump* pDump, const XnChar* csHeader, const XnChar* csFileNameFormat, ...);
+XN_C_API void XN_API_DEPRECATED("Use xnDumpFileX methods instead") XN_C_DECL xnDumpClose(XnDump* pDump);
+XN_C_API void XN_API_DEPRECATED("Use xnDumpFileX methods instead") XN_C_DECL xnDumpWriteBufferImpl(XnDump dump, const void* pBuffer, XnUInt32 nBufferSize);
+XN_C_API void XN_API_DEPRECATED("Use xnDumpFileX methods instead") XN_C_DECL xnDumpWriteStringImpl(XnDump dump, const XnChar* csFormat, ...);
+XN_C_API void XN_API_DEPRECATED("Use xnDumpFileX methods instead") XN_C_DECL xnDumpFlush(XnDump dump);
#define xnDumpWriteBuffer(dump, pBuffer, nBufferSize) \
if (dump.hFile != XN_INVALID_FILE_HANDLE) \
@@ -106,22 +173,6 @@ XN_C_API void XN_C_DECL xnDumpWriteBufferImpl(XnDump dump, const void* pBuffer,
xnDumpWriteBufferImpl(dump, pBuffer, nBufferSize); \
}
-/**
-* Writes a formatted string to the dump.
-*
-* @param dump [in] The dump to write to.
-* @param csFormat [in] A format string.
-* @param ... [in] Arguments to the format string.
-*/
-XN_C_API void XN_C_DECL xnDumpWriteStringImpl(XnDump dump, const XnChar* csFormat, ...);
-
-/**
-* Flushes a dump to the disk.
-*
-* @param dump [in] The dump to flush.
-*/
-XN_C_API void XN_C_DECL xnDumpFlush(XnDump dump);
-
#if XN_PLATFORM_VAARGS_TYPE == XN_PLATFORM_USE_WIN32_VAARGS_STYLE
#define xnDumpWriteString(dump, csFormat, ...) \
if ((dump).hFile != XN_INVALID_FILE_HANDLE) { \
@@ -146,4 +197,6 @@ XN_C_API void XN_C_DECL xnDumpFlush(XnDump dump);
#error Xiron Log - Unknown VAARGS type!
#endif
+#endif // #ifndef __XN_NO_BC__
+
#endif // __XN_DUMP_H__
View
127 Include/XnDumpWriters.h
@@ -0,0 +1,127 @@
+#ifndef __XN_DUMP_WRITERS_H__
+#define __XN_DUMP_WRITERS_H__
+
+//---------------------------------------------------------------------------
+// Includes
+//---------------------------------------------------------------------------
+#include "XnDump.h"
+
+//---------------------------------------------------------------------------
+// Types
+//---------------------------------------------------------------------------
+typedef struct XnDumpWriterFileHandle
+{
+ void* pInternal;
+} XnDumpWriterFileHandle;
+
+typedef struct XnDumpWriter
+{
+ void* pCookie;
+ XnDumpWriterFileHandle (XN_CALLBACK_TYPE* OpenFile)(void* pCookie, const XnChar* strDumpName, XnBool bSessionDump, const XnChar* strFileName);
+ void (XN_CALLBACK_TYPE* Write)(void* pCookie, XnDumpWriterFileHandle hFile, const void* pBuffer, XnUInt32 nBufferSize);
+ void (XN_CALLBACK_TYPE* CloseFile)(void* pCookie, XnDumpWriterFileHandle hFile);
+} XnDumpWriter;
+
+//---------------------------------------------------------------------------
+// Functions
+//---------------------------------------------------------------------------
+XN_C_API XnStatus XN_C_DECL xnDumpRegisterWriter(XnDumpWriter* pWriter);
+
+XN_C_API void XN_C_DECL xnDumpUnregisterWriter(XnDumpWriter* pWriter);
+
+XN_C_API XnStatus XN_C_DECL xnDumpSetFilesOutput(XnBool bOn);
+
+//---------------------------------------------------------------------------
+// Helpers
+//---------------------------------------------------------------------------
+#ifdef __cplusplus
+
+class XnDumpWriterBase
+{
+public:
+ XnDumpWriterBase() : m_bRegistered(FALSE)
+ {
+ m_cObject.pCookie = this;
+ m_cObject.OpenFile = OpenFileCallback;
+ m_cObject.Write = WriteCallback;
+ m_cObject.CloseFile = CloseFileCallback;
+ }
+
+ virtual ~XnDumpWriterBase()
+ {
+ Unregister();
+ }
+
+ XnStatus Register()
+ {
+ XnStatus nRetVal = XN_STATUS_OK;
+
+ if (!m_bRegistered)
+ {
+ OnRegister();
+
+ nRetVal = xnDumpRegisterWriter(&m_cObject);
+ if (nRetVal != XN_STATUS_OK)
+ {
+ OnUnregister();
+ return (nRetVal);
+ }
+
+ m_bRegistered = TRUE;
+ }
+
+ return (XN_STATUS_OK);
+ }
+
+ void Unregister()
+ {
+ if (m_bRegistered)
+ {
+ xnDumpUnregisterWriter(&m_cObject);
+ m_bRegistered = FALSE;
+
+ OnUnregister();
+ }
+ }
+
+ inline XnBool IsRegistered() { return m_bRegistered; }
+
+ virtual XnDumpWriterFileHandle OpenFile(const XnChar* strDumpName, XnBool bSessionDump, const XnChar* strFileName) = 0;
+ virtual void Write(XnDumpWriterFileHandle hFile, const void* pBuffer, XnUInt32 nBufferSize) = 0;
+ virtual void CloseFile(XnDumpWriterFileHandle hFile) = 0;
+
+ operator const XnDumpWriter*() const
+ {
+ return &m_cObject;
+ }
+
+protected:
+ virtual void OnRegister() {}
+ virtual void OnUnregister() {}
+
+private:
+ static XnDumpWriterFileHandle XN_CALLBACK_TYPE OpenFileCallback(void* pCookie, const XnChar* strDumpName, XnBool bSessionDump, const XnChar* strFileName)
+ {
+ XnDumpWriterBase* pThis = (XnDumpWriterBase*)pCookie;
+ return pThis->OpenFile(strDumpName, bSessionDump, strFileName);
+ }
+
+ static void XN_CALLBACK_TYPE WriteCallback(void* pCookie, XnDumpWriterFileHandle hFile, const void* pBuffer, XnUInt32 nBufferSize)
+ {
+ XnDumpWriterBase* pThis = (XnDumpWriterBase*)pCookie;
+ return pThis->Write(hFile, pBuffer, nBufferSize);
+ }
+
+ static void XN_CALLBACK_TYPE CloseFileCallback(void* pCookie, XnDumpWriterFileHandle hFile)
+ {
+ XnDumpWriterBase* pThis = (XnDumpWriterBase*)pCookie;
+ return pThis->CloseFile(hFile);
+ }
+
+ XnDumpWriter m_cObject;
+ XnBool m_bRegistered;
+};
+
+#endif
+
+#endif // __XN_DUMP_WRITERS_H__
View
17 Include/XnEvent.h
@@ -199,6 +199,7 @@ class XnEvent : public XnEventInterface
* It is highly recommended not to use this macro directly.
*/
#define _XN_DECLARE_EVENT_CLASS(_class, _interface, _retVal, _raise, _signature, _raise_sign) \
+ XN_PRAGMA_START_DISABLED_WARNING_SECTION(XN_HIDES_PARENT_METHOD_WARNING_ID) \
class _interface : protected XnEvent \
{ \
public: \
@@ -232,7 +233,9 @@ class XnEvent : public XnEventInterface
return (XN_STATUS_OK); \
} \
XnStatus Clear() { return XnEvent::Clear(); } \
- };
+ }; \
+ XN_PRAGMA_STOP_DISABLED_WARNING_SECTION
+
#define _XN_SIGNATURE_0ARG()
#define _XN_FULL_SIGNATURE_0ARG() void* pCookie
@@ -259,16 +262,8 @@ class XnEvent : public XnEventInterface
#define _XN_ARGS_5ARG(_name1, _name2, _name3, _name4, _name5) _name1, _name2, _name3, _name4, _name5,
/** Declares an event class */
-#if XN_PLATFORM == XN_PLATFORM_WIN32
- #define XN_DECLARE_EVENT_0ARG(_class, _interface) \
- __pragma(warning(push))\
- __pragma(warning(disable:4189))\
- _XN_DECLARE_EVENT_CLASS(_class, _interface, void, _XN_RAISE_NO_RET_CODE(_XN_ARGS_0ARG()), _XN_FULL_SIGNATURE_0ARG(), _XN_SIGNATURE_0ARG())\
- __pragma(warning(pop))
-#else
- #define XN_DECLARE_EVENT_0ARG(_class, _interface) \
- _XN_DECLARE_EVENT_CLASS(_class, _interface, void, _XN_RAISE_NO_RET_CODE(_XN_ARGS_0ARG()), _XN_FULL_SIGNATURE_0ARG(), _XN_SIGNATURE_0ARG())
-#endif
+#define XN_DECLARE_EVENT_0ARG(_class, _interface) \
+ _XN_DECLARE_EVENT_CLASS(_class, _interface, void, _XN_RAISE_NO_RET_CODE(_XN_ARGS_0ARG()), _XN_FULL_SIGNATURE_0ARG(), _XN_SIGNATURE_0ARG())
#define XN_DECLARE_EVENT_0ARG_RETVAL(_class, _interface) \
_XN_DECLARE_EVENT_CLASS(_class, _interface, XnStatus, _XN_RAISE_WITH_RET_CODE(_XN_ARGS_0ARG()), _XN_FULL_SIGNATURE_0ARG(), _XN_SIGNATURE_0ARG())
View
392 Include/XnLog.h
@@ -33,6 +33,12 @@
// Exported Function Declaration
//---------------------------------------------------------------------------
+/**
+ * @name Initialization
+ * Functions for initializing and shutting down the logger.
+ * @{
+ */
+
/**
* This function initializes the log system.
*/
@@ -54,43 +60,57 @@ XN_C_API XnStatus XN_C_DECL xnLogInitFromINIFile(const XnChar* csINIFile, const
XN_C_API XnStatus XN_C_DECL xnLogInitFromXmlFile(const XnChar* strFileName);
/**
- * Registers a new Log Writer to receive log entries.
- *
- * @param pWriter [in] The writer to register
- */
-XN_C_API XnStatus XN_C_DECL xnLogRegisterLogWriter(const XnLogWriter* pWriter);
+* This function closes the log.
+*/
+XN_C_API XnStatus XN_C_DECL xnLogClose();
-/**
- * Unregisters a Log Writer from receiving log entries.
- *
- * @param pWriter [in] The writer to unregister
+// @}
+
+/**
+ * @name Filtering Log Messages
+ * Functions for managing filters on the log system.
+ * @{
*/
-XN_C_API void XN_C_DECL xnLogUnregisterLogWriter(const XnLogWriter* pWriter);
/**
-* This function closes current log file, and starts a new one
+* Sets the minimum severity to be output from a specific mask (logger name).
+*
+* @param strMask [in] Name of the logger.
+* @param minSeverity [in] Minimum severity to be output. Use @ref XN_LOG_SEVERITY_NONE to output nothing.
*/
-XN_C_API XnStatus XN_C_DECL xnLogStartNewFile();
+XN_C_API XnStatus XN_C_DECL xnLogSetMaskMinSeverity(const XnChar* strMask, XnLogSeverity minSeverity);
/**
-* This function closes the log.
+* Gets the minimum severity to be output from a specific mask (logger name).
+*
+* @param strMask [in] Name of the logger.
+*
+* @returns The minimum severity, or @ref XN_LOG_SEVERITY_NONE is mask will output nothing.
*/
-XN_C_API XnStatus XN_C_DECL xnLogClose();
+XN_C_API XnLogSeverity XN_C_DECL xnLogGetMaskMinSeverity(const XnChar* strMask);
+
+// @}
+
+/**
+ * @name Log Writers
+ * Functions for managing which writers are active in the log system (i.e. which outputs
+ * will be generated).
+ * @{
+ */
/**
-* Configures if a specific log mask is enabled.
-*
-* @param csMask [in] The mask to set.
-* @param bEnabled [in] TRUE to enable this mask, FALSE otherwise.
-*/
-XN_C_API XnStatus XN_C_DECL xnLogSetMaskState(const XnChar* csMask, XnBool bEnabled);
+ * Registers a new Log Writer to receive log entries.
+ *
+ * @param pWriter [in] The writer to register
+ */
+XN_C_API XnStatus XN_C_DECL xnLogRegisterLogWriter(const XnLogWriter* pWriter);
/**
-* Configures the minimum severity the log will output.
-*
-* @param nMinSeverity [in] The minimum severity to output.
-*/
-XN_C_API XnStatus XN_C_DECL xnLogSetSeverityFilter(XnLogSeverity nMinSeverity);
+ * Unregisters a Log Writer from receiving log entries.
+ *
+ * @param pWriter [in] The writer to unregister
+ */
+XN_C_API void XN_C_DECL xnLogUnregisterLogWriter(const XnLogWriter* pWriter);
/**
* Configures if log entries will be printed to console.
@@ -106,8 +126,21 @@ XN_C_API XnStatus XN_C_DECL xnLogSetConsoleOutput(XnBool bConsoleOutput);
*/
XN_C_API XnStatus XN_C_DECL xnLogSetFileOutput(XnBool bFileOutput);
+// @}
+
+/**
+ * @name File Output
+ * Functions for configuring how files are created.
+ * @{
+ */
+
+/**
+* This function closes current log file, and starts a new one (if file writer is currently active)
+*/
+XN_C_API XnStatus XN_C_DECL xnLogStartNewFile();
+
/**
-* Configures if log entries will include the file and line that caused them.
+* Configures if log entries in file will include the file and line that caused them.
*
* @param bLineInfo [in] TRUE to print file and line, FALSE otherwise
*/
@@ -120,68 +153,285 @@ XN_C_API XnStatus XN_C_DECL xnLogSetLineInfo(XnBool bLineInfo);
*/
XN_C_API XnStatus XN_C_DECL xnLogSetOutputFolder(const XnChar* strOutputFolder);
+// @}
+
+/**
+ * @name Logger API
+ * Functions for writing entries to the log (used mainly by middleware developers)
+ * @{
+ */
+
/**
-* This function checks if a mask is enabled.
+* Opens a logger for writing.
*
-* @param csLogMask [in] The mask that should be checked.
-* @param nSeverity [in] The severity.
+* @param strMask [in] Name of the logger to open.
*/
-XN_C_API XnBool XN_C_DECL xnLogIsEnabled(const XnChar* csLogMask, XnLogSeverity nSeverity);
+XN_C_API XnLogger* XN_C_DECL xnLoggerOpen(const XnChar* strMask);
/**
-* This function writes a formatted string to the log (only if the mask is turned on)
-*
-* @param csLogMask [in] The mask under which this log should be written.
-* @param nSeverity [in] The severity of this log.
-* @param csFile [in] The name of the file writing this log entry.
-* @param nLine [in] The line number writing this log entry.
-* @param csFormat [in] A format string.
+* Writes a single log entry.
+*
+* @param pLogger [in] Logger to write to
+* @param severity [in] Severity of the log entry
+* @param strFile [in] Name of the source file
+* @param nLine [in] Line in the source file
+* @param strFormat [in] Format string
+*
+* It is advised to use one of the @ref xnLoggerVerbose, @ref xnLoggerInfo, @ref xnLoggerWarning or
+* @ref xnLoggerError macros instead of calling this method directly.
*/
-XN_C_API void XN_C_DECL xnLogWrite(const XnChar* csLogMask, XnLogSeverity nSeverity, const XnChar* csFile, XnUInt32 nLine, const XnChar* csFormat, ...);
+XN_C_API void XN_C_DECL xnLoggerWrite(XnLogger* pLogger, XnLogSeverity severity, const XnChar* strFile, XnUInt32 nLine, const XnChar* strFormat, ...);
/**
-* This function writes a formatted string to the log (only if the mask is turned on), but without
-* marking the timestamp, and without placing the end-of-line marker.
-* It is used for writing complex data to the log file.
-*
-* @param csLogMask [in] The mask under which this log should be written.
-* @param nSeverity [in] The severity of this log.
-* @param csFormat [in] A format string.
+* Writes to a logger without an entry format (i.e. no timestamp, mask name, etc.)
+*
+* @param pLogger [in] Logger to write to
+* @param severity [in] Severity of the log entry
+* @param strFormat [in] Format string
*/
-XN_C_API void XN_C_DECL xnLogWriteNoEntry(const XnChar* csLogMask, XnLogSeverity nSeverity, const XnChar* csFormat, ...);
+XN_C_API void XN_C_DECL xnLoggerWriteNoEntry(XnLogger* pLogger, XnLogSeverity severity, const XnChar* strFormat, ...);
/**
-* This function writes binary data as hex bytes (only if the mask is turned on).
-*
-* @param csLogMask [in] The mask under which this log should be written.
-* @param nSeverity [in] The severity of this log.
-* @param csFile [in] The name of the file writing this log entry.
-* @param nLine [in] The line number writing this log entry.
-* @param pBinData [in] The binary data to be written.
-* @param nDataSize [in] The number of bytes in the binary data.
-* @param csFormat [in] A format string to precede the binary data.
+* Writes binary data to a logger, formatting it to readable text.
+*
+* @param pLogger [in] Logger to write to
+* @param severity [in] Severity of the log entry
+* @param strFile [in] Name of the source file
+* @param nLine [in] Line in the source file
+* @param pBinData [in] A pointer to the binary data to be written
+* @param nDataSize [in] The number of bytes to write
+* @param strFormat [in] Format string for the binary data header
*/
-XN_C_API void XN_C_DECL xnLogWriteBinaryData(const XnChar* csLogMask, XnLogSeverity nSeverity, const XnChar* csFile, XnUInt32 nLine, XnUChar* pBinData, XnUInt32 nDataSize, const XnChar* csFormat, ...);
+XN_C_API void XN_C_DECL xnLoggerWriteBinaryData(XnLogger* pLogger, XnLogSeverity severity, const XnChar* strFile, XnUInt32 nLine, XnUChar* pBinData, XnUInt32 nDataSize, const XnChar* strFormat, ...);
/**
- * Creates a file under the logs directory.
+* Checks if a specific severity is enabled for this logger.
+*
+* @param pLogger [in] Logger to check
+* @param severity [in] Severity to check.
+*/
+XN_C_API XnBool XN_C_DECL xnLoggerIsEnabled(XnLogger* pLogger, XnLogSeverity severity);
+
+/**
+* Closes a logger previsouly opened using @ref xnLoggerOpen().
+*
+* @param pLogger [in] The logger to be closed.
+*/
+XN_C_API void XN_C_DECL _xnLoggerClose(XnLogger* pLogger);
+
+/**
+* Closes a logger and NULLs the handle.
+*
+* @param pLogger [in] The logger to be closed.
+*/
+#define xnLoggerClose(pLogger) \
+ { \
+ _xnLoggerClose(pLogger); \
+ pLogger = NULL; \
+ }
+
+#if XN_PLATFORM_VAARGS_TYPE == XN_PLATFORM_USE_WIN32_VAARGS_STYLE
+ /**
+ * Helper macro for logging. Checks inline if logger is enabled and adds source file and line info.
+ */
+ #define xnLoggerWriteHelper(pLogger, severity, csFormat, ...) \
+ if (pLogger != NULL && severity >= pLogger->nMinSeverity) \
+ { \
+ xnLoggerWrite(pLogger, severity, __FILE__, __LINE__, csFormat, __VA_ARGS__); \
+ }
+
+ /**
+ * Helper macro for logging. Issues a verbose log entry.
+ */
+ #define xnLoggerVerbose(pLogger, csFormat, ...) xnLoggerWriteHelper(pLogger, XN_LOG_VERBOSE, csFormat, __VA_ARGS__)
+ /**
+ * Helper macro for logging. Issues an info log entry.
+ */
+ #define xnLoggerInfo(pLogger, csFormat, ...) xnLoggerWriteHelper(pLogger, XN_LOG_INFO, csFormat, __VA_ARGS__)
+ /**
+ * Helper macro for logging. Issues a warning log entry.
+ */
+ #define xnLoggerWarning(pLogger, csFormat, ...) xnLoggerWriteHelper(pLogger, XN_LOG_WARNING, csFormat, __VA_ARGS__)
+ /**
+ * Helper macro for logging. Issues an error log entry.
+ */
+ #define xnLoggerError(pLogger, csFormat, ...) xnLoggerWriteHelper(pLogger, XN_LOG_ERROR, csFormat, __VA_ARGS__)
+
+ /**
+ * Helper macro for returning from a function while logging
+ *
+ * @param pLogger [in] The logger to be closed.
+ * @param nRetVal [in] The return value from the function.
+ * @param severity [in] Severity of the log entry
+ * @param csFormat [in] Format string
+ */
+ #define XN_RETURN_WITH_LOG(pLogger, nRetVal, severity, csFormat, ...) \
+ { \
+ xnLoggerWriteHelper(pLogger, severity, csFormat, __VA_ARGS__); \
+ return (nRetVal); \
+ }
+
+ /**
+ * Helper macro for returning from a function while logging a warning
+ *
+ * @param pLogger [in] The logger to be closed.
+ * @param nRetVal [in] The return value from the function.
+ * @param csFormat [in] Format string
+ */
+ #define XN_RETURN_WITH_WARNING_LOG(pLogger, nRetVal, csFormat, ...) \
+ XN_RETURN_WITH_LOG(pLogger, nRetVal, XN_LOG_WARNING, csFormat, __VA_ARGS__)
+
+ /**
+ * Helper macro for returning from a function while logging an error
+ *
+ * @param pLogger [in] The logger to be closed.
+ * @param nRetVal [in] The return value from the function.
+ * @param csFormat [in] Format string
+ */
+ #define XN_RETURN_WITH_ERROR_LOG(pLogger, nRetVal, csFormat, ...) \
+ XN_RETURN_WITH_LOG(pLogger, nRetVal, XN_LOG_ERROR, csFormat, __VA_ARGS__)
+
+#elif XN_PLATFORM_VAARGS_TYPE == XN_PLATFORM_USE_GCC_VAARGS_STYLE
+ #define xnLoggerWriteHelper(pLogger, severity, csFormat, ...) \
+ if (pLogger != NULL && severity >= pLogger->nMinSeverity) \
+ { \
+ xnLoggerWrite(pLogger, severity, __FILE__, __LINE__, csFormat, ##__VA_ARGS__); \
+ }
+
+ #define xnLoggerVerbose(pLogger, csFormat, ...) xnLoggerWriteHelper(pLogger, XN_LOG_VERBOSE, csFormat,## __VA_ARGS__)
+ #define xnLoggerInfo(pLogger, csFormat, ...) xnLoggerWriteHelper(pLogger, XN_LOG_INFO, csFormat, ##__VA_ARGS__)
+ #define xnLoggerWarning(pLogger, csFormat, ...) xnLoggerWriteHelper(pLogger, XN_LOG_WARNING, csFormat, ##__VA_ARGS__)
+ #define xnLoggerError(pLogger, csFormat, ...) xnLoggerWriteHelper(pLogger, XN_LOG_ERROR, csFormat, ##__VA_ARGS__)
+
+ /* Writes to the log and returns nRetVal */
+ #define XN_RETURN_WITH_LOG(pLogger, nRetVal, severity, csFormat, ...) \
+ { \
+ xnLoggerWriteHelper(pLogger, severity, csFormat, ##__VA_ARGS__); \
+ return (nRetVal); \
+ }
+
+ /* Logs a warning and returns nRetVal */
+ #define XN_RETURN_WITH_WARNING_LOG(pLogger, nRetVal, csFormat, ...) \
+ XN_RETURN_WITH_LOG(pLogger, nRetVal, XN_LOG_WARNING, csFormat, ##__VA_ARGS__)
+
+ /* Logs an error and returns nRetVal */
+ #define XN_RETURN_WITH_ERROR_LOG(pLogger, nRetVal, csFormat, ...) \
+ XN_RETURN_WITH_LOG(pLogger, nRetVal, XN_LOG_ERROR, csFormat, ##__VA_ARGS__)
+
+#elif XN_PLATFORM_VAARGS_TYPE == XN_PLATFORM_USE_ARC_VAARGS_STYLE
+ #define xnLoggerWriteHelper(pLogger, severity, csFormat...) \
+ if (pLogger != NULL && severity >= pLogger->nMinSeverity) \
+ { \
+ xnLoggerWrite(pLogger, severity, __FILE__, __LINE__, csFormat); \
+ }
+
+ #define xnLoggerVerbose(pLogger, csFormat...) xnLoggerWriteHelper(pLogger, XN_LOG_VERBOSE, csFormat)
+ #define xnLoggerInfo(pLogger, csFormat...) xnLoggerWriteHelper(pLogger, XN_LOG_INFO, csFormat)
+ #define xnLoggerWarning(pLogger, csFormat...) xnLoggerWriteHelper(pLogger, XN_LOG_WARNING, csFormat)
+ #define xnLoggerError(pLogger, csFormat...) xnLoggerWriteHelper(pLogger, XN_LOG_ERROR, csFormat)
+
+ /* Writes to the log and returns nRetVal */
+ #define XN_RETURN_WITH_LOG(pLogger, nRetVal, severity, csFormat...) \
+ { \
+ xnLoggerWriteHelper(pLogger, severity, csFormat); \
+ return (nRetVal); \
+ }
+
+ /* Logs a warning and returns nRetVal */
+ #define XN_RETURN_WITH_WARNING_LOG(pLogger, nRetVal, csFormat...) \
+ XN_RETURN_WITH_LOG(pLogger, nRetVal, XN_LOG_WARNING, csFormat)
+
+ /* Logs an error and returns nRetVal */
+ #define XN_RETURN_WITH_ERROR_LOG(pLogger, nRetVal, csFormat...) \
+ XN_RETURN_WITH_LOG(pLogger, nRetVal, XN_LOG_ERROR, csFormat)
+
+#elif XN_PLATFORM_VAARGS_TYPE == XN_PLATFORM_USE_NO_VAARGS
+ #define xnLoggerWriteHelper(pLogger, severity, csFormat, arg) \
+ if (pLogger != NULL && severity >= pLogger->nMinSeverity) \
+ { \
+ xnLoggerWrite(pLogger, severity, __FILE__, __LINE__, csFormat, arg); \
+ }
+
+ #define xnLoggerVerbose(pLogger, csFormat, arg) xnLoggerWriteHelper(pLogger, XN_LOG_VERBOSE, csFormat, arg)
+ #define xnLoggerInfo(pLogger, csFormat, arg) xnLoggerWriteHelper(pLogger, XN_LOG_INFO, csFormat, arg)
+ #define xnLoggerWarning(pLogger, csFormat, arg) xnLoggerWriteHelper(pLogger, XN_LOG_WARNING, csFormat, arg)
+ #define xnLoggerError(pLogger, csFormat, arg) xnLoggerWriteHelper(pLogger, XN_LOG_ERROR, csFormat, arg)
+
+ /* Writes to the log and returns nRetVal */
+ #define XN_RETURN_WITH_LOG(pLogger, nRetVal, severity, csFormat) \
+ { \
+ xnLoggerWriteHelper(pLogger, severity, csFormat); \
+ return (nRetVal); \
+ }
+
+ /* Logs a warning and returns nRetVal */
+ #define XN_RETURN_WITH_WARNING_LOG(pLogger, nRetVal, csFormat) \
+ XN_RETURN_WITH_LOG(pLogger, nRetVal, XN_LOG_WARNING, csFormat)
+
+ /* Logs an error and returns nRetVal */
+ #define XN_RETURN_WITH_ERROR_LOG(pLogger, nRetVal, csFormat) \
+ XN_RETURN_WITH_LOG(pLogger, nRetVal, XN_LOG_ERROR, csFormat)
+
+#else
+ #error Xiron Log - Unknown VAARGS type!
+#endif
+
+// @}
+
+/**
+ * @name Misc.
+ * Miscellaneous functions regarding the log system.
+ * @{
+ */
+
+/**
+ * Creates a file under the logs directory. The file is session based (see @ref xnLogCreateFileEx() for explanation).
*
- * @param csFileName [in] Name of the file to create
+ * @param strFileName [in] Name of the file to create
* @param phFile [out] The file handle.
*/
-XN_C_API XnStatus XN_C_DECL xnLogCreateFile(const XnChar* csFileName, XN_FILE_HANDLE* phFile);
+XN_C_API XnStatus XN_C_DECL xnLogCreateFile(const XnChar* strFileName, XN_FILE_HANDLE* phFile);
+
+/**
+ * Creates a file under the logs directory.
+ *
+ * @param strFileName [in] Name of the file to create
+ * @param bSessionBased [in] TRUE for a session-based file, FALSE otherwise. A session based
+ file also includes the timestamp and process ID of the running
+ process as a prefix to its name.
+ * @param phFile [out] The file handle.
+ */
+XN_C_API XnStatus XN_C_DECL xnLogCreateFileEx(const XnChar* strFileName, XnBool bSessionBased, XN_FILE_HANDLE* phFile);
+
+// @}
#define XN_MASK_RETVAL_CHECKS "RetValChecks"
+#if XN_PLATFORM == XN_PLATFORM_ARC
+extern "C" XnLogger* XN_LOGGER_RETVAL_CHECKS;
+#else
+XN_C_API XnLogger* XN_LOGGER_RETVAL_CHECKS;
+#endif
+
/** Validates return value and writes log message with appropriate status string **/
-#define XN_IS_STATUS_OK_LOG_ERROR(what, nRetVal) \
- if (nRetVal != XN_STATUS_OK) \
- { \
- xnLogError(XN_MASK_RETVAL_CHECKS, "Failed to " what ": %s", xnGetStatusString(nRetVal)); \
- XN_ASSERT(FALSE); \
- return (nRetVal); \
+#define XN_IS_STATUS_OK_LOG_ERROR(what, nRetVal) \
+ if (nRetVal != XN_STATUS_OK) \
+ { \
+ xnLoggerError(XN_LOGGER_RETVAL_CHECKS, "Failed to " what ": %s", xnGetStatusString(nRetVal)); \
+ XN_ASSERT(FALSE); \
+ return (nRetVal); \
}
+
+#ifndef __XN_NO_BC__
+
+XN_C_API XnStatus XN_API_DEPRECATED("Please use xnLogSetMaskMinSeverity() instead") XN_C_DECL xnLogSetMaskState(const XnChar* csMask, XnBool bEnabled);
+XN_C_API XnStatus XN_API_DEPRECATED("Please use xnLogSetMaskMinSeverity() instead") XN_C_DECL xnLogSetSeverityFilter(XnLogSeverity nMinSeverity);
+XN_C_API XnBool XN_C_DECL xnLogIsEnabled(const XnChar* csLogMask, XnLogSeverity nSeverity);
+XN_C_API void XN_C_DECL xnLogWrite(const XnChar* csLogMask, XnLogSeverity nSeverity, const XnChar* csFile, XnUInt32 nLine, const XnChar* csFormat, ...);
+XN_C_API void XN_C_DECL xnLogWriteNoEntry(const XnChar* csLogMask, XnLogSeverity nSeverity, const XnChar* csFormat, ...);
+XN_C_API void XN_C_DECL xnLogWriteBinaryData(const XnChar* csLogMask, XnLogSeverity nSeverity, const XnChar* csFile, XnUInt32 nLine, XnUChar* pBinData, XnUInt32 nDataSize, const XnChar* csFormat, ...);
+
#if XN_PLATFORM_VAARGS_TYPE == XN_PLATFORM_USE_WIN32_VAARGS_STYLE
#define xnLogVerbose(csLogMask, csFormat, ...) xnLogWrite(csLogMask, XN_LOG_VERBOSE, __FILE__, __LINE__, csFormat, __VA_ARGS__)
#define xnLogInfo(csLogMask, csFormat, ...) xnLogWrite(csLogMask, XN_LOG_INFO, __FILE__, __LINE__, csFormat, __VA_ARGS__)
@@ -190,16 +440,16 @@ XN_C_API XnStatus XN_C_DECL xnLogCreateFile(const XnChar* csFileName, XN_FILE_HA
/* Writes to the log and returns nRetVal */
#define XN_LOG_RETURN(nRetVal, nSeverity, csLogMask, csFormat, ...) \
- { \
- xnLogWrite(csLogMask, nSeverity, __FILE__, __LINE__, csFormat, __VA_ARGS__);\
- return (nRetVal); \
- }
+ { \
+ xnLogWrite(csLogMask, nSeverity, __FILE__, __LINE__, csFormat, __VA_ARGS__); \
+ return (nRetVal); \
+ }
/* Logs a warning and returns nRetVal */
#define XN_LOG_WARNING_RETURN(nRetVal, csLogMask, csFormat, ...) \
XN_LOG_RETURN(nRetVal, XN_LOG_WARNING, csLogMask, csFormat, __VA_ARGS__)
- /* Logs an error and returns nRetVal */
+ /* Logs a warning and returns nRetVal */
#define XN_LOG_ERROR_RETURN(nRetVal, csLogMask, csFormat, ...) \
XN_LOG_RETURN(nRetVal, XN_LOG_ERROR, csLogMask, csFormat, __VA_ARGS__)
@@ -285,5 +535,7 @@ XN_C_API XnStatus XN_C_DECL xnLogCreateFile(const XnChar* csFileName, XN_FILE_HA
#error Xiron Log - Unknown VAARGS type!
#endif
+#endif // ifndef __XN_NO_BC__
+
#endif //_XN_LOG_H_
View
24 Include/XnLogTypes.h
@@ -32,31 +32,31 @@
// Defines
//---------------------------------------------------------------------------
#define XN_LOG_DIR_NAME "Log"
-#define XN_LOG_MASKS_STRING_LEN 600
#define XN_MASK_LOG "Log"
#define XN_LOG_MASK_ALL "ALL"
+#define XN_LOG_MAX_MASK_NAME 16
//---------------------------------------------------------------------------
// Enums
//---------------------------------------------------------------------------
typedef enum XnLogSeverity
{
- XN_LOG_VERBOSE,
- XN_LOG_INFO,
- XN_LOG_WARNING,
- XN_LOG_ERROR
+ XN_LOG_VERBOSE = 0,
+ XN_LOG_INFO = 1,
+ XN_LOG_WARNING = 2,
+ XN_LOG_ERROR = 3,
+ XN_LOG_SEVERITY_NONE = 10,
} XnLogSeverity;
-typedef enum XnLogFilteringType
-{
- XN_LOG_WRITE_NONE,
- XN_LOG_WRITE_ALL,
- XN_LOG_WRITE_MASKS
-} XnLogFilteringType;
-
//---------------------------------------------------------------------------
// Structs
//---------------------------------------------------------------------------
+typedef struct XnLogger
+{
+ volatile XnLogSeverity nMinSeverity;
+ void* pInternal;
+} XnLogger;
+
typedef struct XnLogEntry
{
XnUInt64 nTimestamp;
View
2  Include/XnLogWriterBase.h
@@ -31,7 +31,7 @@
//---------------------------------------------------------------------------
// Types
//---------------------------------------------------------------------------
-class XnLogWriterBase : XnLogWriter
+class XnLogWriterBase
{
public:
XnLogWriterBase() : m_bRegistered(FALSE)
View
10 Include/XnMacros.h
@@ -115,4 +115,14 @@
return (XN_STATUS_OUTPUT_BUFFER_OVERFLOW); \
}
+/** Disables Copy ctor and assignment operator. Should be placed under "private:" section. */
+#define XN_DISABLE_COPY_AND_ASSIGN(TypeName) \
+ TypeName(const TypeName&); \
+ void operator=(const TypeName&)
+
+/** Disables the "local variable is initialized but not referenced" warning (if you need
+ to use this variable in an assert */
+#define XN_REFERENCE_VARIABLE(x) \
+ ((void)x)
+
#endif //_XN_MACROS_H_
View
10 Include/XnModuleCFunctions.h
@@ -1360,6 +1360,7 @@ XnStatus XN_CALLBACK_TYPE __ModuleGetAllAvailablePoses(XnModuleNodeHandle hGener
return pInterface->GetAllAvailablePoses(pstrPoses, nNameLength, *pnPoses);
}
+
XnStatus XN_CALLBACK_TYPE __ModuleStartPoseDetection(XnModuleNodeHandle hGenerator, const XnChar* strPose, XnUserID user)
{
ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
@@ -1376,6 +1377,14 @@ XnStatus XN_CALLBACK_TYPE __ModuleStopPoseDetection(XnModuleNodeHandle hGenerato
_XN_VALIDATE_CAPABILITY_INTERFACE(pInterface);
return pInterface->StopPoseDetection(user);
}
+XnStatus XN_CALLBACK_TYPE __ModuleStopSinglePoseDetection(XnModuleNodeHandle hGenerator, XnUserID user, const XnChar* strPose)
+{
+ ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
+ ModuleUserGenerator* pNode = dynamic_cast<ModuleUserGenerator*>(pProdNode);
+ ModulePoseDetectionInteface* pInterface = pNode->GetPoseDetectionInteface();
+ _XN_VALIDATE_CAPABILITY_INTERFACE(pInterface);
+ return pInterface->StopSinglePoseDetection(user, strPose);
+}
XnStatus XN_CALLBACK_TYPE __ModuleRegisterToPoseCallbacks(XnModuleNodeHandle hGenerator, XnModulePoseDetectionCallback PoseDetectionStartCB, XnModulePoseDetectionCallback PoseDetectionEndCB, void* pCookie, XnCallbackHandle* phCallback)
{
@@ -1898,6 +1907,7 @@ void XN_CALLBACK_TYPE __ModuleGetPoseDetectionInterface(XnModulePoseDetectionCap
pInteface->GetAllAvailablePoses = __ModuleGetAllAvailablePoses;
pInteface->StartPoseDetection = __ModuleStartPoseDetection;
pInteface->StopPoseDetection = __ModuleStopPoseDetection;
+ pInteface->StopSinglePoseDetection = __ModuleStopSinglePoseDetection;
pInteface->RegisterToPoseCallbacks = __ModuleRegisterToPoseCallbacks;
pInteface->UnregisterFromPoseCallbacks = __ModuleUnregisterFromPoseCallbacks;
View
1  Include/XnModuleCppInterface.h
@@ -521,6 +521,7 @@ namespace xn
virtual XnStatus StartPoseDetection(const XnChar* strPose, XnUserID user) = 0;
virtual XnStatus StopPoseDetection(XnUserID user) = 0;
+ virtual XnStatus StopSinglePoseDetection(XnUserID user, const XnChar* strPose) = 0;
virtual XnStatus RegisterToPoseDetectionCallbacks(XnModulePoseDetectionCallback StartPoseCB, XnModulePoseDetectionCallback EndPoseCB, void* pCookie, XnCallbackHandle& hCallback) = 0;
virtual void UnregisterFromPoseDetectionCallbacks(XnCallbackHandle hCallback) = 0;
View
2  Include/XnModuleInterface.h
@@ -1279,6 +1279,8 @@ typedef struct XnModulePoseDetectionCapabilityInterface
void (XN_CALLBACK_TYPE* UnregisterFromPoseDetected)(XnModuleNodeHandle hGenerator, XnCallbackHandle hCallback);
XnStatus (XN_CALLBACK_TYPE* RegisterToOutOfPose)(XnModuleNodeHandle hGenerator, XnModulePoseDetectionCallback handler, void* pCookie, XnCallbackHandle* phCallback);
void (XN_CALLBACK_TYPE* UnregisterFromOutOfPose)(XnModuleNodeHandle hGenerator, XnCallbackHandle hCallback);
+
+ XnStatus (XN_CALLBACK_TYPE* StopSinglePoseDetection)(XnModuleNodeHandle hGenerator, XnUserID user, const XnChar* strPose);
} XnModulePoseDetectionCapabilityInterface;
/** User generator Interface. */
View
61 Include/XnOS.h
@@ -166,50 +166,47 @@ typedef enum {
/** Creates a new type object and validates that allocation succeeded. */
#if XN_PLATFORM_VAARGS_TYPE == XN_PLATFORM_USE_WIN32_VAARGS_STYLE
#define XN_VALIDATE_NEW(ptr, type, ...) \
- __pragma(warning (push)) \
- __pragma(warning (disable: 4127)) \
- do { \
+ { \
(ptr) = XN_NEW(type, __VA_ARGS__); \
if ((ptr) == NULL) \
{ \
return (XN_STATUS_ALLOC_FAILED); \
} \
- } while (0) \
- __pragma(warning (pop))
+ }
#elif XN_PLATFORM_VAARGS_TYPE == XN_PLATFORM_USE_GCC_VAARGS_STYLE
#define XN_VALIDATE_NEW(ptr, type, ...) \
- do { \
+ { \
(ptr) = XN_NEW(type, ##__VA_ARGS__); \
if ((ptr) == NULL) \
{ \
return (XN_STATUS_ALLOC_FAILED); \
} \
- } while (0)
+ }
#elif XN_PLATFORM_VAARGS_TYPE == XN_PLATFORM_USE_ARC_VAARGS_STYLE
#define XN_VALIDATE_NEW(ptr, type...) \
- do { \
+ { \
(ptr) = XN_NEW(type); \
if ((ptr) == NULL) \
{ \
return (XN_STATUS_ALLOC_FAILED); \
} \
- } while (0)
+ }
#else
#define XN_VALIDATE_NEW(ptr, type) \
- do { \
+ { \
(ptr) = XN_NEW(type); \
if ((ptr) == NULL) \
{ \
return (XN_STATUS_ALLOC_FAILED); \
} \
- } while (0)
+ }
#endif
/** Creates a new type object, validates that allocation succeeded, and initializes the object (type must have an Init function). */
#if XN_PLATFORM_VAARGS_TYPE == XN_PLATFORM_USE_WIN32_VAARGS_STYLE
#define XN_VALIDATE_NEW_AND_INIT(ptr, type, ...) \
- do { \
+ { \
XN_VALIDATE_NEW(ptr, type, __VA_ARGS__); \
XnStatus rc = (ptr)->Init(); \
if (rc != XN_STATUS_OK) \
@@ -217,10 +214,10 @@ typedef enum {
XN_DELETE(ptr); \
return (rc); \
} \
- } while (0)
+ }
#elif XN_PLATFORM_VAARGS_TYPE == XN_PLATFORM_USE_GCC_VAARGS_STYLE
#define XN_VALIDATE_NEW_AND_INIT(ptr, type, ...) \
- do { \
+ { \
XN_VALIDATE_NEW(ptr, type, ##__VA_ARGS__); \
XnStatus rc = (ptr)->Init(); \
if (rc != XN_STATUS_OK) \
@@ -228,10 +225,10 @@ typedef enum {
XN_DELETE(ptr); \
return (rc); \
} \
- } while (0)
+ }
#elif XN_PLATFORM_VAARGS_TYPE == XN_PLATFORM_USE_ARC_VAARGS_STYLE
#define XN_VALIDATE_NEW_AND_INIT(ptr, type...) \
- do { \
+ { \
XN_VALIDATE_NEW(ptr, type); \
XnStatus rc = (ptr)->Init(); \
if (rc != XN_STATUS_OK) \
@@ -239,10 +236,10 @@ typedef enum {
XN_DELETE(ptr); \
return (rc); \
} \
- } while (0)
+ }
#else
#define XN_VALIDATE_NEW_AND_INIT(ptr, type) \
- do { \
+ { \
XN_VALIDATE_NEW(ptr, type); \
XnStatus rc = (ptr)->Init(); \
if (rc != XN_STATUS_OK) \
@@ -250,7 +247,7 @@ typedef enum {
XN_DELETE(ptr); \
return (rc); \
} \
- } while (0)
+ }
#endif
// Strings
@@ -392,7 +389,7 @@ XN_C_API void XN_C_DECL xnOSWriteMemoryReport(const XnChar* csFileName);
}
// called only if ctor threw exception
- static void operator delete(void* p, const XnChar* csFunction, const XnChar* csFile, XnUInt32 nLine, const XnChar* csAdditional)
+ static void operator delete(void* p, const XnChar* /*csFunction*/, const XnChar* /*csFile*/, XnUInt32 /*nLine*/, const XnChar* /*csAdditional*/)
{
xnOSLogMemFree(p);
xnOSFree(p);
@@ -411,7 +408,7 @@ XN_C_API void XN_C_DECL xnOSWriteMemoryReport(const XnChar* csFileName);
}
// called only if ctor threw exception
- static void operator delete[](void* p, const XnChar* csFunction, const XnChar* csFile, XnUInt32 nLine, const XnChar* csAdditional)
+ static void operator delete[](void* p, const XnChar* /*csFunction*/, const XnChar* /*csFile*/, XnUInt32 /*nLine*/, const XnChar* /*csAdditional*/)
{
xnOSLogMemFree(p);
xnOSFree(p);
@@ -452,15 +449,21 @@ XN_C_API XnStatus XN_C_DECL xnOSOpenFile(const XnChar* cpFileName, const XnUInt3
XN_C_API XnStatus XN_C_DECL xnOSCloseFile(XN_FILE_HANDLE* pFile);
XN_C_API XnStatus XN_C_DECL xnOSReadFile(const XN_FILE_HANDLE File, void* pBuffer, XnUInt32* pnBufferSize);
XN_C_API XnStatus XN_C_DECL xnOSWriteFile(const XN_FILE_HANDLE File, const void* pBuffer, const XnUInt32 nBufferSize);
-XN_C_API XnStatus XN_C_DECL xnOSSeekFile(const XN_FILE_HANDLE File, const XnOSSeekType SeekType, const XnInt32 nOffset);
-XN_C_API XnStatus XN_C_DECL xnOSTellFile(const XN_FILE_HANDLE File, XnUInt32* nFilePos);
+XN_C_API XnStatus XN_API_DEPRECATED("Use xnOSSeekFile64() instead") XN_C_DECL
+ xnOSSeekFile (const XN_FILE_HANDLE File, const XnOSSeekType SeekType, const XnInt32 nOffset);
+XN_C_API XnStatus XN_C_DECL xnOSSeekFile64(const XN_FILE_HANDLE File, const XnOSSeekType SeekType, const XnInt64 nOffset);
+XN_C_API XnStatus XN_API_DEPRECATED("Use xnOSTellFile64() instead") XN_C_DECL
+ xnOSTellFile (const XN_FILE_HANDLE File, XnUInt32* nFilePos);
+XN_C_API XnStatus XN_C_DECL xnOSTellFile64(const XN_FILE_HANDLE File, XnUInt64* nFilePos);
XN_C_API XnStatus XN_C_DECL xnOSFlushFile(const XN_FILE_HANDLE File);
XN_C_API XnStatus XN_C_DECL xnOSDoesFileExist(const XnChar* cpFileName, XnBool* pbResult);
XN_C_API XnStatus XN_C_DECL xnOSDoesDirecotyExist(const XnChar* cpDirName, XnBool* pbResult);
XN_C_API XnStatus XN_C_DECL xnOSLoadFile(const XnChar* cpFileName, void* pBuffer, const XnUInt32 nBufferSize);
XN_C_API XnStatus XN_C_DECL xnOSSaveFile(const XnChar* cpFileName, const void* pBuffer, const XnUInt32 nBufferSize);
XN_C_API XnStatus XN_C_DECL xnOSAppendFile(const XnChar* cpFileName, const void* pBuffer, const XnUInt32 nBufferSize);
-XN_C_API XnStatus XN_C_DECL xnOSGetFileSize(const XnChar* cpFileName, XnUInt32* pnFileSize);
+XN_C_API XnStatus XN_API_DEPRECATED("Use xnOSGetFileSize64() instead") XN_C_DECL
+ xnOSGetFileSize (const XnChar* cpFileName, XnUInt32* pnFileSize);
+XN_C_API XnStatus XN_C_DECL xnOSGetFileSize64(const XnChar* cpFileName, XnUInt64* pnFileSize);
XN_C_API XnStatus XN_C_DECL xnOSCreateDirectory(const XnChar* cpDirName);
XN_C_API XnStatus XN_C_DECL xnOSGetDirName(const XnChar* cpFilePath, XnChar* cpDirName, const XnUInt32 nBufferSize);
XN_C_API XnStatus XN_C_DECL xnOSGetFileName(const XnChar* cpFilePath, XnChar* cpFileName, const XnUInt32 nBufferSize);
@@ -468,6 +471,8 @@ XN_C_API XnStatus XN_C_DECL xnOSGetFullPathName(const XnChar* strFilePath, XnCha
XN_C_API XnStatus XN_C_DECL xnOSGetCurrentDir(XnChar* cpDirName, const XnUInt32 nBufferSize);
XN_C_API XnStatus XN_C_DECL xnOSSetCurrentDir(const XnChar* cpDirName);
XN_C_API XnStatus XN_C_DECL xnOSDeleteFile(const XnChar* cpFileName);
+XN_C_API XnStatus XN_C_DECL xnOSDeleteEmptyDirectory(const XnChar* strDirName);
+XN_C_API XnStatus XN_C_DECL xnOSDeleteDirectoryTree(const XnChar* strDirName);
// INI
XN_C_API XnStatus XN_C_DECL xnOSReadStringFromINI(const XnChar* cpINIFile, const XnChar* cpSection, const XnChar* cpKey, XnChar* cpDest, const XnUInt32 nDestLength);
@@ -523,6 +528,7 @@ XN_C_API XnStatus XN_C_DECL xnOSCreateProcess(const XnChar* strExecutable, XnUIn
// Mutex
XN_C_API XnStatus XN_C_DECL xnOSCreateMutex(XN_MUTEX_HANDLE* pMutexHandle);
XN_C_API XnStatus XN_C_DECL xnOSCreateNamedMutex(XN_MUTEX_HANDLE* pMutexHandle, const XnChar* cpMutexName);
+XN_C_API XnStatus XN_C_DECL xnOSCreateNamedMutexEx(XN_MUTEX_HANDLE* pMutexHandle, const XnChar* cpMutexName, XnBool bAllowOtherUsers);
XN_C_API XnStatus XN_C_DECL xnOSCloseMutex(XN_MUTEX_HANDLE* pMutexHandle);
XN_C_API XnStatus XN_C_DECL xnOSLockMutex(const XN_MUTEX_HANDLE MutexHandle, XnUInt32 nMilliseconds);
XN_C_API XnStatus XN_C_DECL xnOSUnLockMutex(const XN_MUTEX_HANDLE MutexHandle);
@@ -536,7 +542,9 @@ XN_C_API XnStatus XN_C_DECL xnOSLeaveCriticalSection(XN_CRITICAL_SECTION_HANDLE*
// Events
XN_C_API XnStatus XN_C_DECL xnOSCreateEvent(XN_EVENT_HANDLE* pEventHandle, XnBool bManualReset);
XN_C_API XnStatus XN_C_DECL xnOSCreateNamedEvent(XN_EVENT_HANDLE* pEventHandle, const XnChar* cpEventName, XnBool bManualReset);
+XN_C_API XnStatus XN_C_DECL xnOSCreateNamedEventEx(XN_EVENT_HANDLE* pEventHandle, const XnChar* cpEventName, XnBool bManualReset, XnBool bAllowOtherUsers);
XN_C_API XnStatus XN_C_DECL xnOSOpenNamedEvent(XN_EVENT_HANDLE* pEventHandle, const XnChar* cpEventName);
+XN_C_API XnStatus XN_C_DECL xnOSOpenNamedEventEx(XN_EVENT_HANDLE* pEventHandle, const XnChar* cpEventName, XnBool bAllowOtherUsers);
XN_C_API XnStatus XN_C_DECL xnOSCloseEvent(XN_EVENT_HANDLE* pEventHandle);
XN_C_API XnStatus XN_C_DECL xnOSSetEvent(const XN_EVENT_HANDLE EventHandle);
XN_C_API XnStatus XN_C_DECL xnOSResetEvent(const XN_EVENT_HANDLE EventHandle);
@@ -592,6 +600,8 @@ typedef struct XnOSSharedMemory XnOSSharedMemory, *XN_SHARED_MEMORY_HANDLE;
*/
XN_C_API XnStatus XN_C_DECL xnOSCreateSharedMemory(const XnChar* strName, XnUInt32 nSize, XnUInt32 nAccessFlags, XN_SHARED_MEMORY_HANDLE* phSharedMem);
+XN_C_API XnStatus XN_C_DECL xnOSCreateSharedMemoryEx(const XnChar* strName, XnUInt32 nSize, XnUInt32 nAccessFlags, XnBool bAllowOtherUsers, XN_SHARED_MEMORY_HANDLE* phSharedMem);
+
/**
* Opens a shared memory block, and returns the address in which it was mapped to the process' memory.
*
@@ -601,6 +611,8 @@ XN_C_API XnStatus XN_C_DECL xnOSCreateSharedMemory(const XnChar* strName, XnUInt
*/
XN_C_API XnStatus XN_C_DECL xnOSOpenSharedMemory(const XnChar* strName, XnUInt32 nAccessFlags, XN_SHARED_MEMORY_HANDLE* phSharedMem);
+XN_C_API XnStatus XN_C_DECL xnOSOpenSharedMemoryEx(const XnChar* strName, XnUInt32 nAccessFlags, XnBool bAllowOtherUsers, XN_SHARED_MEMORY_HANDLE* phSharedMem);
+
/**
* Closes a shared memory block.
*
@@ -765,6 +777,7 @@ XN_STATUS_MESSAGE(XN_STATUS_OS_SEMAPHORE_TIMEOUT, "Xiron OS got a semaphore time
XN_STATUS_MESSAGE(XN_STATUS_OS_INVALID_SEMAPHORE, "This Xiron OS semaphore is invalid!")
XN_STATUS_MESSAGE(XN_STATUS_OS_ENV_VAR_NOT_FOUND, "The environment variable could not be found!")
XN_STATUS_MESSAGE(XN_STATUS_USB_NO_REQUEST_PENDING, "There is no request pending!")
+XN_STATUS_MESSAGE(XN_STATUS_OS_FAILED_TO_DELETE_DIR, "Failed to delete a directory!")
XN_STATUS_MESSAGE_MAP_END(XN_ERROR_GROUP_OS)
#endif //__XN_OS_H__
View
14 Include/XnOSCpp.h
@@ -60,8 +60,7 @@ class XnAutoCSLocker
{
if (!m_bLocked)
{
- XnStatus nRetVal = xnOSEnterCriticalSection(&m_hCS);
- XN_ASSERT(nRetVal == XN_STATUS_OK);
+ xnOSEnterCriticalSection(&m_hCS);
m_bLocked = TRUE;
}
}
@@ -70,8 +69,7 @@ class XnAutoCSLocker
{
if (m_bLocked)
{
- XnStatus nRetVal = xnOSLeaveCriticalSection(&m_hCS);
- XN_ASSERT(nRetVal == XN_STATUS_OK);
+ xnOSLeaveCriticalSection(&m_hCS);
m_bLocked = FALSE;
}
}
@@ -128,14 +126,14 @@ class XnOSEvent
return xnOSCreateEvent(&m_hEvent, bManualReset);
}
- XnStatus Create(const XnChar* strName, XnBool bManualReset)
+ XnStatus Create(const XnChar* strName, XnBool bManualReset, XnBool bAllowOtherUsers = FALSE)
{
- return xnOSCreateNamedEvent(&m_hEvent, strName, bManualReset);
+ return xnOSCreateNamedEventEx(&m_hEvent, strName, bManualReset, bAllowOtherUsers);
}
- XnStatus Open(const XnChar* strName)
+ XnStatus Open(const XnChar* strName, XnBool bEnableOtherUsers = FALSE)
{
- return xnOSOpenNamedEvent(&m_hEvent, strName);
+ return xnOSOpenNamedEventEx(&m_hEvent, strName, bEnableOtherUsers);
}
XnStatus Close()
View
2  Include/XnPlatform.h
@@ -60,7 +60,7 @@
#endif
#include "Win32/XnPlatformWin32.h"
-#elif defined(android) && defined(__arm__)
+#elif defined(ANDROID) && defined(__arm__)
#include "Android-Arm/XnPlatformAndroid-Arm.h"
#elif (linux && (i386 || __x86_64__))
#include "Linux-x86/XnPlatformLinux-x86.h"
View
43 Include/XnPrdNode.h
@@ -1419,6 +1419,16 @@ XN_C_API XnStatus XN_C_DECL xnEnumerateGestures(XnNodeHandle hInstance, XnChar**
* @param nGestures [in,out] The size of the preallocated memory. Changed to number of gestures
*/
XN_C_API XnStatus XN_C_DECL xnEnumerateAllGestures(XnNodeHandle hInstance, XnChar** pstrGestures, XnUInt32 nNameLength, XnUInt16* nGestures);
+
+/**
+ * @brief Get the number of all gestures available
+ *
+ * @param hInstance [in] A handle to the instance
+ * @return the number of gestures available
+ */
+XN_C_API XnUInt16 XN_C_DECL xnGetNumberOfAvailableGestures(XnNodeHandle hInstance);
+
+
/**
* @brief Check if a specific gesture is available in this generator
*
@@ -1991,6 +2001,30 @@ XN_C_API XnStatus XN_C_DECL xnGetAvailablePoses(XnNodeHandle hInstance, XnChar**
* @param pnPoses [in,out] In input - size of the preallocated memory, in output - the number of pose names
*/
XN_C_API XnStatus XN_C_DECL xnGetAllAvailablePoses(XnNodeHandle hInstance, XnChar** pstrPoses, XnUInt32 nNameLength, XnUInt32* pnPoses);
+
+/**
+* @brief Tests if a pose is supported
+*
+* @param hInstance [in] A handle to the instance
+* @param strPose [in] The pose string to test
+* @return True if the pose is supported and False otherwise.
+*/
+XN_C_API XnBool XN_C_DECL xnIsPoseSupported(XnNodeHandle hInstance, const XnChar* strPose);
+
+/**
+* @brief Gets the current pose status
+*
+* @param hInstance [in] A handle to the instance
+* @param userID [in] The user whose pose status we are interested in.
+* @param poseName [in] The pose we want to get a status on.
+* @param poseTime [out] The time stamp in which the user entered into the pose (0 if not in pose).
+* @param eStatus [out] The status of the user's pose, i.e. the progress error for getting into
+* pose (XnPoseDetectionStatus, the same as received from the in progress
+* callback. See @ref xnRegisterToPoseDetectionInProgress).
+* @param eState [out] The state of the user pose (i.e. in pose, out of pose).
+* @return The success status. The data is invalid if failed.
+*/
+XN_C_API XnStatus xnGetPoseStatus(XnNodeHandle hInstance, XnUserID userID, const XnChar* poseName, XnUInt64* poseTime, XnPoseDetectionStatus* eStatus, XnPoseDetectionState* eState);
/**
* @brief Start detection of a specific pose for a specific user
*
@@ -2007,6 +2041,14 @@ XN_C_API XnStatus XN_C_DECL xnStartPoseDetection(XnNodeHandle hInstance,const X
*/
XN_C_API XnStatus XN_C_DECL xnStopPoseDetection(XnNodeHandle hInstance, XnUserID user);
/**
+* @brief Stop detection of a specific pose for a specific user
+*
+* @param hInstance [in] A handle to the instance
+* @param user [in] Id of user
+* @param strPose [in] Name of the pose
+*/
+XN_C_API XnStatus XN_C_DECL xnStopSinglePoseDetection(XnNodeHandle hInstance, XnUserID user, const XnChar* strPose);
+/**
* @brief Register to callbacks for pose events
*
* @param hInstance [in] A handle to the instance
@@ -2299,6 +2341,7 @@ XN_C_API XnStatus XN_C_DECL xnSetRecorderDestination(XnNodeHandle hRecorder, XnR
* @param hRecorder [in] A handle to the recorder
* @param pDestType [out] The type of medium the recorder is set to record.
* @param strDest [out] Recording destination. If destType is XN_RECORD_MEDIUM_FILE, this specifies a file name.
+ * @param nBufSize [in] The size of the strDest buffer.
*/
XN_C_API XnStatus XN_C_DECL xnGetRecorderDestination(XnNodeHandle hRecorder, XnRecordMedium* pDestType, XnChar* strDest, XnUInt32 nBufSize);
View
4 Include/XnStatus.h
@@ -82,10 +82,10 @@ typedef enum XnErrorGroup
#define XN_STATUS_MAKE(group, code) ((group << 16) | code)
/** Returns the group of the status. */
-#define XN_STATUS_GROUP(status) (status >> 16)
+#define XN_STATUS_GROUP(status) XnUInt16(status >> 16)
/** Returns the code of the status. */
-#define XN_STATUS_CODE(status) (status & 0x0000FFFF)
+#define XN_STATUS_CODE(status) XnUInt16(status & 0x0000FFFF)
/** Marks the beginning of a message map of a specific module. */
#define XN_STATUS_MESSAGE_MAP_START_FROM(group, first) \
View
10 Include/XnStringsHash.h
@@ -109,16 +109,8 @@ class XnStringsKeyTranslator
* Declares a hash table from strings to @a ValueType that's named @a ClassName and uses default translator
* to translate values.
*/
-#if XN_PLATFORM == XN_PLATFORM_WIN32
-#define XN_DECLARE_STRINGS_HASH(ValueType, ClassName) \
- __pragma(warning(push)) \
- __pragma(warning(disable: 4127)) \
- XN_DECLARE_STRINGS_HASH_DECL(, ValueType, ClassName) \
- __pragma(warning(pop))
-#else
-#define XN_DECLARE_STRINGS_HASH(ValueType, ClassName) \
+#define XN_DECLARE_STRINGS_HASH(ValueType, ClassName) \
XN_DECLARE_STRINGS_HASH_DECL(, ValueType, ClassName)
-#endif
XN_DECLARE_STRINGS_HASH(XnValue, XnStringsHash)
View
74 Include/XnTypes.h
@@ -483,7 +483,7 @@ typedef struct XnFieldOfView
{
/** Horizontal Field Of View, in radians. */
XnDouble fHFOV;
- /** Horizontal Field Of View, in radians. */
+ /** Vertical Field Of View, in radians. */
XnDouble fVFOV;
} XnFieldOfView;
@@ -646,20 +646,32 @@ typedef enum XnPoseDetectionStatus
XN_POSE_DETECTION_STATUS_TOP_FOV = 2,
XN_POSE_DETECTION_STATUS_SIDE_FOV = 3,
XN_POSE_DETECTION_STATUS_ERROR = 4,
+ XN_POSE_DETECTION_STATUS_NO_TRACKING = 5
} XnPoseDetectionStatus;
+
+/** Possible pose detection states */
+typedef enum XnPoseDetectionState
+{
+ XN_POSE_DETECTION_STATE_IN_POSE =0,
+ XN_POSE_DETECTION_STATE_OUT_OF_POSE =1,
+ XN_POSE_DETECTION_STATE_UNDEFINED =2
+} XnPoseDetectionState;
/** Possible statuses for calibration */
typedef enum XnCalibrationStatus
{
- XN_CALIBRATION_STATUS_OK = 0,
- XN_CALIBRATION_STATUS_NO_USER = 1,
- XN_CALIBRATION_STATUS_ARM = 2,
- XN_CALIBRATION_STATUS_LEG = 3,
- XN_CALIBRATION_STATUS_HEAD = 4,
- XN_CALIBRATION_STATUS_TORSO = 5,
- XN_CALIBRATION_STATUS_TOP_FOV = 6,
- XN_CALIBRATION_STATUS_SIDE_FOV = 7,
- XN_CALIBRATION_STATUS_POSE = 8,
+ XN_CALIBRATION_STATUS_OK = 0,
+ XN_CALIBRATION_STATUS_NO_USER = 1,
+ XN_CALIBRATION_STATUS_ARM = 2,
+ XN_CALIBRATION_STATUS_LEG = 3,
+ XN_CALIBRATION_STATUS_HEAD = 4,
+ XN_CALIBRATION_STATUS_TORSO = 5,
+ XN_CALIBRATION_STATUS_TOP_FOV = 6,
+ XN_CALIBRATION_STATUS_SIDE_FOV = 7,
+ XN_CALIBRATION_STATUS_POSE = 8,
+ XN_CALIBRATION_STATUS_MANUAL_ABORT = 9,
+ XN_CALIBRATION_STATUS_MANUAL_RESET = 10,
+ XN_CALIBRATION_STATUS_TIMEOUT_FAIL = 11
} XnCalibrationStatus;
typedef enum XnDirection
@@ -840,7 +852,7 @@ typedef struct XnRecorderOutputStreamInterface
* @param seekType [in] Specifies how to seek - according to current position, end or beginning.
* @param nOffset [in] Specifies how many bytes to move
*/
- XnStatus (XN_CALLBACK_TYPE* Seek)(void* pCookie, XnOSSeekType seekType, const XnUInt32 nOffset);
+ XnStatus (XN_CALLBACK_TYPE* Seek)(void* pCookie, XnOSSeekType seekType, const XnInt32 nOffset);
/**
* Tells the current position in the stream.
@@ -858,6 +870,26 @@ typedef struct XnRecorderOutputStreamInterface
* @param pCookie [in] A token that was received with this interface.
*/
void (XN_CALLBACK_TYPE* Close)(void* pCookie);
+
+ /**
+ * Sets the stream's pointer to the specified position. (64bit version, for large files)
+ *
+ * @param pCookie [in] A cookie that was received with this interface.
+ * @param seekType [in] Specifies how to seek - according to current position, end or beginning.
+ * @param nOffset [in] Specifies how many bytes to move
+ */
+ XnStatus (XN_CALLBACK_TYPE* Seek64)(void* pCookie, XnOSSeekType seekType, const XnInt64 nOffset);
+