Blob Blame History Raw
diff -up ./.gitignore.fedora ./.gitignore
--- ./.gitignore.fedora	2013-09-13 20:45:08.642163658 -0400
+++ ./.gitignore	2013-09-13 20:45:08.642163658 -0400
@@ -0,0 +1,8 @@
+*~
+Release/
+/Source/DoxyGen/html
+/Platform/Linux/Bin
+/Platform/Linux/CreateRedist/Final
+/Platform/Linux/CreateRedist/Output
+/Platform/Linux/Redist
+/Platform/Linux/Build
diff -up ./Platform/Linux/Build/Modules/nimCodecs/Makefile.fedora ./Platform/Linux/Build/Modules/nimCodecs/Makefile
--- ./Platform/Linux/Build/Modules/nimCodecs/Makefile.fedora	2012-01-04 06:35:46.000000000 -0500
+++ ./Platform/Linux/Build/Modules/nimCodecs/Makefile	2013-09-13 20:45:08.642163658 -0400
@@ -1,18 +1,20 @@
 BIN_DIR = ../../../Bin
 
 INC_DIRS = \
-	../../../../../Include \
-	../../../../../Source \
-	../../../../../Source/External/LibJPEG
+	../../../../../Include 
 
 SRC_FILES = \
-	../../../../../Source/Modules/nimCodecs/*.cpp \
-	../../../../../Source/External/LibJPEG/*.c
+	../../../../../Source/Modules/nimCodecs/*.cpp 
 
 LIB_NAME = nimCodecs
 USED_LIBS = OpenNI
 
-include ../../Common/CommonCppMakefile
-
+ifneq ($(wildcard /usr/lib/libjpeg.so /usr/lib32/libjpeg.so /usr/lib64/libjpeg.so /usr/local/lib/libjpeg.so /usr/local/lib32/libjpeg.so /usr/local/lib64/libjpeg.so),)
+  USED_LIBS += jpeg
+else
+  INC_DIRS  += ../../../../../Source/External/LibJPEG
+  SRC_FILES += ../../../../../Source/External/LibJPEG/*.c
+endif
 
+include ../../Common/CommonCppMakefile
 
diff -up ./Platform/Linux/Build/OpenNI/Makefile.fedora ./Platform/Linux/Build/OpenNI/Makefile
--- ./Platform/Linux/Build/OpenNI/Makefile.fedora	2012-01-04 06:35:46.000000000 -0500
+++ ./Platform/Linux/Build/OpenNI/Makefile	2013-09-13 20:45:08.643163697 -0400
@@ -4,13 +4,11 @@ BIN_DIR = ../../Bin
 
 INC_DIRS = \
 	../../../../Include \
-	../../../../Source \
-	../../../../Source/External/TinyXml
+	../../../../Source
 
 SRC_FILES = \
 	../../../../Source/OpenNI/*.cpp \
-	../../../../Source/OpenNI/Linux/*.cpp \
-	../../../../Source/External/TinyXml/*.cpp
+	../../../../Source/OpenNI/Linux/*.cpp
 
 ifeq ("$(OSTYPE)","Darwin")
 	INC_DIRS += /opt/local/include
@@ -25,6 +23,14 @@ ifneq ("$(OSTYPE)","Darwin")
 endif
 DEFINES = XN_EXPORTS
 
+ifneq ($(wildcard /usr/include/tinyxml.h /usr/local/include/tinyxml.h),)
+  USED_LIBS += tinyxml
+else
+  INC_DIRS += ../../../../Source/External/TinyXml
+  SRC_FILES += ../../../../Source/External/TinyXml/*.cpp
+endif
+
+
 include ../Common/CommonCppMakefile
 
 
diff -up ./Platform/Linux/Build/Samples/NiHandTracker/Makefile.fedora ./Platform/Linux/Build/Samples/NiHandTracker/Makefile
--- ./Platform/Linux/Build/Samples/NiHandTracker/Makefile.fedora	2012-01-04 06:35:46.000000000 -0500
+++ ./Platform/Linux/Build/Samples/NiHandTracker/Makefile	2013-09-13 20:45:08.643163697 -0400
@@ -11,7 +11,7 @@ SRC_FILES = ../../../../../Samples/NiHan
 ifeq ("$(OSTYPE)","Darwin")
 	LDFLAGS += -framework OpenGL -framework GLUT
 else
-	USED_LIBS += glut
+	USED_LIBS += glut GL
 endif
 
 USED_LIBS += OpenNI
diff -up ./Platform/Linux/Build/Samples/NiSimpleViewer/Makefile.fedora ./Platform/Linux/Build/Samples/NiSimpleViewer/Makefile
--- ./Platform/Linux/Build/Samples/NiSimpleViewer/Makefile.fedora	2012-01-04 06:35:46.000000000 -0500
+++ ./Platform/Linux/Build/Samples/NiSimpleViewer/Makefile	2013-09-13 20:45:08.644163736 -0400
@@ -11,7 +11,7 @@ EXE_NAME = Sample-NiSimpleViewer
 ifeq ("$(OSTYPE)","Darwin")
 	LDFLAGS += -framework OpenGL -framework GLUT
 else
-	USED_LIBS += glut
+	USED_LIBS += glut GL
 endif
 
 USED_LIBS += OpenNI
diff -up ./Platform/Linux/Build/Samples/NiUserSelection/Makefile.fedora ./Platform/Linux/Build/Samples/NiUserSelection/Makefile
--- ./Platform/Linux/Build/Samples/NiUserSelection/Makefile.fedora	2013-09-13 20:46:15.143743887 -0400
+++ ./Platform/Linux/Build/Samples/NiUserSelection/Makefile	2013-09-13 20:46:21.133976302 -0400
@@ -12,7 +12,7 @@ ifeq "$(GLUT_SUPPORTED)" "1"
 	ifeq ("$(OSTYPE)","Darwin")
 		LDFLAGS += -framework OpenGL -framework GLUT
 	else
-		USED_LIBS += glut
+		USED_LIBS += glut GL
 	endif
 else
 	ifeq "$(GLES_SUPPORTED)" "1"
diff -up ./Platform/Linux/Build/Samples/NiUserTracker/Makefile.fedora ./Platform/Linux/Build/Samples/NiUserTracker/Makefile
--- ./Platform/Linux/Build/Samples/NiUserTracker/Makefile.fedora	2012-01-04 06:35:46.000000000 -0500
+++ ./Platform/Linux/Build/Samples/NiUserTracker/Makefile	2013-09-13 20:45:08.644163736 -0400
@@ -12,7 +12,7 @@ ifeq "$(GLUT_SUPPORTED)" "1"
 	ifeq ("$(OSTYPE)","Darwin")
 		LDFLAGS += -framework OpenGL -framework GLUT
 	else
-		USED_LIBS += glut
+		USED_LIBS += glut GL
 	endif
 else
 	ifeq "$(GLES_SUPPORTED)" "1"
diff -up ./Platform/Linux/Build/Samples/NiViewer/Makefile.fedora ./Platform/Linux/Build/Samples/NiViewer/Makefile
--- ./Platform/Linux/Build/Samples/NiViewer/Makefile.fedora	2012-01-04 06:35:46.000000000 -0500
+++ ./Platform/Linux/Build/Samples/NiViewer/Makefile	2013-09-13 20:45:08.644163736 -0400
@@ -11,7 +11,7 @@ SRC_FILES = ../../../../../Samples/NiVie
 ifeq ("$(OSTYPE)","Darwin")
 	LDFLAGS += -framework OpenGL -framework GLUT
 else
-	USED_LIBS += glut
+	USED_LIBS += glut GL
 endif
 
 USED_LIBS += OpenNI
diff -up ./Platform/Linux/CreateRedist/install.sh.fedora ./Platform/Linux/CreateRedist/install.sh
--- ./Platform/Linux/CreateRedist/install.sh.fedora	2012-01-04 06:35:46.000000000 -0500
+++ ./Platform/Linux/CreateRedist/install.sh	2013-09-13 20:45:08.644163736 -0400
@@ -8,6 +8,8 @@ Installs OpenNI to current machine.
 	Installs OpenNI (default mode)
 -u,--uninstall
 	Uninstalls OpenNI.
+-n,--noregister
+	Do not (un)register the modules
 -c,--cross-compile-rootfs <path>
 	Used for cross-compiling. Installs OpenNI to <path> instead of '/'.
 -h,--help
@@ -45,6 +47,9 @@ while [ "$1" ]; do
 	-u|--uninstall)
 		uninstall=yes
 		;;
+	-n|--noregister)
+		register=no
+		;;
 	-c|--cross-staging-dir)
 		shift
 		rootfs=$1
@@ -71,11 +76,22 @@ if [ "$install" = yes ] && [ "$uninstall
 	exit 1
 fi
 
-INSTALL_LIB=$rootfs/usr/lib
-INSTALL_BIN=$rootfs/usr/bin
-INSTALL_INC=$rootfs/usr/include/ni
-INSTALL_VAR=$rootfs/var/lib/ni
-INSTALL_JAR=$rootfs/usr/share/java
+
+if [ -z "$INSTALL_LIB" ]; then
+  INSTALL_LIB=$rootfs/usr/lib
+fi
+if [ -z "$INSTALL_BIN" ]; then
+  INSTALL_BIN=$rootfs/usr/bin
+fi
+if [ -z "$INSTALL_INC" ]; then
+  INSTALL_INC=$rootfs/usr/include/ni
+fi
+if [ -z "$INSTALL_VAR" ]; then
+  INSTALL_VAR=$rootfs/usr/etc/ni
+fi
+if [ -z "$INSTALL_JAR" ]; then
+  INSTALL_JAR=$rootfs/usr/share/java
+fi
 
 # make all calls into OpenNI run in this filesystem
 export OPEN_NI_INSTALL_PATH=$rootfs
@@ -86,6 +102,12 @@ if [ "$install" = yes ]; then
 	printf "Installing OpenNI\n"
 	printf "****************************\n\n"
 	
+	mkdir -p $INSTALL_LIB
+	mkdir -p $INSTALL_BIN
+	mkdir -p $INSTALL_INC
+	mkdir -p $INSTALL_VAR
+	mkdir -p $INSTALL_JAR
+
 	# copy libraries
 	printf "copying shared libraries..."
 	cp $LIB_FILES $INSTALL_LIB
@@ -107,17 +129,21 @@ if [ "$install" = yes ]; then
 	mkdir -p $INSTALL_VAR
 	printf "OK\n"
 
-	# register modules
-	for module in $MODULES; do
-		printf "registering module '$module'..."
-		$INSTALL_BIN/niReg -r $INSTALL_LIB/$module
-		printf "OK\n"
-	done
+	if [ "$register" = yes ]; then
+		# register modules
+		for module in $MODULES; do
+			printf "registering module '$module'..."
+			$INSTALL_BIN/niReg -r $INSTALL_LIB/$module
+			printf "OK\n"
+		done
+	fi
 
-	# mono
-	if [ -f $rootfs/usr/bin/gmcs -a -f Bin/OpenNI.net.dll ]; then
-		printf "Installing .Net wrappers...\n"
-		gacutil -i Bin/OpenNI.net.dll -package 2.0 $GACDIR
+	if [ "$register" = yes ]; then
+		# mono
+		if [ -f $rootfs/usr/bin/gmcs -a -f Bin/OpenNI.net.dll ]; then
+			printf "Installing .Net wrappers...\n"
+			gacutil -i Bin/OpenNI.net.dll -package 2.0 $GACDIR
+		fi
 	fi
 
 	# java wrappers
@@ -135,13 +161,15 @@ elif [ "$uninstall" = yes ]; then
 	printf "Uninstalling OpenNI\n"
 	printf "****************************\n\n"
 
-	# unregister modules
-	for module in $MODULES; do
-    	printf "unregistering module '$module'..."
-        if $INSTALL_BIN/niReg -u $INSTALL_LIB/$module; then
-            printf "OK\n"
-        fi
-	done
+	if [ "$register" = yes ]; then
+		# unregister modules
+		for module in $MODULES; do
+			printf "unregistering module '$module'..."
+			if $INSTALL_BIN/niReg -u $INSTALL_LIB/$module; then
+				printf "OK\n"
+			fi
+		done
+	fi
 
 	# include files
 	printf "removing include files..."
@@ -162,12 +190,13 @@ elif [ "$uninstall" = yes ]; then
 	done
 	printf "OK\n"
 
-	# mono
-	if [ -f $rootfs/usr/bin/gmcs -a -f Bin/OpenNI.net.dll ]; then
-		printf "Removing .Net wrappers...\n"
-		gacutil -u OpenNI.net $GACDIR
+	if [ "$register" = yes ]; then
+		# mono
+		if [ -f $rootfs/usr/bin/gmcs -a -f Bin/OpenNI.net.dll ]; then
+			printf "Removing .Net wrappers...\n"
+			gacutil -u OpenNI.net $GACDIR
+		fi
 	fi
-
 	# java
 	printf "removing java bindings..."
 	for filename in $JAR_FILES; do
diff -up ./Source/OpenNI/Linux/XnUSBLinux.cpp.fedora ./Source/OpenNI/Linux/XnUSBLinux.cpp
--- ./Source/OpenNI/Linux/XnUSBLinux.cpp.fedora	2012-01-04 06:35:46.000000000 -0500
+++ ./Source/OpenNI/Linux/XnUSBLinux.cpp	2013-09-13 20:45:08.645163775 -0400
@@ -383,6 +383,16 @@ XN_C_API XnStatus xnUSBOpenDeviceImpl(li
 		return (XN_STATUS_USB_SET_CONFIG_FAILED);
 	}
 */	
