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;
57 new_listener->
id =
id;
126 #if CV_ALLOW_VIDEO_TO_CHANGE_SIZE
205 if (result != NULL) {
struct video_listener * listener
void * cv_async_thread(void *args)
struct video_listener * cv_add_to_device(struct video_config_t *device, cv_function func, uint16_t fps, uint8_t id)
void cv_attach_listener(struct video_config_t *device, struct video_listener *new_listener)
void cv_run_device(struct video_config_t *device, struct image_t *img)
static uint32_t timeval_diff(struct timeval *A, struct timeval *B)
int8_t cv_async_function(struct cv_async *async, struct image_t *img)
struct video_listener * cv_add_to_device_async(struct video_config_t *device, cv_function func, int nice_level, uint16_t fps, uint8_t id)
Computer vision framework for onboard processing.
volatile int thread_priority
volatile bool thread_running
struct video_listener * next
volatile bool img_processed
pthread_cond_t img_available
bool add_video_device(struct video_config_t *device)
Keep track of video devices added by modules.
struct image_t *(* cv_function)(struct image_t *img, uint8_t camera_id)
pthread_mutex_t img_mutex
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.
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.
struct timeval ts
The timestamp of creation.
uint32_t buf_size
The buffer size.
void * buf
Image buffer (depending on the image_type)
enum image_type type
The image type.
Functions to obtain rt priority or set the nice level.
static int set_nice_level(int level)
struct video_listener * cv_listener
The first computer vision listener in the linked list for this video device.
unsigned short uint16_t
Typedef defining 16 bit unsigned short type.
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.
signed char int8_t
Typedef defining 8 bit char type.