diff options
author | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-03-11 13:57:50 -0500 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-03-11 13:57:50 -0500 |
commit | 28887d5145e41c9e073c7c6e6990c4e218e05628 (patch) | |
tree | faf919c15c7e71ac859e505f4fc6ca967863e057 /main.h |
stuff
Diffstat (limited to 'main.h')
-rw-r--r-- | main.h | 39 |
1 files changed, 39 insertions, 0 deletions
@@ -0,0 +1,39 @@ +#pragma once + +#include <signal.h> /* for sig_atomic_t */ +#include <string.h> /* for memset(3) */ + +#define UNUSED __attribute__((__unused__)) +#define ZERO(x) memset(&(x), 0, sizeof(x)) + +#ifndef _ +#define _(str) str +#endif + +extern volatile sig_atomic_t running; + +struct frame { + ssize_t len; + size_t cap; + char *data; +}; + +struct mpjpeg_stream { + struct frame a; + struct frame b; + + struct frame *front; + struct frame *back; + pthread_mutex_t frontlock; +}; + +struct wg; + +void thread_kinect(int video_fd, int depth_fd, int accel_fd); +void thread_http_listen(int fd); +void thread_mpjpeg_reader(struct mpjpeg_stream *s, int fd, const char *boundary); +void thread_mpjpeg_writer(struct mpjpeg_stream *s, int fd, const char *boundary); +void thread_http_listener(struct wg *wg, struct mpjpeg_stream *video, struct mpjpeg_stream *depth); +void init_mpjpeg_stream(); + +void * xrealloc(void *ptr, size_t size); |