diff --git a/addon_config.mk b/addon_config.mk
new file mode 100644
index 0000000..7578f80
--- /dev/null
+++ b/addon_config.mk
@@ -0,0 +1,91 @@
+# All variables and this file are optional, if they are not present the PG and the
+# makefiles will try to parse the correct values from the file system.
+#
+# Variables that specify exclusions can use % as a wildcard to specify that anything in
+# that position will match. A partial path can also be specified to, for example, exclude
+# a whole folder from the parsed paths from the file system
+#
+# Variables can be specified using = or +=
+# = will clear the contents of that variable both specified from the file or the ones parsed
+# from the file system
+# += will add the values to the previous ones in the file or the ones parsed from the file
+# system
+#
+# The PG can be used to detect errors in this file, just create a new project with this addon
+# and the PG will write to the console the kind of error and in which line it is
+
+meta:
+ ADDON_NAME = ofxOpenNI
+ ADDON_DESCRIPTION = Wrapper for OpenNI, NITE and SensorKinect
+ ADDON_AUTHOR = Matthew Gingold, Wouter Verweirder
+ ADDON_TAGS = "computer vision" "3D sensing" "kinect"
+ ADDON_URL = https://github.com/gameoverhack/ofxOpenNI
+
+common:
+ # dependencies with other addons, a list of them separated by spaces
+ # or use += in several lines
+ # ADDON_DEPENDENCIES =
+
+ # include search paths, this will be usually parsed from the file system
+ # but if the addon or addon libraries need special search paths they can be
+ # specified here separated by spaces or one per line using +=
+ # ADDON_INCLUDES =
+
+ # any special flag that should be passed to the compiler when using this
+ # addon
+ # ADDON_CFLAGS =
+
+ # any special flag that should be passed to the linker when using this
+ # addon, also used for system libraries with -lname
+ # ADDON_LDFLAGS =
+
+ # linux only, any library that should be included in the project using
+ # pkg-config
+ # ADDON_PKG_CONFIG_LIBRARIES =
+
+ # osx/iOS only, any framework that should be included in the project
+ # ADDON_FRAMEWORKS =
+
+ # source files, these will be usually parsed from the file system looking
+ # in the src folders in libs and the root of the addon. if your addon needs
+ # to include files in different places or a different set of files per platform
+ # they can be specified here
+ # ADDON_SOURCES =
+
+ # some addons need resources to be copied to the bin/data folder of the project
+ # specify here any files that need to be copied, you can use wildcards like * and ?
+ # ADDON_DATA =
+
+ # when parsing the file system looking for libraries exclude this for all or
+ # a specific platform
+ # ADDON_LIBS_EXCLUDE =
+
+ # when parsing the file system looking for sources exclude this for all or
+ # a specific platform
+ # ADDON_SOURCES_EXCLUDE =
+
+ # when parsing the file system looking for include paths exclude this for all or
+ # a specific platform
+ # ADDON_INCLUDES_EXCLUDE =
+
+linux64:
+
+linux:
+
+win_cb:
+
+vs:
+
+linuxarmv6l:
+
+linuxarmv7l:
+
+android/armeabi:
+
+android/armeabi-v7a:
+
+osx:
+
+ios:
+
+
diff --git a/copy_contents_to_data_folder/openni/config/Data/lbsdata.idx b/copy_contents_to_data_folder/openni/config/Data/lbsdata.idx
new file mode 100755
index 0000000..8c0c3df
Binary files /dev/null and b/copy_contents_to_data_folder/openni/config/Data/lbsdata.idx differ
diff --git a/copy_contents_to_data_folder/openni/config/Data/lbsdata.lbd b/copy_contents_to_data_folder/openni/config/Data/lbsdata.lbd
new file mode 100755
index 0000000..bf6cea7
Binary files /dev/null and b/copy_contents_to_data_folder/openni/config/Data/lbsdata.lbd differ
diff --git a/copy_contents_to_data_folder/openni/config/Data/lbsparam1.lbd b/copy_contents_to_data_folder/openni/config/Data/lbsparam1.lbd
new file mode 100755
index 0000000..6152caa
Binary files /dev/null and b/copy_contents_to_data_folder/openni/config/Data/lbsparam1.lbd differ
diff --git a/copy_contents_to_data_folder/openni/config/Data/lbsparam2.lbd b/copy_contents_to_data_folder/openni/config/Data/lbsparam2.lbd
new file mode 100755
index 0000000..94de0ef
Binary files /dev/null and b/copy_contents_to_data_folder/openni/config/Data/lbsparam2.lbd differ
diff --git a/copy_contents_to_data_folder/openni/config/FeatureExtraction.ini b/copy_contents_to_data_folder/openni/config/FeatureExtraction.ini
new file mode 100755
index 0000000..d8df39f
--- /dev/null
+++ b/copy_contents_to_data_folder/openni/config/FeatureExtraction.ini
@@ -0,0 +1,16 @@
+[FeatureExtractor]
+AutoBodyParameters=1
+AutoCalibrate=1
+
+[LBS]
+;Resolution=2
+UseAutoCalibration=1
+DatabaseFilename=Data/lbsdata.lbd
+ParameterFilename=Data/lbsparam
+
+[Generator]
+Preference=Quality
+;Preference=Speed
+
+[Server]
+;UseServer=1
diff --git a/copy_contents_to_data_folder/openni/config/GlobalDefaultsKinect.ini b/copy_contents_to_data_folder/openni/config/GlobalDefaultsKinect.ini
new file mode 100755
index 0000000..a21b748
--- /dev/null
+++ b/copy_contents_to_data_folder/openni/config/GlobalDefaultsKinect.ini
@@ -0,0 +1,186 @@
+[Core]
+; 0 - Verbose, 1 - Info, 2 - Warning, 3 - Error (default)
+LogLevel=3
+; leave empty for nothing (default). ALL - all masks
+LogMasks=ALL
+; 0 - No (default), 1 - Yes
+;LogWriteToConsole=1
+; 0 - No (default), 1 - Yes
+LogWriteToFile=1
+; 0 - No (default), 1 - Yes
+;LogWriteLineInfo=0
+; leave empty for nothing (default). ALL - all masks
+;DumpMasks=
+
+; Number of milliseconds between profiling logs. 0 - Off (default)
+;ProfilingInterval=1000
+
+;---------------- Server Default Configuration -------------------
+[Server]
+; Use a server to access sensor. 0 - No (single application), 1 - Yes (multiple applications, default)
+;EnableMultiProcess=0
+
+; The timeout in which a server goes down if no client is connected, in milliseconds
+;ServerNoClientsTimeout=10000
+
+; The number of shared memory buffers per stream (default is 6).
+; This value affects the number of concurrent clients to the server: (NumberOfBuffers = clients + 3)
+;NumberOfBuffers=6
+
+;---------------- Sensor Default Configuration -------------------
+[Device]
+; Mirroring. 0 - Off (default), 1 - On
+;Mirror=1
+
+; FrameSync. 0 - Off (default), 1 - On
+;FrameSync=1
+
+; Stream Data Timestamps. 0 - milliseconds, 1 - microseconds (default)
+;HighResTimestamps=1
+
+; A filter for the firmware log. Default is determined by firmware.
+;FirmwareLogFilter=0
+
+; Automatic firmare log retrieval. 0 - Off (default), or the number of milliseconds between log retrievals operations.
+;FirmwareLogInterval=1000
+
+; Print firmware log to console when automatic firmware log retrieval is on. 0 - Off (default), 1 - On
+;FirmwareLogPrint=1
+
+; Automatic firmware CPU statistics retrieval. 0 - Off (default), or the number of milliseconds between CPU retrievals operations.
+;FirmwareCPUInterval=1000
+
+; Is APC enabled. 0 - Off, 1 - On (default)
+;APCEnabled=1
+
+; USB interface to be used. 0 - FW Default (default), 1 - ISO endpoints, 2 - BULK endpoints
+;UsbInterface=2
+
+[Depth]
+; Output format. 0 - Shift values, 1 - 12-bit depth values (default)
+;OutputFormat=1
+
+; Is stream mirrored. 0 - Off, 1 - On
+;Mirror=1
+
+; 0 - QVGA (default), 1 - VGA
+;Resolution=1
+
+; Frames per second (default is 30)
+;FPS=30
+
+; Min depth cutoff. 0-10000 mm (default is 0)
+;MinDepthValue=0
+
+; Max depth cutoff. 0-10000 mm (default is 10000)
+;MaxDepthValue=10000
+
+; Input format. 0 - Uncompressed 16-bit, 1 - PS Compression, 3 - Packed 11-bit (default)
+;InputFormat=1
+
+; Registration. 0 - Off (default), 1 - On
+;Registration=1
+
+; Registration Type. 0 - Don't care (default), 1 - use hardware accelaration, 2 - perform in software
+;RegistrationType=0
+
+; Hole Filler. 0 - Off, 1 - On (default)
+;HoleFilter=1
+
+; White Balance. 0 - Off, 1 - On (default)
+;WhiteBalancedEnabled=1
+
+; Gain. 0-50 (0 - Auto, 1 - Min., 50 - Max.). Default value is set by firmware.
+;Gain=0
+
+; GMC Mode. 0 - Off, 1 - On (default)
+;GMCMode=0
+
+; GMC Debug. 0 - Off (default), 1 - On
+;GMCDebug=1
+
+; Depth Auto Gain Region-of-Interest. Default values are set by firmware.
+;DepthAGCBin0MinDepth=500
+;DepthAGCBin0MaxDepth=800
+;DepthAGCBin1MinDepth=1500
+;DepthAGCBin1MaxDepth=1800
+;DepthAGCBin2MinDepth=2500
+;DepthAGCBin2MaxDepth=2800
+;DepthAGCBin3MinDepth=3500
+;DepthAGCBin3MaxDepth=3800
+
+; Wavelength Correction Mechanism. 0 - Off (default), 1 - On
+;WavelengthCorrection=1
+
+; Wavelength Correction debug info. 0 - Off (default), 1 - On
+;WavelengthCorrectionDebug=1
+
+; Cropping section
+[Depth.Cropping]
+;OffsetX=0
+;OffsetY=0
+;SizeX=320
+;SizeY=240
+;Enabled=1
+
+[Image]
+; Output format. 2 - Gray8 (2.0 MP only), 4 - YUV422, 5 - RGB24 (default)
+;OutputFormat=5
+
+; Is stream mirrored. 0 - Off, 1 - On
+;Mirror=1
+
+; 0 - QVGA (default), 1 - VGA, 2- SXGA (1.3MP) 3 - UXGA (2.0MP)
+;Resolution=1
+
+; Frames per second (default is 30)
+;FPS=30
+
+; Input format. 0 - BAYER (1.3MP or 2.0MP only), 1 - Compressed YUV422, 2 - Jpeg, 5 - Uncompressed YUV422 (default), 6 - Uncompressed 8-bit BAYER
+;InputFormat=5
+
+; Anti Flicker. 0 - Off (default), 50 - 50Hz, 60 - 60 Hz.
+;Flicker=50
+
+; Image quality when using Jpeg. 1-10 (1 - Lowest, 10 - Highest (default))
+;Quality=10
+
+; Cropping section
+[Image.Cropping]
+;OffsetX=0
+;OffsetY=0
+;SizeX=320
+;SizeY=240
+;Enabled=1
+
+[IR]
+; Output format. 3 - Grayscale 16-bit, 5 - RGB24 (default)
+;OutputFormat=3
+
+; Is stream mirrored. 0 - Off, 1 - On
+;Mirror=1
+
+; 0 - QVGA (default), 1 - VGA, 2 - SXGA(1.3MP)
+;Resolution=1
+
+; Frames per second (default is 30)
+;FPS=30
+
+; Cropping section
+[SensorIR.Cropping]
+;OffsetX=0
+;OffsetY=0
+;SizeX=320
+;SizeY=240
+;Enabled=1
+
+[Audio]
+; Sample Rate. 8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000 (default)
+;SampleRate=48000
+
+; Volume. 0-49 (0 - Mute, 1 - Min., 49 - Max.). Default is 12.
+;LeftChannelVolume=12
+;RightChannelVolume=12
+
+; Number of channels. 1, 2 (default)
+;NumOfChannels=2
diff --git a/copy_contents_to_data_folder/openni/config/Nite.ini b/copy_contents_to_data_folder/openni/config/Nite.ini
new file mode 100755
index 0000000..d3a98d4
--- /dev/null
+++ b/copy_contents_to_data_folder/openni/config/Nite.ini
@@ -0,0 +1,3 @@
+[HandTrackerManager]
+AllowMultipleHands=1
+TrackAdditionalHands=1
diff --git a/copy_contents_to_data_folder/openni/config/SamplesConfig.xml b/copy_contents_to_data_folder/openni/config/SamplesConfig.xml
new file mode 100755
index 0000000..e4f1c91
--- /dev/null
+++ b/copy_contents_to_data_folder/openni/config/SamplesConfig.xml
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/copy_contents_to_data_folder/openni/config/SceneServer.ini b/copy_contents_to_data_folder/openni/config/SceneServer.ini
new file mode 100755
index 0000000..4d93252
--- /dev/null
+++ b/copy_contents_to_data_folder/openni/config/SceneServer.ini
@@ -0,0 +1,11 @@
+[Timeouts]
+;NoClientsExit=5000
+;NoClientsTakeOver=100
+
+[Counters]
+;ConsequtiveErrors=1
+
+[Log]
+;On=0
+;Level=3
+;Mask=ALL
\ No newline at end of file
diff --git a/copy_contents_to_data_folder/openni/config/h.dat b/copy_contents_to_data_folder/openni/config/h.dat
new file mode 100755
index 0000000..cfc3200
Binary files /dev/null and b/copy_contents_to_data_folder/openni/config/h.dat differ
diff --git a/copy_contents_to_data_folder/openni/config/licenses.xml b/copy_contents_to_data_folder/openni/config/licenses.xml
new file mode 100755
index 0000000..e5967fd
--- /dev/null
+++ b/copy_contents_to_data_folder/openni/config/licenses.xml
@@ -0,0 +1,3 @@
+
+
+
diff --git a/copy_contents_to_data_folder/openni/config/modules.xml b/copy_contents_to_data_folder/openni/config/modules.xml
new file mode 100755
index 0000000..b0ee8d9
--- /dev/null
+++ b/copy_contents_to_data_folder/openni/config/modules.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/copy_contents_to_data_folder/openni/config/ofxopenni_config.xml b/copy_contents_to_data_folder/openni/config/ofxopenni_config.xml
new file mode 100755
index 0000000..13622ad
--- /dev/null
+++ b/copy_contents_to_data_folder/openni/config/ofxopenni_config.xml
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/copy_contents_to_data_folder/openni/config/s.dat b/copy_contents_to_data_folder/openni/config/s.dat
new file mode 100755
index 0000000..60a30fd
Binary files /dev/null and b/copy_contents_to_data_folder/openni/config/s.dat differ
diff --git a/win/copy_to_data_openni_path/lib/OpenNI.dll b/copy_contents_to_data_folder/openni/lib/OpenNI.dll
similarity index 100%
rename from win/copy_to_data_openni_path/lib/OpenNI.dll
rename to copy_contents_to_data_folder/openni/lib/OpenNI.dll
diff --git a/win/copy_to_data_openni_path/lib/XnVCNITE_1_5_2.dll b/copy_contents_to_data_folder/openni/lib/XnVCNITE_1_5_2.dll
similarity index 100%
rename from win/copy_to_data_openni_path/lib/XnVCNITE_1_5_2.dll
rename to copy_contents_to_data_folder/openni/lib/XnVCNITE_1_5_2.dll
diff --git a/win/copy_to_data_openni_path/lib/XnVCNITE_1_5_2.lib b/copy_contents_to_data_folder/openni/lib/XnVCNITE_1_5_2.lib
similarity index 100%
rename from win/copy_to_data_openni_path/lib/XnVCNITE_1_5_2.lib
rename to copy_contents_to_data_folder/openni/lib/XnVCNITE_1_5_2.lib
diff --git a/win/copy_to_data_openni_path/lib/XnVFeatures_1_5_2.dll b/copy_contents_to_data_folder/openni/lib/XnVFeatures_1_5_2.dll
similarity index 100%
rename from win/copy_to_data_openni_path/lib/XnVFeatures_1_5_2.dll
rename to copy_contents_to_data_folder/openni/lib/XnVFeatures_1_5_2.dll
diff --git a/win/copy_to_data_openni_path/lib/XnVFeatures_1_5_2.lib b/copy_contents_to_data_folder/openni/lib/XnVFeatures_1_5_2.lib
similarity index 100%
rename from win/copy_to_data_openni_path/lib/XnVFeatures_1_5_2.lib
rename to copy_contents_to_data_folder/openni/lib/XnVFeatures_1_5_2.lib
diff --git a/win/copy_to_data_openni_path/lib/XnVHandGenerator_1_5_2.dll b/copy_contents_to_data_folder/openni/lib/XnVHandGenerator_1_5_2.dll
similarity index 100%
rename from win/copy_to_data_openni_path/lib/XnVHandGenerator_1_5_2.dll
rename to copy_contents_to_data_folder/openni/lib/XnVHandGenerator_1_5_2.dll
diff --git a/win/copy_to_data_openni_path/lib/XnVHandGenerator_1_5_2.lib b/copy_contents_to_data_folder/openni/lib/XnVHandGenerator_1_5_2.lib
similarity index 100%
rename from win/copy_to_data_openni_path/lib/XnVHandGenerator_1_5_2.lib
rename to copy_contents_to_data_folder/openni/lib/XnVHandGenerator_1_5_2.lib
diff --git a/win/copy_to_data_openni_path/lib/XnVNITE_1_5_2.dll b/copy_contents_to_data_folder/openni/lib/XnVNITE_1_5_2.dll
similarity index 100%
rename from win/copy_to_data_openni_path/lib/XnVNITE_1_5_2.dll
rename to copy_contents_to_data_folder/openni/lib/XnVNITE_1_5_2.dll
diff --git a/win/copy_to_data_openni_path/lib/XnVNITE_1_5_2.lib b/copy_contents_to_data_folder/openni/lib/XnVNITE_1_5_2.lib
similarity index 100%
rename from win/copy_to_data_openni_path/lib/XnVNITE_1_5_2.lib
rename to copy_contents_to_data_folder/openni/lib/XnVNITE_1_5_2.lib
diff --git a/copy_contents_to_data_folder/openni/lib/libOpenNI.dylib b/copy_contents_to_data_folder/openni/lib/libOpenNI.dylib
new file mode 100644
index 0000000..5d73788
Binary files /dev/null and b/copy_contents_to_data_folder/openni/lib/libOpenNI.dylib differ
diff --git a/mac/copy_to_data_openni_path/lib/libXnCore.dylib b/copy_contents_to_data_folder/openni/lib/libXnCore.dylib
similarity index 100%
rename from mac/copy_to_data_openni_path/lib/libXnCore.dylib
rename to copy_contents_to_data_folder/openni/lib/libXnCore.dylib
diff --git a/mac/copy_to_data_openni_path/lib/libXnDDK.dylib b/copy_contents_to_data_folder/openni/lib/libXnDDK.dylib
similarity index 100%
rename from mac/copy_to_data_openni_path/lib/libXnDDK.dylib
rename to copy_contents_to_data_folder/openni/lib/libXnDDK.dylib
diff --git a/mac/copy_to_data_openni_path/lib/libXnDeviceFile.dylib b/copy_contents_to_data_folder/openni/lib/libXnDeviceFile.dylib
similarity index 100%
rename from mac/copy_to_data_openni_path/lib/libXnDeviceFile.dylib
rename to copy_contents_to_data_folder/openni/lib/libXnDeviceFile.dylib
diff --git a/mac/copy_to_data_openni_path/lib/libXnDeviceSensorV2KM.dylib b/copy_contents_to_data_folder/openni/lib/libXnDeviceSensorV2KM.dylib
similarity index 100%
rename from mac/copy_to_data_openni_path/lib/libXnDeviceSensorV2KM.dylib
rename to copy_contents_to_data_folder/openni/lib/libXnDeviceSensorV2KM.dylib
diff --git a/mac/copy_to_data_openni_path/lib/libXnFormats.dylib b/copy_contents_to_data_folder/openni/lib/libXnFormats.dylib
similarity index 100%
rename from mac/copy_to_data_openni_path/lib/libXnFormats.dylib
rename to copy_contents_to_data_folder/openni/lib/libXnFormats.dylib
diff --git a/mac/copy_to_data_openni_path/lib/libXnVCNITE_1_5_2.dylib b/copy_contents_to_data_folder/openni/lib/libXnVCNITE_1_5_2.dylib
similarity index 100%
rename from mac/copy_to_data_openni_path/lib/libXnVCNITE_1_5_2.dylib
rename to copy_contents_to_data_folder/openni/lib/libXnVCNITE_1_5_2.dylib
diff --git a/mac/copy_to_data_openni_path/lib/libXnVFeatures_1_5_2.dylib b/copy_contents_to_data_folder/openni/lib/libXnVFeatures_1_5_2.dylib
similarity index 100%
rename from mac/copy_to_data_openni_path/lib/libXnVFeatures_1_5_2.dylib
rename to copy_contents_to_data_folder/openni/lib/libXnVFeatures_1_5_2.dylib
diff --git a/mac/copy_to_data_openni_path/lib/libXnVHandGenerator_1_5_2.dylib b/copy_contents_to_data_folder/openni/lib/libXnVHandGenerator_1_5_2.dylib
similarity index 100%
rename from mac/copy_to_data_openni_path/lib/libXnVHandGenerator_1_5_2.dylib
rename to copy_contents_to_data_folder/openni/lib/libXnVHandGenerator_1_5_2.dylib
diff --git a/mac/copy_to_data_openni_path/lib/libXnVNite_1_5_2.dylib b/copy_contents_to_data_folder/openni/lib/libXnVNite_1_5_2.dylib
similarity index 100%
rename from mac/copy_to_data_openni_path/lib/libXnVNite_1_5_2.dylib
rename to copy_contents_to_data_folder/openni/lib/libXnVNite_1_5_2.dylib
diff --git a/mac/copy_to_data_openni_path/lib/libnimCodecs.dylib b/copy_contents_to_data_folder/openni/lib/libnimCodecs.dylib
similarity index 100%
rename from mac/copy_to_data_openni_path/lib/libnimCodecs.dylib
rename to copy_contents_to_data_folder/openni/lib/libnimCodecs.dylib
diff --git a/mac/copy_to_data_openni_path/lib/libnimMockNodes.dylib b/copy_contents_to_data_folder/openni/lib/libnimMockNodes.dylib
similarity index 100%
rename from mac/copy_to_data_openni_path/lib/libnimMockNodes.dylib
rename to copy_contents_to_data_folder/openni/lib/libnimMockNodes.dylib
diff --git a/mac/copy_to_data_openni_path/lib/libnimRecorder.dylib b/copy_contents_to_data_folder/openni/lib/libnimRecorder.dylib
similarity index 100%
rename from mac/copy_to_data_openni_path/lib/libnimRecorder.dylib
rename to copy_contents_to_data_folder/openni/lib/libnimRecorder.dylib
diff --git a/mac/copy_to_data_openni_path/lib/libusb-1.0.0.dylib b/copy_contents_to_data_folder/openni/lib/libusb-1.0.0.dylib
similarity index 100%
rename from mac/copy_to_data_openni_path/lib/libusb-1.0.0.dylib
rename to copy_contents_to_data_folder/openni/lib/libusb-1.0.0.dylib
diff --git a/win/copy_to_data_openni_path/lib/nimCodecs.dll b/copy_contents_to_data_folder/openni/lib/nimCodecs.dll
similarity index 100%
rename from win/copy_to_data_openni_path/lib/nimCodecs.dll
rename to copy_contents_to_data_folder/openni/lib/nimCodecs.dll
diff --git a/win/copy_to_data_openni_path/lib/nimMockNodes.dll b/copy_contents_to_data_folder/openni/lib/nimMockNodes.dll
similarity index 100%
rename from win/copy_to_data_openni_path/lib/nimMockNodes.dll
rename to copy_contents_to_data_folder/openni/lib/nimMockNodes.dll
diff --git a/win/copy_to_data_openni_path/lib/nimRecorder.dll b/copy_contents_to_data_folder/openni/lib/nimRecorder.dll
similarity index 100%
rename from win/copy_to_data_openni_path/lib/nimRecorder.dll
rename to copy_contents_to_data_folder/openni/lib/nimRecorder.dll
diff --git a/win/copy_to_data_openni_path/lib/openNI.lib b/copy_contents_to_data_folder/openni/lib/openNI.lib
similarity index 100%
rename from win/copy_to_data_openni_path/lib/openNI.lib
rename to copy_contents_to_data_folder/openni/lib/openNI.lib
diff --git a/include/libusb/libusb.h b/libs/libusb-1.0/include/libusb-1.0/libusb.h
similarity index 100%
rename from include/libusb/libusb.h
rename to libs/libusb-1.0/include/libusb-1.0/libusb.h
diff --git a/libs/libusb-1.0/lib/osx/libusb-1.0.0.dylib b/libs/libusb-1.0/lib/osx/libusb-1.0.0.dylib
new file mode 100644
index 0000000..26bc4f8
Binary files /dev/null and b/libs/libusb-1.0/lib/osx/libusb-1.0.0.dylib differ
diff --git a/include/nite/XnCommon.h b/libs/nite/include/XnCommon.h
similarity index 100%
rename from include/nite/XnCommon.h
rename to libs/nite/include/XnCommon.h
diff --git a/include/nite/XnV3DVector.h b/libs/nite/include/XnV3DVector.h
similarity index 100%
rename from include/nite/XnV3DVector.h
rename to libs/nite/include/XnV3DVector.h
diff --git a/include/nite/XnVActivationMessage.h b/libs/nite/include/XnVActivationMessage.h
similarity index 100%
rename from include/nite/XnVActivationMessage.h
rename to libs/nite/include/XnVActivationMessage.h
diff --git a/include/nite/XnVBroadcaster.h b/libs/nite/include/XnVBroadcaster.h
similarity index 100%
rename from include/nite/XnVBroadcaster.h
rename to libs/nite/include/XnVBroadcaster.h
diff --git a/include/nite/XnVCCMessage.h b/libs/nite/include/XnVCCMessage.h
similarity index 100%
rename from include/nite/XnVCCMessage.h
rename to libs/nite/include/XnVCCMessage.h
diff --git a/include/nite/XnVCircle.h b/libs/nite/include/XnVCircle.h
similarity index 100%
rename from include/nite/XnVCircle.h
rename to libs/nite/include/XnVCircle.h
diff --git a/include/nite/XnVCircleDetector.h b/libs/nite/include/XnVCircleDetector.h
similarity index 100%
rename from include/nite/XnVCircleDetector.h
rename to libs/nite/include/XnVCircleDetector.h
diff --git a/include/nite/XnVClickableVirtualPlane.h b/libs/nite/include/XnVClickableVirtualPlane.h
similarity index 100%
rename from include/nite/XnVClickableVirtualPlane.h
rename to libs/nite/include/XnVClickableVirtualPlane.h
diff --git a/include/nite/XnVComplexMessage.h b/libs/nite/include/XnVComplexMessage.h
similarity index 100%
rename from include/nite/XnVComplexMessage.h
rename to libs/nite/include/XnVComplexMessage.h
diff --git a/include/nite/XnVDepthControl.h b/libs/nite/include/XnVDepthControl.h
similarity index 100%
rename from include/nite/XnVDepthControl.h
rename to libs/nite/include/XnVDepthControl.h
diff --git a/include/nite/XnVDepthGenerator.h b/libs/nite/include/XnVDepthGenerator.h
similarity index 100%
rename from include/nite/XnVDepthGenerator.h
rename to libs/nite/include/XnVDepthGenerator.h
diff --git a/include/nite/XnVDepthMessage.h b/libs/nite/include/XnVDepthMessage.h
similarity index 100%
rename from include/nite/XnVDepthMessage.h
rename to libs/nite/include/XnVDepthMessage.h
diff --git a/include/nite/XnVDeviceControl.h b/libs/nite/include/XnVDeviceControl.h
similarity index 100%
rename from include/nite/XnVDeviceControl.h
rename to libs/nite/include/XnVDeviceControl.h
diff --git a/include/nite/XnVDeviceFilter.h b/libs/nite/include/XnVDeviceFilter.h
similarity index 100%
rename from include/nite/XnVDeviceFilter.h
rename to libs/nite/include/XnVDeviceFilter.h
diff --git a/include/nite/XnVDeviceGenerator.h b/libs/nite/include/XnVDeviceGenerator.h
similarity index 100%
rename from include/nite/XnVDeviceGenerator.h
rename to libs/nite/include/XnVDeviceGenerator.h
diff --git a/include/nite/XnVDeviceMessage.h b/libs/nite/include/XnVDeviceMessage.h
similarity index 100%
rename from include/nite/XnVDeviceMessage.h
rename to libs/nite/include/XnVDeviceMessage.h
diff --git a/include/nite/XnVDirection.h b/libs/nite/include/XnVDirection.h
similarity index 100%
rename from include/nite/XnVDirection.h
rename to libs/nite/include/XnVDirection.h
diff --git a/include/nite/XnVFilter.h b/libs/nite/include/XnVFilter.h
similarity index 100%
rename from include/nite/XnVFilter.h
rename to libs/nite/include/XnVFilter.h
diff --git a/include/nite/XnVFlowRouter.h b/libs/nite/include/XnVFlowRouter.h
similarity index 100%
rename from include/nite/XnVFlowRouter.h
rename to libs/nite/include/XnVFlowRouter.h
diff --git a/include/nite/XnVGesture.h b/libs/nite/include/XnVGesture.h
similarity index 100%
rename from include/nite/XnVGesture.h
rename to libs/nite/include/XnVGesture.h
diff --git a/include/nite/XnVHandPointContext.h b/libs/nite/include/XnVHandPointContext.h
similarity index 100%
rename from include/nite/XnVHandPointContext.h
rename to libs/nite/include/XnVHandPointContext.h
diff --git a/include/nite/XnVHandle.h b/libs/nite/include/XnVHandle.h
similarity index 100%
rename from include/nite/XnVHandle.h
rename to libs/nite/include/XnVHandle.h
diff --git a/include/nite/XnVImageGenerator.h b/libs/nite/include/XnVImageGenerator.h
similarity index 100%
rename from include/nite/XnVImageGenerator.h
rename to libs/nite/include/XnVImageGenerator.h
diff --git a/include/nite/XnVImageMessage.h b/libs/nite/include/XnVImageMessage.h
similarity index 100%
rename from include/nite/XnVImageMessage.h
rename to libs/nite/include/XnVImageMessage.h
diff --git a/include/nite/XnVMathCommon.h b/libs/nite/include/XnVMathCommon.h
similarity index 100%
rename from include/nite/XnVMathCommon.h
rename to libs/nite/include/XnVMathCommon.h
diff --git a/include/nite/XnVMessage.h b/libs/nite/include/XnVMessage.h
similarity index 100%
rename from include/nite/XnVMessage.h
rename to libs/nite/include/XnVMessage.h
diff --git a/include/nite/XnVMessageGenerator.h b/libs/nite/include/XnVMessageGenerator.h
similarity index 100%
rename from include/nite/XnVMessageGenerator.h
rename to libs/nite/include/XnVMessageGenerator.h
diff --git a/include/nite/XnVMessageListener.h b/libs/nite/include/XnVMessageListener.h
similarity index 100%
rename from include/nite/XnVMessageListener.h
rename to libs/nite/include/XnVMessageListener.h
diff --git a/include/nite/XnVMessageMux.h b/libs/nite/include/XnVMessageMux.h
similarity index 100%
rename from include/nite/XnVMessageMux.h
rename to libs/nite/include/XnVMessageMux.h
diff --git a/include/nite/XnVMultiItemHysteresis1D.h b/libs/nite/include/XnVMultiItemHysteresis1D.h
similarity index 100%
rename from include/nite/XnVMultiItemHysteresis1D.h
rename to libs/nite/include/XnVMultiItemHysteresis1D.h
diff --git a/include/nite/XnVMultiItemHysteresis2D.h b/libs/nite/include/XnVMultiItemHysteresis2D.h
similarity index 100%
rename from include/nite/XnVMultiItemHysteresis2D.h
rename to libs/nite/include/XnVMultiItemHysteresis2D.h
diff --git a/include/nite/XnVMultiProcessFlowClient.h b/libs/nite/include/XnVMultiProcessFlowClient.h
similarity index 100%
rename from include/nite/XnVMultiProcessFlowClient.h
rename to libs/nite/include/XnVMultiProcessFlowClient.h
diff --git a/include/nite/XnVMultiProcessFlowServer.h b/libs/nite/include/XnVMultiProcessFlowServer.h
similarity index 100%
rename from include/nite/XnVMultiProcessFlowServer.h
rename to libs/nite/include/XnVMultiProcessFlowServer.h
diff --git a/include/nite/XnVMultipleHands.h b/libs/nite/include/XnVMultipleHands.h
similarity index 100%
rename from include/nite/XnVMultipleHands.h
rename to libs/nite/include/XnVMultipleHands.h
diff --git a/include/nite/XnVNite.h b/libs/nite/include/XnVNite.h
similarity index 100%
rename from include/nite/XnVNite.h
rename to libs/nite/include/XnVNite.h
diff --git a/include/nite/XnVNiteControls.h b/libs/nite/include/XnVNiteControls.h
similarity index 100%
rename from include/nite/XnVNiteControls.h
rename to libs/nite/include/XnVNiteControls.h
diff --git a/include/nite/XnVNiteDefs.h b/libs/nite/include/XnVNiteDefs.h
similarity index 100%
rename from include/nite/XnVNiteDefs.h
rename to libs/nite/include/XnVNiteDefs.h
diff --git a/include/nite/XnVNiteFramework.h b/libs/nite/include/XnVNiteFramework.h
similarity index 100%
rename from include/nite/XnVNiteFramework.h
rename to libs/nite/include/XnVNiteFramework.h
diff --git a/include/nite/XnVNiteLog.h b/libs/nite/include/XnVNiteLog.h
similarity index 100%
rename from include/nite/XnVNiteLog.h
rename to libs/nite/include/XnVNiteLog.h
diff --git a/include/nite/XnVNiteStatus.h b/libs/nite/include/XnVNiteStatus.h
similarity index 100%
rename from include/nite/XnVNiteStatus.h
rename to libs/nite/include/XnVNiteStatus.h
diff --git a/include/nite/XnVNiteVersion.h b/libs/nite/include/XnVNiteVersion.h
similarity index 100%
rename from include/nite/XnVNiteVersion.h
rename to libs/nite/include/XnVNiteVersion.h
diff --git a/include/nite/XnVPointArea.h b/libs/nite/include/XnVPointArea.h
similarity index 100%
rename from include/nite/XnVPointArea.h
rename to libs/nite/include/XnVPointArea.h
diff --git a/include/nite/XnVPointControl.h b/libs/nite/include/XnVPointControl.h
similarity index 100%
rename from include/nite/XnVPointControl.h
rename to libs/nite/include/XnVPointControl.h
diff --git a/include/nite/XnVPointDenoiser.h b/libs/nite/include/XnVPointDenoiser.h
similarity index 100%
rename from include/nite/XnVPointDenoiser.h
rename to libs/nite/include/XnVPointDenoiser.h
diff --git a/include/nite/XnVPointFilter.h b/libs/nite/include/XnVPointFilter.h
similarity index 100%
rename from include/nite/XnVPointFilter.h
rename to libs/nite/include/XnVPointFilter.h
diff --git a/include/nite/XnVPointMessage.h b/libs/nite/include/XnVPointMessage.h
similarity index 100%
rename from include/nite/XnVPointMessage.h
rename to libs/nite/include/XnVPointMessage.h
diff --git a/include/nite/XnVPointTracker.h b/libs/nite/include/XnVPointTracker.h
similarity index 100%
rename from include/nite/XnVPointTracker.h
rename to libs/nite/include/XnVPointTracker.h
diff --git a/include/nite/XnVPushDetector.h b/libs/nite/include/XnVPushDetector.h
similarity index 100%
rename from include/nite/XnVPushDetector.h
rename to libs/nite/include/XnVPushDetector.h
diff --git a/include/nite/XnVSelectableSlider1D.h b/libs/nite/include/XnVSelectableSlider1D.h
similarity index 100%
rename from include/nite/XnVSelectableSlider1D.h
rename to libs/nite/include/XnVSelectableSlider1D.h
diff --git a/include/nite/XnVSelectableSlider2D.h b/libs/nite/include/XnVSelectableSlider2D.h
similarity index 100%
rename from include/nite/XnVSelectableSlider2D.h
rename to libs/nite/include/XnVSelectableSlider2D.h
diff --git a/include/nite/XnVSessionGenerator.h b/libs/nite/include/XnVSessionGenerator.h
similarity index 100%
rename from include/nite/XnVSessionGenerator.h
rename to libs/nite/include/XnVSessionGenerator.h
diff --git a/include/nite/XnVSessionListener.h b/libs/nite/include/XnVSessionListener.h
similarity index 100%
rename from include/nite/XnVSessionListener.h
rename to libs/nite/include/XnVSessionListener.h
diff --git a/include/nite/XnVSessionManager.h b/libs/nite/include/XnVSessionManager.h
similarity index 100%
rename from include/nite/XnVSessionManager.h
rename to libs/nite/include/XnVSessionManager.h
diff --git a/include/nite/XnVSessionMessage.h b/libs/nite/include/XnVSessionMessage.h
similarity index 100%
rename from include/nite/XnVSessionMessage.h
rename to libs/nite/include/XnVSessionMessage.h
diff --git a/include/nite/XnVSlider1D.h b/libs/nite/include/XnVSlider1D.h
similarity index 100%
rename from include/nite/XnVSlider1D.h
rename to libs/nite/include/XnVSlider1D.h
diff --git a/include/nite/XnVSlider2D.h b/libs/nite/include/XnVSlider2D.h
similarity index 100%
rename from include/nite/XnVSlider2D.h
rename to libs/nite/include/XnVSlider2D.h
diff --git a/include/nite/XnVSlider3D.h b/libs/nite/include/XnVSlider3D.h
similarity index 100%
rename from include/nite/XnVSlider3D.h
rename to libs/nite/include/XnVSlider3D.h
diff --git a/include/nite/XnVSteadyDetector.h b/libs/nite/include/XnVSteadyDetector.h
similarity index 100%
rename from include/nite/XnVSteadyDetector.h
rename to libs/nite/include/XnVSteadyDetector.h
diff --git a/include/nite/XnVSwipeDetector.h b/libs/nite/include/XnVSwipeDetector.h
similarity index 100%
rename from include/nite/XnVSwipeDetector.h
rename to libs/nite/include/XnVSwipeDetector.h
diff --git a/include/nite/XnVVirtualCoordinates.h b/libs/nite/include/XnVVirtualCoordinates.h
similarity index 100%
rename from include/nite/XnVVirtualCoordinates.h
rename to libs/nite/include/XnVVirtualCoordinates.h
diff --git a/include/nite/XnVWaveDetector.h b/libs/nite/include/XnVWaveDetector.h
similarity index 100%
rename from include/nite/XnVWaveDetector.h
rename to libs/nite/include/XnVWaveDetector.h
diff --git a/libs/nite/lib/osx/libXnCore.dylib b/libs/nite/lib/osx/libXnCore.dylib
new file mode 100755
index 0000000..5719023
Binary files /dev/null and b/libs/nite/lib/osx/libXnCore.dylib differ
diff --git a/libs/nite/lib/osx/libXnDDK.dylib b/libs/nite/lib/osx/libXnDDK.dylib
new file mode 100755
index 0000000..c58c144
Binary files /dev/null and b/libs/nite/lib/osx/libXnDDK.dylib differ
diff --git a/libs/nite/lib/osx/libXnDeviceFile.dylib b/libs/nite/lib/osx/libXnDeviceFile.dylib
new file mode 100755
index 0000000..6e3c97f
Binary files /dev/null and b/libs/nite/lib/osx/libXnDeviceFile.dylib differ
diff --git a/libs/nite/lib/osx/libXnDeviceSensorV2KM.dylib b/libs/nite/lib/osx/libXnDeviceSensorV2KM.dylib
new file mode 100755
index 0000000..7fed9a6
Binary files /dev/null and b/libs/nite/lib/osx/libXnDeviceSensorV2KM.dylib differ
diff --git a/libs/nite/lib/osx/libXnFormats.dylib b/libs/nite/lib/osx/libXnFormats.dylib
new file mode 100755
index 0000000..a850f4d
Binary files /dev/null and b/libs/nite/lib/osx/libXnFormats.dylib differ
diff --git a/libs/nite/lib/osx/libXnVCNITE_1_5_2.dylib b/libs/nite/lib/osx/libXnVCNITE_1_5_2.dylib
new file mode 100755
index 0000000..ede044d
Binary files /dev/null and b/libs/nite/lib/osx/libXnVCNITE_1_5_2.dylib differ
diff --git a/libs/nite/lib/osx/libXnVFeatures_1_5_2.dylib b/libs/nite/lib/osx/libXnVFeatures_1_5_2.dylib
new file mode 100755
index 0000000..91c03b7
Binary files /dev/null and b/libs/nite/lib/osx/libXnVFeatures_1_5_2.dylib differ
diff --git a/libs/nite/lib/osx/libXnVHandGenerator_1_5_2.dylib b/libs/nite/lib/osx/libXnVHandGenerator_1_5_2.dylib
new file mode 100755
index 0000000..6f1dc88
Binary files /dev/null and b/libs/nite/lib/osx/libXnVHandGenerator_1_5_2.dylib differ
diff --git a/libs/nite/lib/osx/libXnVNite_1_5_2.dylib b/libs/nite/lib/osx/libXnVNite_1_5_2.dylib
new file mode 100755
index 0000000..45a7da5
Binary files /dev/null and b/libs/nite/lib/osx/libXnVNite_1_5_2.dylib differ
diff --git a/libs/nite/lib/win32/XnVCNITE_1_5_2.dll b/libs/nite/lib/win32/XnVCNITE_1_5_2.dll
new file mode 100644
index 0000000..4a840db
Binary files /dev/null and b/libs/nite/lib/win32/XnVCNITE_1_5_2.dll differ
diff --git a/libs/nite/lib/win32/XnVCNITE_1_5_2.lib b/libs/nite/lib/win32/XnVCNITE_1_5_2.lib
new file mode 100644
index 0000000..a448845
Binary files /dev/null and b/libs/nite/lib/win32/XnVCNITE_1_5_2.lib differ
diff --git a/libs/nite/lib/win32/XnVFeatures_1_5_2.dll b/libs/nite/lib/win32/XnVFeatures_1_5_2.dll
new file mode 100644
index 0000000..4dfd466
Binary files /dev/null and b/libs/nite/lib/win32/XnVFeatures_1_5_2.dll differ
diff --git a/libs/nite/lib/win32/XnVFeatures_1_5_2.lib b/libs/nite/lib/win32/XnVFeatures_1_5_2.lib
new file mode 100644
index 0000000..1ce33b6
Binary files /dev/null and b/libs/nite/lib/win32/XnVFeatures_1_5_2.lib differ
diff --git a/libs/nite/lib/win32/XnVHandGenerator_1_5_2.dll b/libs/nite/lib/win32/XnVHandGenerator_1_5_2.dll
new file mode 100644
index 0000000..0f7a622
Binary files /dev/null and b/libs/nite/lib/win32/XnVHandGenerator_1_5_2.dll differ
diff --git a/libs/nite/lib/win32/XnVHandGenerator_1_5_2.lib b/libs/nite/lib/win32/XnVHandGenerator_1_5_2.lib
new file mode 100644
index 0000000..c173075
Binary files /dev/null and b/libs/nite/lib/win32/XnVHandGenerator_1_5_2.lib differ
diff --git a/libs/nite/lib/win32/XnVNITE_1_5_2.dll b/libs/nite/lib/win32/XnVNITE_1_5_2.dll
new file mode 100644
index 0000000..45102fd
Binary files /dev/null and b/libs/nite/lib/win32/XnVNITE_1_5_2.dll differ
diff --git a/libs/nite/lib/win32/XnVNITE_1_5_2.lib b/libs/nite/lib/win32/XnVNITE_1_5_2.lib
new file mode 100644
index 0000000..5d7ff0d
Binary files /dev/null and b/libs/nite/lib/win32/XnVNITE_1_5_2.lib differ
diff --git a/include/openni/ARC/XnOSARC.h b/libs/openni/include/ARC/XnOSARC.h
similarity index 100%
rename from include/openni/ARC/XnOSARC.h
rename to libs/openni/include/ARC/XnOSARC.h
diff --git a/include/openni/ARC/XnPlatformARC.h b/libs/openni/include/ARC/XnPlatformARC.h
similarity index 100%
rename from include/openni/ARC/XnPlatformARC.h
rename to libs/openni/include/ARC/XnPlatformARC.h
diff --git a/include/openni/Android-Arm/XnPlatformAndroid-Arm.h b/libs/openni/include/Android-Arm/XnPlatformAndroid-Arm.h
similarity index 100%
rename from include/openni/Android-Arm/XnPlatformAndroid-Arm.h
rename to libs/openni/include/Android-Arm/XnPlatformAndroid-Arm.h
diff --git a/include/openni/IXnNodeAllocator.h b/libs/openni/include/IXnNodeAllocator.h
similarity index 100%
rename from include/openni/IXnNodeAllocator.h
rename to libs/openni/include/IXnNodeAllocator.h
diff --git a/include/openni/Linux-Arm/XnPlatformLinux-Arm.h b/libs/openni/include/Linux-Arm/XnPlatformLinux-Arm.h
similarity index 100%
rename from include/openni/Linux-Arm/XnPlatformLinux-Arm.h
rename to libs/openni/include/Linux-Arm/XnPlatformLinux-Arm.h
diff --git a/include/openni/Linux-x86/XnOSLinux-x86.h b/libs/openni/include/Linux-x86/XnOSLinux-x86.h
similarity index 100%
rename from include/openni/Linux-x86/XnOSLinux-x86.h
rename to libs/openni/include/Linux-x86/XnOSLinux-x86.h
diff --git a/include/openni/Linux-x86/XnPlatformLinux-x86.h b/libs/openni/include/Linux-x86/XnPlatformLinux-x86.h
similarity index 100%
rename from include/openni/Linux-x86/XnPlatformLinux-x86.h
rename to libs/openni/include/Linux-x86/XnPlatformLinux-x86.h
diff --git a/include/openni/MacOSX/XnPlatformMacOSX.h b/libs/openni/include/MacOSX/XnPlatformMacOSX.h
similarity index 100%
rename from include/openni/MacOSX/XnPlatformMacOSX.h
rename to libs/openni/include/MacOSX/XnPlatformMacOSX.h
diff --git a/include/openni/Win32/XnOSWin32.h b/libs/openni/include/Win32/XnOSWin32.h
similarity index 100%
rename from include/openni/Win32/XnOSWin32.h
rename to libs/openni/include/Win32/XnOSWin32.h
diff --git a/include/openni/Win32/XnPlatformWin32.h b/libs/openni/include/Win32/XnPlatformWin32.h
similarity index 100%
rename from include/openni/Win32/XnPlatformWin32.h
rename to libs/openni/include/Win32/XnPlatformWin32.h
diff --git a/include/openni/Win32/usb100.h b/libs/openni/include/Win32/usb100.h
similarity index 100%
rename from include/openni/Win32/usb100.h
rename to libs/openni/include/Win32/usb100.h
diff --git a/include/openni/XnAlgorithms.h b/libs/openni/include/XnAlgorithms.h
similarity index 100%
rename from include/openni/XnAlgorithms.h
rename to libs/openni/include/XnAlgorithms.h
diff --git a/include/openni/XnArray.h b/libs/openni/include/XnArray.h
similarity index 100%
rename from include/openni/XnArray.h
rename to libs/openni/include/XnArray.h
diff --git a/include/openni/XnBaseNode.h b/libs/openni/include/XnBaseNode.h
similarity index 100%
rename from include/openni/XnBaseNode.h
rename to libs/openni/include/XnBaseNode.h
diff --git a/include/openni/XnBitSet.h b/libs/openni/include/XnBitSet.h
similarity index 100%
rename from include/openni/XnBitSet.h
rename to libs/openni/include/XnBitSet.h
diff --git a/include/openni/XnCallback.h b/libs/openni/include/XnCallback.h
similarity index 100%
rename from include/openni/XnCallback.h
rename to libs/openni/include/XnCallback.h
diff --git a/include/openni/XnCodecIDs.h b/libs/openni/include/XnCodecIDs.h
similarity index 100%
rename from include/openni/XnCodecIDs.h
rename to libs/openni/include/XnCodecIDs.h
diff --git a/include/openni/XnContext.h b/libs/openni/include/XnContext.h
similarity index 100%
rename from include/openni/XnContext.h
rename to libs/openni/include/XnContext.h
diff --git a/include/openni/XnCppWrapper.h b/libs/openni/include/XnCppWrapper.h
similarity index 100%
rename from include/openni/XnCppWrapper.h
rename to libs/openni/include/XnCppWrapper.h
diff --git a/include/openni/XnDataTypes.h b/libs/openni/include/XnDataTypes.h
similarity index 100%
rename from include/openni/XnDataTypes.h
rename to libs/openni/include/XnDataTypes.h
diff --git a/include/openni/XnDerivedCast.h b/libs/openni/include/XnDerivedCast.h
similarity index 100%
rename from include/openni/XnDerivedCast.h
rename to libs/openni/include/XnDerivedCast.h
diff --git a/include/openni/XnDump.h b/libs/openni/include/XnDump.h
similarity index 100%
rename from include/openni/XnDump.h
rename to libs/openni/include/XnDump.h
diff --git a/include/openni/XnDumpWriters.h b/libs/openni/include/XnDumpWriters.h
similarity index 100%
rename from include/openni/XnDumpWriters.h
rename to libs/openni/include/XnDumpWriters.h
diff --git a/include/openni/XnEnumerationErrors.h b/libs/openni/include/XnEnumerationErrors.h
similarity index 100%
rename from include/openni/XnEnumerationErrors.h
rename to libs/openni/include/XnEnumerationErrors.h
diff --git a/include/openni/XnEvent.h b/libs/openni/include/XnEvent.h
similarity index 100%
rename from include/openni/XnEvent.h
rename to libs/openni/include/XnEvent.h
diff --git a/include/openni/XnFPSCalculator.h b/libs/openni/include/XnFPSCalculator.h
similarity index 100%
rename from include/openni/XnFPSCalculator.h
rename to libs/openni/include/XnFPSCalculator.h
diff --git a/include/openni/XnGeneralBuffer.h b/libs/openni/include/XnGeneralBuffer.h
similarity index 100%
rename from include/openni/XnGeneralBuffer.h
rename to libs/openni/include/XnGeneralBuffer.h
diff --git a/include/openni/XnHash.h b/libs/openni/include/XnHash.h
similarity index 100%
rename from include/openni/XnHash.h
rename to libs/openni/include/XnHash.h
diff --git a/include/openni/XnInternalDefs.h b/libs/openni/include/XnInternalDefs.h
similarity index 100%
rename from include/openni/XnInternalDefs.h
rename to libs/openni/include/XnInternalDefs.h
diff --git a/include/openni/XnLicensing.h b/libs/openni/include/XnLicensing.h
similarity index 100%
rename from include/openni/XnLicensing.h
rename to libs/openni/include/XnLicensing.h
diff --git a/include/openni/XnList.h b/libs/openni/include/XnList.h
similarity index 100%
rename from include/openni/XnList.h
rename to libs/openni/include/XnList.h
diff --git a/include/openni/XnLog.h b/libs/openni/include/XnLog.h
similarity index 100%
rename from include/openni/XnLog.h
rename to libs/openni/include/XnLog.h
diff --git a/include/openni/XnLogTypes.h b/libs/openni/include/XnLogTypes.h
similarity index 100%
rename from include/openni/XnLogTypes.h
rename to libs/openni/include/XnLogTypes.h
diff --git a/include/openni/XnLogWriterBase.h b/libs/openni/include/XnLogWriterBase.h
similarity index 100%
rename from include/openni/XnLogWriterBase.h
rename to libs/openni/include/XnLogWriterBase.h
diff --git a/include/openni/XnMacros.h b/libs/openni/include/XnMacros.h
similarity index 100%
rename from include/openni/XnMacros.h
rename to libs/openni/include/XnMacros.h
diff --git a/include/openni/XnModuleCFunctions.h b/libs/openni/include/XnModuleCFunctions.h
similarity index 100%
rename from include/openni/XnModuleCFunctions.h
rename to libs/openni/include/XnModuleCFunctions.h
diff --git a/include/openni/XnModuleCppInterface.h b/libs/openni/include/XnModuleCppInterface.h
similarity index 100%
rename from include/openni/XnModuleCppInterface.h
rename to libs/openni/include/XnModuleCppInterface.h
diff --git a/include/openni/XnModuleCppRegistratration.h b/libs/openni/include/XnModuleCppRegistratration.h
similarity index 100%
rename from include/openni/XnModuleCppRegistratration.h
rename to libs/openni/include/XnModuleCppRegistratration.h
diff --git a/include/openni/XnModuleInterface.h b/libs/openni/include/XnModuleInterface.h
similarity index 100%
rename from include/openni/XnModuleInterface.h
rename to libs/openni/include/XnModuleInterface.h
diff --git a/include/openni/XnNode.h b/libs/openni/include/XnNode.h
similarity index 100%
rename from include/openni/XnNode.h
rename to libs/openni/include/XnNode.h
diff --git a/include/openni/XnNodeAllocator.h b/libs/openni/include/XnNodeAllocator.h
similarity index 100%
rename from include/openni/XnNodeAllocator.h
rename to libs/openni/include/XnNodeAllocator.h
diff --git a/include/openni/XnOS.h b/libs/openni/include/XnOS.h
similarity index 100%
rename from include/openni/XnOS.h
rename to libs/openni/include/XnOS.h
diff --git a/include/openni/XnOSCpp.h b/libs/openni/include/XnOSCpp.h
similarity index 100%
rename from include/openni/XnOSCpp.h
rename to libs/openni/include/XnOSCpp.h
diff --git a/include/openni/XnOSMemory.h b/libs/openni/include/XnOSMemory.h
similarity index 100%
rename from include/openni/XnOSMemory.h
rename to libs/openni/include/XnOSMemory.h
diff --git a/include/openni/XnOSStrings.h b/libs/openni/include/XnOSStrings.h
similarity index 100%
rename from include/openni/XnOSStrings.h
rename to libs/openni/include/XnOSStrings.h
diff --git a/include/openni/XnOpenNI.h b/libs/openni/include/XnOpenNI.h
similarity index 100%
rename from include/openni/XnOpenNI.h
rename to libs/openni/include/XnOpenNI.h
diff --git a/include/openni/XnPlatform.h b/libs/openni/include/XnPlatform.h
similarity index 100%
rename from include/openni/XnPlatform.h
rename to libs/openni/include/XnPlatform.h
diff --git a/include/openni/XnPrdNode.h b/libs/openni/include/XnPrdNode.h
similarity index 100%
rename from include/openni/XnPrdNode.h
rename to libs/openni/include/XnPrdNode.h
diff --git a/include/openni/XnPrdNodeInfo.h b/libs/openni/include/XnPrdNodeInfo.h
similarity index 100%
rename from include/openni/XnPrdNodeInfo.h
rename to libs/openni/include/XnPrdNodeInfo.h
diff --git a/include/openni/XnPrdNodeInfoList.h b/libs/openni/include/XnPrdNodeInfoList.h
similarity index 100%
rename from include/openni/XnPrdNodeInfoList.h
rename to libs/openni/include/XnPrdNodeInfoList.h
diff --git a/include/openni/XnProfiling.h b/libs/openni/include/XnProfiling.h
similarity index 100%
rename from include/openni/XnProfiling.h
rename to libs/openni/include/XnProfiling.h
diff --git a/include/openni/XnPropNames.h b/libs/openni/include/XnPropNames.h
similarity index 100%
rename from include/openni/XnPropNames.h
rename to libs/openni/include/XnPropNames.h
diff --git a/include/openni/XnQueries.h b/libs/openni/include/XnQueries.h
similarity index 100%
rename from include/openni/XnQueries.h
rename to libs/openni/include/XnQueries.h
diff --git a/include/openni/XnQueue.h b/libs/openni/include/XnQueue.h
similarity index 100%
rename from include/openni/XnQueue.h
rename to libs/openni/include/XnQueue.h
diff --git a/include/openni/XnScheduler.h b/libs/openni/include/XnScheduler.h
similarity index 100%
rename from include/openni/XnScheduler.h
rename to libs/openni/include/XnScheduler.h
diff --git a/include/openni/XnStack.h b/libs/openni/include/XnStack.h
similarity index 100%
rename from include/openni/XnStack.h
rename to libs/openni/include/XnStack.h
diff --git a/include/openni/XnStatus.h b/libs/openni/include/XnStatus.h
similarity index 100%
rename from include/openni/XnStatus.h
rename to libs/openni/include/XnStatus.h
diff --git a/include/openni/XnStatusCodes.h b/libs/openni/include/XnStatusCodes.h
similarity index 100%
rename from include/openni/XnStatusCodes.h
rename to libs/openni/include/XnStatusCodes.h
diff --git a/include/openni/XnStatusRegister.h b/libs/openni/include/XnStatusRegister.h
similarity index 100%
rename from include/openni/XnStatusRegister.h
rename to libs/openni/include/XnStatusRegister.h
diff --git a/include/openni/XnStringsHash.h b/libs/openni/include/XnStringsHash.h
similarity index 100%
rename from include/openni/XnStringsHash.h
rename to libs/openni/include/XnStringsHash.h
diff --git a/include/openni/XnThreadSafeQueue.h b/libs/openni/include/XnThreadSafeQueue.h
similarity index 100%
rename from include/openni/XnThreadSafeQueue.h
rename to libs/openni/include/XnThreadSafeQueue.h
diff --git a/include/openni/XnTypes.h b/libs/openni/include/XnTypes.h
similarity index 100%
rename from include/openni/XnTypes.h
rename to libs/openni/include/XnTypes.h
diff --git a/include/openni/XnUSB.h b/libs/openni/include/XnUSB.h
similarity index 100%
rename from include/openni/XnUSB.h
rename to libs/openni/include/XnUSB.h
diff --git a/include/openni/XnUSBDevice.h b/libs/openni/include/XnUSBDevice.h
similarity index 100%
rename from include/openni/XnUSBDevice.h
rename to libs/openni/include/XnUSBDevice.h
diff --git a/include/openni/XnUtils.h b/libs/openni/include/XnUtils.h
similarity index 100%
rename from include/openni/XnUtils.h
rename to libs/openni/include/XnUtils.h
diff --git a/include/openni/XnVersion.h b/libs/openni/include/XnVersion.h
similarity index 100%
rename from include/openni/XnVersion.h
rename to libs/openni/include/XnVersion.h
diff --git a/libs/openni/lib/osx/libOpenNI.dylib b/libs/openni/lib/osx/libOpenNI.dylib
new file mode 100644
index 0000000..5d73788
Binary files /dev/null and b/libs/openni/lib/osx/libOpenNI.dylib differ
diff --git a/libs/openni/lib/osx/libnimCodecs.dylib b/libs/openni/lib/osx/libnimCodecs.dylib
new file mode 100755
index 0000000..3613092
Binary files /dev/null and b/libs/openni/lib/osx/libnimCodecs.dylib differ
diff --git a/libs/openni/lib/osx/libnimMockNodes.dylib b/libs/openni/lib/osx/libnimMockNodes.dylib
new file mode 100755
index 0000000..c918289
Binary files /dev/null and b/libs/openni/lib/osx/libnimMockNodes.dylib differ
diff --git a/libs/openni/lib/osx/libnimRecorder.dylib b/libs/openni/lib/osx/libnimRecorder.dylib
new file mode 100755
index 0000000..06cbee7
Binary files /dev/null and b/libs/openni/lib/osx/libnimRecorder.dylib differ
diff --git a/libs/openni/lib/win32/OpenNI.dll b/libs/openni/lib/win32/OpenNI.dll
new file mode 100644
index 0000000..34b73d8
Binary files /dev/null and b/libs/openni/lib/win32/OpenNI.dll differ
diff --git a/libs/openni/lib/win32/nimCodecs.dll b/libs/openni/lib/win32/nimCodecs.dll
new file mode 100644
index 0000000..6ff19ca
Binary files /dev/null and b/libs/openni/lib/win32/nimCodecs.dll differ
diff --git a/libs/openni/lib/win32/nimMockNodes.dll b/libs/openni/lib/win32/nimMockNodes.dll
new file mode 100644
index 0000000..7d08e78
Binary files /dev/null and b/libs/openni/lib/win32/nimMockNodes.dll differ
diff --git a/libs/openni/lib/win32/nimRecorder.dll b/libs/openni/lib/win32/nimRecorder.dll
new file mode 100644
index 0000000..36f2c5b
Binary files /dev/null and b/libs/openni/lib/win32/nimRecorder.dll differ
diff --git a/libs/openni/lib/win32/openNI.lib b/libs/openni/lib/win32/openNI.lib
new file mode 100755
index 0000000..dcca6cc
Binary files /dev/null and b/libs/openni/lib/win32/openNI.lib differ
diff --git a/mac/copy_to_data_openni_path/lib/change_exec_paths.sh b/mac/copy_to_data_openni_path/lib/change_exec_paths.sh
deleted file mode 100755
index a6e4776..0000000
--- a/mac/copy_to_data_openni_path/lib/change_exec_paths.sh
+++ /dev/null
@@ -1,34 +0,0 @@
-in="install_name_tool -change "
-
-cd ../OpenNI_openFrameworks/openni/lib
-
-libs=(*.dylib)
-num_libs=${#libs[*]}
-
-for lib in *.dylib ; do
- i=0
- echo ""
- echo "${lib}"
- echo "-------------------------------------------------"
- lines=`otool -L ${lib}`
- echo ${lines}
- for linked_name in ${lines} ; do
- for local_lib in ${libs[@]}; do
- in=`echo ${linked_name} | grep -i ${local_lib}`
- if [ "$in" != "" ] ; then
- check_id=`echo "${linked_name}" | grep -i "${lib}"`
-
- #install_name_tool -change "/opt/local/lib/libusb-1.0.0.dylib" "@executable_path/./../../../data/openni/lib/libusb-1.0.0.dylib" ${lib}
- #echo install_name_tool -change "/opt/local/lib/libusb-1.0.0.dylib" "@executable_path/./../../../data/openni/lib/libusb-1.0.0.dylib" ${lib}
-
- if [ "$check_id" != "" ] ; then
- install_name_tool -id "@executable_path/./../../../data/openni/lib/${local_lib}" ${lib}
- echo install_name_tool -id "@executable_path/./../../../data/openni/lib/${local_lib}" ${lib}
- else
- install_name_tool -change "${linked_name}" "@executable_path/./../../../data/openni/lib/${local_lib}" ${lib}
- echo install_name_tool -change "${linked_name}" "@executable_path/./../../../data/openni/lib/${local_lib}" ${lib}
- fi
- fi
- done
- done
-done
diff --git a/mac/copy_to_data_openni_path/lib/libOpenNI.dylib b/mac/copy_to_data_openni_path/lib/libOpenNI.dylib
deleted file mode 100755
index 97e1076..0000000
Binary files a/mac/copy_to_data_openni_path/lib/libOpenNI.dylib and /dev/null differ
diff --git a/src/ofxOpenNI.cpp b/src/ofxOpenNI.cpp
old mode 100644
new mode 100755
index 994b5ea..9cd6edc
--- a/src/ofxOpenNI.cpp
+++ b/src/ofxOpenNI.cpp
@@ -28,6 +28,10 @@
#include "ofxOpenNI.h"
+#include
+#include
+#include
+
/**************************************************************
*
* constructor and setup methods
@@ -157,7 +161,7 @@ bool ofxOpenNI::init(string oniFilePath, string xmlFilePath, bool threaded){
void ofxOpenNI::start(){
if(bIsThreaded && !isThreadRunning()) {
ofLogNotice(LOG_NAME) << "Starting ofxOpenNI with threading";
- startThread(true, false);
+ startThread();
} else if(!bIsThreaded) {
ofLogNotice(LOG_NAME) << "Starting ofxOpenNI without threading";
}
@@ -379,7 +383,8 @@ void ofxOpenNI::stop(){
//--------------------------------------------------------------
void ofxOpenNI::stopCommon(){
- ofxOpenNIScopedLock scopedLock(bIsThreaded, mutex);
+ std::unique_lock uniqueLock(recursiveMutex, std::defer_lock);
+ if (bIsThreaded) uniqueLock.lock();
if(g_bIsRecordOn){
cout << LOG_NAME << ": releasing recorder" << endl;
@@ -490,7 +495,8 @@ void ofxOpenNI::logErrors(xn::EnumerationErrors & errors){
//--------------------------------------------------------------
bool ofxOpenNI::startRecording(string oniFileName, XnCodecID depthFormat, XnCodecID imageFormat, XnCodecID infraFormat, XnCodecID audioFormat){
- ofxOpenNIScopedLock scopedLock(bIsThreaded, mutex);
+ std::unique_lock uniqueLock(recursiveMutex, std::defer_lock);
+ if (bIsThreaded) uniqueLock.lock();
if(!g_bIsRecordOn){
XnStatus nRetVal = XN_STATUS_OK;
oniFilePath = ofToDataPath(oniFileName);
@@ -599,7 +605,7 @@ void ofxOpenNI::setFrame(int frame){
bPaused = false;
updateGenerators();
bPaused = true;
- startThread(true, false);
+ startThread();
}
}
}
@@ -672,7 +678,7 @@ void ofxOpenNI::nextFrame(){
bPaused = false;
updateGenerators();
bPaused = true;
- startThread(true, false);
+ startThread();
}
}
}
@@ -688,7 +694,7 @@ void ofxOpenNI::previousFrame(){
bPaused = false;
updateGenerators();
bPaused = true;
- startThread(true, false);
+ startThread();
}
}
}
@@ -725,7 +731,8 @@ bool ofxOpenNI::isPlaying(){
//--------------------------------------------------------------
bool ofxOpenNI::addDepthGenerator(){
- ofxOpenNIScopedLock scopedLock(bIsThreaded, mutex);
+ std::unique_lock uniqueLock(recursiveMutex, std::defer_lock);
+ if (bIsThreaded) uniqueLock.lock();
addGenerator(XN_NODE_TYPE_DEPTH, g_bIsDepthOn);
if(g_bIsDepthOn) allocateDepthBuffers();
setMirror(bUseMirror);
@@ -734,7 +741,8 @@ bool ofxOpenNI::addDepthGenerator(){
//--------------------------------------------------------------
bool ofxOpenNI::addImageGenerator(){
- ofxOpenNIScopedLock scopedLock(bIsThreaded, mutex);
+ std::unique_lock uniqueLock(recursiveMutex, std::defer_lock);
+ if (bIsThreaded) uniqueLock.lock();
addGenerator(XN_NODE_TYPE_IMAGE, g_bIsImageOn);
if(g_bIsImageOn) allocateImageBuffers();
setMirror(bUseMirror);
@@ -743,7 +751,8 @@ bool ofxOpenNI::addImageGenerator(){
//--------------------------------------------------------------
bool ofxOpenNI::addInfraGenerator(){
- ofxOpenNIScopedLock scopedLock(bIsThreaded, mutex);
+ std::unique_lock uniqueLock(recursiveMutex, std::defer_lock);
+ if (bIsThreaded) uniqueLock.lock();
addGenerator(XN_NODE_TYPE_IR, g_bIsInfraOn);
if(g_bIsInfraOn) allocateIRBuffers();
setMirror(bUseMirror);
@@ -752,7 +761,8 @@ bool ofxOpenNI::addInfraGenerator(){
//--------------------------------------------------------------
bool ofxOpenNI::addUserGenerator(){
- ofxOpenNIScopedLock scopedLock(bIsThreaded, mutex);
+ std::unique_lock uniqueLock(recursiveMutex, std::defer_lock);
+ if (bIsThreaded) uniqueLock.lock();
if(instanceID > 0) {
// see: http://groups.google.com/group/openni-dev/browse_thread/thread/188a2ac823584117
ofLogWarning(LOG_NAME) << "Currently it is only possible to have a user generator on one device in a single process!!";
@@ -766,7 +776,8 @@ bool ofxOpenNI::addUserGenerator(){
//--------------------------------------------------------------
bool ofxOpenNI::addGestureGenerator(){
- ofxOpenNIScopedLock scopedLock(bIsThreaded, mutex);
+ std::unique_lock uniqueLock(recursiveMutex, std::defer_lock);
+ if (bIsThreaded) uniqueLock.lock();
addGenerator(XN_NODE_TYPE_GESTURE, g_bIsGestureOn);
if(g_bIsGestureOn) allocateGestures();
return g_bIsGestureOn;
@@ -774,7 +785,8 @@ bool ofxOpenNI::addGestureGenerator(){
//--------------------------------------------------------------
bool ofxOpenNI::addHandsGenerator(){
- ofxOpenNIScopedLock scopedLock(bIsThreaded, mutex);
+ std::unique_lock uniqueLock(recursiveMutex, std::defer_lock);
+ if (bIsThreaded) uniqueLock.lock();
addGenerator(XN_NODE_TYPE_HANDS, g_bIsHandsOn);
if(g_bIsHandsOn) allocateHands();
return g_bIsHandsOn;
@@ -782,13 +794,15 @@ bool ofxOpenNI::addHandsGenerator(){
//--------------------------------------------------------------
bool ofxOpenNI::addAudioGenerator(){
- ofxOpenNIScopedLock scopedLock(bIsThreaded, mutex);
+ std::unique_lock uniqueLock(recursiveMutex, std::defer_lock);
+ if (bIsThreaded) uniqueLock.lock();
ofLogWarning(LOG_NAME) << "Not yet implimented";
return false;
}
void ofxOpenNI::addGenerator(XnPredefinedProductionNodeType type, bool & bIsOn){
- ofxOpenNIScopedLock scopedLock(bIsThreaded, mutex);
+ std::unique_lock uniqueLock(recursiveMutex, std::defer_lock);
+ if (bIsThreaded) uniqueLock.lock();
string generatorType = getNodeTypeAsString(type);
ofLogNotice(LOG_NAME) << "Adding generator type" << generatorType;
XnStatus nRetVal = XN_STATUS_OK;
@@ -876,56 +890,64 @@ void ofxOpenNI::addGenerator(XnPredefinedProductionNodeType type, bool & bIsOn){
//--------------------------------------------------------------
bool ofxOpenNI::removeDepthGenerator(){
- ofxOpenNIScopedLock scopedLock(bIsThreaded, mutex);
+ std::unique_lock uniqueLock(recursiveMutex, std::defer_lock);
+ if (bIsThreaded) uniqueLock.lock();
removeGenerator(XN_NODE_TYPE_DEPTH, g_bIsDepthOn);
return !g_bIsDepthOn;
}
//--------------------------------------------------------------
bool ofxOpenNI::removeImageGenerator(){
- ofxOpenNIScopedLock scopedLock(bIsThreaded, mutex);
+ std::unique_lock uniqueLock(recursiveMutex, std::defer_lock);
+ if (bIsThreaded) uniqueLock.lock();
removeGenerator(XN_NODE_TYPE_IMAGE, g_bIsImageOn);
return !g_bIsImageOn;
}
//--------------------------------------------------------------
bool ofxOpenNI::removeInfraGenerator(){
- ofxOpenNIScopedLock scopedLock(bIsThreaded, mutex);
+ std::unique_lock uniqueLock(recursiveMutex, std::defer_lock);
+ if (bIsThreaded) uniqueLock.lock();
removeGenerator(XN_NODE_TYPE_IR, g_bIsInfraOn);
return !g_bIsInfraOn;
}
//--------------------------------------------------------------
bool ofxOpenNI::removeUserGenerator(){
- ofxOpenNIScopedLock scopedLock(bIsThreaded, mutex);
+ std::unique_lock uniqueLock(recursiveMutex, std::defer_lock);
+ if (bIsThreaded) uniqueLock.lock();
removeGenerator(XN_NODE_TYPE_USER, g_bIsUserOn);
return !g_bIsUserOn;
}
//--------------------------------------------------------------
bool ofxOpenNI::removeGestureGenerator(){
- ofxOpenNIScopedLock scopedLock(bIsThreaded, mutex);
+ std::unique_lock uniqueLock(recursiveMutex, std::defer_lock);
+ if (bIsThreaded) uniqueLock.lock();
removeGenerator(XN_NODE_TYPE_GESTURE, g_bIsGestureOn);
return !g_bIsGestureOn;
}
//--------------------------------------------------------------
bool ofxOpenNI::removeHandsGenerator(){
- ofxOpenNIScopedLock scopedLock(bIsThreaded, mutex);
+ std::unique_lock uniqueLock(recursiveMutex, std::defer_lock);
+ if (bIsThreaded) uniqueLock.lock();
removeGenerator(XN_NODE_TYPE_HANDS, g_bIsHandsOn);
return !g_bIsHandsOn;
}
//--------------------------------------------------------------
bool ofxOpenNI::removeAudioGenerator(){
- ofxOpenNIScopedLock scopedLock(bIsThreaded, mutex);
+ std::unique_lock uniqueLock(recursiveMutex, std::defer_lock);
+ if (bIsThreaded) uniqueLock.lock();
ofLogWarning(LOG_NAME) << "Not yet implimented";
return false;
}
//--------------------------------------------------------------
void ofxOpenNI::removeGenerator(XnPredefinedProductionNodeType type, bool & bIsOn){
- ofxOpenNIScopedLock scopedLock(bIsThreaded, mutex);
+ std::unique_lock uniqueLock(recursiveMutex, std::defer_lock);
+ if (bIsThreaded) uniqueLock.lock();
string generatorType = getNodeTypeAsString(type);
ofLogNotice(LOG_NAME) << "Removing generator type" << generatorType;
XnStatus nRetVal = XN_STATUS_OK;
@@ -992,7 +1014,8 @@ void ofxOpenNI::removeGenerator(XnPredefinedProductionNodeType type, bool & bIsO
//--------------------------------------------------------------
void ofxOpenNI::allocateDepthBuffers(){
- ofxOpenNIScopedLock scopedLock(bIsThreaded, mutex);
+ std::unique_lock uniqueLock(recursiveMutex, std::defer_lock);
+ if (bIsThreaded) uniqueLock.lock();
if(depthPixels[0].getWidth() != width || depthPixels[0].getHeight() != height){
ofLogVerbose(LOG_NAME) << "Allocating depth";
maxDepth = g_Depth.GetDeviceMaxDepth();
@@ -1007,7 +1030,8 @@ void ofxOpenNI::allocateDepthBuffers(){
//--------------------------------------------------------------
void ofxOpenNI::allocateDepthRawBuffers(){
- ofxOpenNIScopedLock scopedLock(bIsThreaded, mutex);
+ std::unique_lock uniqueLock(recursiveMutex, std::defer_lock);
+ if (bIsThreaded) uniqueLock.lock();
if(depthRawPixels[0].getWidth() != width || depthRawPixels[0].getHeight() != height){
ofLogVerbose(LOG_NAME) << "Allocating depth raw";
maxDepth = g_Depth.GetDeviceMaxDepth();
@@ -1020,7 +1044,8 @@ void ofxOpenNI::allocateDepthRawBuffers(){
//--------------------------------------------------------------
void ofxOpenNI::allocateImageBuffers(){
- ofxOpenNIScopedLock scopedLock(bIsThreaded, mutex);
+ std::unique_lock uniqueLock(recursiveMutex, std::defer_lock);
+ if (bIsThreaded) uniqueLock.lock();
if(imagePixels[0].getWidth() != width || imagePixels[0].getHeight() != height){
ofLogVerbose(LOG_NAME) << "Allocating image";
imagePixels[0].allocate(width, height, OF_IMAGE_COLOR);
@@ -1033,7 +1058,8 @@ void ofxOpenNI::allocateImageBuffers(){
//--------------------------------------------------------------
void ofxOpenNI::allocateIRBuffers(){
- ofxOpenNIScopedLock scopedLock(bIsThreaded, mutex);
+ std::unique_lock uniqueLock(recursiveMutex, std::defer_lock);
+ if (bIsThreaded) uniqueLock.lock();
if(imagePixels[0].getWidth() != width || imagePixels[0].getHeight() != height){
ofLogVerbose(LOG_NAME) << "Allocating infra";
imagePixels[0].allocate(width, height, OF_IMAGE_GRAYSCALE);
@@ -1046,7 +1072,8 @@ void ofxOpenNI::allocateIRBuffers(){
//--------------------------------------------------------------
bool ofxOpenNI::allocateUsers(){
- ofxOpenNIScopedLock scopedLock(bIsThreaded, mutex);
+ std::unique_lock uniqueLock(recursiveMutex, std::defer_lock);
+ if (bIsThreaded) uniqueLock.lock();
ofLogVerbose(LOG_NAME) << "Allocating users";
XnStatus nRetVal = XN_STATUS_OK;
@@ -1100,7 +1127,8 @@ bool ofxOpenNI::allocateUsers(){
//--------------------------------------------------------------
bool ofxOpenNI::allocateGestures(){
- ofxOpenNIScopedLock scopedLock(bIsThreaded, mutex);
+ std::unique_lock uniqueLock(recursiveMutex, std::defer_lock);
+ if (bIsThreaded) uniqueLock.lock();
ofLogVerbose(LOG_NAME) << "Allocating gestures";
XnStatus nRetVal = XN_STATUS_OK;
lastGestureEvent.timestampMillis = 0; // used to know this is first event in CB handlers
@@ -1111,7 +1139,8 @@ bool ofxOpenNI::allocateGestures(){
//--------------------------------------------------------------
bool ofxOpenNI::allocateHands(){
- ofxOpenNIScopedLock scopedLock(bIsThreaded, mutex);
+ std::unique_lock uniqueLock(recursiveMutex, std::defer_lock);
+ if (bIsThreaded) uniqueLock.lock();
ofLogVerbose(LOG_NAME) << "Allocating hands";
currentTrackedHands.clear();
currentTrackedHandIDs.clear();
@@ -1186,9 +1215,9 @@ void ofxOpenNI::update(){
if(user.getUseMaskTexture() && user.bNewPixels){
if(user.maskTexture.getWidth() != getWidth() || user.maskTexture.getHeight() != getHeight()){
ofLogVerbose(LOG_NAME) << "Allocating mask texture " << user.getXnID();
- user.maskTexture.allocate(getWidth(), getHeight(), ofGetGLTypeFromPixelFormat(user.getMaskPixelFormat()));
+ user.maskTexture.allocate(getWidth(), getHeight(), ofGetGLFormatFromPixelFormat(user.getMaskPixelFormat()));
}
- if(user.maskPixels.getPixels() != NULL) user.maskTexture.loadData(user.maskPixels.getPixels(), getWidth(), getHeight(), ofGetGLTypeFromPixelFormat(user.getMaskPixelFormat()));
+ if(user.maskPixels.getData() != NULL) user.maskTexture.loadData(user.maskPixels.getData(), getWidth(), getHeight(), ofGetGLFormatFromPixelFormat(user.getMaskPixelFormat()));
}
user.bNewPixels = false;
user.bNewPointCloud = false;
@@ -1216,16 +1245,16 @@ void ofxOpenNI::update(){
if(depthThreshold.getUseMaskPixels()){
if(depthThreshold.maskTexture.getWidth() != getWidth() || depthThreshold.maskTexture.getHeight() != getHeight()){
ofLogVerbose(LOG_NAME) << "Allocating mask texture for depthThreshold";
- depthThreshold.maskTexture.allocate(getWidth(), getHeight(), ofGetGLTypeFromPixelFormat(depthThreshold.getMaskPixelFormat()));
+ depthThreshold.maskTexture.allocate(getWidth(), getHeight(), ofGetGLFormatFromPixelFormat(depthThreshold.getMaskPixelFormat()));
}
- depthThreshold.maskTexture.loadData(depthThreshold.maskPixels.getPixels(), getWidth(), getHeight(), ofGetGLTypeFromPixelFormat(depthThreshold.getMaskPixelFormat()));
+ depthThreshold.maskTexture.loadData(depthThreshold.maskPixels.getData(), getWidth(), getHeight(), ofGetGLFormatFromPixelFormat(depthThreshold.getMaskPixelFormat()));
}
if(depthThreshold.getUseDepthPixels()){
if(depthThreshold.depthTexture.getWidth() != getWidth() || depthThreshold.depthTexture.getHeight() != getHeight()){
ofLogVerbose(LOG_NAME) << "Allocating depth texture for depthThreshold";
depthThreshold.depthTexture.allocate(getWidth(), getHeight(), GL_RGBA);
}
- depthThreshold.depthTexture.loadData(depthThreshold.depthPixels.getPixels(), getWidth(), getHeight(), GL_RGBA);
+ depthThreshold.depthTexture.loadData(depthThreshold.depthPixels.getData(), getWidth(), getHeight(), GL_RGBA);
}
depthThreshold.bNewPixels = false;
@@ -1334,7 +1363,8 @@ void ofxOpenNI::updateGenerators(){
//--------------------------------------------------------------
void ofxOpenNI::updateDepthPixels(){
- ofxOpenNIScopedLock scopedLock(bIsThreaded, mutex);
+ std::unique_lock uniqueLock(recursiveMutex, std::defer_lock);
+ if (bIsThreaded) uniqueLock.lock();
// get the pixels
const XnDepthPixel* depth = g_DepthMD.Data();
@@ -1369,7 +1399,7 @@ void ofxOpenNI::updateDepthPixels(){
// copy depth into texture-map
for (XnUInt16 y = g_DepthMD.YOffset(); y < g_DepthMD.YRes() + g_DepthMD.YOffset(); y++){
- unsigned char * texture = backDepthPixels->getPixels() + y * g_DepthMD.XRes() * 4 + g_DepthMD.XOffset() * 4;
+ unsigned char * texture = backDepthPixels->getData() + y * g_DepthMD.XRes() * 4 + g_DepthMD.XOffset() * 4;
for (XnUInt16 x = 0; x < g_DepthMD.XRes(); x++, depth++, texture += 4){
ofColor depthColor;
@@ -1400,14 +1430,16 @@ void ofxOpenNI::updateDepthPixels(){
//--------------------------------------------------------------
void ofxOpenNI::updateImagePixels(){
- ofxOpenNIScopedLock scopedLock(bIsThreaded, mutex);
+ std::unique_lock uniqueLock(recursiveMutex, std::defer_lock);
+ if (bIsThreaded) uniqueLock.lock();
const XnUInt8* pImage = g_ImageMD.Data();
backImagePixels->setFromPixels(pImage, g_ImageMD.XRes(), g_ImageMD.YRes(), OF_IMAGE_COLOR);
}
//--------------------------------------------------------------
void ofxOpenNI::updateIRPixels(){
- ofxOpenNIScopedLock scopedLock(bIsThreaded, mutex);
+ std::unique_lock uniqueLock(recursiveMutex, std::defer_lock);
+ if (bIsThreaded) uniqueLock.lock();
const XnIRPixel* pImage = g_InfraMD.Data();
unsigned char * ir_pixels = new unsigned char[g_InfraMD.XRes() * g_InfraMD.YRes()];
for (int i = 0; i < g_InfraMD.XRes() * g_InfraMD.YRes(); i++){
@@ -1426,7 +1458,8 @@ void ofxOpenNI::updateIRPixels(){
//--------------------------------------------------------------
void ofxOpenNI::updateHandTracker(){
- ofxOpenNIScopedLock scopedLock(bIsThreaded, mutex);
+ std::unique_lock uniqueLock(recursiveMutex, std::defer_lock);
+ if (bIsThreaded) uniqueLock.lock();
int index = 0;
map::iterator it;
@@ -1458,7 +1491,8 @@ void ofxOpenNI::updateHandTracker(){
//--------------------------------------------------------------
void ofxOpenNI::updateUserTracker(){
- ofxOpenNIScopedLock scopedLock(bIsThreaded, mutex);
+ std::unique_lock uniqueLock(recursiveMutex, std::defer_lock);
+ if (bIsThreaded) uniqueLock.lock();
vector userIDs(maxNumUsers);
XnUInt16 xnMaxNumUsers = maxNumUsers;
@@ -1529,7 +1563,8 @@ void ofxOpenNI::updateUserTracker(){
//--------------------------------------------------------------
void ofxOpenNI::updatePointClouds(ofxOpenNIUser & user){
- ofxOpenNIScopedLock scopedLock(bIsThreaded, mutex);
+ std::unique_lock uniqueLock(recursiveMutex, std::defer_lock);
+ if (bIsThreaded) uniqueLock.lock();
const XnRGB24Pixel* pColor;
const XnDepthPixel* pDepth = g_DepthMD.Data();
@@ -1562,7 +1597,8 @@ void ofxOpenNI::updatePointClouds(ofxOpenNIUser & user){
//--------------------------------------------------------------
void ofxOpenNI::updateUserPixels(ofxOpenNIUser & user){
- ofxOpenNIScopedLock scopedLock(bIsThreaded, mutex);
+ std::unique_lock uniqueLock(recursiveMutex, std::defer_lock);
+ if (bIsThreaded) uniqueLock.lock();
if(user.maskPixels.getWidth() != getWidth() || user.maskPixels.getHeight() != getHeight()){
user.maskPixels.allocate(getWidth(), getHeight(), user.getMaskPixelFormat());
}
@@ -1605,7 +1641,7 @@ void ofxOpenNI::updateUserPixels(ofxOpenNIUser & user){
break;
default:
- ofLogError(LOG_NAME) << "Mask pixel type not supported: " << user.getMaskPixelFormat();
+ ofLogError(LOG_NAME) << "Mask pixel type not supported: " << ofToString(user.getMaskPixelFormat());
break;
}
@@ -1615,7 +1651,8 @@ void ofxOpenNI::updateUserPixels(ofxOpenNIUser & user){
//--------------------------------------------------------------
void ofxOpenNI::updateRecorder(){
- ofxOpenNIScopedLock scopedLock(bIsThreaded, mutex);
+ std::unique_lock uniqueLock(recursiveMutex, std::defer_lock);
+ if (bIsThreaded) uniqueLock.lock();
XnStatus nRetVal = XN_STATUS_OK;
switch(g_ONITask){
case ONI_START_RECORD:
@@ -1688,7 +1725,8 @@ void ofxOpenNI::updateRecorder(){
//--------------------------------------------------------------
void ofxOpenNI::updateDepthThresholds(const unsigned short& depth, ofColor& depthColor, int nX, int nY){
- ofxOpenNIScopedLock scopedLock(bIsThreaded, mutex);
+ std::unique_lock uniqueLock(recursiveMutex, std::defer_lock);
+ if (bIsThreaded) uniqueLock.lock();
int nIndex = nY * getWidth() + nX;
ofPoint p = ofPoint(nX, nY, depth);
for(int i = 0; i < currentDepthThresholds.size(); i++){
@@ -1728,7 +1766,7 @@ void ofxOpenNI::updateDepthThresholds(const unsigned short& depth, ofColor& dept
break;
default:
- ofLogError(LOG_NAME) << "Mask pixel type not supported: " << depthThreshold.getMaskPixelFormat();
+ ofLogError(LOG_NAME) << "Mask pixel type not supported: " << ofToString(depthThreshold.getMaskPixelFormat());
break;
}
depthThreshold.bNewPixels = true;
@@ -1812,7 +1850,8 @@ XnSkeletonProfile ofxOpenNI::getSkeletonProfile(){
//--------------------------------------------------------------
void ofxOpenNI::resetUserTracking(XnUserID nID, bool forceImmediateRestart){
- ofxOpenNIScopedLock scopedLock(bIsThreaded, mutex);
+ std::unique_lock uniqueLock(recursiveMutex, std::defer_lock);
+ if (bIsThreaded) uniqueLock.lock();
if(currentTrackedUsers.find(nID) == currentTrackedUsers.end()) return;
stopTrackingUser(nID);
if(forceImmediateRestart) startTrackingUser(nID);
@@ -1825,13 +1864,15 @@ bool ofxOpenNI::getAutoUserCalibrationPossible(){
//--------------------------------------------------------------
int ofxOpenNI::getNumTrackedUsers(){
- ofxOpenNIScopedLock scopedLock(bIsThreaded, mutex);
+ std::unique_lock uniqueLock(recursiveMutex, std::defer_lock);
+ if (bIsThreaded) uniqueLock.lock();
return currentTrackedUserIDs.size();
}
//--------------------------------------------------------------
ofxOpenNIUser& ofxOpenNI::getTrackedUser(int index){
- ofxOpenNIScopedLock scopedLock(bIsThreaded, mutex);
+ std::unique_lock uniqueLock(recursiveMutex, std::defer_lock);
+ if (bIsThreaded) uniqueLock.lock();
if(index > currentTrackedUserIDs.size()){
ofLogError(LOG_NAME) << "no tracked user for that index...have you called getNumTrackedUsers()? Returning garbage baseUser";
return baseUser;
@@ -1841,7 +1882,8 @@ ofxOpenNIUser& ofxOpenNI::getTrackedUser(int index){
//--------------------------------------------------------------
void ofxOpenNI::setMaxNumUsers(int numUsers){
- ofxOpenNIScopedLock scopedLock(bIsThreaded, mutex);
+ std::unique_lock uniqueLock(recursiveMutex, std::defer_lock);
+ if (bIsThreaded) uniqueLock.lock();
maxNumUsers = numUsers;
}
@@ -1884,7 +1926,7 @@ void ofxOpenNI::setMaskPixelFormatAllUsers(ofPixelFormat format){
currentTrackedUsers[currentTrackedUserIDs[i]].setMaskPixelFormat(format);
}
}else{
- ofLogError(LOG_NAME) << "Mask pixel format not supported: " << format;
+ ofLogError(LOG_NAME) << "Mask pixel format not supported: " << ofToString(format);
}
}
@@ -2210,13 +2252,15 @@ int ofxOpenNI::getNumTrackedHands(){
//--------------------------------------------------------------
ofxOpenNIHand& ofxOpenNI::getTrackedHand(int index){
- ofxOpenNIScopedLock scopedLock(bIsThreaded, mutex);
+ std::unique_lock uniqueLock(recursiveMutex, std::defer_lock);
+ if (bIsThreaded) uniqueLock.lock();
return currentTrackedHands[currentTrackedHandIDs[index]];
}
//--------------------------------------------------------------
ofxOpenNIHand& ofxOpenNI::getHand(XnUserID nID){
- ofxOpenNIScopedLock scopedLock(bIsThreaded, mutex);
+ std::unique_lock uniqueLock(recursiveMutex, std::defer_lock);
+ if (bIsThreaded) uniqueLock.lock();
ofxOpenNIHand & hand = baseHand;
map::iterator it = currentTrackedHands.find(nID);
if(it != currentTrackedHands.end()){
@@ -2277,7 +2321,8 @@ void ofxOpenNI::setBaseHandClass(ofxOpenNIHand & hand){
//--------------------------------------------------------------
void ofxOpenNI::addDepthThreshold(ofxOpenNIDepthThreshold & depthThreshold){
- ofxOpenNIScopedLock scopedLock(bIsThreaded, mutex);
+ std::unique_lock uniqueLock(recursiveMutex, std::defer_lock);
+ if (bIsThreaded) uniqueLock.lock();
currentDepthThresholds.push_back(depthThreshold);
}
@@ -2294,7 +2339,8 @@ int ofxOpenNI::getNumDepthThresholds(){
//--------------------------------------------------------------
ofxOpenNIDepthThreshold & ofxOpenNI::getDepthThreshold(int index){
- ofxOpenNIScopedLock scopedLock(bIsThreaded, mutex);
+ std::unique_lock uniqueLock(recursiveMutex, std::defer_lock);
+ if (bIsThreaded) uniqueLock.lock();
return currentDepthThresholds[index];
}
@@ -2492,7 +2538,8 @@ void handleSignal(int err){
//--------------------------------------------------------------
void ofxOpenNI::setSafeThreading(bool b){
- ofxOpenNIScopedLock scopedLock(bIsThreaded, mutex);
+ std::unique_lock uniqueLock(recursiveMutex, std::defer_lock);
+ if (bIsThreaded) uniqueLock.lock();
bUseSafeThreading = b;
if(b) return;
#if defined (TARGET_OSX) && defined (USE_SIGNALS_HACK)
@@ -2520,7 +2567,8 @@ bool ofxOpenNI::getSafeThreading(){
//--------------------------------------------------------------
void ofxOpenNI::setUseBackgroundDepthSubtraction(bool b){
- ofxOpenNIScopedLock scopedLock(bIsThreaded, mutex);
+ std::unique_lock uniqueLock(recursiveMutex, std::defer_lock);
+ if (bIsThreaded) uniqueLock.lock();
bUseBackgroundSubtraction = b;
}
@@ -2531,7 +2579,8 @@ bool ofxOpenNI::getUseBackgroundDepthSubtraction(){
//--------------------------------------------------------------
void ofxOpenNI::setCaptureBackgroundDepthPixels(bool b){
- ofxOpenNIScopedLock scopedLock(bIsThreaded, mutex);
+ std::unique_lock uniqueLock(recursiveMutex, std::defer_lock);
+ if (bIsThreaded) uniqueLock.lock();
if(b) bInitGrabBackgroundPixels = true;
bGrabBackgroundPixels = b;
}
@@ -2543,7 +2592,8 @@ bool ofxOpenNI::getCaptureBackgroundDepthPixels(){
//--------------------------------------------------------------
void ofxOpenNI::setUseDepthRawPixels(bool b){
- ofxOpenNIScopedLock scopedLock(bIsThreaded, mutex);
+ std::unique_lock uniqueLock(recursiveMutex, std::defer_lock);
+ if (bIsThreaded) uniqueLock.lock();
if(b) allocateDepthRawBuffers();
g_bIsDepthRawOn = b;
}
@@ -2581,7 +2631,8 @@ bool ofxOpenNI::isNewFrame(){
//--------------------------------------------------------------
ofPixels& ofxOpenNI::getDepthPixels(){
- ofxOpenNIScopedLock scopedLock(bIsThreaded, mutex);
+ std::unique_lock uniqueLock(recursiveMutex, std::defer_lock);
+ if (bIsThreaded) uniqueLock.lock();
if(bUseBackBuffer){
return *currentDepthPixels;
}else{
@@ -2591,7 +2642,8 @@ ofPixels& ofxOpenNI::getDepthPixels(){
//--------------------------------------------------------------
ofShortPixels& ofxOpenNI::getDepthRawPixels(){
- ofxOpenNIScopedLock scopedLock(bIsThreaded, mutex);
+ std::unique_lock uniqueLock(recursiveMutex, std::defer_lock);
+ if (bIsThreaded) uniqueLock.lock();
if(!g_bIsDepthRawOn){
ofLogWarning(LOG_NAME) << "g_bIsDepthRawOn was disabled, enabling raw pixels. Should really call setUseDepthRawPixels(true) first?";
setUseDepthRawPixels(true);
@@ -2605,7 +2657,8 @@ ofShortPixels& ofxOpenNI::getDepthRawPixels(){
//--------------------------------------------------------------
ofPixels& ofxOpenNI::getImagePixels(){
- ofxOpenNIScopedLock scopedLock(bIsThreaded, mutex);
+ std::unique_lock uniqueLock(recursiveMutex, std::defer_lock);
+ if (bIsThreaded) uniqueLock.lock();
if(bUseBackBuffer){
return *currentImagePixels;
}else{
@@ -2615,13 +2668,15 @@ ofPixels& ofxOpenNI::getImagePixels(){
//--------------------------------------------------------------
ofTexture& ofxOpenNI::getDepthTextureReference(){
- ofxOpenNIScopedLock scopedLock(bIsThreaded, mutex);
+ std::unique_lock uniqueLock(recursiveMutex, std::defer_lock);
+ if (bIsThreaded) uniqueLock.lock();
return depthTexture;
}
//--------------------------------------------------------------
ofTexture& ofxOpenNI::getimageTextureReference(){
- ofxOpenNIScopedLock scopedLock(bIsThreaded, mutex);
+ std::unique_lock uniqueLock(recursiveMutex, std::defer_lock);
+ if (bIsThreaded) uniqueLock.lock();
return imageTexture;
}
@@ -2633,7 +2688,8 @@ ofTexture& ofxOpenNI::getimageTextureReference(){
//--------------------------------------------------------------
bool ofxOpenNI::setResolution(int w, int h, int f){
- ofxOpenNIScopedLock scopedLock(bIsThreaded, mutex);
+ std::unique_lock uniqueLock(recursiveMutex, std::defer_lock);
+ if (bIsThreaded) uniqueLock.lock();
ofLogWarning(LOG_NAME) << "Not implimented";
return false; // uncomment to give it a try
@@ -2663,7 +2719,8 @@ bool ofxOpenNI::setResolution(int w, int h, int f){
//--------------------------------------------------------------
bool ofxOpenNI::setGeneratorResolution(xn::MapGenerator & generator, int w, int h, int f){
- ofxOpenNIScopedLock scopedLock(bIsThreaded, mutex);
+ std::unique_lock uniqueLock(recursiveMutex, std::defer_lock);
+ if (bIsThreaded) uniqueLock.lock();
XnMapOutputMode mapMode;
XnStatus nRetVal = XN_STATUS_OK;
mapMode.nXRes = w; mapMode.nYRes = h; mapMode.nFPS = f;
@@ -2705,7 +2762,8 @@ float ofxOpenNI::getHeight(){
}
float ofxOpenNI::getFrameRate(){
- ofxOpenNIScopedLock scopedLock(bIsThreaded, mutex);
+ std::unique_lock uniqueLock(recursiveMutex, std::defer_lock);
+ if (bIsThreaded) uniqueLock.lock();
// this returns a calcualted frame rate based on threaded/normal updates NOT the device target frame rate
return frameRate;
}
@@ -2852,7 +2910,8 @@ xn::AudioMetaData& ofxOpenNI::getAudioMetaData(){
//--------------------------------------------------------------
void ofxOpenNI::startTrackingUser(XnUserID nID){
- ofxOpenNIScopedLock scopedLock(bIsThreaded, mutex);
+ std::unique_lock uniqueLock(recursiveMutex, std::defer_lock);
+ if (bIsThreaded) uniqueLock.lock();
XnStatus nRetVal = XN_STATUS_OK;
ofLogNotice(LOG_NAME) << "Start tracking user" << nID;
nRetVal = g_User.GetSkeletonCap().StartTracking(nID);
@@ -2868,7 +2927,8 @@ void ofxOpenNI::startTrackingUser(XnUserID nID){
//--------------------------------------------------------------
void ofxOpenNI::stopTrackingUser(XnUserID nID){
- ofxOpenNIScopedLock scopedLock(bIsThreaded, mutex);
+ std::unique_lock uniqueLock(recursiveMutex, std::defer_lock);
+ if (bIsThreaded) uniqueLock.lock();
XnStatus nRetVal = XN_STATUS_OK;
if(g_User.GetSkeletonCap().IsCalibrating(nID)){// || g_User.GetSkeletonCap().IsCalibrated(nID)){
ofLogNotice(LOG_NAME) << "Calibration stopped for user" << nID;
@@ -2893,7 +2953,8 @@ void ofxOpenNI::stopTrackingUser(XnUserID nID){
//--------------------------------------------------------------
void ofxOpenNI::requestCalibration(XnUserID nID){
- ofxOpenNIScopedLock scopedLock(bIsThreaded, mutex);
+ std::unique_lock uniqueLock(recursiveMutex, std::defer_lock);
+ if (bIsThreaded) uniqueLock.lock();
XnStatus nRetVal = XN_STATUS_OK;
if(getNumTrackedUsers() + 1 > getMaxNumUsers()){
ofLogVerbose(LOG_NAME) << "Calibration requested cancelled for user" << nID << "since maxNumUsers is" << maxNumUsers;
@@ -2919,7 +2980,8 @@ void ofxOpenNI::requestCalibration(XnUserID nID){
//--------------------------------------------------------------
void ofxOpenNI::startPoseDetection(XnUserID nID){
- ofxOpenNIScopedLock scopedLock(bIsThreaded, mutex);
+ std::unique_lock uniqueLock(recursiveMutex, std::defer_lock);
+ if (bIsThreaded) uniqueLock.lock();
XnStatus nRetVal = XN_STATUS_OK;
if(getNumTrackedUsers() + 1 > getMaxNumUsers()){
ofLogVerbose(LOG_NAME) << "Pose detection cancelled for user" << nID << "since maxNumUsers is" << maxNumUsers;
@@ -2946,7 +3008,8 @@ void ofxOpenNI::startPoseDetection(XnUserID nID){
//--------------------------------------------------------------
void ofxOpenNI::stopPoseDetection(XnUserID nID){
- ofxOpenNIScopedLock scopedLock(bIsThreaded, mutex);
+ std::unique_lock uniqueLock(recursiveMutex, std::defer_lock);
+ if (bIsThreaded) uniqueLock.lock();
XnStatus nRetVal = XN_STATUS_OK;
ofLogNotice(LOG_NAME) << "Stop pose detection for user" << nID;
nRetVal = g_User.GetPoseDetectionCap().StopPoseDetection(nID);
@@ -3169,7 +3232,8 @@ void ofxOpenNI::drawDebug(float x, float y){
//--------------------------------------------------------------
void ofxOpenNI::drawDebug(float x, float y, float w, float h){
- ofxOpenNIScopedLock scopedLock(bIsThreaded, mutex);
+ std::unique_lock uniqueLock(recursiveMutex, std::defer_lock);
+ if (bIsThreaded) uniqueLock.lock();
if(!bIsContextReady) return;
int generatorCount = g_bIsDepthOn + g_bIsImageOn + g_bIsInfraOn;
@@ -3225,7 +3289,8 @@ void ofxOpenNI::drawDepth(float x, float y){
//--------------------------------------------------------------
void ofxOpenNI::drawDepth(float x, float y, float w, float h){
- ofxOpenNIScopedLock scopedLock(bIsThreaded, mutex);
+ std::unique_lock uniqueLock(recursiveMutex, std::defer_lock);
+ if (bIsThreaded) uniqueLock.lock();
if(bUseTexture && bIsContextReady) depthTexture.draw(x, y, w, h);
}
@@ -3247,7 +3312,8 @@ void ofxOpenNI::drawImage(float x, float y){
//--------------------------------------------------------------
void ofxOpenNI::drawImage(float x, float y, float w, float h){
- ofxOpenNIScopedLock scopedLock(bIsThreaded, mutex);
+ std::unique_lock uniqueLock(recursiveMutex, std::defer_lock);
+ if (bIsThreaded) uniqueLock.lock();
if(bUseTexture && bIsContextReady) imageTexture.draw(x, y, w, h);
}
@@ -3269,7 +3335,8 @@ void ofxOpenNI::drawSkeletons(float x, float y){
//--------------------------------------------------------------
void ofxOpenNI::drawSkeletons(float x, float y, float w, float h){
- ofxOpenNIScopedLock scopedLock(bIsThreaded, mutex);
+ std::unique_lock uniqueLock(recursiveMutex, std::defer_lock);
+ if (bIsThreaded) uniqueLock.lock();
if(!bIsContextReady) return;
for(int i = 0; i < getNumTrackedUsers(); ++i){
drawSkeleton(x, y, w, h, i);
@@ -3288,7 +3355,8 @@ void ofxOpenNI::drawSkeleton(float x, float y, int nID){
//--------------------------------------------------------------
void ofxOpenNI::drawSkeleton(float x, float y, float w, float h, int nID){
- ofxOpenNIScopedLock scopedLock(bIsThreaded, mutex);
+ std::unique_lock uniqueLock(recursiveMutex, std::defer_lock);
+ if (bIsThreaded) uniqueLock.lock();
if(nID - 1 > getNumTrackedUsers()) return;
ofPushStyle();
ofPushMatrix();
@@ -3317,7 +3385,8 @@ void ofxOpenNI::drawHands(float x, float y){
//--------------------------------------------------------------
void ofxOpenNI::drawHands(float x, float y, float w, float h){
- ofxOpenNIScopedLock scopedLock(bIsThreaded, mutex);
+ std::unique_lock uniqueLock(recursiveMutex, std::defer_lock);
+ if (bIsThreaded) uniqueLock.lock();
for (int i = 0; i < getNumTrackedHands(); i++) {
drawHand(i);
}
@@ -3335,14 +3404,15 @@ void ofxOpenNI::drawHand(float x, float y, int index){
//--------------------------------------------------------------
void ofxOpenNI::drawHand(float x, float y, float w, float, int index){
- ofxOpenNIScopedLock scopedLock(bIsThreaded, mutex);
+ std::unique_lock uniqueLock(recursiveMutex, std::defer_lock);
+ if (bIsThreaded) uniqueLock.lock();
if(index > getNumTrackedHands()) return;
ofPushStyle();
ofPushMatrix();
ofFill();
ofSetColor(255, 255, 0);
ofxOpenNIHand & hand = getTrackedHand(index);
- ofCircle(hand.position.x, hand.position.y, 10);
+ ofDrawCircle(hand.position.x, hand.position.y, 10);
ofPopMatrix();
ofPopStyle();
}
@@ -3400,7 +3470,7 @@ void ofxOpenNI::cameraToWorld(const vector& c, vector& w){
//XnPoint3D *out = &projective[0];
//mutex.lock();
- const XnDepthPixel* d = currentDepthRawPixels->getPixels();
+ const XnDepthPixel* d = currentDepthRawPixels->getData();
unsigned int pixel;
for (int i = 0; i < nPoints; ++i){
pixel = (int)c[i].x + (int)c[i].y * g_DepthMD.XRes();
diff --git a/src/ofxOpenNI.h b/src/ofxOpenNI.h
old mode 100644
new mode 100755
index 371ac49..8b322c7
--- a/src/ofxOpenNI.h
+++ b/src/ofxOpenNI.h
@@ -520,8 +520,8 @@ class ofxOpenNI : public ofThread {
// frame rate storage
double prevMillis, lastFrameTime, timeNow, timeThen, tFps, frameRate;
-
- Poco::Mutex mutex;
+
+ std::recursive_mutex recursiveMutex;
// block copy ctor and assignment operator
ofxOpenNI(const ofxOpenNI& other);
@@ -529,16 +529,4 @@ class ofxOpenNI : public ofThread {
};
-class ofxOpenNIScopedLock {
-public:
- ofxOpenNIScopedLock(bool _bIsThreaded, Poco::Mutex & _mutex):bIsThreaded(_bIsThreaded), mutex(_mutex){
- if(bIsThreaded) mutex.lock();
- };
- ~ofxOpenNIScopedLock(){
- if(bIsThreaded) mutex.unlock();
- };
- bool bIsThreaded;
- Poco::Mutex & mutex;
-};
-
#endif
diff --git a/src/ofxOpenNITypes.cpp b/src/ofxOpenNITypes.cpp
old mode 100644
new mode 100755
index 5a9baa9..128705b
--- a/src/ofxOpenNITypes.cpp
+++ b/src/ofxOpenNITypes.cpp
@@ -271,7 +271,7 @@ void ofxOpenNIUser::setMaskPixelFormat(ofPixelFormat format){
maskPixelFormat = format;
if(maskPixels.getImageType() != ofGetImageTypeFromGLType(maskPixelFormat)){
maskPixels.allocate(maskPixels.getWidth(), maskPixels.getHeight(), maskPixelFormat);
- if(bUseMaskTexture) maskTexture.allocate(maskPixels.getWidth(), maskPixels.getHeight(), ofGetGLTypeFromPixelFormat(maskPixelFormat));
+ if(bUseMaskTexture) maskTexture.allocate(maskPixels.getWidth(), maskPixels.getHeight(), ofGetGLFormatFromPixelFormat(maskPixelFormat));
}
}
@@ -677,7 +677,7 @@ void ofxOpenNIDepthThreshold::setMaskPixelFormat(ofPixelFormat format){
maskPixelFormat = format;
if(maskPixels.getImageType() != ofGetImageTypeFromGLType(maskPixelFormat)){
maskPixels.allocate(maskPixels.getWidth(), maskPixels.getHeight(), maskPixelFormat);
- if(bUseMaskTexture) maskTexture.allocate(maskPixels.getWidth(), maskPixels.getHeight(), ofGetGLTypeFromPixelFormat(maskPixelFormat));
+ if(bUseMaskTexture) maskTexture.allocate(maskPixels.getWidth(), maskPixels.getHeight(), ofGetGLFormatFromPixelFormat(maskPixelFormat));
}
}
diff --git a/src/ofxOpenNITypes.h b/src/ofxOpenNITypes.h
old mode 100644
new mode 100755
index 5c5f9a3..0d4bd5e
--- a/src/ofxOpenNITypes.h
+++ b/src/ofxOpenNITypes.h
@@ -32,6 +32,8 @@
#include "ofxOpenNIUtils.h"
#include "ofNode.h"
+using namespace std;
+
class ofxOpenNIJoint {
public:
@@ -210,7 +212,7 @@ class ofxOpenNIJoint {
mOrientation.getRotate(angle, vec);
ofRotate(angle, vec.x, vec.y, vec.z);
- ofLine(0, 0, 0, getProjectiveDistanceToParent());
+ ofDrawLine(0, 0, 0, getProjectiveDistanceToParent());
ofDrawAxis(30);
ofPopMatrix();
@@ -229,7 +231,7 @@ class ofxOpenNIJoint {
}
ofFill();
- ofCircle(0, 0, 5);
+ ofDrawCircle(0, 0, 5);
ofNoFill();
if(isParent()){
@@ -244,7 +246,7 @@ class ofxOpenNIJoint {
ofSetLineWidth(5);
if(isParent()){
ofVec2f bone = ofVec2f(parent->getProjectivePosition()) - ofVec2f(getProjectivePosition());
- if(!bUseOrientation) ofLine(0, 0, 0, bone.x, bone.y, 0);
+ if(!bUseOrientation) ofDrawLine(0, 0, 0, bone.x, bone.y, 0);
}
}
}
@@ -328,7 +330,7 @@ class ofxOpenNILimb {
ofSetColor(255, 0, 0);
}
ofSetLineWidth(5);
- ofLine(ofVec2f(startJoint->getProjectivePosition()),ofVec2f(endJoint->getProjectivePosition()));
+ ofDrawLine(ofVec2f(startJoint->getProjectivePosition()),ofVec2f(endJoint->getProjectivePosition()));
ofPopStyle();
}
@@ -610,24 +612,25 @@ class ofxOpenNIROI {
ofPushMatrix();
ofNoFill();
ofSetLineWidth(0.5);
- ofCircle(ofVec2f(centerProjective), 5);
- ofRect(nearPlane);
- ofRect(farPlane);
+ ofDrawCircle(ofVec2f(centerProjective), 5);
+
+ ofDrawRectangle(nearPlane);
+ ofDrawRectangle(farPlane);
- ofLine(ofVec2f(leftBottomNearProjective), ofVec2f(leftBottomFarProjective));
- ofLine(ofVec2f(rightTopNearProjective), ofVec2f(rightTopFarProjective));
- ofLine(ofVec2f(leftBottomNearProjective.x, rightTopNearProjective.y), ofVec2f(leftBottomFarProjective.x, rightTopFarProjective.y));
- ofLine(ofVec2f(rightTopNearProjective.x, leftBottomNearProjective.y), ofVec2f(rightTopFarProjective.x, leftBottomFarProjective.y));
+ ofDrawLine(ofVec2f(leftBottomNearProjective), ofVec2f(leftBottomFarProjective));
+ ofDrawLine(ofVec2f(rightTopNearProjective), ofVec2f(rightTopFarProjective));
+ ofDrawLine(ofVec2f(leftBottomNearProjective.x, rightTopNearProjective.y), ofVec2f(leftBottomFarProjective.x, rightTopFarProjective.y));
+ ofDrawLine(ofVec2f(rightTopNearProjective.x, leftBottomNearProjective.y), ofVec2f(rightTopFarProjective.x, leftBottomFarProjective.y));
ofPopMatrix();
ofPopStyle();
}
void drawJoint(ofxOpenNIJoint & joint){
ofSetColor(255*magnitude(joint), 0, 255);
- ofCircle(ofVec2f(joint.getProjectivePosition()), 5);
+ ofDrawCircle(ofVec2f(joint.getProjectivePosition()), 5);
ofSetLineWidth(2);
- ofLine(ofVec2f(joint.getProjectivePosition()), ofVec2f(centerProjective));
+ ofDrawLine(ofVec2f(joint.getProjectivePosition()), ofVec2f(centerProjective));
}
inline int numJointsInside(ofxOpenNIUser & user){
diff --git a/src/ofxOpenNIUtils.h b/src/ofxOpenNIUtils.h
old mode 100644
new mode 100755
index a61dff6..1351be0
--- a/src/ofxOpenNIUtils.h
+++ b/src/ofxOpenNIUtils.h
@@ -29,6 +29,8 @@
#ifndef _H_OFXOPENNIUTILS
#define _H_OFXOPENNIUTILS
+using namespace std;
+
#include
#include