42 return (B->tv_sec - A->tv_sec) * 1000000 + (B->tv_usec - A->tv_usec);
52 new_listener->
active =
true;
54 new_listener->
next = NULL;
55 new_listener->
async = NULL;
70 while (listener->
next != NULL) {
71 listener = listener->
next;
75 listener->
next = new_listener;
124 #if CV_ALLOW_VIDEO_TO_CHANGE_SIZE
204 if (result != NULL) {
uint32_t buf_size
The buffer size.
volatile bool thread_running
void cv_attach_listener(struct video_config_t *device, struct video_listener *new_listener)
void image_free(struct image_t *img)
Free the image.
void image_create(struct image_t *img, uint16_t width, uint16_t height, enum image_type type)
Create a new image.
void image_copy(struct image_t *input, struct image_t *output)
Copy an image from inut to output This will only work if the formats are the same.
struct video_listener * cv_add_to_device(struct video_config_t *device, cv_function func, uint16_t fps)
Functions to obtain rt priority or set the nice level.
struct video_listener * listener
struct video_listener * cv_listener
The first computer vision listener in the linked list for this video device.
int8_t cv_async_function(struct cv_async *async, struct image_t *img)
Computer vision framework for onboard processing.
volatile int thread_priority
void * buf
Image buffer (depending on the image_type)
bool add_video_device(struct video_config_t *device)
Keep track of video devices added by modules.
static uint32_t timeval_diff(struct timeval *A, struct timeval *B)
struct video_listener * cv_add_to_device_async(struct video_config_t *device, cv_function func, int nice_level, uint16_t fps)
pthread_cond_t img_available
struct image_t *(* cv_function)(struct image_t *img)
void cv_run_device(struct video_config_t *device, struct image_t *img)
volatile bool img_processed
struct timeval ts
The timestamp of creation.
void * cv_async_thread(void *args)
pthread_mutex_t img_mutex
struct video_listener * next
static int set_nice_level(int level)
enum image_type type
The image type.