wrappers/python: Support asynchronous usage without the full runloop

Signed-off-by: Hector Martin <hector@marcansoft.com>
Add a non-blocking freenect_process_events_timeout().

This should make it easier to integrate libfreenect into some other event loop.

Fixes #43.

Signed-off-by: Drew Fisher <drew.m.fisher@gmail.com>
wrappers/python: fix numpy include path for cmake build too

Signed-off-by: Hector Martin <hector@marcansoft.com>
wrappers/python: fix sync wrappers

Do not do Pythony stuff (e.g. object conversion) with the GIL released.
Use the correct type for timestamp.

Signed-off-by: Hector Martin <hector@marcansoft.com>
Add function to query what subdevices the library supports.

This is essential for making wrappers that can work properly with
both versions of libfreenect with audio support and versions of
libfreenect without audio support.

Signed-off-by: Drew Fisher <drew.m.fisher@gmail.com>
opencv wrapper: Use the CMake OpenCV finder instead of naming libraries explicitly.

Signed-off-by: Drew Fisher <drew.m.fisher@gmail.com>
fakenect: add fakenect helper script

Add a shell script to call libfreenect applications with fakenect.

Simplifies the use of fakenect by not requiring users to know or specify
environment variables and the like.

Usage:
fakenect <database> <application> <args>

Signed-off-by: Evan Shelhamer <shelhamer@imaginarynumber.net>
Signed-off-by: Drew Fisher <drew.m.fisher@gmail.com>
Fix the audios.bin install path.

Apparently this has been wrong for months.  Oops.  Presumably, people figured
out where else they could put the firmware to have it get found, but it's good
to fix these things.

Signed-off-by: Drew Fisher <drew.m.fisher@gmail.com>
Fix the java wrapper

Signed-off-by: Erwan Daubert <erwan.daubert@gmail.com>
Fix the java wrapper

Signed-off-by: Erwan Daubert <erwan.daubert@gmail.com>
Fix the java wrapper

Signed-off-by: Erwan Daubert <erwan.daubert@gmail.com>
Switch entirely to using FrameModes internally

Signed-off-by: Robert Xiao <brx@cs.cmu.edu>
wrappers/cpp/libfreenect.hpp: Trivial changes to allow the resolution parameters to be set.

Signed-off-by: Gabor Szarka <szarkagabor@coralworks.hu>
usb_libusb10.c: Keep track of dead transfers more correctly.

We failed to catch if the resubmission of a transfer failed in the transfer's
isochronous callback.  This is bad because this is a very likely failure mode
if we accidentally unplug the Kinect - the last set of transfers complete
successfully, but the device is no longer there when we resubmit them.

It's okay for us to not know which particular transfers are dead, since
libusb_cancel_transfer() will handle transfers that don't exist by returning
LIBUSB_ERROR_NOT_FOUND if the transfer isn't pending.

This is related to #229, but I'm not sure if this is sufficient to fix it.
libusb on OSX doesn't always return what I expect it to.

Signed-off-by: Drew Fisher <drew.m.fisher@gmail.com>
Behave sanely when the Kinect is unplugged.

libusb_handle_events is thread-safe, but not reentrant.  Which means that we
can't call fnusb_stop_iso which calls libusb_handle_events from inside the
isochronous callback function.

Instead, we add a member to fnusb_dev that tracks if the device is permanently
dead, and set it to true when we get a LIBUSB_TRANSFER_NO_DEVICE (or on resubmission,
LIBUSB_ERROR_NO_DEVICE).

Then, in freenect_process_events, after calling libusb_handle_events
internally, we check to see if any of the devices in the context have this flag
set.  If they do, then we should return some nonzero error value, which is
currently -1.

In the future, we intend to provide callbacks so that clients can receive
explicit notifications when a device has disappeared, so the code can robustly
handle that situation.  Future work.

Fixes #229 (I think)

Signed-off-by: Drew Fisher <drew.m.fisher@gmail.com>
libusbemu: include winsock.h

MSVC needs struct timeval from winsock.h to support freenect_process_events_timeout.

Signed-off-by: Drew Fisher <drew.m.fisher@gmail.com>
Export maximum and no-value values for the depth modes.

We get questions about the maximum range of the Kinect; hopefully this will
make it slightly clearer.

Signed-off-by: Drew Fisher <drew.m.fisher@gmail.com>
Fix some documentation issues.

Signed-off-by: Drew Fisher <drew.m.fisher@gmail.com>
libusbemu/libusb.h: include <sys/time.h>

MinGW also needs struct timeval.

Signed-off-by: Drew Fisher <drew.m.fisher@gmail.com>
python wrapper: Explicitly cast freenect_device_flags to int

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