generic-linux
authorDebian Multimedia Maintainers <debian-multimedia@lists.debian.org>
Fri, 5 Feb 2021 19:15:35 +0000 (19:15 +0000)
committerJochen Sprickerhof <jspricke@debian.org>
Fri, 5 Feb 2021 19:15:35 +0000 (19:15 +0000)
Gbp-Pq: Name 0012-generic-linux.patch

13 files changed:
Include/Linux-generic/OniPlatformLinux-generic.h [new file with mode: 0644]
Include/OniPlatform.h
Source/Drivers/PS1080/Sensor/XnDeviceSensorInit.h
Source/Drivers/PSLink/LinkProtoLib/XnClientUSBInDataEndpoint.cpp
Source/Drivers/PSLink/PS1200Device.cpp
Source/Tools/NiViewer/NiViewer.cpp
ThirdParty/PSCommon/BuildSystem/CommonDefs.mak
ThirdParty/PSCommon/BuildSystem/Platform.generic [new file with mode: 0644]
ThirdParty/PSCommon/XnLib/Include/Linux-generic/XnPlatformLinux-generic.h [new file with mode: 0644]
ThirdParty/PSCommon/XnLib/Include/XnOS.h
ThirdParty/PSCommon/XnLib/Include/XnPlatform.h
ThirdParty/PSCommon/XnLib/Include/XnUSBDevice.h
ThirdParty/PSCommon/XnLib/Source/Linux/XnLinuxUSB.cpp

diff --git a/Include/Linux-generic/OniPlatformLinux-generic.h b/Include/Linux-generic/OniPlatformLinux-generic.h
new file mode 100644 (file)
index 0000000..50f2c58
--- /dev/null
@@ -0,0 +1,36 @@
+/*****************************************************************************
+*                                                                            *
+*  OpenNI 2.x Alpha                                                          *
+*  Copyright (C) 2012 PrimeSense Ltd.                                        *
+*                                                                            *
+*  This file is part of OpenNI.                                              *
+*                                                                            *
+*  Licensed under the Apache License, Version 2.0 (the "License");           *
+*  you may not use this file except in compliance with the License.          *
+*  You may obtain a copy of the License at                                   *
+*                                                                            *
+*      http://www.apache.org/licenses/LICENSE-2.0                            *
+*                                                                            *
+*  Unless required by applicable law or agreed to in writing, software       *
+*  distributed under the License is distributed on an "AS IS" BASIS,         *
+*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  *
+*  See the License for the specific language governing permissions and       *
+*  limitations under the License.                                            *
+*                                                                            *
+*****************************************************************************/
+#ifndef _ONI_PLATFORM_LINUX_GENERIC_H_
+#define _ONI_PLATFORM_LINUX_GENERIC_H_
+
+// Start with Linux-x86, and override what's different
+#include "../Linux-x86/OniPlatformLinux-x86.h"
+
+//---------------------------------------------------------------------------
+// Platform Basic Definition
+//---------------------------------------------------------------------------
+#undef ONI_PLATFORM
+#undef ONI_PLATFORM_STRING
+#define ONI_PLATFORM ONI_PLATFORM_LINUX_GENERIC
+#define ONI_PLATFORM_STRING "Linux-generic"
+
+#endif //_ONI_PLATFORM_LINUX_GENERIC_H_
+
index 602b4ba563ee76f8cbd3fb48d2cee257283a051d..cac860bb30963c2e32d04a1167e368499cb3a183 100644 (file)
@@ -27,6 +27,7 @@
 #define ONI_PLATFORM_LINUX_ARM 3
 #define ONI_PLATFORM_MACOSX 4
 #define ONI_PLATFORM_ANDROID_ARM 5
+#define ONI_PLATFORM_LINUX_GENERIC 6
 
 #if (defined _WIN32)
 #      ifndef RC_INVOKED
@@ -41,6 +42,8 @@
 #      include "Linux-x86/OniPlatformLinux-x86.h"
 #elif (__linux__ && __arm__)
 #      include "Linux-Arm/OniPlatformLinux-Arm.h"
