@@ -222,7 +222,7 @@ static void init_thread(void)
222
222
pthread_create (& thread , NULL , init , NULL );
223
223
}
224
224
225
- static int change_video_format_with_res (sync_kinect_t * kinect , freenect_resolution res , freenect_video_format fmt )
225
+ static int change_video_format (sync_kinect_t * kinect , freenect_resolution res , freenect_video_format fmt )
226
226
{
227
227
freenect_stop_video (kinect -> dev );
228
228
free_buffer_ring (& kinect -> video );
@@ -234,12 +234,7 @@ static int change_video_format_with_res(sync_kinect_t *kinect, freenect_resoluti
234
234
return 0 ;
235
235
}
236
236
237
- static int change_video_format (sync_kinect_t * kinect , freenect_resolution res , freenect_video_format fmt )
238
- {
239
- return change_video_format_with_res (kinect , FREENECT_RESOLUTION_MEDIUM , fmt );
240
- }
241
-
242
- static int change_depth_format_with_res (sync_kinect_t * kinect , freenect_resolution res , freenect_depth_format fmt )
237
+ static int change_depth_format (sync_kinect_t * kinect , freenect_resolution res , freenect_depth_format fmt )
243
238
{
244
239
freenect_stop_depth (kinect -> dev );
245
240
free_buffer_ring (& kinect -> depth );
@@ -251,11 +246,6 @@ static int change_depth_format_with_res(sync_kinect_t *kinect, freenect_resoluti
251
246
return 0 ;
252
247
}
253
248
254
- static int change_depth_format (sync_kinect_t * kinect , freenect_resolution res , freenect_depth_format fmt )
255
- {
256
- return change_depth_format_with_res (kinect , FREENECT_RESOLUTION_MEDIUM , fmt );
257
- }
258
-
259
249
static sync_kinect_t * alloc_kinect (int index )
260
250
{
261
251
sync_kinect_t * kinect = (sync_kinect_t * )malloc (sizeof (sync_kinect_t ));
@@ -281,7 +271,7 @@ static sync_kinect_t *alloc_kinect(int index)
281
271
return kinect ;
282
272
}
283
273
284
- static int setup_kinect_with_res (int index , int res , int fmt , int is_depth )
274
+ static int setup_kinect (int index , int res , int fmt , int is_depth )
285
275
{
286
276
pending_runloop_tasks_inc ();
287
277
pthread_mutex_lock (& runloop_lock );
@@ -315,20 +305,16 @@ static int setup_kinect_with_res(int index, int res, int fmt, int is_depth)
315
305
if ((buf -> fmt != fmt ) || (buf -> res != res ))
316
306
{
317
307
if (is_depth )
318
- change_depth_format_with_res (kinects [index ], (freenect_resolution )res , (freenect_depth_format )fmt );
308
+ change_depth_format (kinects [index ], (freenect_resolution )res , (freenect_depth_format )fmt );
319
309
else
320
- change_video_format_with_res (kinects [index ], (freenect_resolution )res , (freenect_video_format )fmt );
310
+ change_video_format (kinects [index ], (freenect_resolution )res , (freenect_video_format )fmt );
321
311
}
322
312
pthread_mutex_unlock (& buf -> lock );
323
313
pthread_mutex_unlock (& runloop_lock );
324
314
pending_runloop_tasks_dec ();
325
315
return 0 ;
326
316
}
327
317
328
- static int setup_kinect (int index , int fmt , int is_depth ) {
329
- return setup_kinect_with_res (index , FREENECT_RESOLUTION_MEDIUM , fmt , is_depth );
330
- }
331
-
332
318
static int sync_get (void * * data , uint32_t * timestamp , buffer_ring_t * buf )
333
319
{
334
320
pthread_mutex_lock (& buf -> lock );
@@ -361,7 +347,7 @@ static int runloop_enter(int index)
361
347
return -1 ;
362
348
}
363
349
if (!thread_running || !kinects [index ])
364
- if (setup_kinect_with_res (index , FREENECT_RESOLUTION_MEDIUM , FREENECT_DEPTH_11BIT , 1 ))
350
+ if (setup_kinect (index , FREENECT_RESOLUTION_MEDIUM , FREENECT_DEPTH_11BIT , 1 ))
365
351
return -1 ;
366
352
367
353
pending_runloop_tasks_inc ();
@@ -383,7 +369,7 @@ int freenect_sync_get_video_with_res(void **video, uint32_t *timestamp, int inde
383
369
return -1 ;
384
370
}
385
371
if (!thread_running || !kinects [index ] || kinects [index ]-> video .fmt != fmt || kinects [index ]-> video .res != res )
386
- if (setup_kinect_with_res (index , res , fmt , 0 ))
372
+ if (setup_kinect (index , res , fmt , 0 ))
387
373
return -1 ;
388
374
sync_get (video , timestamp , & kinects [index ]-> video );
389
375
return 0 ;
@@ -403,7 +389,7 @@ int freenect_sync_get_depth_with_res(void **depth, uint32_t *timestamp, int inde
403
389
}
404
390
if (!thread_running || !kinects [index ] || kinects [index ]-> depth .fmt != fmt
405
391
|| kinects [index ]-> depth .res != res )
406
- if (setup_kinect_with_res (index , res , fmt , 1 ))
392
+ if (setup_kinect (index , res , fmt , 1 ))
407
393
return -1 ;
408
394
sync_get (depth , timestamp , & kinects [index ]-> depth );
409
395
return 0 ;
0 commit comments