Classes | Macros | Typedefs | Functions | Variables
libfreenect_sync.c File Reference
#include <stdio.h>
#include <pthread.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include "libfreenect_registration.h"
#include "libfreenect_sync.h"
Include dependency graph for libfreenect_sync.c:

Go to the source code of this file.

Classes

struct  buffer_ring
 
struct  sync_kinect
 

Macros

#define MAX_KINECTS   64
 

Typedefs

typedef struct buffer_ring buffer_ring_t
 
typedef int(* set_buffer_t) (freenect_device *dev, void *buf)
 
typedef struct sync_kinect sync_kinect_t
 

Functions

static int alloc_buffer_ring_depth (freenect_resolution res, freenect_depth_format fmt, buffer_ring_t *buf)
 
static int alloc_buffer_ring_video (freenect_resolution res, freenect_video_format fmt, buffer_ring_t *buf)
 
static sync_kinect_talloc_kinect (int index)
 
static int change_depth_format (sync_kinect_t *kinect, freenect_resolution res, freenect_depth_format fmt)
 
static int change_video_format (sync_kinect_t *kinect, freenect_resolution res, freenect_video_format fmt)
 
static void depth_producer_cb (freenect_device *dev, void *data, uint32_t timestamp)
 
static void free_buffer_ring (buffer_ring_t *buf)
 
int freenect_sync_camera_to_world (int cx, int cy, int wz, double *wx, double *wy, int index)
 
int freenect_sync_get_depth (void **depth, uint32_t *timestamp, int index, freenect_depth_format fmt)
 
int freenect_sync_get_depth_with_res (void **depth, uint32_t *timestamp, int index, freenect_resolution res, freenect_depth_format fmt)
 
int freenect_sync_get_tilt_state (freenect_raw_tilt_state **state, int index)
 
int freenect_sync_get_video (void **video, uint32_t *timestamp, int index, freenect_video_format fmt)
 
int freenect_sync_get_video_with_res (void **video, uint32_t *timestamp, int index, freenect_resolution res, freenect_video_format fmt)
 
int freenect_sync_set_led (freenect_led_options led, int index)
 
int freenect_sync_set_tilt_degs (int angle, int index)
 
void freenect_sync_stop (void)
 
static void * init (void *unused)
 
static void init_thread (void)
 
static void pending_runloop_tasks_dec (void)
 
static void pending_runloop_tasks_inc (void)
 
static void pending_runloop_tasks_wait_zero (void)
 
static void producer_cb_inner (freenect_device *dev, void *data, uint32_t timestamp, buffer_ring_t *buf, set_buffer_t set_buffer)
 
static int runloop_enter (int index)
 
static void runloop_exit ()
 
static int setup_kinect (int index, int res, int fmt, int is_depth)
 
static int sync_get (void **data, uint32_t *timestamp, buffer_ring_t *buf)
 
static void video_producer_cb (freenect_device *dev, void *data, uint32_t timestamp)
 

Variables

static freenect_contextctx
 
static sync_kinect_tkinects [MAX_KINECTS] = {}
 
static int pending_runloop_tasks = 0
 
static pthread_cond_t pending_runloop_tasks_cond = PTHREAD_COND_INITIALIZER
 
static pthread_mutex_t pending_runloop_tasks_lock = PTHREAD_MUTEX_INITIALIZER
 
static pthread_mutex_t runloop_lock = PTHREAD_MUTEX_INITIALIZER
 
static pthread_t thread
 
static int thread_running = 0
 

Macro Definition Documentation

#define MAX_KINECTS   64

Definition at line 52 of file libfreenect_sync.c.

Typedef Documentation

typedef struct buffer_ring buffer_ring_t
typedef int(* set_buffer_t) (freenect_device *dev, void *buf)

Definition at line 50 of file libfreenect_sync.c.

typedef struct sync_kinect sync_kinect_t

Function Documentation

static int alloc_buffer_ring_depth ( freenect_resolution  res,
freenect_depth_format  fmt,
buffer_ring_t buf 
)
static

Definition at line 96 of file libfreenect_sync.c.

static int alloc_buffer_ring_video ( freenect_resolution  res,
freenect_video_format  fmt,
buffer_ring_t buf 
)
static

Definition at line 72 of file libfreenect_sync.c.

static sync_kinect_t* alloc_kinect ( int  index)
static

Definition at line 249 of file libfreenect_sync.c.

static int change_depth_format ( sync_kinect_t kinect,
freenect_resolution  res,
freenect_depth_format  fmt 
)
static

Definition at line 237 of file libfreenect_sync.c.