+#elif (__linux__)
+#      include "Linux-generic/OniPlatformLinux-generic.h"
 #elif _ARC
 #      include "ARC/OniPlaformARC.h"
 #elif (__APPLE__)
index 031eb1b5210e6d63653fd0ca33b426dc58288f9f..de8b95a230a3462751179b16b8b29892e5a6cdf0 100644 (file)
@@ -57,7 +57,7 @@
 
        #define XN_SENSOR_USB_MISC_BUFFER_SIZE  0x1000
        #define XN_SENSOR_USB_MISC_BUFFERS              1
-#elif (XN_PLATFORM == XN_PLATFORM_LINUX_X86 || XN_PLATFORM == XN_PLATFORM_LINUX_ARM || XN_PLATFORM == XN_PLATFORM_MACOSX || XN_PLATFORM == XN_PLATFORM_ANDROID_ARM)
+#elif (XN_PLATFORM == XN_PLATFORM_LINUX_X86 || XN_PLATFORM == XN_PLATFORM_LINUX_ARM || XN_PLATFORM == XN_PLATFORM_MACOSX || XN_PLATFORM == XN_PLATFORM_ANDROID_ARM || XN_PLATFORM_LINUX_GENERIC)
        #define XN_SENSOR_USB_IMAGE_BUFFER_SIZE_MULTIPLIER_ISO                          32
        #define XN_SENSOR_USB_IMAGE_BUFFER_SIZE_MULTIPLIER_BULK                         40
        #define XN_SENSOR_USB_IMAGE_BUFFER_SIZE_MULTIPLIER_LOWBAND_ISO          16
index 74c6f2c1d9b27bffd7f2bf4fb6e8ae98e7971490..45a304809585bda1761b40536e0eaf6abcfa944a 100644 (file)
@@ -16,7 +16,7 @@ namespace xn
        const XnUInt32 ClientUSBInDataEndpoint::READ_THREAD_BUFFER_NUM_PACKETS_BULK = 120;
        const XnUInt32 ClientUSBInDataEndpoint::READ_THREAD_NUM_BUFFERS_BULK = 8;
        const XnUInt32 ClientUSBInDataEndpoint::READ_THREAD_TIMEOUT_BULK = 1000;
-#elif (XN_PLATFORM == XN_PLATFORM_LINUX_X86 || XN_PLATFORM == XN_PLATFORM_LINUX_ARM || XN_PLATFORM == XN_PLATFORM_MACOSX || XN_PLATFORM == XN_PLATFORM_ANDROID_ARM)
+#elif (XN_PLATFORM == XN_PLATFORM_LINUX_X86 || XN_PLATFORM == XN_PLATFORM_LINUX_ARM || XN_PLATFORM == XN_PLATFORM_MACOSX || XN_PLATFORM == XN_PLATFORM_ANDROID_ARM || XN_PLATFORM_LINUX_GENERIC )
        const XnUInt32 ClientUSBInDataEndpoint::READ_THREAD_BUFFER_NUM_PACKETS_ISO = 32;
        const XnUInt32 ClientUSBInDataEndpoint::READ_THREAD_NUM_BUFFERS_ISO = 16;
        const XnUInt32 ClientUSBInDataEndpoint::READ_THREAD_TIMEOUT_ISO = 100;
