Added a feature to use accelerometer data to rotate camera view in software
when the camera is physically rotated such that the view on the screen is
always upright even when the camera is upside down. Enabling it, and
disabling it is done with the "r" key. Not on by default. I enabled several
things that were disabled in the last patch, but only when rotation
mode is toggled on.

I uploaded a youtube video of this feature
http://www.youtube.com/watch?v=JSjV1Y1eC8M

Signed-off-by: Daniel Patrick Johnson <teknotus@gmail.com> (teknotus)
Make it compile on Cython 0.15.1
Add support for DEPTH_10BIT, DEPTH_REGISTERED and DEPTH_MM
Don't initialise depth and video on runloop if device is passed in

Signed-off-by: Alejandro Dubrovsky <alito@organicrobot.com>
python wrapper: Explicitly cast freenect_device_flags to int

Signed-off-by: Drew Fisher <drew.m.fisher@gmail.com>
Bump version to 0.1.2

Signed-off-by: Drew Fisher <drew.m.fisher@gmail.com>
cameras.c: memcpy structs into properly aligned buffers before toggling endianness.

The new registration structs are not aligned to 4-byte boundaries in the
buffers that we get back from the Kinect.  This might have been causing
breakage on ARM, where nonaligned access is prohibited.

Signed-off-by: Drew Fisher <drew.m.fisher@gmail.com>
C++ wrapper: ignore LIBUSB_ERROR_INTERRUPTED from freenect_process_events()

I kept getting errors about "Cannot process freenect events" when trying to
start cppview although glview worked perfectly. It turns out libusb kept
returning error "interrupted" when starting up, this patch ignores all
such errors from libusb.
I do not know libusb well enough to be able to tell whether this workaround
will cause any problems in special cases.
cppview seems to be working, but crashes when pressing ESC or closing the
window with the error "pure virtual method called". I'm still investigating
that error but I do not think it is related to this patch.

Signed-off-by: Joakim Gebart <joakim.gebart@jge.se>
loader.c: memcpy structs into properly aligned buffers before accessing contents

Signed-off-by: Drew Fisher <drew.m.fisher@gmail.com>
Build on big-endian systems again.

On big endian, fn_le32() is actually a function, not an empty preprocessor
macro, so we can't take the address of its return value when doing the C
equivalent of reinterpret_cast.

Signed-off-by: Drew Fisher <drew.m.fisher@gmail.com>
Hides unexported symbols

Mark all non static internal functions with visibility hidden on
ELF platform. Declare some internal symbols that were meant to have
static linkage as such. On win32 the hidden visibility is no op since
it is the default behavior.

Signed-off-by: Nicolas Bourdaud <nicolas.bourdaud@gmail.com>
Remove libusb.h include from libfreenect.h

typedef freenect_usb_context as void, as it is already for win32. That way,
we drop the need to have a properly installed developpement files of libusb
when we don't use it directly. This fix also partly the problem of
discrepancy between the include paths of libusb on freebsd and libusb-1.0

Signed-off-by: Nicolas Bourdaud <nicolas.bourdaud@gmail.com>
Fix cmake libusb search and fix libusb include

Adjust cmake test for libusb library so that the compatible libusb for
freebsd can be found.  Since freebsd's libusb header are located in a
different place from libusb-1.0, the includes in the source code must be
adjusted using #include <libusb.h>.  Actually those new include statements
are those that libusb-1.0 really expects to be used (see libusb-1.0.pc
cflags to verify this). With this commit, libfreenect is buildable on
freebsd.

Signed-off-by: Nicolas Bourdaud <nicolas.bourdaud@gmail.com>
Fix build on Windows after changing includes from <libusb-1.0/libusb.h> to <libusb.h>

Also obtain struct timeval from the winsock headers.

Signed-off-by: Drew Fisher <drew.m.fisher@gmail.com>
Use unions to perform safe type-punning.

Signed-off-by: Drew Fisher <drew.m.fisher@gmail.com>
Added error reporting for failed subdevice initialization.

The error was encountered on Win32 when *only* the Camera subdevice
had a proper driver installed. This caused a silent failure.

Signed-off-by: JD Cole <jd@jdc.me>
Make fakenect work on Windows.

We needed platform-specific functions for mkdir(), timers, and we need to open
files in binary mode for compatibility.

Signed-off-by: Drew Fisher <drew.m.fisher@gmail.com>
examples: call freenect_shutdown() on exit

This is mostly useful when using tools like valgrind, which may report
possibly lost memory even if the operating systems is going to get it
back anyway on the actual process exit.

Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
freenect: avoid leaking the context when fnusb_init() fails

Maybe this is more a theoretical issue than an actual one, I am not sure
in which case fnusb_init() —and hence libusb_init()— is supposed to
fail, but let's handle that once I noticed it.

Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
freenect: initialize the 'transferred' variable used in bulk transfers

This is in order to make the printouts in the error path of the callers
of fnusb_bulk() show a saner value when libusb does not touch the
variable (i.e. when a transfer fails).

Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
Search for threading lib on any platform in c_sync

Threading library is necessary for all platform when compiling c_sync
wrapper. Moving the search fix the missing library on Linux.

Signed-off-by: Nicolas Bourdaud <nicolas.bourdaud@gmail.com>
Add missing math lib to fakenect

Fix the missing dependency of fakenect on the math lib and remove the
unecessary one of record. On the way centralizes definition of MATH_LIB
since several wrappers and examples uses it.

Signed-off-by: Nicolas Bourdaud <nicolas.bourdaud@gmail.com>