diff options
| author | pants <niklasjo2004@gmail.com> | 2026-09-21 14:16:59 -0700 |
|---|---|---|
| committer | pants <niklasjo2004@gmail.com> | 2026-09-21 14:16:59 -0700 |
| commit | a091c00c00c1d5ae5e3da7ef31b98293c76d479f (patch) | |
| tree | 62c4b3bc114faac9922873ae48672c46cc2cf7d4 /include/capture/v4l2.h | |
Diffstat (limited to 'include/capture/v4l2.h')
| -rw-r--r-- | include/capture/v4l2.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/include/capture/v4l2.h b/include/capture/v4l2.h new file mode 100644 index 0000000..b7665aa --- /dev/null +++ b/include/capture/v4l2.h @@ -0,0 +1,30 @@ +#ifndef GSR_CAPTURE_V4L2_H +#define GSR_CAPTURE_V4L2_H + +#include "capture.h" + +typedef enum { + GSR_CAPTURE_V4L2_PIXFMT_AUTO, + GSR_CAPTURE_V4L2_PIXFMT_YUYV, + GSR_CAPTURE_V4L2_PIXFMT_MJPEG +} gsr_capture_v4l2_pixfmt; + +typedef struct { + bool yuyv; + bool mjpeg; +} gsr_capture_v4l2_supported_pixfmts; + +typedef struct { + gsr_egl *egl; + vec2i output_resolution; + const char *device_path; + gsr_capture_v4l2_pixfmt pixfmt; + int fps; +} gsr_capture_v4l2_params; + +gsr_capture* gsr_capture_v4l2_create(const gsr_capture_v4l2_params *params); + +typedef void (*v4l2_devices_query_callback)(const char *path, gsr_capture_v4l2_supported_pixfmts supported_pixfmts, vec2i size, void *userdata); +void gsr_capture_v4l2_list_devices(v4l2_devices_query_callback callback, void *userdata); + +#endif /* GSR_CAPTURE_V4L2_H */ |