index caff56ed73d432731444b7bbb5fc3302d99ddf2b..e3a2436015a02daf59882f4ce197b72c297044a4 100644 (file)
@@ -43,7 +43,7 @@ XnStatus PS1200Device::Init(const XnChar* strConnString, XnTransportType transpo
        // On all platforms other than Windows, prefer BULK
        nRetVal = SetUsbAltInterface(0);
        XN_IS_STATUS_OK_LOG_ERROR("Switch to ISO", nRetVal);
-#elif (XN_PLATFORM == XN_PLATFORM_LINUX_X86 || XN_PLATFORM == XN_PLATFORM_LINUX_ARM || XN_PLATFORM == XN_PLATFORM_MACOSX || XN_PLATFORM == XN_PLATFORM_ANDROID_ARM)
+#elif (XN_PLATFORM == XN_PLATFORM_LINUX_X86 || XN_PLATFORM == XN_PLATFORM_LINUX_ARM || XN_PLATFORM == XN_PLATFORM_MACOSX || XN_PLATFORM == XN_PLATFORM_ANDROID_ARM || XN_PLATFORM_LINUX_GENERIC)
        // On all platforms other than Windows, prefer BULK
        nRetVal = SetUsbAltInterface(1);
        XN_IS_STATUS_OK_LOG_ERROR("Switch to BULK", nRetVal);
index 2a6a9fd6edb1f357529ac5cbf70e00b6c20722b7..684e145d946ceb1c22d1460f7c8ae89884e327df 100644 (file)
@@ -89,7 +89,8 @@ using namespace glh;
 #if (ONI_PLATFORM == ONI_PLATFORM_WIN32)
        #include <conio.h>
        #include <direct.h>     
-#elif (ONI_PLATFORM == ONI_PLATFORM_LINUX_X86 || ONI_PLATFORM == ONI_PLATFORM_LINUX_ARM || ONI_PLATFORM == ONI_PLATFORM_MACOSX)
+#elif (ONI_PLATFORM == ONI_PLATFORM_LINUX_X86 || ONI_PLATFORM == ONI_PLATFORM_LINUX_ARM \
+    || ONI_PLATFORM == ONI_PLATFORM_MACOSX ||ONI_PLATFORM == ONI_PLATFORM_LINUX_GENERIC)
        #define _getch() getchar()
 #endif
 
index de4a17def09a3eaf38d8eeb11b86a8a863aabe2c..c29d9bd90b2833558bc90bae0dffeb921199adab 100644 (file)
@@ -21,7 +21,7 @@ else ifneq (,$(findstring armv6l,$(MACHINE)))
 else ifneq (,$(findstring arm,$(MACHINE)))
        HOST_PLATFORM = Arm
 else
