|
Paparazzi UAS
v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
|
Go to the documentation of this file.
28 #ifndef _CV_LIB_V4L2_H
29 #define _CV_LIB_V4L2_H
31 #include <linux/v4l2-subdev.h>
38 #define V4L2_IMG_NONE 255
bool v4l2_stop_capture(struct v4l2_device *dev)
Stop capturing of the image stream (Thread safe) This function is blocking until capturing thread is ...
pthread_t thread
The thread that handles the images.
uint16_t w
The width of the image.
uint32_t pprz_timestamp
The time of the image in us since system startup.
void * buf
Pointer to the memory mapped buffer.
struct timeval timestamp
The time value of the image.
uint32_t physp
Physical address pointer.
bool v4l2_start_capture(struct v4l2_device *dev)
Start capturing images in streaming mode (Thread safe)
void v4l2_image_free(struct v4l2_device *dev, struct image_t *img)
Free the image and enqueue the buffer (Thread safe) This must be done after processing the image,...
static const struct usb_device_descriptor dev
uint8_t buffers_cnt
The number of image buffers.
volatile uint8_t buffers_deq_idx
The current dequeued index.
bool v4l2_image_get_nonblock(struct v4l2_device *dev, struct image_t *img)
Get the latest image and lock it (Thread safe, NON BLOCKING) This function returns NULL if it can't g...
int fd
The file pointer to the device.
bool v4l2_init_subdev(char *subdev_name, uint8_t pad, uint16_t code, struct img_size_t size)
Initialize a V4L2 subdevice.
uint16_t h
The height of the image.
struct v4l2_device * v4l2_init(char *device_name, struct img_size_t size, struct crop_t crop, uint8_t buffers_cnt, uint32_t _pixelformat)
Initialize a V4L2(Video for Linux 2) device.
struct v4l2_img_buf * buffers
The memory mapped image buffers.
void v4l2_close(struct v4l2_device *dev)
Close the V4L2 device (Thread safe) This needs to be preformed to clean up all the buffers and close ...
size_t length
The size of the buffer.
pthread_mutex_t mutex
Mutex lock for enqueue/dequeue of buffers (change the deq_idx)
void v4l2_image_get(struct v4l2_device *dev, struct image_t *img)
Get the latest image buffer and lock it (Thread safe, BLOCKING) This functions blocks until image acc...
char * name
The name of the device.