Add support for opening some subset of the three Kinect devices (motor, camera, audio).

This allows libfreenect to be used alongside other Kinect drivers more easily,
as well as allows different processes to use libfreenect for different
subdevices.  Examples of things you can do now that you couldn't do before:

1) use libfreenect's audio and motor support alongside OpenNI's camera support
2) use libfreenect's video support in one process while processing audio with
another process

Signed-off-by: Drew Fisher <drew.m.fisher@gmail.com> (zarvox)
Server source separated into libraries, this makes the code easier to read.

Signed-off-by: Juan Carlos del Valle <jc.ekinox@gmail.com> (imekinox)
Merge from https://github.com/corrado72/openkinect "unstable"
Solved some conflicts

Signed-off-by: Juan Carlos del Valle <jc.ekinox@gmail.com> (imekinox)
as3-server.c: drop some lines that look like a mismerge and appear to just waste CPU

Signed-off-by: Drew Fisher <drew.m.fisher@gmail.com>
examples/CMakeLists.txt: Trivial whitespace changes.

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

Signed-off-by: Drew Fisher <drew.m.fisher@gmail.com>
examples/hiview.c: Actually request all the devices used.

If we don't, we get a segfault as soon as we try to set the LED.
I should learn to do QA before releases.

Signed-off-by: Drew Fisher <drew.m.fisher@gmail.com>
src/usb_libusb10.c: slightly smarter isoc error handling.

Unless we get LIBUSB_TRANSFER_NO_DEVICE or LIBUSB_TRANSFER_CANCELLED, we really
should resubmit unsucessful transfers, or eventually all of them will error and
we won't stream any transfers anymore.  We should also correctly track the
number of dead transfers if we fail to submit a transfer.

Fixes #227.

Signed-off-by: Drew Fisher <drew.m.fisher@gmail.com>
examples: use exit() instead of pthread_exit() from main thread.

OSX seems to spawn an extra thread for GLUT. As a result, we can't just call
pthread_exit() because there's still one thread left after we kill all the
threads we directly spawned, so the examples never stop running.

Signed-off-by: Drew Fisher <drew.m.fisher@gmail.com>
Add depth to RGB registration via FREENECT_DEPTH_REGISTERED and raw-to-mm via FREENECT_DEPTH_MM

Also add a simple demo showing overlaid depth and RGB video is included in regview.c

Some advanced users may want to write GPU shaders to implement the transforms,
or want to not apply the transform to the entire frame to save CPU cycles.  For them,
we have added in freenect-registration.h a way to access the internal parameters and shift tables
needed to perform the transform.  Since this includes heap variables, such users should free
the tables when no longer in use with freenect_destroy_registration().

Signed-off-by: Drew Fisher <drew.m.fisher@gmail.com>
Signed-off-by: Kyle McDonald <kyle@kylemcdonald.net>
Signed-off-by: Florian Echtler <floe@butterbrot.org>
libfreenect: stricter check for send_cmd() in freenect_fetch_zero_plane_info()

Check for the expected number of bytes, just like done in the other
"fetch" calls.

Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
libfreenect: Use the actual dev_reg_info field names in unprinted debug output

Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
c_sync: Add support for registered depth to c_sync wrapper

Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
c_sync: Add an example program for registered depth based on c_sync

Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
HACKING: fix indentation; add a missing '=' to one of the titles

Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
HACKING: document how to make debug builds

Signed-off-by: Drew Fisher <drew.m.fisher@gmail.com>
not necessary to init reg tables for 11-bit unpacked depth

Signed-off-by: Florian Echtler <floe@butterbrot.org>
no need to wipe the buffer as every pixel will be written exactly once

Signed-off-by: Florian Echtler <floe@butterbrot.org>
add helper function to convert camera coords -> metric world coords

Signed-off-by: Florian Echtler <floe@butterbrot.org>
wrappers/python: Use explicit include path

Ask numpy for the correct include path for its headers, instead of just
assuming they are available in the default include path.

Signed-off-by: Hector Martin <hector@marcansoft.com>