Skip to content
Browse files

wrappers/python: fix sync wrappers

Do not do Pythony stuff (e.g. object conversion) with the GIL released.
Use the correct type for timestamp.

Signed-off-by: Hector Martin <hector@marcansoft.com>
  • Loading branch information...
1 parent 4e1be4e commit e04ba7f9be4699c0a46ee4ed0eed9154c71b5147 @marcan marcan committed Nov 10, 2011
Showing with 147 additions and 117 deletions.
  1. +139 −113 wrappers/python/freenect.c
  2. +8 −4 wrappers/python/freenect.pyx
View
252 wrappers/python/freenect.c
@@ -1,4 +1,4 @@
-/* Generated by Cython 0.14.1 on Mon Nov 7 21:08:07 2011 */
+/* Generated by Cython 0.14.1 on Thu Nov 10 13:32:00 2011 */
#define PY_SSIZE_T_CLEAN
#include "Python.h"
@@ -4398,9 +4398,11 @@ static PyObject *__pyx_pf_8freenect_26sync_get_depth(PyObject *__pyx_self, PyObj
PyObject *__pyx_v_index = 0;
PyObject *__pyx_v_format = 0;
void *__pyx_v_data;
- unsigned int __pyx_v_timestamp;
+ uint32_t __pyx_v_timestamp;
npy_intp __pyx_v_dims[2];
int __pyx_v_out;
+ int __pyx_v__index;
+ freenect_depth_format __pyx_v__format;
PyObject *__pyx_r = NULL;
int __pyx_t_1;
freenect_depth_format __pyx_t_2;
@@ -4463,8 +4465,28 @@ static PyObject *__pyx_pf_8freenect_26sync_get_depth(PyObject *__pyx_self, PyObj
/* "freenect.pyx":472
* cdef npc.npy_intp dims[2]
* cdef int out
+ * cdef int _index = index # <<<<<<<<<<<<<<
+ * cdef freenect_depth_format _format = format
+ * with nogil:
+ */
+ __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_index); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_v__index = __pyx_t_1;
+
+ /* "freenect.pyx":473
+ * cdef int out
+ * cdef int _index = index
+ * cdef freenect_depth_format _format = format # <<<<<<<<<<<<<<
+ * with nogil:
+ * out = freenect_sync_get_depth(&data, &timestamp, _index, _format)
+ */
+ __pyx_t_2 = ((freenect_depth_format)PyInt_AsLong(__pyx_v_format)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_v__format = __pyx_t_2;
+
+ /* "freenect.pyx":474
+ * cdef int _index = index
+ * cdef freenect_depth_format _format = format
* with nogil: # <<<<<<<<<<<<<<
- * out = freenect_sync_get_depth(&data, &timestamp, index, format)
+ * out = freenect_sync_get_depth(&data, &timestamp, _index, _format)
* if out:
*/
{
@@ -4474,61 +4496,52 @@ static PyObject *__pyx_pf_8freenect_26sync_get_depth(PyObject *__pyx_self, PyObj
Py_UNBLOCK_THREADS
/*try:*/ {
- /* "freenect.pyx":473
- * cdef int out
+ /* "freenect.pyx":475
+ * cdef freenect_depth_format _format = format
* with nogil:
- * out = freenect_sync_get_depth(&data, &timestamp, index, format) # <<<<<<<<<<<<<<
+ * out = freenect_sync_get_depth(&data, &timestamp, _index, _format) # <<<<<<<<<<<<<<
* if out:
* error_open_device()
*/
- __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_index); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L7;}
- __pyx_t_2 = ((freenect_depth_format)PyInt_AsLong(__pyx_v_format)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L7;}
- __pyx_v_out = freenect_sync_get_depth((&__pyx_v_data), (&__pyx_v_timestamp), __pyx_t_1, __pyx_t_2);
+ __pyx_v_out = freenect_sync_get_depth((&__pyx_v_data), (&__pyx_v_timestamp), __pyx_v__index, __pyx_v__format);
}
- /* "freenect.pyx":472
- * cdef npc.npy_intp dims[2]
- * cdef int out
+ /* "freenect.pyx":474
+ * cdef int _index = index
+ * cdef freenect_depth_format _format = format
* with nogil: # <<<<<<<<<<<<<<
- * out = freenect_sync_get_depth(&data, &timestamp, index, format)
+ * out = freenect_sync_get_depth(&data, &timestamp, _index, _format)
* if out:
*/
/*finally:*/ {
- int __pyx_why;
- __pyx_why = 0; goto __pyx_L8;
- __pyx_L7: __pyx_why = 4; goto __pyx_L8;
- __pyx_L8:;
Py_BLOCK_THREADS
- switch (__pyx_why) {
- case 4: goto __pyx_L1_error;
- }
}
}
- /* "freenect.pyx":474
+ /* "freenect.pyx":476
* with nogil:
- * out = freenect_sync_get_depth(&data, &timestamp, index, format)
+ * out = freenect_sync_get_depth(&data, &timestamp, _index, _format)
* if out: # <<<<<<<<<<<<<<
* error_open_device()
* return
*/
if (__pyx_v_out) {
- /* "freenect.pyx":475
- * out = freenect_sync_get_depth(&data, &timestamp, index, format)
+ /* "freenect.pyx":477
+ * out = freenect_sync_get_depth(&data, &timestamp, _index, _format)
* if out:
* error_open_device() # <<<<<<<<<<<<<<
* return
* if format == DEPTH_11BIT:
*/
- __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__error_open_device); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__error_open_device); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "freenect.pyx":476
+ /* "freenect.pyx":478
* if out:
* error_open_device()
* return # <<<<<<<<<<<<<<
@@ -4538,27 +4551,27 @@ static PyObject *__pyx_pf_8freenect_26sync_get_depth(PyObject *__pyx_self, PyObj
__Pyx_XDECREF(__pyx_r);
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
- goto __pyx_L10;
+ goto __pyx_L9;
}
- __pyx_L10:;
+ __pyx_L9:;
- /* "freenect.pyx":477
+ /* "freenect.pyx":479
* error_open_device()
* return
* if format == DEPTH_11BIT: # <<<<<<<<<<<<<<
* dims[0], dims[1] = 480, 640
* return PyArray_SimpleNewFromData(2, dims, npc.NPY_UINT16, data), timestamp
*/
- __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__DEPTH_11BIT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__DEPTH_11BIT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_3 = PyObject_RichCompare(__pyx_v_format, __pyx_t_4, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_RichCompare(__pyx_v_format, __pyx_t_4, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_5) {
- /* "freenect.pyx":478
+ /* "freenect.pyx":480
* return
* if format == DEPTH_11BIT:
* dims[0], dims[1] = 480, 640 # <<<<<<<<<<<<<<
@@ -4570,19 +4583,19 @@ static PyObject *__pyx_pf_8freenect_26sync_get_depth(PyObject *__pyx_self, PyObj
(__pyx_v_dims[0]) = __pyx_t_6;
(__pyx_v_dims[1]) = __pyx_t_7;
- /* "freenect.pyx":479
+ /* "freenect.pyx":481
* if format == DEPTH_11BIT:
* dims[0], dims[1] = 480, 640
* return PyArray_SimpleNewFromData(2, dims, npc.NPY_UINT16, data), timestamp # <<<<<<<<<<<<<<
* else:
* raise TypeError('Conversion not implemented for type [%d]' % (format))
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_3 = PyArray_SimpleNewFromData(2, __pyx_v_dims, NPY_UINT16, __pyx_v_data); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyArray_SimpleNewFromData(2, __pyx_v_dims, NPY_UINT16, __pyx_v_data); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyLong_FromUnsignedLong(__pyx_v_timestamp); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyInt_to_py_uint32_t(__pyx_v_timestamp); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_8));
PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
@@ -4593,32 +4606,32 @@ static PyObject *__pyx_pf_8freenect_26sync_get_depth(PyObject *__pyx_self, PyObj
__pyx_r = ((PyObject *)__pyx_t_8);
__pyx_t_8 = 0;
goto __pyx_L0;
- goto __pyx_L11;
+ goto __pyx_L10;
}
/*else*/ {
- /* "freenect.pyx":481
+ /* "freenect.pyx":483
* return PyArray_SimpleNewFromData(2, dims, npc.NPY_UINT16, data), timestamp
* else:
* raise TypeError('Conversion not implemented for type [%d]' % (format)) # <<<<<<<<<<<<<<
*
*
*/
- __pyx_t_8 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_10), __pyx_v_format); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_10), __pyx_v_format); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_8));
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_4));
PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_8));
__Pyx_GIVEREF(((PyObject *)__pyx_t_8));
__pyx_t_8 = 0;
- __pyx_t_8 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
__Pyx_Raise(__pyx_t_8, 0, 0);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
- __pyx_L11:;
+ __pyx_L10:;
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
@@ -4634,7 +4647,7 @@ static PyObject *__pyx_pf_8freenect_26sync_get_depth(PyObject *__pyx_self, PyObj
return __pyx_r;
}
-/* "freenect.pyx":484
+/* "freenect.pyx":486
*
*
* def sync_get_video(index=0, format=VIDEO_RGB): # <<<<<<<<<<<<<<
@@ -4649,9 +4662,11 @@ static PyObject *__pyx_pf_8freenect_27sync_get_video(PyObject *__pyx_self, PyObj
PyObject *__pyx_v_index = 0;
PyObject *__pyx_v_format = 0;
void *__pyx_v_data;
- unsigned int __pyx_v_timestamp;
+ uint32_t __pyx_v_timestamp;
npy_intp __pyx_v_dims[3];
int __pyx_v_out;
+ int __pyx_v__index;
+ freenect_video_format __pyx_v__format;
PyObject *__pyx_r = NULL;
int __pyx_t_1;
freenect_video_format __pyx_t_2;
@@ -4689,7 +4704,7 @@ static PyObject *__pyx_pf_8freenect_27sync_get_video(PyObject *__pyx_self, PyObj
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "sync_get_video") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "sync_get_video") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
__pyx_v_index = values[0];
__pyx_v_format = values[1];
@@ -4705,18 +4720,38 @@ static PyObject *__pyx_pf_8freenect_27sync_get_video(PyObject *__pyx_self, PyObj
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("sync_get_video", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("sync_get_video", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("freenect.sync_get_video");
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- /* "freenect.pyx":500
+ /* "freenect.pyx":502
* cdef npc.npy_intp dims[3]
* cdef int out
+ * cdef int _index = index # <<<<<<<<<<<<<<
+ * cdef freenect_video_format _format = format
+ * with nogil:
+ */
+ __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_index); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_v__index = __pyx_t_1;
+
+ /* "freenect.pyx":503
+ * cdef int out
+ * cdef int _index = index
+ * cdef freenect_video_format _format = format # <<<<<<<<<<<<<<
+ * with nogil:
+ * out = freenect_sync_get_video(&data, &timestamp, _index, _format)
+ */
+ __pyx_t_2 = ((freenect_video_format)PyInt_AsLong(__pyx_v_format)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_v__format = __pyx_t_2;
+
+ /* "freenect.pyx":504
+ * cdef int _index = index
+ * cdef freenect_video_format _format = format
* with nogil: # <<<<<<<<<<<<<<
- * out = freenect_sync_get_video(&data, &timestamp, index, format)
+ * out = freenect_sync_get_video(&data, &timestamp, _index, _format)
* if out:
*/
{
@@ -4726,61 +4761,52 @@ static PyObject *__pyx_pf_8freenect_27sync_get_video(PyObject *__pyx_self, PyObj
Py_UNBLOCK_THREADS
/*try:*/ {
- /* "freenect.pyx":501
- * cdef int out
+ /* "freenect.pyx":505
+ * cdef freenect_video_format _format = format
* with nogil:
- * out = freenect_sync_get_video(&data, &timestamp, index, format) # <<<<<<<<<<<<<<
+ * out = freenect_sync_get_video(&data, &timestamp, _index, _format) # <<<<<<<<<<<<<<
* if out:
* error_open_device()
*/
- __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_index); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L7;}
- __pyx_t_2 = ((freenect_video_format)PyInt_AsLong(__pyx_v_format)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L7;}
- __pyx_v_out = freenect_sync_get_video((&__pyx_v_data), (&__pyx_v_timestamp), __pyx_t_1, __pyx_t_2);
+ __pyx_v_out = freenect_sync_get_video((&__pyx_v_data), (&__pyx_v_timestamp), __pyx_v__index, __pyx_v__format);
}
- /* "freenect.pyx":500
- * cdef npc.npy_intp dims[3]
- * cdef int out
+ /* "freenect.pyx":504
+ * cdef int _index = index
+ * cdef freenect_video_format _format = format
* with nogil: # <<<<<<<<<<<<<<
- * out = freenect_sync_get_video(&data, &timestamp, index, format)
+ * out = freenect_sync_get_video(&data, &timestamp, _index, _format)
* if out:
*/
/*finally:*/ {
- int __pyx_why;
- __pyx_why = 0; goto __pyx_L8;
- __pyx_L7: __pyx_why = 4; goto __pyx_L8;
- __pyx_L8:;
Py_BLOCK_THREADS
- switch (__pyx_why) {
- case 4: goto __pyx_L1_error;
- }
}
}
- /* "freenect.pyx":502
+ /* "freenect.pyx":506
* with nogil:
- * out = freenect_sync_get_video(&data, &timestamp, index, format)
+ * out = freenect_sync_get_video(&data, &timestamp, _index, _format)
* if out: # <<<<<<<<<<<<<<
* error_open_device()
* return
*/
if (__pyx_v_out) {
- /* "freenect.pyx":503
- * out = freenect_sync_get_video(&data, &timestamp, index, format)
+ /* "freenect.pyx":507
+ * out = freenect_sync_get_video(&data, &timestamp, _index, _format)
* if out:
* error_open_device() # <<<<<<<<<<<<<<
* return
* if format == VIDEO_RGB:
*/
- __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__error_open_device); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__error_open_device); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "freenect.pyx":504
+ /* "freenect.pyx":508
* if out:
* error_open_device()
* return # <<<<<<<<<<<<<<
@@ -4790,27 +4816,27 @@ static PyObject *__pyx_pf_8freenect_27sync_get_video(PyObject *__pyx_self, PyObj
__Pyx_XDECREF(__pyx_r);
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
- goto __pyx_L10;
+ goto __pyx_L9;
}
- __pyx_L10:;
+ __pyx_L9:;
- /* "freenect.pyx":505
+ /* "freenect.pyx":509
* error_open_device()
* return
* if format == VIDEO_RGB: # <<<<<<<<<<<<<<
* dims[0], dims[1], dims[2] = 480, 640, 3
* return PyArray_SimpleNewFromData(3, dims, npc.NPY_UINT8, data), timestamp
*/
- __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__VIDEO_RGB); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__VIDEO_RGB); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_3 = PyObject_RichCompare(__pyx_v_format, __pyx_t_4, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_RichCompare(__pyx_v_format, __pyx_t_4, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_5) {
- /* "freenect.pyx":506
+ /* "freenect.pyx":510
* return
* if format == VIDEO_RGB:
* dims[0], dims[1], dims[2] = 480, 640, 3 # <<<<<<<<<<<<<<
@@ -4824,19 +4850,19 @@ static PyObject *__pyx_pf_8freenect_27sync_get_video(PyObject *__pyx_self, PyObj
(__pyx_v_dims[1]) = __pyx_t_7;
(__pyx_v_dims[2]) = __pyx_t_8;
- /* "freenect.pyx":507
+ /* "freenect.pyx":511
* if format == VIDEO_RGB:
* dims[0], dims[1], dims[2] = 480, 640, 3
* return PyArray_SimpleNewFromData(3, dims, npc.NPY_UINT8, data), timestamp # <<<<<<<<<<<<<<
* elif format == VIDEO_IR_8BIT:
* dims[0], dims[1] = 480, 640
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_3 = PyArray_SimpleNewFromData(3, __pyx_v_dims, NPY_UINT8, __pyx_v_data); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyArray_SimpleNewFromData(3, __pyx_v_dims, NPY_UINT8, __pyx_v_data); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyLong_FromUnsignedLong(__pyx_v_timestamp); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyInt_to_py_uint32_t(__pyx_v_timestamp); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_9));
PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
@@ -4847,26 +4873,26 @@ static PyObject *__pyx_pf_8freenect_27sync_get_video(PyObject *__pyx_self, PyObj
__pyx_r = ((PyObject *)__pyx_t_9);
__pyx_t_9 = 0;
goto __pyx_L0;
- goto __pyx_L11;
+ goto __pyx_L10;
}
- /* "freenect.pyx":508
+ /* "freenect.pyx":512
* dims[0], dims[1], dims[2] = 480, 640, 3
* return PyArray_SimpleNewFromData(3, dims, npc.NPY_UINT8, data), timestamp
* elif format == VIDEO_IR_8BIT: # <<<<<<<<<<<<<<
* dims[0], dims[1] = 480, 640
* return PyArray_SimpleNewFromData(2, dims, npc.NPY_UINT8, data), timestamp
*/
- __pyx_t_9 = __Pyx_GetName(__pyx_m, __pyx_n_s__VIDEO_IR_8BIT); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_GetName(__pyx_m, __pyx_n_s__VIDEO_IR_8BIT); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
- __pyx_t_4 = PyObject_RichCompare(__pyx_v_format, __pyx_t_9, Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_RichCompare(__pyx_v_format, __pyx_t_9, Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_5) {
- /* "freenect.pyx":509
+ /* "freenect.pyx":513
* return PyArray_SimpleNewFromData(3, dims, npc.NPY_UINT8, data), timestamp
* elif format == VIDEO_IR_8BIT:
* dims[0], dims[1] = 480, 640 # <<<<<<<<<<<<<<
@@ -4878,19 +4904,19 @@ static PyObject *__pyx_pf_8freenect_27sync_get_video(PyObject *__pyx_self, PyObj
(__pyx_v_dims[0]) = __pyx_t_8;
(__pyx_v_dims[1]) = __pyx_t_7;
- /* "freenect.pyx":510
+ /* "freenect.pyx":514
* elif format == VIDEO_IR_8BIT:
* dims[0], dims[1] = 480, 640
* return PyArray_SimpleNewFromData(2, dims, npc.NPY_UINT8, data), timestamp # <<<<<<<<<<<<<<
* else:
* raise TypeError('Conversion not implemented for type [%d]' % (format))
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_4 = PyArray_SimpleNewFromData(2, __pyx_v_dims, NPY_UINT8, __pyx_v_data); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyArray_SimpleNewFromData(2, __pyx_v_dims, NPY_UINT8, __pyx_v_data); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_9 = PyLong_FromUnsignedLong(__pyx_v_timestamp); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyInt_to_py_uint32_t(__pyx_v_timestamp); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
- __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_3));
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
@@ -4901,32 +4927,32 @@ static PyObject *__pyx_pf_8freenect_27sync_get_video(PyObject *__pyx_self, PyObj
__pyx_r = ((PyObject *)__pyx_t_3);
__pyx_t_3 = 0;
goto __pyx_L0;
- goto __pyx_L11;
+ goto __pyx_L10;
}
/*else*/ {
- /* "freenect.pyx":512
+ /* "freenect.pyx":516
* return PyArray_SimpleNewFromData(2, dims, npc.NPY_UINT8, data), timestamp
* else:
* raise TypeError('Conversion not implemented for type [%d]' % (format)) # <<<<<<<<<<<<<<
*
*
*/
- __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_10), __pyx_v_format); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_10), __pyx_v_format); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_3));
- __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_9));
PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_t_3));
__Pyx_GIVEREF(((PyObject *)__pyx_t_3));
__pyx_t_3 = 0;
- __pyx_t_3 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
__Pyx_Raise(__pyx_t_3, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
- __pyx_L11:;
+ __pyx_L10:;
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
@@ -4942,7 +4968,7 @@ static PyObject *__pyx_pf_8freenect_27sync_get_video(PyObject *__pyx_self, PyObj
return __pyx_r;
}
-/* "freenect.pyx":515
+/* "freenect.pyx":519
*
*
* def sync_stop(): # <<<<<<<<<<<<<<
@@ -4958,7 +4984,7 @@ static PyObject *__pyx_pf_8freenect_28sync_stop(PyObject *__pyx_self, CYTHON_UNU
__Pyx_RefNannySetupContext("sync_stop");
__pyx_self = __pyx_self;
- /* "freenect.pyx":518
+ /* "freenect.pyx":522
* """Terminate the synchronous runloop if running, else this is a NOP
* """
* freenect_sync_stop() # <<<<<<<<<<<<<<
@@ -7534,7 +7560,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
static int __Pyx_InitCachedBuiltins(void) {
__pyx_builtin_property = __Pyx_GetName(__pyx_b, __pyx_n_s__property); if (!__pyx_builtin_property) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_builtin_Exception = __Pyx_GetName(__pyx_b, __pyx_n_s__Exception); if (!__pyx_builtin_Exception) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_builtin_TypeError = __Pyx_GetName(__pyx_b, __pyx_n_s__TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_builtin_TypeError = __Pyx_GetName(__pyx_b, __pyx_n_s__TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_builtin_ValueError = __Pyx_GetName(__pyx_b, __pyx_n_s__ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_builtin_range = __Pyx_GetName(__pyx_b, __pyx_n_s__range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_builtin_RuntimeError = __Pyx_GetName(__pyx_b, __pyx_n_s__RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
@@ -8519,33 +8545,33 @@ PyMODINIT_FUNC PyInit_freenect(void)
if (PyObject_SetAttr(__pyx_m, __pyx_n_s__sync_get_depth, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "freenect.pyx":484
+ /* "freenect.pyx":486
*
*
* def sync_get_video(index=0, format=VIDEO_RGB): # <<<<<<<<<<<<<<
* """Get the next available rgb frame from the kinect, as a numpy array.
*
*/
- __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__VIDEO_RGB); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__VIDEO_RGB); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__pyx_k_11 = __pyx_t_2;
__Pyx_GIVEREF(__pyx_t_2);
__pyx_t_2 = 0;
- __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8freenect_27sync_get_video, NULL, __pyx_n_s__freenect); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8freenect_27sync_get_video, NULL, __pyx_n_s__freenect); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- if (PyObject_SetAttr(__pyx_m, __pyx_n_s__sync_get_video, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_s__sync_get_video, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "freenect.pyx":515
+ /* "freenect.pyx":519
*
*
* def sync_stop(): # <<<<<<<<<<<<<<
* """Terminate the synchronous runloop if running, else this is a NOP
* """
*/
- __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8freenect_28sync_stop, NULL, __pyx_n_s__freenect); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8freenect_28sync_stop, NULL, __pyx_n_s__freenect); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- if (PyObject_SetAttr(__pyx_m, __pyx_n_s__sync_stop, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_s__sync_stop, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
/* "freenect.pyx":1
View
12 wrappers/python/freenect.pyx
@@ -466,11 +466,13 @@ def sync_get_depth(index=0, format=DEPTH_11BIT):
timestamp: int representing the time
"""
cdef void* data
- cdef unsigned int timestamp
+ cdef uint32_t timestamp
cdef npc.npy_intp dims[2]
cdef int out
+ cdef int _index = index
+ cdef freenect_depth_format _format = format
with nogil:
- out = freenect_sync_get_depth(&data, &timestamp, index, format)
+ out = freenect_sync_get_depth(&data, &timestamp, _index, _format)
if out:
error_open_device()
return
@@ -494,11 +496,13 @@ def sync_get_video(index=0, format=VIDEO_RGB):
timestamp: int representing the time
"""
cdef void* data
- cdef unsigned int timestamp
+ cdef uint32_t timestamp
cdef npc.npy_intp dims[3]
cdef int out
+ cdef int _index = index
+ cdef freenect_video_format _format = format
with nogil:
- out = freenect_sync_get_video(&data, &timestamp, index, format)
+ out = freenect_sync_get_video(&data, &timestamp, _index, _format)
if out:
error_open_device()
return

0 comments on commit e04ba7f

Please sign in to comment.
Something went wrong with that request. Please try again.