diff options
| author | dec05eba <dec05eba@protonmail.com> | 2026-01-15 20:03:23 +0100 |
|---|---|---|
| committer | dec05eba <dec05eba@protonmail.com> | 2026-01-15 20:03:23 +0100 |
| commit | 8af761f9bde2297df22f2eb06d75f0147ea1277d (patch) | |
| tree | 48c9389ea778da8069c55502b92ac658d3d6aa8c /include | |
| parent | b2f0d135120fa19513ff4d9de1a5b7aafbfe596e (diff) | |
v4l2: select best camera option by default
Display all camera options in --info and --list-v4l2-devices.
Add camera_width, camera_height and camera_fps v4l2 capture options.
Diffstat (limited to 'include')
| -rw-r--r-- | include/capture/v4l2.h | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/include/capture/v4l2.h b/include/capture/v4l2.h index b7665aa..6793fdb 100644 --- a/include/capture/v4l2.h +++ b/include/capture/v4l2.h @@ -10,21 +10,35 @@ typedef enum { } gsr_capture_v4l2_pixfmt; typedef struct { - bool yuyv; - bool mjpeg; -} gsr_capture_v4l2_supported_pixfmts; + uint32_t width; + uint32_t height; +} gsr_capture_v4l2_resolution; + +typedef struct { + uint32_t denominator; + uint32_t numerator; +} gsr_capture_v4l2_framerate; + +typedef struct { + gsr_capture_v4l2_pixfmt pixfmt; + gsr_capture_v4l2_resolution resolution; + gsr_capture_v4l2_framerate framerate; +} gsr_capture_v4l2_supported_setup; typedef struct { gsr_egl *egl; vec2i output_resolution; const char *device_path; gsr_capture_v4l2_pixfmt pixfmt; - int fps; + uint32_t camera_fps; /* Set to 0 if the best option should be chosen */ + gsr_capture_v4l2_resolution camera_resolution; /* Set to 0, 0 if the best option should be chosen */ } 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); +const char* gsr_capture_v4l2_pixfmt_to_string(gsr_capture_v4l2_pixfmt pixfmt); +uint32_t gsr_capture_v4l2_framerate_to_number(gsr_capture_v4l2_framerate framerate); +typedef void (*v4l2_devices_query_callback)(const char *path, const gsr_capture_v4l2_supported_setup *supported_setup, void *userdata); void gsr_capture_v4l2_list_devices(v4l2_devices_query_callback callback, void *userdata); #endif /* GSR_CAPTURE_V4L2_H */ |
