Skip to content

Commit cf24c40

Browse files
committed
Merge branch 'unstable' of git://github.com/alito/libfreenect
Reviewed-by: Benn Snyder <[email protected]> Conflicts: wrappers/python/freenect.pyx
2 parents 8c59ba2 + 2c8f462 commit cf24c40

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

wrappers/python/freenect.pyx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ cpdef init():
282282
# to both but haven't wrapped the python API for selecting subdevices yet.
283283
# Also, we don't support audio in the python wrapper yet, so no sense claiming
284284
# the device.
285-
freenect_select_subdevices(ctx, int(FREENECT_DEVICE_MOTOR | FREENECT_DEVICE_CAMERA))
285+
freenect_select_subdevices(ctx, <freenect_device_flags> (FREENECT_DEVICE_MOTOR | FREENECT_DEVICE_CAMERA))
286286
cdef CtxPtr ctx_out
287287
ctx_out = CtxPtr()
288288
ctx_out._ptr = ctx
@@ -373,16 +373,19 @@ def runloop(depth=None, video=None, body=None, dev=None):
373373
if not mdev:
374374
error_open_device()
375375
return
376+
if depth is not None:
377+
freenect_set_depth_mode(mdev._ptr, freenect_find_depth_mode(FREENECT_RESOLUTION_MEDIUM, FREENECT_DEPTH_11BIT))
378+
if video is not None:
379+
freenect_set_video_mode(mdev._ptr, freenect_find_video_mode(FREENECT_RESOLUTION_MEDIUM, FREENECT_VIDEO_RGB))
380+
376381
else:
377382
mdev = dev
378383
devp = mdev._ptr
379384
ctxp = mdev.ctx._ptr
380385
if depth is not None:
381-
freenect_set_depth_mode(devp, freenect_find_depth_mode(FREENECT_RESOLUTION_MEDIUM, FREENECT_DEPTH_11BIT))
382386
freenect_start_depth(devp)
383387
freenect_set_depth_callback(devp, depth_cb)
384388
if video is not None:
385-
freenect_set_video_mode(devp, freenect_find_video_mode(FREENECT_RESOLUTION_MEDIUM, FREENECT_VIDEO_RGB))
386389
freenect_start_video(devp)
387390
freenect_set_video_callback(devp, video_cb)
388391
try:

0 commit comments

Comments
 (0)