static int change_video_format ( sync_kinect_t kinect,
freenect_resolution  res,
freenect_video_format  fmt 
)
static

Definition at line 225 of file libfreenect_sync.c.

static void depth_producer_cb ( freenect_device dev,
void *  data,
uint32_t  timestamp 
)
static

Definition at line 153 of file libfreenect_sync.c.

static void free_buffer_ring ( buffer_ring_t buf)
static

Definition at line 121 of file libfreenect_sync.c.

int freenect_sync_camera_to_world ( int  cx,
int  cy,
int  wz,
double *  wx,
double *  wy,
int  index 
)

Definition at line 426 of file libfreenect_sync.c.

int freenect_sync_get_depth ( void **  depth,
uint32_t timestamp,
int  index,
freenect_depth_format  fmt 
)

Definition at line 398 of file libfreenect_sync.c.

int freenect_sync_get_depth_with_res ( void **  depth,
uint32_t timestamp,
int  index,
freenect_resolution  res,
freenect_depth_format  fmt 
)

Definition at line 383 of file libfreenect_sync.c.

int freenect_sync_get_tilt_state ( freenect_raw_tilt_state **  state,
int  index 
)

Definition at line 403 of file libfreenect_sync.c.

int freenect_sync_get_video ( void **  video,
uint32_t timestamp,
int  index,
freenect_video_format  fmt 
)

Definition at line 378 of file libfreenect_sync.c.

int freenect_sync_get_video_with_res ( void **  video,
uint32_t timestamp,
int  index,
freenect_resolution  res,
freenect_video_format  fmt 
)

Definition at line 364 of file libfreenect_sync.c.

int freenect_sync_set_led ( freenect_led_options  led,
int  index 
)

Definition at line 419 of file libfreenect_sync.c.

int freenect_sync_set_tilt_degs ( int  angle,
int  index 
)

Definition at line 412 of file libfreenect_sync.c.

void freenect_sync_stop ( void  )

Definition at line 433 of file libfreenect_sync.c.

static void* init ( void *  unused)
static

Definition at line 185 of file libfreenect_sync.c.

static void init_thread ( void  )
static

Definition at line 214 of file libfreenect_sync.c.

static void pending_runloop_tasks_dec ( void  )
static

Definition at line 167 of file libfreenect_sync.c.

static void pending_runloop_tasks_inc ( void  )
static

Definition at line 159 of file libfreenect_sync.c.

static void pending_runloop_tasks_wait_zero ( void  )
static

Definition at line 177 of file libfreenect_sync.c.

static void producer_cb_inner ( freenect_device dev,
void *  data,
uint32_t  timestamp,
buffer_ring_t buf,
set_buffer_t  set_buffer 
)
static

Definition at line 134 of file libfreenect_sync.c.

static int runloop_enter ( int  index)
static

Definition at line 343 of file libfreenect_sync.c.

static void runloop_exit ( )
static

Definition at line 358 of file libfreenect_sync.c.

static int setup_kinect ( int  index,
int  res,
int  fmt,
int  is_depth 
)
static

Definition at line 274 of file libfreenect_sync.c.

static int sync_get ( void **  data,
uint32_t timestamp,
buffer_ring_t buf 
)
static

Definition at line 318 of file libfreenect_sync.c.

static void video_producer_cb ( freenect_device dev,
void *  data,
uint32_t  timestamp 
)
static

Definition at line 148 of file libfreenect_sync.c.

Variable Documentation

freenect_context* ctx
static

Definition at line 54 of file libfreenect_sync.c.

sync_kinect_t* kinects[MAX_KINECTS] = {}
static

Definition at line 53 of file libfreenect_sync.c.

int pending_runloop_tasks = 0
static

Definition at line 58 of file libfreenect_sync.c.

pthread_cond_t pending_runloop_tasks_cond = PTHREAD_COND_INITIALIZER
static

Definition at line 60 of file libfreenect_sync.c.

pthread_mutex_t pending_runloop_tasks_lock = PTHREAD_MUTEX_INITIALIZER
static

Definition at line 59 of file libfreenect_sync.c.

pthread_mutex_t runloop_lock = PTHREAD_MUTEX_INITIALIZER
static

Definition at line 57 of file libfreenect_sync.c.

pthread_t thread
static

Definition at line 56 of file libfreenect_sync.c.

int thread_running = 0
static

Definition at line 55 of file libfreenect_sync.c.



libfreenect
Author(s): Hector Martin, Josh Blake, Kyle Machulis, OpenKinect community
autogenerated on Thu Jun 6 2019 19:25:39