|
31 | 31 | #include <libusb.h> |
32 | 32 | #include "freenect_internal.h" |
33 | 33 | #include "loader.h" |
34 | | -#include "keep_alive.h" |
35 | 34 |
|
36 | 35 | #ifdef _MSC_VER |
37 | 36 | # define sleep(x) Sleep((x)*1000) |
@@ -168,8 +167,6 @@ FN_INTERNAL int fnusb_is_pid_k4w_audio(int pid) |
168 | 167 | return (pid == PID_K4W_AUDIO || pid == PID_K4W_AUDIO_ALT_1 || pid == PID_K4W_AUDIO_ALT_2); |
169 | 168 | } |
170 | 169 |
|
171 | | -// fnusb_find_connected_audio_device uses new libusb features. we use guards to make sure its backwards compatible with older versions of libusb |
172 | | -#if defined(LIBUSB_API_VERSION) && (LIBUSB_API_VERSION >= 0x01000102) |
173 | 170 | FN_INTERNAL libusb_device * fnusb_find_connected_audio_device(libusb_device * camera, libusb_device ** deviceList, int cnt){ |
174 | 171 |
|
175 | 172 | int cameraBusNo = libusb_get_bus_number(camera); |
@@ -203,7 +200,6 @@ FN_INTERNAL libusb_device * fnusb_find_connected_audio_device(libusb_device * ca |
203 | 200 |
|
204 | 201 | return NULL; |
205 | 202 | } |
206 | | -#endif |
207 | 203 |
|
208 | 204 | FN_INTERNAL int fnusb_open_subdevices(freenect_device *dev, int index) |
209 | 205 | { |
@@ -266,10 +262,7 @@ FN_INTERNAL int fnusb_open_subdevices(freenect_device *dev, int index) |
266 | 262 | dev->device_does_motor_control_with_audio = 1; |
267 | 263 |
|
268 | 264 | // set the LED for non 1414 devices to keep the camera alive for some systems which get freezes |
269 | | - // this code replaces keep_alive.c, which didn't know which hub the connected audio device was on |
270 | | - // fnusb_find_connected_audio_device needs libusb 1.0.18 or later |
271 | 265 |
|
272 | | -#if defined(LIBUSB_API_VERSION) && (LIBUSB_API_VERSION >= 0x01000102) |
273 | 266 | libusb_device * audioDevice = fnusb_find_connected_audio_device(devs[i], devs, cnt); |
274 | 267 | if (audioDevice != NULL) |
275 | 268 | { |
@@ -304,11 +297,6 @@ FN_INTERNAL int fnusb_open_subdevices(freenect_device *dev, int index) |
304 | 297 | } |
305 | 298 | } |
306 | 299 | } |
307 | | -#else |
308 | | - // Legacy: for older versions of libusb we use this approach which doesn't do well when multiple K4W or 1473 devices are attached to the system. |
309 | | - // also set the LED ON to keep the camera alive for some systems which get freezes |
310 | | - freenect_extra_keep_alive((desc.idProduct == PID_K4W_CAMERA) ? PID_K4W_AUDIO : PID_NUI_AUDIO); |
311 | | -#endif |
312 | 300 |
|
313 | 301 | #ifdef BUILD_AUDIO |
314 | 302 | // for newer devices we need to enable the audio device for motor control |
|
0 commit comments