+	// detach any active kernel driver, code extracted from libfreenect
+	rc = libusb_kernel_driver_active(handle, 0);
+	if (rc == 1) {
+	  	rc = libusb_detach_kernel_driver(handle, 0);
+		if (rc != 0)
+		{
+		  	libusb_close(handle);
+			return (XN_STATUS_USB_SET_INTERFACE_FAILED);
+		}
+	}
 	// claim the interface (you cannot open any end point before claiming the interface)
 	rc = libusb_claim_interface(handle, 0);
 	if (rc != 0)
@@ -496,7 +506,7 @@ XN_C_API XnStatus xnUSBCloseDevice(XN_US
 	{
 		return (XN_STATUS_USB_DEVICE_CLOSE_FAILED);
 	}
-
+	rc = libusb_attach_kernel_driver(pDevHandle->hDevice, 0); 
 	libusb_close(pDevHandle->hDevice);
 
 	XN_FREE_AND_NULL(pDevHandle);
diff -up ./Wrappers/OpenNI.jni/jni.h.fedora ./Wrappers/OpenNI.jni/jni.h
--- ./Wrappers/OpenNI.jni/jni.h.fedora	2012-01-04 06:35:46.000000000 -0500
+++ ./Wrappers/OpenNI.jni/jni.h	2013-09-13 20:45:08.646163813 -0400
@@ -183,7 +183,7 @@ typedef enum _jobjectType {
 typedef struct {
     const char *name;
     const char *signature;
-    void *fnPtr;
+    const void *fnPtr;
 } JNINativeMethod;
 
 /*