invisible
view src/frame.cc @ 1:fdbd55eaa14e
add frame class, mutices
author | Eleni Maria Stea <eleni@mutantstargoat.com> |
---|---|
date | Sat, 05 Oct 2013 19:02:40 +0300 |
parents | |
children | b0b90ef993a0 |
line source
1 #include <stdio.h>
2 #include <pthread.h>
4 #include "frame.h"
6 static pthread_mutex_t video_mutex = PTHREAD_MUTEX_INITIALIZER;
7 static pthread_mutex_t depth_mutex = PTHREAD_MUTEX_INITIALIZER;
9 void init_frame_mx()
10 {
11 pthread_mutex_init(&video_mutex, NULL);
12 pthread_mutex_init(&depth_mutex, NULL);
13 }
15 void video_cb(freenect_device *kin_dev, void *rgb, uint32_t time)
16 {
17 pthread_mutex_lock(&video_mutex);
18 printf("Started video.\n");
19 pthread_mutex_unlock(&video_mutex);
20 }
22 void depth_cb(freenect_device *kin_dev, void *depth, uint32_t time)
23 {
24 pthread_mutex_lock(&depth_mutex);
25 printf("Started depth.\n");
26 pthread_mutex_unlock(&depth_mutex);
27 }