EDIT 2: Working code:
This branch already contains a subset of the changes I was making, and actually runs. It's unstable, but at least you can get a depth and color image.
https://github.com/zarvox/libfreenect/tree/k4w-wip
The instability is due to isochronous transfers in libusb on Darwin. The patch that comes with libfreenect just makes libusb less unstable.
Kinect for Windows isn't supported in the main tree. Have you tried this patch? https://github.com/renewagner/libfreenect/tree/k4w-wip
Edit: This repository is too old for the firmware version that I (we) have.
To detect the camera, you only need to change usb_libusb10.c in three places, where it checks desc.idProduct == PID_NUI_CAMERA
. This must now be
(desc.idProduct == PID_NUI_CAMERA || desc.idProduct == PID_NUI_CAMERA_K4W);
And add:
#define PID_NUI_CAMERA_K4W 0x02bf
Also remember that the Kinect for Windows does not have a motor. You may need to modify source that assumes it exists.
This is still insufficient, however. The USB commands have also changed.
In cameras.c,
static int freenect_fetch_zero_plane_info(freenect_device *dev)
{
freenect_context *ctx = dev->parent;
char reply[0x200];
uint16_t cmd[5] = {0}; // Offset is the only field in this command, and it's 0
// Different reply based on hardware
const int expected_reply_length = dev->kinect_for_windows ? 334 : 322;
int res;
res = send_cmd(dev, 0x04, cmd, 10, reply, expected_reply_length); //OPCODE_GET_FIXED_PARAMS = 4,
if (res != expected_reply_length) {
FN_ERROR("freenect_fetch_zero_plane_info: send_cmd read %d bytes (expected %d)\n", res, expected_reply_length);
return -1;
}
Note that I added a field to freenect_device to store if it's a Kinect for Windows.
It's still not streaming data, but this is as far as I've gotten.