#pragma once #include 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; }; void mpjpeg_reader(struct mpjpeg_stream *s, int fd, const char *boundary); void mpjpeg_writer(struct mpjpeg_stream *s, int fd, const char *boundary); void init_mpjpeg_stream();