-       DUMMY:=$(error Can't determine host platform)
+       HOST_PLATFORM = generic
 endif
 
 # now check if this is a cross-compilation or not
diff --git a/ThirdParty/PSCommon/BuildSystem/Platform.generic b/ThirdParty/PSCommon/BuildSystem/Platform.generic
new file mode 100644 (file)
index 0000000..02ea5e0
--- /dev/null
@@ -0,0 +1,4 @@
+# some defaults
+export GLUT_SUPPORTED=1
+FLAGS += -O3 -fno-strict-aliasing
+
diff --git a/ThirdParty/PSCommon/XnLib/Include/Linux-generic/XnPlatformLinux-generic.h b/ThirdParty/PSCommon/XnLib/Include/Linux-generic/XnPlatformLinux-generic.h
new file mode 100644 (file)
index 0000000..359deb8
--- /dev/null
@@ -0,0 +1,36 @@
+/*****************************************************************************
+*                                                                            *
+*  PrimeSense PSCommon Library                                               *
+*  Copyright (C) 2012 PrimeSense Ltd.                                        *
+*                                                                            *
+*  This file is part of PSCommon.                                            *
+*                                                                            *
+*  Licensed under the Apache License, Version 2.0 (the "License");           *
+*  you may not use this file except in compliance with the License.          *
+*  You may obtain a copy of the License at                                   *
+*                                                                            *
+*      http://www.apache.org/licenses/LICENSE-2.0                            *
+*                                                                            *
+*  Unless required by applicable law or agreed to in writing, software       *
+*  distributed under the License is distributed on an "AS IS" BASIS,         *
+*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  *
+*  See the License for the specific language governing permissions and       *
+*  limitations under the License.                                            *
+*                                                                            *
+*****************************************************************************/
+#ifndef _XN_PLATFORM_LINUX_GENERIC_H_
+#define _XN_PLATFORM_LINUX_GENERIC_H_
+
+// Start with Linux-x86, and override what's different
+#include "../Linux-x86/XnPlatformLinux-x86.h"
+
+//---------------------------------------------------------------------------
+// Platform Basic Definition
+//---------------------------------------------------------------------------
+#undef XN_PLATFORM
+#undef XN_PLATFORM_STRING
+#define XN_PLATFORM XN_PLATFORM_LINUX_GENERIC
+#define XN_PLATFORM_STRING "Linux-generic"
+
+#endif //_XN_PLATFORM_LINUX_GENERIC_H_
+
index 3e41060623737780372dcb1dd240889709fe3cf8..09cce1f69d3893cdb6b5714590f285704a94d7aa 100644 (file)
@@ -43,7 +43,7 @@
 //---------------------------------------------------------------------------
 #if (XN_PLATFORM == XN_PLATFORM_WIN32)
        #include "Win32/XnOSWin32.h"
-#elif (XN_PLATFORM == XN_PLATFORM_LINUX_X86 || XN_PLATFORM == XN_PLATFORM_LINUX_ARM || XN_PLATFORM == XN_PLATFORM_ANDROID_ARM)
+#elif (XN_PLATFORM == XN_PLATFORM_LINUX_X86 || XN_PLATFORM == XN_PLATFORM_LINUX_ARM || XN_PLATFORM == XN_PLATFORM_ANDROID_ARM || XN_PLATFORM == XN_PLATFORM_LINUX_GENERIC)
        #include "Linux-x86/XnOSLinux-x86.h"
 #elif (XN_PLATFORM == XN_PLATFORM_MACOSX)
         #include "MacOSX/XnOSMacOSX.h"
index 07e8192b4d6c6b8df4d6a2783dfd550a7010f96f..0b0f1da8a5674364e815a84f667046a599545bea 100644 (file)
@@ -31,6 +31,7 @@
 #define XN_PLATFORM_LINUX_ARM 7
 #define XN_PLATFORM_MACOSX 8
 #define XN_PLATFORM_ANDROID_ARM 9
+#define XN_PLATFORM_LINUX_GENERIC 10
 
 #define XN_PLATFORM_IS_LITTLE_ENDIAN 1
 #define XN_PLATFORM_IS_BIG_ENDIAN    2
@@ -53,6 +54,8 @@
 #include "Linux-x86/XnPlatformLinux-x86.h"
 #elif (__linux__ && __arm__)
 #include "Linux-Arm/XnPlatformLinux-Arm.h"
+#elif (__linux__) 
+#include "Linux-generic/XnPlatformLinux-generic.h"
 #elif _ARC
 #include "ARC/XnPlaformARC.h"
 #elif (__APPLE__)
index 94c729b89d2e3cd1cdde9a086d122cc901343d8f..acaf66746ec609e740dafa15914541c985af3978 100644 (file)
@@ -47,7 +47,7 @@
        #define USB_DT_DEVICE_SIZE 0
        #define USB_DT_DEVICE 0
 
-#elif (XN_PLATFORM == XN_PLATFORM_LINUX_X86 || XN_PLATFORM == XN_PLATFORM_LINUX_ARM)
+#elif (XN_PLATFORM == XN_PLATFORM_LINUX_X86 || XN_PLATFORM == XN_PLATFORM_LINUX_ARM || XN_PLATFORM == XN_PLATFORM_LINUX_GENERIC)
        #include <linux/usb/ch9.h>
        typedef struct usb_endpoint_descriptor XnUSBEndpointDescriptor;
        typedef struct usb_interface_descriptor XnUSBInterfaceDescriptor;
index 3db80482a0420bd78fc49bc3bc948581daf0019f..49d1920e2819632264f9e672916c795e645f5220 100644 (file)
@@ -36,7 +36,7 @@
 #include <XnOSCpp.h>
 #include <XnList.h>
 
-#if (XN_PLATFORM == XN_PLATFORM_LINUX_X86 || XN_PLATFORM == XN_PLATFORM_LINUX_ARM)
+#if (XN_PLATFORM == XN_PLATFORM_LINUX_X86 || XN_PLATFORM == XN_PLATFORM_LINUX_ARM || XN_PLATFORM == XN_PLATFORM_LINUX_GENERIC)
 #include <libudev.h>
 #define XN_USE_UDEV
 #endif