Updated to use rspec 2

Signed-off-by: Alex Weiss <algrs@cacography.net>
Updated FFI interface to match new interface. All tests run, some tests
fail.

Signed-off-by: Alex Weiss <algrs@cacography.net>
Updated Freenect singleton to query the new FrameMode system.

Signed-off-by: Alex Weiss <algrs@cacography.net>
Minor code cleanup, removing commented out code.

Signed-off-by: Alex Weiss <algrs@cacography.net>
Updated tests

Signed-off-by: Alex Weiss <algrs@cacography.net>
wappers/ruby: Updated to use new frame mode code.

Signed-off-by: Alex Weiss <algrs@cacography.net>
wrappers/ruby: Update examples

Updated examples & got the last few tests passing

Signed-off-by: Alex Weiss <algrs@cacography.net>
Fixed up ConsoleTest project for new API changes. Also made small tweaks in different places for new API and for Windows buildage. KinectDemo now runs on windows. Still get very poor FPS, but it does run. Maybe win32 driver is to blame? Not sure. Will investigate.
Signed-off-by: Aditya Gaddam <adityagaddam@gmail.com> (LostInCake)
libusbemu: fix missing int types when compiling under mingw

Fix errors like:

platform/windows/libusb10emu/libusb-1.0/libusb.h:69: error: ‘uint8_t’ has not been declared
platform/windows/libusb10emu/libusb-1.0/libusb.h:69: error: ‘uint8_t’ has not been declared
platform/windows/libusb10emu/libusb-1.0/libusb.h:69: error: ‘uint16_t’ has not been declared
platform/windows/libusb10emu/libusb-1.0/libusb.h:69: error: ‘uint16_t’ has not been declared
...

Unfortunately it looks like not all Visual Studio versions provide
stdint.h, so hack around them.

Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
libusbemu: fix "expected unqualified-id before numeric constant" error

Undefine the error numeric constants before redefining them, some
systems define those in errno.h which can be brought in by some other
header.

platform/windows/libusb10emu/libusb-1.0/libusbemu.cpp: In function ‘int ReapTransfer(transfer_wrapper*, unsigned int, libusbemu::QuickList<transfer_wrapper>*)’:
platform/windows/libusb10emu/libusb-1.0/libusbemu.cpp:698: error: expected unqualified-id before numeric constant
platform/windows/libusb10emu/libusb-1.0/libusbemu.cpp:704: error: ‘ETIMEOUT’ was not declared in this scope
platform/windows/libusb10emu/libusb-1.0/libusbemu.cpp: At global scope:
platform/windows/libusb10emu/libusb-1.0/libusbemu.cpp:745: error: expected unqualified-id before ‘return’
platform/windows/libusb10emu/libusb-1.0/libusbemu.cpp:746: error: expected declaration before ‘}’ token

Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
libusbemu: make libusb functions callable with a NULL context

Implement a default_context mechanism similar to the one in libusb-1.0
itself, so that we can still pass a NULL context to libusb functions.

NOTE: we still assume libusb_init() needs to be called before any other
libusb_* function, otherwise the code will crash happily.

Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
libusbemu: add a stub implementation for libusb_set_debug()

Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
libusbemu: add a stub implementation for libusb_set_configuration()

Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
libusbemu: implement libusb_open_device_with_vid_pid()

Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
libusbemu: implement libusb_bulk_transfer()

Signed-off-by: Drew Fisher <drew.m.fisher@gmail.com>
Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
Adjust freenect_camera_to_world for 1280x1024 -> 640x480 conversion.

Otherwise all the values are off by a factor of 2 in the x direction and
2.1333333 in the y direction.

Signed-off-by: Drew Fisher <drew.m.fisher@gmail.com>
Actually, the camera_to_world scale factor should just be 2.

The 640x480 image is actually the result of cropping the 1280x1024 image
down to 1280x960 and then scaling by .5, so aspect ratio is preserved,
and we should scale x and y by exactly 2.

Thanks to Kyle McDonald for paying attention to detail and pointing this out.

Signed-off-by: Drew Fisher <drew.m.fisher@gmail.com>
libusbemu: implement libusb_set_debug and libusb_set_configuration

This also fixes the build in VS2010, which would apparently stop compiling when
it saw the stub function #warning.

Signed-off-by: Drew Fisher <drew.m.fisher@gmail.com>
Add string descriptor retrieval to libusbemu.

This is a prerequisite for adding open-by-serial-number functionality.

Signed-off-by: Drew Fisher <drew.m.fisher@gmail.com>
Drop the consts from function return types; they don't do anything in C anyway.

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