18 #include <linux/videodev2.h> 43 bool get_frame(
Frame &frame);
44 void put_frame(
Frame &frame);
45 void set_device_path(
const char* path);
47 bool open_device(
const char *device_path, uint32_t memtype);
48 bool allocate_buffers(uint32_t nbufs);
49 void get_pixel_formats(std::vector<uint32_t> *formats);
50 bool set_format(uint32_t *width, uint32_t *height, uint32_t *format,
51 uint32_t *bytesperline, uint32_t *sizeimage);
52 bool set_crop(uint32_t left, uint32_t top,
53 uint32_t width, uint32_t height);
54 void prepare_capture();
56 static void shrink_8bpp(uint8_t *
buffer, uint8_t *new_buffer,
57 uint32_t width, uint32_t height, uint32_t left,
58 uint32_t selection_width, uint32_t top,
59 uint32_t selection_height, uint32_t fx, uint32_t fy);
61 static void crop_8bpp(uint8_t *
buffer, uint8_t *new_buffer,
62 uint32_t width, uint32_t left,
63 uint32_t crop_width, uint32_t top,
64 uint32_t crop_height);
66 static void yuyv_to_grey(uint8_t *
buffer, uint32_t buffer_size,
70 void _queue_buffer(
int index);
71 bool _set_streaming(
bool enable);
72 bool _dequeue_frame(
Frame &frame);
73 uint32_t _timeval_to_us(
struct timeval& tv);
83 uint32_t _memtype = V4L2_MEMORY_MMAP;
void init()
Generic board initialization function.